/* chat.css — Widget de Chat Ciudadano */
#chat-widget-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #691c32;
    color: #fff;
    border: none;
    font-size: 26px;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
#chat-widget-toggle:hover { transform: scale(1.1); }
#chat-widget-toggle .badge-pending {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #dc3545;
    color: #fff;
    font-size: 11px;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

#chat-widget-panel {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 360px;
    height: 480px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    z-index: 9998;
    display: none;
    flex-direction: column;
    overflow: hidden;
}
#chat-widget-panel.open { display: flex; }

.chat-header {
    background: #691c32;
    color: #fff;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.chat-header h6 { margin: 0; font-size: 0.95rem; }
.chat-header button { background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; }

.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    background: #f5f6fa;
}

.chat-msg {
    margin-bottom: 10px;
    max-width: 80%;
    clear: both;
}
.chat-msg.ciudadano { float: right; }
.chat-msg.staff { float: left; }
.chat-msg .bubble {
    padding: 8px 12px;
    border-radius: 14px;
    font-size: 0.85rem;
    line-height: 1.4;
    word-wrap: break-word;
}
.chat-msg.ciudadano .bubble { background: #691c32; color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.staff .bubble { background: #e9ecef; color: #333; border-bottom-left-radius: 4px; }
.chat-msg .time { font-size: 0.65rem; color: #999; margin-top: 2px; }

.chat-register {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.chat-register input {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.85rem;
}
.chat-register button {
    background: #691c32;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px;
    font-weight: 600;
    cursor: pointer;
}

.chat-input-area {
    padding: 10px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 8px;
}
.chat-input-area input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 0.85rem;
    outline: none;
}
.chat-input-area button {
    background: #691c32;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    cursor: pointer;
    font-size: 16px;
}

.badge-pendiente {
    background: #dc3545;
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    margin-left: 8px;
}

.chat-code-badge {
    display: inline-block;
    background: #f0f0ff;
    border: 2px dashed #691c32;
    border-radius: 10px;
    padding: 10px 20px;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 4px;
    color: #691c32;
    font-family: monospace;
}
