/* ============================================
   TUTOR IA
   Navy #0A0E27 + Gold #C9A84C + Poppins
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Colores (personalizables desde el panel) */
    --navy: #0A0E27;
    --navy-light: #131836;
    --navy-mid: #1a2040;
    --navy-surface: #1e2548;
    --gold: #C9A84C;
    --gold-light: #e8d5a0;
    --gold-dark: #a88a3a;
    --gold-glow: rgba(201, 168, 76, 0.12);
    --white: #f5f5f5;
    --gray: #94a3b8;
    --gray-dark: #64748b;
    --red: #ef4444;
    --green: #22c55e;
    --border: rgba(201, 168, 76, 0.13);
    --border-hover: rgba(201, 168, 76, 0.35);

    /* Sombras */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.4);
    --shadow-gold: 0 0 60px rgba(201, 168, 76, 0.07);

    /* Radio de bordes */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Escala de spacing (4px base) */
    --s-1: 4px;
    --s-2: 8px;
    --s-3: 12px;
    --s-4: 16px;
    --s-5: 20px;
    --s-6: 24px;
    --s-7: 32px;
    --s-8: 40px;
    --s-9: 56px;
    --s-10: 72px;

    /* Tipografía fluida (Fase 5 ajustará con clamp) */
    --fs-xs: 11px;
    --fs-sm: 12px;
    --fs-base: 13px;
    --fs-md: 14px;
    --fs-lg: 16px;
    --fs-xl: 20px;
    --fs-2xl: 26px;

    /* Altura de línea */
    --lh-tight: 1.25;
    --lh-base: 1.5;
    --lh-loose: 1.7;

    /* Capas Z */
    --z-dropdown: 10;
    --z-sticky: 20;
    --z-backdrop: 80;
    --z-drawer: 90;
    --z-modal: 1000;
    --z-toast: 1100;

    /* Misc */
    --transition: 0.2s ease;
    --ring: 0 0 0 3px rgba(201, 168, 76, 0.35);
    --tap-target: 44px; /* mínimo recomendado para móvil */
    --content-max: 1280px;
}

/* Breakpoints de referencia (no se pueden usar en media queries, son solo guía):
   xl: 1280px · lg: 1024px · md: 768px · sm: 480px · xs: 375px */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Poppins', sans-serif;
    font-size: var(--fs-md);
    line-height: var(--lh-base);
    background: var(--navy);
    color: var(--white);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-wrap: break-word;
}

img, svg, video { max-width: 100%; display: block; }

button, input, textarea, select {
    font: inherit;
    color: inherit;
}

button { background: none; border: none; cursor: pointer; }

a { text-decoration: none; color: inherit; }

/* Foco accesible (teclado) */
:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}
.form-input:focus-visible,
button:focus-visible,
a:focus-visible,
.chat-suggestion:focus-visible,
.admin-nav-item:focus-visible,
.modal-close:focus-visible { outline: none; box-shadow: var(--ring); }

/* Respeta reduce-motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ─── FORMULARIOS ─── */
.form-group { margin-bottom: 20px; }

.form-label {
    font-size: 11px;
    color: var(--gold-light);
    font-weight: 600;
    letter-spacing: 1.5px;
    display: block;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--navy);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--white);
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.1);
}

.form-input::placeholder { color: var(--gray-dark); }

.form-input:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Inputs de fecha: cursor pointer y icono visible en tema oscuro */
.form-input--date {
    height: 45px;
    padding: 0 14px;
    cursor: pointer;
    color-scheme: dark;
    min-width: 160px;
}

.form-input--date::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.2) sepia(0.3) hue-rotate(15deg);
    cursor: pointer;
    opacity: 0.8;
    padding-left: 6px;
}

.form-input--date::-webkit-calendar-picker-indicator:hover { opacity: 1; }

/* Botones de filtros (chips + aplicar) — misma altura que .form-input--date */
.btn-chip,
.btn-apply {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 45px;
    padding: 0 16px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.4px;
    font-family: 'Poppins', sans-serif;
    background: transparent;
    color: var(--gold);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(201, 168, 76, 0.35);
    transition: box-shadow var(--transition), background var(--transition), color var(--transition);
}

.btn-chip:hover,
.btn-apply:hover {
    background: rgba(201, 168, 76, 0.08);
    color: var(--gold-light);
    box-shadow: inset 0 0 0 1px var(--gold), inset 0 0 12px rgba(201, 168, 76, 0.15);
}

.btn-apply {
    color: var(--gold-light);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px var(--gold);
}

.btn-apply:hover {
    background: var(--gold);
    color: var(--navy);
    box-shadow: inset 0 0 0 1px var(--gold), inset 0 0 16px rgba(201, 168, 76, 0.3);
}

/* Puntos de la gráfica de métricas */
.m-point { cursor: pointer; }
.m-point .m-point-dot {
    transition: r 0.15s ease, fill 0.15s ease, stroke-width 0.15s ease;
}
.m-point:hover .m-point-dot {
    r: 6;
    fill: var(--gold-light);
    stroke-width: 2;
}

select.form-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

textarea.form-input {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

/* ─── BOTONES ─── */
.btn-gold {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    border: none;
    border-radius: var(--radius-sm);
    color: var(--navy);
    font-size: 14px;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all var(--transition);
    text-transform: uppercase;
}

.btn-gold:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-gold:active { transform: translateY(0); }
.btn-gold:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-outline {
    padding: 8px 18px;
    background: transparent;
    border: 1px solid rgba(201, 168, 76, 0.4);
    border-radius: var(--radius-sm);
    color: var(--gold);
    font-size: 13px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-outline:hover {
    background: var(--gold);
    color: var(--navy);
    border-color: var(--gold);
}

/* Variante compacta (cabecera del chat) */
.btn-outline--compact { padding: 5px 12px; font-size: 11px; }

.btn-sm {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-danger { background: rgba(239,68,68,0.12); color: var(--red); }
.btn-success { background: rgba(34,197,94,0.12); color: var(--green); }
.btn-edit { background: rgba(201,168,76,0.12); color: var(--gold); }
.btn-info { background: rgba(148,163,184,0.12); color: var(--gray); }
.btn-info:hover { background: rgba(148,163,184,0.25); }
.btn-role {
    background: rgba(96,165,250,0.12);
    color: #60a5fa;
    border: none;
    padding: 6px 26px 6px 12px;
    font-weight: 500;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2360a5fa' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: background-color 0.2s;
}
.btn-role:hover { background-color: rgba(96,165,250,0.22); }
.btn-role option { background: var(--navy-mid); color: var(--white); }
.btn-danger:hover { background: rgba(239,68,68,0.25); }
.btn-success:hover { background: rgba(34,197,94,0.25); }
.btn-edit:hover { background: rgba(201,168,76,0.25); }

.admin-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    border: none;
    border-radius: var(--radius-sm);
    color: var(--navy);
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
    transition: all var(--transition);
}

.admin-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.admin-btn:active { transform: translateY(0); }

.error-msg {
    color: var(--red);
    font-size: 13px;
    text-align: center;
    margin-bottom: 16px;
    padding: 10px;
    background: rgba(239, 68, 68, 0.08);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(239, 68, 68, 0.15);
}

/* ─── LOGIN ─── */
.login-wrapper {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--navy);
    background-image:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(201, 168, 76, 0.06) 0%, transparent 70%),
        radial-gradient(ellipse 60% 40% at 50% 100%, rgba(19, 24, 54, 0.8) 0%, transparent 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--navy-mid);
    border-radius: var(--radius-lg);
    padding: 48px 36px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-gold), var(--shadow-lg);
    backdrop-filter: blur(10px);
}

.login-brand {
    text-align: center;
    margin-bottom: 40px;
}

.login-brand-label {
    font-size: 12px;
    letter-spacing: 6px;
    color: var(--gold);
    font-weight: 600;
    margin-bottom: 8px;
}

.login-brand-title {
    font-size: clamp(22px, 5.5vw, 30px);
    font-weight: 800;
    color: var(--white);
    line-height: 1.2;
    background: linear-gradient(135deg, var(--white), var(--gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-brand-company {
    font-size: 15px;
    color: var(--gold);
    font-weight: 600;
    margin-top: 6px;
    letter-spacing: 0.5px;
}

.login-brand-sub {
    font-size: 13px;
    color: var(--gray);
    margin-top: 8px;
}

.forgot-link {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: var(--gold);
    cursor: pointer;
    transition: all var(--transition);
    user-select: none;
}

.forgot-link:hover {
    color: var(--gold-light);
    text-decoration: underline;
}

.reset-form {
    animation: fadeIn 0.25s ease;
}

.login-footer {
    text-align: center;
    margin-top: 28px;
    font-size: 11px;
    color: var(--gray-dark);
    letter-spacing: 0.5px;
}

/* ─── CHAT ─── */
.chat-wrapper {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--navy);
}

.chat-header {
    padding: 14px 20px;
    background: var(--navy-mid);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: var(--navy);
    font-size: 13px;
    letter-spacing: -0.5px;
    box-shadow: 0 2px 12px rgba(201, 168, 76, 0.25);
    overflow: hidden;
}

.chat-avatar-img { background: transparent; padding: 0; }
.chat-avatar-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-avatar-svg svg { display: block; }

.chat-title { font-size: 14px; font-weight: 700; }

.chat-status {
    font-size: 11px;
    color: var(--green);
    display: flex;
    align-items: center;
    gap: 5px;
}

.chat-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    display: inline-block;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.chat-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-user-name {
    font-size: 12px;
    color: var(--gray);
    font-weight: 500;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px 16px;
    scroll-behavior: smooth;
}

.chat-welcome {
    text-align: center;
    padding-top: 60px;
    animation: fadeIn 0.5s ease;
}

.chat-welcome-icon { font-size: 48px; margin-bottom: 16px; }

.chat-welcome-title {
    font-size: clamp(19px, 4.5vw, 22px);
    font-weight: 700;
    margin-bottom: 8px;
}

.chat-welcome-text {
    font-size: 14px;
    color: var(--gray);
    max-width: 500px;
    margin: 0 auto 36px;
    line-height: 1.7;
}

.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    max-width: 620px;
    margin: 0 auto;
}

.chat-suggestion {
    padding: 10px 18px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    color: var(--gold-light);
    font-size: 12px;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all var(--transition);
}

.chat-suggestion:hover {
    background: var(--gold);
    color: var(--navy);
    border-color: var(--gold);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(201, 168, 76, 0.2);
}

.message {
    display: flex;
    margin-bottom: 14px;
    animation: messageIn 0.3s ease;
}

@keyframes messageIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-user { justify-content: flex-end; }
.message-assistant { justify-content: flex-start; }

.message-bubble {
    max-width: 75%;
    padding: 14px 18px;
    font-size: 14px;
    line-height: 1.7;
    word-break: break-word;
    white-space: pre-wrap;
}

.message-user .message-bubble {
    border-radius: var(--radius-lg) var(--radius-lg) 4px var(--radius-lg);
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--navy);
    box-shadow: 0 2px 12px rgba(201, 168, 76, 0.15);
}

.message-assistant .message-bubble {
    border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 4px;
    background: var(--navy-mid);
    color: var(--white);
    border: 1px solid var(--border);
}

.typing-indicator {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 14px;
    animation: messageIn 0.3s ease;
}

.typing-dots {
    padding: 14px 22px;
    border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 4px;
    background: var(--navy-mid);
    border: 1px solid var(--border);
    display: flex;
    gap: 6px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gold);
    animation: pulse 1.2s ease-in-out infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes pulse {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.1); }
}

.chat-input-area {
    padding: 14px 16px 22px;
    background: var(--navy-mid);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.chat-input-row {
    display: flex;
    gap: 10px;
    max-width: 800px;
    margin: 0 auto;
}

#chat-input {
    flex: 1;
    padding: 13px 18px;
    background: var(--navy);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--white);
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

#chat-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.1);
}

#chat-input::placeholder { color: var(--gray-dark); }

#send-btn {
    padding: 13px 22px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    border: none;
    border-radius: var(--radius-md);
    color: var(--navy);
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    font-size: 14px;
    transition: all var(--transition);
}

#send-btn:hover { box-shadow: 0 4px 16px rgba(201, 168, 76, 0.25); }
#send-btn:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }

/* ─── ADMIN LAYOUT ─── */
.admin-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, var(--navy-light) 0%, var(--navy) 100%);
    border-right: 1px solid var(--border);
    padding: 24px 16px;
}

.admin-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 8px 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.admin-brand-mark {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--navy);
    border-radius: var(--radius-sm);
    font-weight: 800;
    font-size: 18px;
    box-shadow: var(--shadow-sm), 0 0 24px rgba(201, 168, 76, 0.18);
}

.admin-brand-text { min-width: 0; }

.admin-brand-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-brand-sub {
    font-size: 10px;
    color: var(--gray);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-top: 2px;
}

/* Navegación vertical */
.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    overflow-y: auto;
    padding-right: 2px;
}

.admin-nav::-webkit-scrollbar { width: 6px; }
.admin-nav::-webkit-scrollbar-track { background: transparent; }
.admin-nav::-webkit-scrollbar-thumb { background: rgba(201, 168, 76, 0.15); border-radius: 3px; }

.admin-nav-item {
    position: relative;
    padding: 10px 14px 10px 18px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 13px;
    color: var(--gray);
    transition: background var(--transition), color var(--transition);
}

.admin-nav-item:hover {
    background: rgba(201, 168, 76, 0.06);
    color: var(--gold-light);
}

.admin-nav-item.active {
    background: rgba(201, 168, 76, 0.1);
    color: var(--white);
    font-weight: 600;
}

.admin-nav-item.active::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 18px;
    background: var(--gold);
    border-radius: 2px;
}

/* Footer del sidebar */
.admin-sidebar-footer {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
}

.admin-user-avatar {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    background: var(--navy-surface);
    border: 1px solid var(--border);
    color: var(--gold-light);
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
}

.admin-user-meta { min-width: 0; flex: 1; }

.admin-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-user-role {
    font-size: 10px;
    color: var(--gray);
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.admin-sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.btn-block { width: 100%; text-align: center; }

/* Main */
.admin-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 32px;
    background: rgba(10, 14, 39, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.admin-topbar-crumb {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.admin-topbar-root {
    color: var(--gray);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 11px;
}

.admin-topbar-sep { color: var(--gray-dark); }

.admin-topbar-current {
    color: var(--white);
    font-weight: 600;
    font-size: 15px;
}

/* Burger (solo mobile). Se oculta en desktop por display:none */
.admin-burger {
    display: none;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: var(--radius-sm);
    color: var(--gold-light);
    margin-right: var(--s-2);
    transition: background var(--transition), color var(--transition);
}
.admin-burger:hover { background: rgba(201, 168, 76, 0.08); color: var(--gold); }
.admin-burger:focus-visible { box-shadow: var(--ring); outline: none; }
.admin-burger svg { width: 22px; height: 22px; display: block; }

/* Botón cerrar drawer — solo se pinta en mobile */
.admin-drawer-close {
    display: none;
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: var(--radius-sm);
    color: var(--gray);
    transition: all var(--transition);
}
.admin-drawer-close:hover { background: rgba(255, 255, 255, 0.06); color: var(--white); }
.admin-drawer-close svg { width: 18px; height: 18px; display: block; }

/* Backdrop — solo mobile */
.admin-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: var(--z-backdrop);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.admin-backdrop.is-open { opacity: 1; pointer-events: auto; }

.admin-content {
    padding: 28px 32px 40px;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
}

.admin-card {
    background: var(--navy-mid);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    transition: border-color var(--transition);
}

.admin-card:hover {
    border-color: var(--border-hover);
}

.admin-card-title {
    font-size: clamp(13px, 1.1vw, 14px);
    font-weight: 700;
    color: var(--gold-light);
    margin-bottom: 14px;
    letter-spacing: 0.3px;
}

.admin-form-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-form-row .form-input { flex: 1; min-width: 120px; }

.user-row, .doc-row {
    background: var(--navy-mid);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 10px;
    transition: all var(--transition);
}

.user-row:hover, .doc-row:hover {
    border-color: var(--border-hover);
    background: var(--navy-surface);
}

.user-info, .doc-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.user-name { font-weight: 600; font-size: 14px; }
.user-username { color: var(--gray); font-size: 12px; }
.user-actions, .doc-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.badge {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.badge-active { background: rgba(34,197,94,0.12); color: var(--green); }
.badge-inactive { background: rgba(239,68,68,0.12); color: var(--red); }
.badge-label { background: rgba(201,168,76,0.12); color: var(--gold); }

.labels-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
    min-height: 4px;
}

.label-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(201,168,76,0.15);
    color: var(--gold);
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 500;
}

.label-chip-x {
    cursor: pointer;
    color: var(--gold);
    opacity: 0.6;
    font-weight: 700;
    line-height: 1;
    user-select: none;
    transition: opacity 0.2s;
}

.label-chip-x:hover { opacity: 1; }

.doc-meta { color: var(--gray); font-size: 12px; }

.doc-drag-handle {
    cursor: grab;
    color: var(--gray-dark);
    font-size: 16px;
    user-select: none;
    line-height: 1;
    transition: color var(--transition);
}

.doc-draggable { cursor: default; transition: all 0.15s ease; }
.doc-draggable:hover .doc-drag-handle { color: var(--gold); }
.doc-dragging { opacity: 0.4; border-color: var(--gold); }
.doc-draggable.drag-over { border-color: var(--gold); background: var(--navy-surface); }

.empty-state {
    text-align: center;
    color: var(--gray-dark);
    padding: 48px 20px;
    font-size: 14px;
}

/* ─── MODAL ─── */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal-card {
    width: 100%;
    max-width: 440px;
    background: var(--navy-mid);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    border: 1px solid var(--border-hover);
    box-shadow: var(--shadow-lg), var(--shadow-gold);
    animation: modalIn 0.25s ease;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.modal-close {
    background: none;
    border: none;
    color: var(--gray);
    font-size: 22px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    line-height: 1;
    transition: all var(--transition);
}

.modal-close:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.06);
}

.modal-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(201, 168, 76, 0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(201, 168, 76, 0.3); }

/* ─── STATUS MESSAGES ─── */
.status-msg {
    font-size: 13px;
    text-align: center;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    margin-top: 12px;
    animation: fadeIn 0.3s ease;
}

.status-msg--success { color: var(--green); background: rgba(34, 197, 94, 0.06); }
.status-msg--error { color: var(--red); background: rgba(239, 68, 68, 0.06); }

/* ─── UTILIDADES ─── */
/* Layout compositional — úsalas en vez de inline flex/grid */
.row { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.row--nowrap { flex-wrap: nowrap; }
.row--between { justify-content: space-between; }
.row--end { justify-content: flex-end; }
.row--center { justify-content: center; }
.row--top { align-items: flex-start; }

.stack { display: flex; flex-direction: column; gap: var(--s-3); }
.stack--sm { gap: var(--s-2); }
.stack--lg { gap: var(--s-4); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--s-3); }

.w-full { width: 100%; }
.flex-1 { flex: 1 1 0; min-width: 0; }
.nowrap { white-space: nowrap; }

/* Texto */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted { color: var(--gray); }
.text-faint { color: var(--gray-dark); }
.text-xs { font-size: var(--fs-xs); }
.text-sm { font-size: var(--fs-sm); }
.text-md { font-size: var(--fs-md); }
.text-lg { font-size: var(--fs-lg); }
.text-white  { color: var(--white); }
.text-success { color: var(--green); }
.text-accent { color: var(--gold); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.inline-block { display: inline-block; }

/* Texto de ayuda (reemplaza inline "font-size:12px;color:var(--gray);margin-bottom:12px") */
.hint {
    font-size: var(--fs-sm);
    color: var(--gray);
    line-height: var(--lh-base);
    margin-bottom: var(--s-3);
}
.hint--tight { margin-bottom: var(--s-2); }

/* Spacing helpers (usa solo cuando el componente no tenga clase propia) */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--s-1); }
.mt-2 { margin-top: var(--s-2); }
.mt-3 { margin-top: var(--s-3); }
.mt-4 { margin-top: var(--s-4); }
.mt-5 { margin-top: var(--s-5); }
.mt-6 { margin-top: var(--s-6); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--s-1); }
.mb-2 { margin-bottom: var(--s-2); }
.mb-3 { margin-bottom: var(--s-3); }
.mb-4 { margin-bottom: var(--s-4); }
.mb-5 { margin-bottom: var(--s-5); }

/* Botón a ancho completo alineado a la base del admin-card */
.btn-full { width: 100%; padding: var(--s-3); }

/* Variante outline roja para admin-btn (ej: "quitar") */
.admin-btn--danger {
    background: transparent;
    border: 1px solid var(--red);
    color: var(--red);
}
.admin-btn--danger:hover { background: rgba(239, 68, 68, 0.08); opacity: 1; }

/* Variante neutra: outline dorado */
.admin-btn--ghost {
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
}
.admin-btn--ghost:hover { background: rgba(201, 168, 76, 0.08); opacity: 1; }

/* Mensaje de estado de formularios (cuyo color lo pinta JS) */
.form-msg {
    text-align: center;
    font-size: var(--fs-base);
    margin-top: var(--s-2);
    min-height: 18px;
    line-height: 1.4;
}
.form-msg--success { color: var(--green); }
.form-msg--error   { color: var(--red); }
.form-msg--muted   { color: var(--gray); }
.log-line          { line-height: 1.5; }
.log-line--ok      { color: var(--green); }

/* Variantes de modal */
.modal-card--lg { max-width: 640px; }
.modal-card--xl { max-width: 840px; }
.modal-card--2xl { max-width: 1000px; }

/* Card title con meta a la derecha */
.card-title-split {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--s-3);
}

/* Etiqueta meta (uppercase gray) */
.meta-label {
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--gray);
    letter-spacing: 1px;
    text-transform: uppercase;
}
.meta-label--strong { font-weight: 600; font-size: var(--fs-base); }

/* Toolbar de fechas + rangos (flex-wrap) */
.date-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    margin-top: var(--s-2);
    margin-bottom: var(--s-3);
}
.date-toolbar-chips {
    display: flex;
    gap: var(--s-1);
    flex-wrap: wrap;
    margin-left: auto;
}
@media (max-width: 640px) {
    .date-toolbar-chips { margin-left: 0; width: 100%; justify-content: flex-start; }
    .date-toolbar > * { flex: 1 1 auto; }
}

/* Filtros inline para métricas (search + sort + filter) */
.metrics-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-3);
    align-items: center;
    margin-top: var(--s-2);
    margin-bottom: var(--s-3);
}
.metrics-filters > input { flex: 1 1 220px; min-width: 180px; }
.metrics-filters > select { flex: 0 1 auto; min-width: 180px; }
@media (max-width: 640px) {
    .metrics-filters > input,
    .metrics-filters > select { flex: 1 1 100%; min-width: 0; }
}

/* Lista de logs con scroll */
.logs-list {
    max-height: 420px;
    overflow-y: auto;
}

/* Textarea alto */
.form-input--tall { min-height: 300px; }
.form-input--x-tall { min-height: 360px; }

/* Mensaje de formulario que va ENCIMA (antes) del botón */
.form-msg--above { margin-top: 0; margin-bottom: var(--s-3); }

/* Lead / párrafo descriptivo dentro de modales */
.modal-lead {
    font-size: var(--fs-sm);
    color: var(--gray);
    line-height: 1.6;
    margin-bottom: var(--s-4);
}

/* Subtítulo dentro de modales (secciones) */
.modal-subtitle {
    font-size: var(--fs-sm);
    color: var(--gray);
    margin-bottom: var(--s-3);
}

/* Preview de avatar / imagen */
.avatar-preview {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    display: grid;
    place-items: center;
    font-weight: 800;
    color: var(--navy);
    font-size: 18px;
    overflow: hidden;
    flex-shrink: 0;
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }

/* Input de tipo file más compacto */
.file-input { padding: 8px; }

/* Fila input + botón inmediata (ej: añadir sugerencia) */
.inline-form {
    display: flex;
    gap: var(--s-2);
    margin-bottom: var(--s-4);
    flex-wrap: wrap;
}
.inline-form .form-input { flex: 1; min-width: 180px; }

/* Fila con gap mayor (16px) */
.row--wide { gap: var(--s-4); }

/* Subtítulos dentro de admin-card (ej: "FONDOS", "ACENTO"…) */
.subsection-title {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--gold-light);
    margin: var(--s-4) 0 var(--s-3);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.subsection-title:first-child { margin-top: 0; }

/* Variante row alineada en base (para selects + botón guardar) */
.row--end-align { align-items: flex-end; }
.row--bottom { align-items: flex-end; }

/* Display de número de versión */
.version-display {
    display: flex;
    align-items: baseline;
    gap: var(--s-3);
    flex-wrap: wrap;
}
.version-number {
    font-size: 28px;
    font-weight: 800;
    color: var(--gold);
    line-height: 1;
}

/* Bloques de código inline / block */
.code-block {
    display: block;
    background: var(--navy);
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: var(--s-3);
    font-size: var(--fs-sm);
    color: var(--gray);
    word-break: break-all;
    font-family: 'SF Mono', Consolas, Menlo, monospace;
    border: 1px solid var(--border);
}
.code-block--http { color: var(--green); font-weight: 500; }
.code-block--tight { margin-bottom: var(--s-1); }

.code-pre {
    background: var(--navy);
    padding: 10px 14px;
    border-radius: 6px;
    font-size: var(--fs-xs);
    color: var(--gray);
    white-space: pre-wrap;
    margin-bottom: var(--s-3);
    font-family: 'SF Mono', Consolas, Menlo, monospace;
    line-height: 1.6;
    overflow-x: auto;
    border: 1px solid var(--border);
}
.code-pre:last-child { margin-bottom: 0; }

/* Caja destacada para API key cuando se genera */
.key-display {
    margin-bottom: var(--s-4);
    padding: var(--s-4);
    background: var(--navy);
    border-radius: var(--radius-sm);
    border: 1px solid var(--red);
}
.key-display-warning {
    font-size: var(--fs-xs);
    color: var(--red);
    margin-bottom: var(--s-1);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.key-display-value {
    font-size: var(--fs-base);
    color: var(--gold);
    word-break: break-all;
    font-family: 'SF Mono', Consolas, Menlo, monospace;
}

/* Lista de códigos HTTP */
.status-code-list { font-size: var(--fs-sm); line-height: 2.2; }
.status-code {
    display: inline-block;
    width: 44px;
    font-weight: 600;
    font-family: 'SF Mono', Consolas, Menlo, monospace;
}
.status-code--ok { color: var(--green); }
.status-code--err { color: var(--red); }

/* Texto documental (tabs con mucho contenido leído) */
.doc-text {
    font-size: var(--fs-sm);
    color: var(--gray);
    line-height: 1.8;
}
.doc-text p { margin-bottom: var(--s-3); }
.doc-text p:last-child { margin-bottom: 0; }
.doc-text code,
.hint code { color: var(--gold); font-family: 'SF Mono', Consolas, Menlo, monospace; font-size: 0.9em; }
.doc-text a,
.hint a {
    color: var(--gold);
    transition: color var(--transition);
}
.doc-text a:hover,
.hint a:hover { color: var(--gold-light); text-decoration: underline; }

/* Los botones dentro de doc-text / hint mantienen su color propio */
.doc-text .admin-btn,
.hint .admin-btn,
.doc-text .btn-outline,
.hint .btn-outline { color: var(--navy); }
.doc-text .admin-btn:hover,
.hint .admin-btn:hover { color: var(--navy); text-decoration: none; }
.doc-text .btn-outline,
.hint .btn-outline { color: var(--gold); }
.doc-text .btn-outline:hover,
.hint .btn-outline:hover { text-decoration: none; }

/* Barra de filtros (search + selects + botón). Colapsa en mobile */
.filters-toolbar {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: var(--s-2);
    align-items: stretch;
}
@media (max-width: 960px) {
    .filters-toolbar {
        grid-template-columns: 1fr 1fr;
    }
    .filters-toolbar > :first-child { grid-column: 1 / -1; }
    .filters-toolbar > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
    .filters-toolbar { grid-template-columns: 1fr; }
    .filters-toolbar > :first-child,
    .filters-toolbar > :last-child { grid-column: auto; }
}

/* Toggle con label */
.toggle-label {
    display: inline-flex;
    align-items: center;
    gap: var(--s-3);
    cursor: pointer;
    user-select: none;
    font-size: var(--fs-md);
}
.toggle-label input[type="checkbox"] {
    accent-color: var(--gold);
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

/* Complemento en una form-label (ej: "— quién es la IA") */
.form-label-hint {
    color: var(--gray-dark);
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    margin-left: var(--s-1);
}

/* Preview de prompt (system + user) */
.prompt-preview {
    margin-top: var(--s-4);
    padding: var(--s-5);
    background: var(--navy);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    max-height: 500px;
    overflow-y: auto;
}
.prompt-preview-label {
    font-size: var(--fs-xs);
    color: var(--gold);
    letter-spacing: 1px;
    margin-bottom: var(--s-3);
    font-weight: 600;
    text-transform: uppercase;
}
.prompt-preview pre {
    font-size: var(--fs-sm);
    color: var(--gray);
    white-space: pre-wrap;
    word-break: break-word;
    line-height: var(--lh-loose);
    margin: 0;
    font-family: inherit;
}
.prompt-preview pre.is-user { color: var(--white); }

/* Caja tipo consola/log */
.log-box {
    margin-top: var(--s-3);
    padding: var(--s-4);
    background: var(--navy);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: var(--fs-sm);
    color: var(--gray);
    line-height: 1.8;
    font-family: 'SF Mono', Consolas, Menlo, monospace;
    max-height: 320px;
    overflow-y: auto;
}

/* Nota pequeña bajo un botón o bloque */
.note-sm {
    font-size: var(--fs-xs);
    color: var(--gray-dark);
    text-align: center;
    margin-top: var(--s-3);
    line-height: var(--lh-base);
}

/* Columna de botones en card (2 columnas, colapsa en móvil vía grid-2 responsive) */
.card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); }
@media (max-width: 400px) { .card-actions { grid-template-columns: 1fr; } }

/* Separador sutil */
.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: var(--s-5) 0;
}

/* Visually-hidden accesible */
.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}

/* En móvil, grids de 2 columnas pasan a 1 por defecto en .grid-2--collapse */
.grid-2--collapse,
.grid-3--collapse { grid-template-columns: 1fr; }
@media (min-width: 481px) {
    .grid-2--collapse { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 641px) {
    .grid-3--collapse { grid-template-columns: repeat(3, 1fr); }
}

/* ─── RESPONSIVE ─── */

/* En dispositivos sin hover real (táctil), no dejes estados "pegados" */
@media (hover: none) {
    .btn-gold:hover,
    .admin-btn:hover,
    .chat-suggestion:hover,
    .btn-outline:hover {
        transform: none;
        box-shadow: none;
    }
}

/* ≤ 1024px — tablets horizontales y laptops pequeñas */
@media (max-width: 1024px) {
    .admin-content { padding: 24px 24px 36px; }
    .admin-topbar { padding: 16px 24px; }
}

/* ≤ 960px — sidebar se convierte en drawer deslizable */
@media (max-width: 960px) {
    .admin-layout { grid-template-columns: 1fr; }

    .admin-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        height: 100vh;
        height: 100dvh;
        width: 280px;
        max-width: 86vw;
        z-index: var(--z-drawer);
        padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
        border-right: 1px solid var(--border);
        border-bottom: none;
        transform: translateX(-100%);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        overscroll-behavior: contain;
        will-change: transform;
    }
    .admin-sidebar.is-open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .admin-sidebar-brand { padding-right: 44px; /* espacio para botón cerrar */ }
    .admin-nav { flex-direction: column; overflow-x: hidden; overflow-y: auto; gap: 2px; }
    .admin-nav-item { white-space: normal; padding: 11px 14px 11px 18px; font-size: 14px; }
    .admin-nav-item.active::before { display: block; }

    .admin-sidebar-footer {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        margin-top: 16px;
        padding-top: 16px;
    }
    .admin-user-chip { flex: 0 1 auto; }
    .admin-sidebar-actions { flex-direction: column; gap: 6px; }

    .admin-backdrop { display: block; }
    .admin-burger { display: grid; }
    .admin-drawer-close { display: grid; }

    /* Bloquear scroll del body cuando el drawer está abierto */
    body.admin-drawer-open { overflow: hidden; touch-action: none; }
}

/* ≤ 768px — tablets verticales */
@media (max-width: 768px) {
    .admin-content { padding: 20px 16px 32px; }
    .admin-topbar { padding: 14px 16px; justify-content: flex-start; }
    .admin-card { padding: 20px 18px; }
    .chat-messages { padding: 20px 14px; }
    .chat-input-area { padding: 12px 14px calc(16px + env(safe-area-inset-bottom)); }
}

/* ≤ 640px — móviles grandes */
@media (max-width: 640px) {
    .login-card { padding: 32px 20px; }
    .login-brand { margin-bottom: 28px; }
    .admin-form-row { flex-direction: column; }
    .user-row, .doc-row { flex-direction: column; align-items: flex-start; padding: 14px 16px; }
    .user-actions, .doc-actions { width: 100%; justify-content: flex-start; }
    .message-bubble { max-width: 88%; padding: 12px 16px; font-size: 14px; }
    .chat-header { padding: 12px 14px; }
    .chat-header-right { gap: 6px; }
    .chat-user-name { display: none; }
    .chat-suggestions { max-width: 100%; }
    .modal-card { padding: 24px 20px; max-height: 94vh; border-radius: var(--radius-md); }
    .admin-card { padding: 18px 16px; margin-bottom: 12px; }
    .admin-card-title { margin-bottom: 12px; }
    .form-group { margin-bottom: 16px; }
    .grid-2 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr 1fr; }
}

/* ≤ 480px — móviles medios */
@media (max-width: 480px) {
    .login-card { padding: 28px 18px; }
    .chat-welcome { padding-top: 32px; }
    .chat-welcome-text { font-size: 13px; }
    .chat-suggestion { font-size: 12px; padding: 8px 14px; }
    #send-btn { padding: 12px 18px; }
    #chat-input { padding: 12px 16px; }
    .admin-topbar-current { font-size: 14px; }
    .btn-outline { padding: 7px 14px; font-size: 12px; }
    .grid-3 { grid-template-columns: 1fr; }
}

/* ≤ 375px — iPhone SE / Android compactos */
@media (max-width: 375px) {
    .login-card { padding: 24px 16px; }
    .chat-header { padding: 10px 12px; }
    .chat-title { font-size: 13px; }
    .chat-status { font-size: 10px; }
    .chat-avatar { width: 34px; height: 34px; font-size: 12px; }
    .btn-outline--compact { padding: 4px 10px; font-size: 10.5px; }
    .btn-outline { padding: 6px 10px; font-size: 11px; }
    .btn-sm { padding: 6px 10px; font-size: 11px; }
    .admin-card { padding: 16px 14px; }
    .modal-card { padding: 20px 16px; }
    .admin-btn { padding: 10px 14px; font-size: 12px; }
}
