/* ═══════════════════════════════════════════════════════════════════════════
   style.css — Mesa de Soporte Técnico
   Tema basado en el sistema de diseño documentado en tema UI-UX.md
   NOTA: Los archivos .woff2 deben descargarse y colocarse en assets/fonts/
         Manrope:       500, 600, 700, 800  (latin + latin-ext)
         IBM Plex Sans: 400, 500, 600       (latin + latin-ext)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── @font-face ─────────────────────────────────────────────────────────── */
@font-face { font-family: 'Manrope'; font-weight: 500; font-display: swap;
    src: url('../assets/fonts/manrope-500.woff2') format('woff2'); }
@font-face { font-family: 'Manrope'; font-weight: 600; font-display: swap;
    src: url('../assets/fonts/manrope-600.woff2') format('woff2'); }
@font-face { font-family: 'Manrope'; font-weight: 700; font-display: swap;
    src: url('../assets/fonts/manrope-700.woff2') format('woff2'); }
@font-face { font-family: 'Manrope'; font-weight: 800; font-display: swap;
    src: url('../assets/fonts/manrope-800.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-display: swap;
    src: url('../assets/fonts/ibm-plex-sans-400.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 500; font-display: swap;
    src: url('../assets/fonts/ibm-plex-sans-500.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; font-display: swap;
    src: url('../assets/fonts/ibm-plex-sans-600.woff2') format('woff2'); }

/* ── Variables CSS ──────────────────────────────────────────────────────── */
:root {
    /* Brand */
    --c-primary:      #0D2D4A;
    --c-primary-mid:  #11436A;
    --c-action:       #8FB32E;
    --c-action-soft:  #C8DC78;

    /* Azules auxiliares */
    --c-blue-1: #175C94;
    --c-blue-2: #4F6E9C;

    /* Semánticos */
    --c-success:  #1AAB7E;
    --c-warn:     #E07B2A;
    --c-danger:   #C94040;
    --c-info:     #3A82C4;
    --c-neutral:  #7090AD;

    /* Superficies */
    --c-surface:       #F5F8FC;
    --c-surface-soft:  #EAF0F8;
    --c-surface-card:  #FFFFFF;
    --c-line:          #D4DFE9;
    --c-line-soft:     #E6EEF5;

    /* Grises UI */
    --c-gray-1:     #E8EEF4;
    --c-gray-2:     #A8B8C8;
    --c-warn-soft:  #F4E0D6;
    --c-white:      #fff;
    --c-black:      #141E28;

    /* Texto */
    --c-text:       #1A2D3E;
    --c-text-soft:  #5A7490;
    --c-text-muted: #8FA8BE;

    /* Sombras */
    --shadow-soft:    0 4px 16px rgba(13, 45, 74, .07);
    --shadow-card:    0 2px 8px rgba(13, 45, 74, .06), 0 8px 24px rgba(13, 45, 74, .05);
    --shadow-strong:  0 12px 36px rgba(13, 45, 74, .14);
    --shadow-sidebar: 18px 0 40px rgba(13, 45, 74, .18);

    /* Tipografía */
    --font-brand: 'Manrope', system-ui, -apple-system, sans-serif;
    --font-body:  'IBM Plex Sans', system-ui, -apple-system, sans-serif;

    /* Layout */
    --sidebar-w: 250px;
    --topbar-h:  64px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 22px;
}

/* ── Reset / Base ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-body);
    color: var(--c-text);
    background: var(--c-surface);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--c-blue-1); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { display: block; }

/* ── Transiciones globales ───────────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
    :is(button, .btn, a.btn, input[type="submit"],
        .dash-nav-item, .dash-panel, .kpi, .info-card,
        .ticket-row, .stat-card) {
        transition: transform .18s ease, box-shadow .18s ease,
                    background-color .15s ease, border-color .15s ease,
                    opacity .15s ease;
    }
}

/* ════════════════════════════════════════════════════════════════════════════
   LOGIN
   ════════════════════════════════════════════════════════════════════════════ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(ellipse 70% 55% at 62% 44%, rgba(143,179,46,.08) 0%, transparent 65%),
        radial-gradient(circle at 18% 18%, rgba(255,255,255,.08) 0%, transparent 28%),
        linear-gradient(150deg, #071826 0%, #0D2237 55%, #0f3254 100%);
}

.login-shell {
    display: grid;
    grid-template-columns: 1fr;   /* 1 columna en móvil: solo el form */
    max-width: 1120px;
    width: 100%;
    border-radius: var(--radius-xl);
    box-shadow:
        0 50px 100px rgba(0, 0, 0, .38),
        0 12px 32px rgba(0, 0, 0, .22),
        0 0 0 1px rgba(255,255,255,.04);
    overflow: hidden;
    animation: login-shell-enter .5s ease-out both;
}

/* Panel izquierdo — brand (oculto en móvil por defecto) */
.login-brand {
    display: none;
    padding: 54px 46px 40px;
    flex-direction: column;
    justify-content: center;
    gap: 28px;
    background: linear-gradient(165deg, #071826 0%, #0D2237 50%, #0b3050 100%);
    position: relative;
    overflow: hidden;
}
.login-brand::before,
.login-brand::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(143,179,46,.25);
    pointer-events: none;
}
.login-brand::before { width: 420px; height: 420px; top: -120px; right: -120px; border-color: rgba(143,179,46,.12); }
.login-brand::after  { width: 260px; height: 260px; bottom: -80px; left: -60px; opacity: .45; border-color: rgba(143,179,46,.06); }

.login-brand-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 55% 40% at 50% 50%, rgba(143,179,46,.06) 0%, transparent 70%);
    pointer-events: none;
}

.login-brand-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    flex: 1;
    text-align: center;
}

.login-logo {
    width: 156px;
    height: 156px;
    object-fit: contain;
    align-self: center;
    filter: drop-shadow(0 14px 36px rgba(0, 0, 0, .42));
}

.login-tagline {
    margin: 0;
    align-self: center;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .20em;
    text-transform: uppercase;
    color: rgba(143,179,46,.80);
}

.login-tagline,
.login-logo,
.login-copy-block,
.login-feature-list {
    animation-duration: .78s;
    animation-timing-function: cubic-bezier(.22, 1, .36, 1);
    animation-fill-mode: both;
}

.login-tagline {
    animation-name: login-content-rise;
    animation-delay: .12s;
}

.login-logo {
    animation-name: login-content-float-in;
    animation-delay: .2s;
}

.login-copy-block {
    animation-name: login-content-rise;
    animation-delay: .3s;
}

.login-feature-list {
    animation-name: login-content-rise;
    animation-delay: .42s;
}

.login-copy-block {
    display: grid;
    gap: 12px;
    max-width: 430px;
    justify-items: center;
    text-align: center;
}
.login-brand-title {
    font-family: var(--font-brand);
    font-weight: 800;
    font-size: 38px;
    color: var(--c-white);
    line-height: 1.04;
    letter-spacing: -.045em;
    max-width: 430px;
}
.login-brand-sub {
    margin: 0;
    font-size: .9375rem;
    color: rgba(232,241,252,.72);
    line-height: 1.72;
    max-width: 390px;
}
.login-brand-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    gap: 6px;
    font-size: .875rem;
    font-weight: 700;
    color: rgba(235,245,214,.96);
    background: rgba(143,179,46,.14);
    border: 1px solid rgba(143,179,46,.28);
    border-radius: 99px;
    padding: 6px 14px;
    width: fit-content;
}

.login-feature-list {
    display: grid;
    gap: 12px;
    width: min(100%, 340px);
    margin: 0;
    padding: 0;
    list-style: none;
    align-self: center;
    text-align: left;
}

.login-feature-list li {
    position: relative;
    padding-left: 34px;
    color: rgba(245, 250, 255, .92);
    font-size: 14px;
    line-height: 1.55;
}

.login-feature-list li::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid rgba(143,179,46,.42);
    background: rgba(143,179,46,.12);
    box-shadow: inset 0 0 0 4px rgba(143,179,46,.1);
}

/* Panel derecho — formulario */
.login-form-panel {
    padding: 60px 56px;
    background: linear-gradient(180deg, rgba(255,255,255,.98), #f7f9fd 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;   /* ocupa pantalla completa en móvil */
    position: relative;
}
.login-form-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 0% 0%, rgba(13,45,74,.05) 0%, transparent 34%);
    pointer-events: none;
}
.login-form-inner { max-width: 360px; width: 100%; position: relative; z-index: 1; }
.login-platform-badge {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(13,45,74,.12);
    background: rgba(13,45,74,.06);
    color: var(--c-primary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 18px;
}
.login-form-title {
    font-family: var(--font-brand);
    font-weight: 800;
    font-size: 1.875rem;
    color: var(--c-primary);
    margin-bottom: 6px;
}
.login-form-sub {
    font-size: .875rem;
    color: var(--c-text-soft);
    margin-bottom: 32px;
}

/* Alerta de error de login */
.login-alert {
    background: rgba(201,64,64,.08);
    border: 1px solid rgba(201,64,64,.3);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-size: .85rem;
    color: var(--c-danger);
    margin-bottom: 20px;
}

.login-platform-switch {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid rgba(13,45,74,.08);
}

.login-platform-switch-label {
    display: block;
    margin-bottom: 12px;
    color: var(--c-text-soft);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.login-platform-tabs {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 8px;
    border-radius: 18px;
    background: rgba(13,45,74,.06);
    overflow: hidden;
}

.login-platform-tabs::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    width: calc(50% - 8px);
    height: calc(100% - 16px);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255,255,255,.98), rgba(242,249,222,.94));
    box-shadow: 0 12px 28px rgba(13,45,74,.18);
    transition: transform .42s cubic-bezier(.22, 1, .36, 1), box-shadow .28s ease, opacity .28s ease;
}

.login-platform-tabs.is-rh::before {
    background: linear-gradient(135deg, rgba(255,255,255,.99), rgba(226,241,255,.96));
    box-shadow: 0 12px 28px rgba(23,92,148,.18), inset 0 0 0 1px rgba(79,110,156,.08);
}

.login-platform-tabs.is-soporte::before {
    transform: translateX(100%);
    background: linear-gradient(135deg, rgba(255,255,255,.99), rgba(239,248,210,.96));
    box-shadow: 0 12px 28px rgba(143,179,46,.18), inset 0 0 0 1px rgba(143,179,46,.08);
}

.login-platform-tab {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    color: var(--c-primary);
    font-family: var(--font-brand);
    font-size: .875rem;
    font-weight: 700;
    text-decoration: none;
    position: relative;
    z-index: 1;
    transition: transform .24s ease, color .24s ease, opacity .24s ease, letter-spacing .24s ease;
}

.login-platform-tab:not(.is-active) {
    opacity: .74;
}

.login-platform-tab:hover:not(.is-active) {
    opacity: 1;
    transform: translateY(-1px) scale(1.02);
    text-decoration: none;
}

.login-platform-tab.is-active {
    color: var(--c-primary);
    letter-spacing: .01em;
}

.login-platform-tabs:hover::before {
    box-shadow: 0 14px 30px rgba(13,45,74,.2);
}

.login-page.is-platform-switching .login-tagline,
.login-page.is-platform-switching .login-logo,
.login-page.is-platform-switching .login-copy-block,
.login-page.is-platform-switching .login-feature-list {
    animation: login-content-exit .4s ease forwards;
}

.login-page.is-platform-switching .login-form-panel,
.login-page.is-platform-switching .login-brand {
    animation: login-panel-exit .4s cubic-bezier(.4, 0, .2, 1) forwards;
}

@keyframes login-content-float-in {
    0% {
        opacity: 0;
        transform: translateX(42px) scale(.86);
    }

    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes login-content-rise {
    0% {
        opacity: 0;
        transform: translateY(44px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes login-content-exit {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateY(-22px) scale(.98);
    }
}

@keyframes login-panel-exit {
    0% {
        opacity: 1;
        transform: translateX(0);
        filter: blur(0);
    }

    100% {
        opacity: .12;
        transform: translateX(24px);
        filter: blur(8px);
    }
}

@keyframes login-shell-enter {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ════════════════════════════════════════════════════════════════════════════
   FORMULARIOS — elementos reutilizables
   ════════════════════════════════════════════════════════════════════════════ */
.field-block { display: flex; flex-direction: column; gap: 6px; }

.field-block label {
    font-family: var(--font-body);
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--c-blue-1);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    font-family: var(--font-body);
    font-size: .875rem;
    color: var(--c-text);
    background: linear-gradient(180deg, #fff 0%, #f9fbfd 100%);
    border: 1px solid #d9e3ee;
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    -webkit-appearance: none;
    appearance: none;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--c-blue-2);
    box-shadow: 0 0 0 3px rgba(79, 110, 156, .15);
}
input::placeholder, textarea::placeholder { color: var(--c-text-muted); }
textarea { resize: vertical; min-height: 100px; line-height: 1.55; }

/* ── Campos fecha estilizados ──────────────────────────────────────────── */
.date-wrap {
    position: relative;
}
.date-wrap input[type="date"] {
    padding-right: 40px;
    cursor: pointer;
}
.date-wrap input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: 40px;
    height: 100%;
    cursor: pointer;
}
.date-wrap::after {
    content: '';
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234f6e9c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    pointer-events: none;
}
.date-wrap input[type="date"]:disabled,
.date-wrap input[type="date"][readonly] {
    background: linear-gradient(180deg, #f4f6fa 0%, #edf0f5 100%);
    color: var(--c-text-muted);
    cursor: default;
}
.date-wrap input[type="date"]:disabled + .date-lock-icon,
.date-wrap input[type="date"][readonly] + .date-lock-icon {
    display: flex;
}
/* Icono candado para fecha bloqueada */
.date-lock-icon {
    display: none;
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--c-text-muted);
    pointer-events: none;
}
/* Cuando bloqueado, el ícono de candado reemplaza el calendario */
.date-wrap:has(input:disabled)::after,
.date-wrap:has(input[readonly])::after { display: none; }

.form-grid {
    display: grid;
    grid-template-columns: 1fr;   /* 1 columna en móvil */
    gap: 14px;
}
.form-grid .span-2 { grid-column: 1; }

.password-wrap { position: relative; }
.password-wrap input { padding-right: 44px; }
.password-toggle {
    position: absolute;
    right: 12px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    cursor: pointer; color: var(--c-text-muted);
    padding: 4px; font-size: 1rem;
    line-height: 1;
}
.password-toggle:hover { color: var(--c-blue-1); }

/* ════════════════════════════════════════════════════════════════════════════
   BOTONES
   ════════════════════════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 20px;
    font-family: var(--font-brand);
    font-size: .875rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    background: linear-gradient(135deg, var(--c-blue-1) 0%, var(--c-primary) 100%);
    color: #fff;
    box-shadow: 0 2px 6px rgba(13,45,74,.18);
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn:hover:not(:disabled)     { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(13,45,74,.22); }
.btn:focus-visible             { outline: 2px solid var(--c-action); outline-offset: 2px; }
.btn:disabled                  { opacity: .58; cursor: not-allowed; filter: grayscale(.1); }

.btn-action {
    background: linear-gradient(135deg, var(--c-action) 0%, #bfd86c 100%);
    color: var(--c-primary);
    box-shadow: 0 2px 6px rgba(143,179,46,.28);
}
.btn-action:hover:not(:disabled) { box-shadow: 0 4px 14px rgba(143,179,46,.34); }

.btn-secondary {
    background: linear-gradient(135deg, var(--c-blue-2) 0%, var(--c-blue-1) 100%);
    color: #fff;
}

.btn-danger {
    background: linear-gradient(135deg, #c75c5c 0%, #b74848 100%);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--c-text-soft);
    box-shadow: none;
    border: 1px solid var(--c-line);
}
.btn-ghost:hover:not(:disabled) { background: var(--c-surface-soft); }

.btn-sm { padding: 6px 14px; font-size: .8125rem; }
.btn-full { width: 100%; }

/* ════════════════════════════════════════════════════════════════════════════
   DASHBOARD — shell  (mobile-first)
   ════════════════════════════════════════════════════════════════════════════ */
.dashboard-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr);  /* base: sin sidebar en layout */
    min-height: 100vh;
    background: linear-gradient(180deg, #eaf1f8 0%, #f7f9fc 100%);
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.dash-sidebar {
    grid-column: 1;
    grid-row: 1;
    width: var(--sidebar-w);
    position: fixed;              /* base: overlay en móvil */
    left: 0; top: 0;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform .25s ease;
    display: flex;
    flex-direction: column;
    gap: 0;
    background: linear-gradient(180deg, #0D2237 0%, #0A1C2E 100%);
    border-right: 1px solid rgba(255,255,255,.07);
    box-shadow: var(--shadow-sidebar);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 200;
    scrollbar-width: thin;
    scrollbar-color: rgba(143,179,46,.35) rgba(255,255,255,.04);
}
.dash-sidebar::-webkit-scrollbar { width: 4px; }
.dash-sidebar::-webkit-scrollbar-track  { background: rgba(255,255,255,.04); }
.dash-sidebar::-webkit-scrollbar-thumb  { background: rgba(143,179,46,.35); border-radius: 999px; }
.dash-sidebar::-webkit-scrollbar-thumb:hover { background: rgba(143,179,46,.6); }

/* Logo */
.dash-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 22px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.dash-logo-icon { font-size: 1.4rem; }
.dash-logo-text {
    font-family: var(--font-brand);
    font-weight: 800;
    font-size: .9375rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Usuario en sidebar */
.dash-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    margin: 10px 12px;
    background: rgba(255,255,255,.06);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255,255,255,.08);
}
.dash-user-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--c-action) 0%, #c8dc78 100%);
    color: var(--c-primary);
    font-family: var(--font-brand);
    font-weight: 800;
    font-size: .875rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.dash-user-info { display: flex; flex-direction: column; min-width: 0; }
.dash-user-name {
    font-size: .8125rem; font-weight: 600; color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dash-user-role { font-size: .6875rem; color: rgba(255,255,255,.5); margin-top: 1px; }

/* Navegación */
.dash-nav { padding: 8px 0 12px; flex: 1; }

.dash-nav-group { margin-bottom: 4px; }

.dash-nav-group-label {
    display: block;
    padding: 10px 20px 4px;
    font-size: .625rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(255,255,255,.32);
}

.dash-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px 9px 16px;
    margin: 1px 10px;
    border-radius: var(--radius-sm);
    font-size: .875rem;
    font-weight: 500;
    color: rgba(255,255,255,.65);
    text-decoration: none;
    border-left: 3px solid transparent;
    position: relative;
    transition: color .14s, background .14s, border-color .14s;
}
.dash-nav-item .nav-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: .75; }
.dash-nav-item .nav-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dash-nav-item:hover {
    color: #fff;
    background: rgba(255,255,255,.07);
    border-left-color: rgba(143,179,46,.5);
    text-decoration: none;
}
.dash-nav-item.is-active {
    color: #fff;
    background: rgba(143,179,46,.14);
    border-left-color: var(--c-action);
    font-weight: 600;
}
.dash-nav-item.is-active .nav-icon { opacity: 1; }

/* Footer sidebar */
.dash-sidebar-footer {
    padding: 14px 12px;
    border-top: 1px solid rgba(255,255,255,.07);
    background: linear-gradient(0deg, rgba(10,28,46,.9) 0%, transparent 100%);
}
.sidebar-logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: .8125rem;
    color: rgba(255,255,255,.5);
    text-decoration: none;
    transition: color .14s, background .14s;
}
.sidebar-logout-btn svg { width: 16px; height: 16px; }
.sidebar-logout-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-logout-btn:hover { color: #fff; background: rgba(255,255,255,.07); text-decoration: none; }

/* Handle toggle sidebar — visible en móvil por defecto */
.dash-sidebar-handle {
    display: flex;
    position: fixed;
    top: 16px; left: 16px;
    z-index: 210;
    background: var(--c-primary);
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
    width: 38px; height: 38px;
    align-items: center; justify-content: center;
    transition: left .25s ease, transform .2s ease, background .2s ease;
}
.dash-sidebar-handle span {
    display: block;
    width: 18px; height: 2px;
    background: rgba(255,255,255,.8);
    border-radius: 99px;
    transition: transform .2s, opacity .2s;
}
.dash-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10,28,46,.5);
    backdrop-filter: blur(2px);
    z-index: 190;
}

/* Estado colapsado (desktop) */
.is-sidebar-collapsed .dash-sidebar { width: 60px; }
.is-sidebar-collapsed .dash-logo-text,
.is-sidebar-collapsed .dash-user-info,
.is-sidebar-collapsed .dash-nav-group-label,
.is-sidebar-collapsed .dash-nav-item .nav-label,
.is-sidebar-collapsed .sidebar-logout-label { display: none; }
.is-sidebar-collapsed .dash-nav-item { justify-content: center; padding: 10px; }
.is-sidebar-collapsed .dash-user    { justify-content: center; padding: 10px; }
.is-sidebar-collapsed .dash-sidebar-footer { padding-left: 10px; padding-right: 10px; }
.is-sidebar-collapsed .sidebar-logout-btn { justify-content: center; padding-left: 10px; padding-right: 10px; }

/* ── Área de contenido ───────────────────────────────────────────────────── */
.dash-content {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
    width: 100%;
    justify-self: stretch;
    align-self: stretch;
}

/* Topbar */
.dash-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    box-sizing: border-box;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px 0 60px; /* espacio izq para el hamburger en móvil */
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--c-line-soft);
    box-shadow: var(--shadow-soft);
    /* Borde superior degradado azul→lima */
    border-top: 2px solid transparent;
    background-clip: padding-box;
    box-shadow: 0 2px 0 0 var(--c-action), var(--shadow-soft);
}
.topbar-left { display: flex; flex-direction: column; gap: 2px; }
.topbar-title {
    font-family: var(--font-brand);
    font-weight: 700;
    font-size: 1rem;
    color: var(--c-primary);
}
.topbar-breadcrumb { display: flex; align-items: center; gap: 4px; font-size: .75rem; }
.bc-link  { color: var(--c-blue-1); }
.bc-sep   { color: var(--c-text-muted); }
.bc-current { color: var(--c-text-soft); font-weight: 500; }

.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-cta   { padding: 7px 16px; font-size: .8125rem; }
.topbar-user  { display: flex; align-items: center; gap: 8px; }
.topbar-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--c-action) 0%, #c8dc78 100%);
    color: var(--c-primary);
    font-family: var(--font-brand);
    font-weight: 800;
    font-size: .8125rem;
    display: flex; align-items: center; justify-content: center;
}
.topbar-user-name {
    font-size: .8125rem;
    font-weight: 500;
    color: var(--c-text);
    display: none;   /* oculto en móvil, visible en desktop */
}

/* Área principal */
.dash-main {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 14px 28px;
    flex: 1;
}

/* ════════════════════════════════════════════════════════════════════════════
   CARDS — dash-panel, kpi, stat-card, info-card
   ════════════════════════════════════════════════════════════════════════════ */
.dash-panel {
    background: var(--c-surface-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 24px;
    border: 1px solid var(--c-line-soft);
}

/* KPI row — 2 columnas en móvil */
.kpi-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.kpi {
    background: var(--c-surface-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    padding: 14px 16px;   /* más compacto en móvil */
    border: 1px solid var(--c-line-soft);
    border-top: 2px solid transparent;
    position: relative;
    overflow: hidden;
}
.kpi--total     { border-top-color: var(--c-blue-1); }
.kpi--open      { border-top-color: var(--c-warn); }
.kpi--progress  { border-top-color: var(--c-info); }
.kpi--resolved  { border-top-color: var(--c-success); }

.kpi-label {
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--c-text-soft);
    margin-bottom: 8px;
}
.kpi-value {
    font-family: var(--font-brand);
    font-weight: 800;
    font-size: 1.6rem;   /* más compacto en móvil */
    color: var(--c-primary);
    line-height: 1;
}
.kpi-sub { font-size: .75rem; color: var(--c-text-muted); margin-top: 4px; }

.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-strong); }

/* ════════════════════════════════════════════════════════════════════════════
   TABLA DE TICKETS — .rh-grid
   ════════════════════════════════════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); }

.rh-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}
.rh-grid thead tr {
    background: linear-gradient(90deg, var(--c-blue-2) 0%, var(--c-primary) 100%);
}
.rh-grid th {
    padding: 12px 16px;
    font-family: var(--font-brand);
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: rgba(255,255,255,.88);
    text-align: left;
    white-space: nowrap;
}
.rh-grid th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.rh-grid th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }

.rh-grid tbody tr {
    border-bottom: 1px solid var(--c-line-soft);
    transition: background .12s;
}
.rh-grid tbody tr:nth-child(even) { background: #fbfdff; }
.rh-grid tbody tr:hover {
    background: var(--c-surface-soft);
    box-shadow: inset 3px 0 0 var(--c-action);
}
.rh-grid td {
    padding: 11px 16px;
    color: var(--c-text);
    vertical-align: middle;
}
.rh-grid td.folio-cell {
    font-family: var(--font-brand);
    font-weight: 700;
    font-size: .8125rem;
    color: var(--c-blue-1);
}
.rh-grid td.title-cell { max-width: 280px; }
.rh-grid td.title-cell a {
    color: var(--c-text);
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.rh-grid td.title-cell a:hover { color: var(--c-blue-1); }

/* Tabla vacía */
.table-empty {
    text-align: center;
    padding: 48px 16px;
    color: var(--c-text-muted);
}
.table-empty-icon { font-size: 2.5rem; margin-bottom: 12px; }
.table-empty-msg  { font-size: .875rem; }

/* ════════════════════════════════════════════════════════════════════════════
   BADGES — estado y prioridad de tickets
   ════════════════════════════════════════════════════════════════════════════ */
.ticket-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    border-radius: 99px;
    padding: 3px 10px;
    white-space: nowrap;
}
.ticket-badge::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: .7;
}

/* Estado */
.badge-status.is-open        { color: var(--c-warn);    background: rgba(224,123,42,.1);  border: 1px solid rgba(224,123,42,.25); }
.badge-status.is-in_progress { color: var(--c-info);    background: rgba(58,130,196,.1);  border: 1px solid rgba(58,130,196,.25); }
.badge-status.is-resolved    { color: var(--c-success); background: rgba(26,171,126,.1);  border: 1px solid rgba(26,171,126,.25); }
.badge-status.is-closed      { color: var(--c-neutral); background: rgba(112,144,173,.1); border: 1px solid rgba(112,144,173,.25); }

/* Prioridad */
.badge-priority.is-low      { color: var(--c-neutral); background: rgba(112,144,173,.1); border: 1px solid rgba(112,144,173,.2); }
.badge-priority.is-medium   { color: var(--c-warn);    background: rgba(224,123,42,.1);  border: 1px solid rgba(224,123,42,.2); }
.badge-priority.is-high     { color: var(--c-danger);  background: rgba(201,64,64,.1);   border: 1px solid rgba(201,64,64,.2); }
.badge-priority.is-critical {
    color: #fff;
    background: var(--c-danger);
    border: 1px solid var(--c-danger);
}

/* ════════════════════════════════════════════════════════════════════════════
   VISTA DE TICKET — ticket-view.php
   ════════════════════════════════════════════════════════════════════════════ */
.ticket-header-card {
    background: var(--c-surface-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--c-line-soft);
    overflow: hidden;
    margin-bottom: 20px;
}
.ticket-header-top {
    background: linear-gradient(135deg, #0D2237 0%, #175C94 100%);
    padding: 22px 26px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.ticket-folio {
    font-family: var(--font-brand);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--c-action-soft);
    margin-bottom: 6px;
}
.ticket-title-h {
    font-family: var(--font-brand);
    font-weight: 800;
    font-size: 1.25rem;
    color: #fff;
    line-height: 1.3;
}
.ticket-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.ticket-header-body { padding: 20px 26px; }
.ticket-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px 24px;
    margin-bottom: 16px;
}
.ticket-meta-item { display: flex; flex-direction: column; gap: 3px; }
.ticket-meta-label {
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--c-text-muted);
}
.ticket-meta-value { font-size: .875rem; color: var(--c-text); font-weight: 500; }

.ticket-description {
    background: var(--c-surface);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    font-size: .875rem;
    color: var(--c-text);
    line-height: 1.65;
    border: 1px solid var(--c-line-soft);
    white-space: pre-wrap;
    word-break: break-word;
}

/* Comentarios */
.comments-section { margin-top: 24px; }
.comments-title {
    font-family: var(--font-brand);
    font-weight: 700;
    font-size: .9375rem;
    color: var(--c-primary);
    margin-bottom: 14px;
}

.comment-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.comment-item {
    background: var(--c-surface-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--c-line-soft);
    padding: 14px 18px;
    box-shadow: var(--shadow-soft);
}
.comment-item.is-internal {
    background: rgba(58,130,196,.04);
    border-color: rgba(58,130,196,.2);
    border-left: 3px solid var(--c-info);
}
.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.comment-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--c-blue-1) 0%, var(--c-primary) 100%);
    color: #fff;
    font-family: var(--font-brand);
    font-weight: 700;
    font-size: .75rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.comment-author { font-size: .8125rem; font-weight: 600; color: var(--c-text); }
.comment-time   { font-size: .75rem; color: var(--c-text-muted); margin-left: auto; }
.comment-internal-tag {
    font-size: .625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--c-info);
    background: rgba(58,130,196,.1);
    border-radius: 99px;
    padding: 2px 8px;
}
.comment-body { font-size: .875rem; color: var(--c-text); line-height: 1.6; white-space: pre-wrap; word-break: break-word; }

/* Formulario de respuesta */
.reply-form-card {
    background: var(--c-surface-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--c-line-soft);
    box-shadow: var(--shadow-soft);
    padding: 20px 24px;
}
.reply-form-title {
    font-family: var(--font-brand);
    font-weight: 700;
    font-size: .9375rem;
    color: var(--c-primary);
    margin-bottom: 14px;
}
.reply-internal-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .8125rem;
    color: var(--c-text-soft);
    cursor: pointer;
    user-select: none;
    margin-bottom: 14px;
}
.reply-internal-toggle input[type="checkbox"] { accent-color: var(--c-info); width: 15px; height: 15px; }

/* ════════════════════════════════════════════════════════════════════════════
   PANEL DE ACCIONES DEL TICKET (lateral en la vista)
   ════════════════════════════════════════════════════════════════════════════ */
.ticket-view-layout {
    display: grid;
    grid-template-columns: 1fr;   /* apilado en móvil */
    gap: 16px;
    align-items: start;
}
.ticket-actions-panel {
    background: var(--c-surface-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--c-line-soft);
    box-shadow: var(--shadow-soft);
    padding: 20px;
    position: static;   /* sticky solo en desktop */
}
.actions-panel-title {
    font-family: var(--font-brand);
    font-weight: 700;
    font-size: .8125rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--c-text-muted);
    margin-bottom: 14px;
}
.actions-panel-row { display: flex; flex-direction: column; gap: 8px; }
.actions-panel-item { display: flex; flex-direction: column; gap: 5px; }
.actions-panel-label {
    font-size: .6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--c-text-muted);
}
.actions-panel-item select {
    font-size: .8125rem;
    padding: 7px 10px;
}

/* ════════════════════════════════════════════════════════════════════════════
   NUEVO TICKET — ticket-new.php
   ════════════════════════════════════════════════════════════════════════════ */
.new-ticket-grid {
    display: grid;
    grid-template-columns: 1fr;   /* apilado en móvil */
    gap: 16px;
    align-items: start;
}
.new-ticket-tips {
    background: var(--c-surface-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--c-line-soft);
    box-shadow: var(--shadow-soft);
    padding: 20px;
    position: static;   /* sticky solo en desktop */
}
.tips-title {
    font-family: var(--font-brand);
    font-weight: 700;
    font-size: .875rem;
    color: var(--c-primary);
    margin-bottom: 12px;
}
.tip-item {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--c-line-soft);
    font-size: .8125rem;
    color: var(--c-text-soft);
    line-height: 1.45;
}
.tip-item:last-child { border-bottom: none; }
.tip-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }

/* ════════════════════════════════════════════════════════════════════════════
   MODALES
   ════════════════════════════════════════════════════════════════════════════ */
.admin-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(18, 32, 48, .48);
    backdrop-filter: blur(8px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.admin-modal.is-open { display: flex; }
body.modal-open { overflow: hidden; }

.admin-modal-card {
    background: var(--c-surface-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-strong);
    width: 100%;
    max-width: 540px;
    overflow: hidden;
    animation: fadeSlideUp .22s ease both;
}
.admin-modal-header {
    background: linear-gradient(135deg, #2a3f54 0%, #175C94 100%);
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-title {
    font-family: var(--font-brand);
    font-weight: 700;
    font-size: .9375rem;
    color: #fff;
}
.modal-close {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    border: none;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .14s;
}
.modal-close:hover { background: rgba(255,255,255,.22); }
.admin-modal-body { padding: 22px; }
.admin-modal-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--c-line-soft);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ════════════════════════════════════════════════════════════════════════════
   ALERTAS DE FLASH
   ════════════════════════════════════════════════════════════════════════════ */
.flash {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: .875rem;
    margin-bottom: 20px;
    animation: fadeSlideUp .22s ease both;
}
.flash-success { background: rgba(26,171,126,.08); border: 1px solid rgba(26,171,126,.3); color: #148060; }
.flash-error   { background: rgba(201,64,64,.08);  border: 1px solid rgba(201,64,64,.3);  color: var(--c-danger); }
.flash-warn    { background: rgba(224,123,42,.08); border: 1px solid rgba(224,123,42,.3); color: #b85e14; }
.flash-info    { background: rgba(58,130,196,.08); border: 1px solid rgba(58,130,196,.3); color: var(--c-info); }
.flash-icon    { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }

/* ════════════════════════════════════════════════════════════════════════════
   ANIMACIONES
   ════════════════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: no-preference) {
    @keyframes fadeSlideUp {
        from { opacity: 0; transform: translateY(10px); }
        to   { opacity: 1; transform: translateY(0); }
    }
    @keyframes sidebarEnter {
        from { opacity: 0; transform: translateX(-18px); }
        to   { opacity: 1; transform: translateX(0); }
    }

    /* sidebar enter solo en desktop (donde arranca visible) */

    .kpi:nth-child(1) { animation: fadeSlideUp .32s .04s ease both; }
    .kpi:nth-child(2) { animation: fadeSlideUp .32s .09s ease both; }
    .kpi:nth-child(3) { animation: fadeSlideUp .32s .14s ease both; }
    .kpi:nth-child(4) { animation: fadeSlideUp .32s .19s ease both; }

    .dash-panel, .ticket-header-card, .reply-form-card { animation: fadeSlideUp .38s ease both; }
}

/* ════════════════════════════════════════════════════════════════════════════
   RESPONSIVE — mobile-first  |  3 breakpoints
   · base       < 480px  — iPhone 14 Pro Max (430)
   · ≥ 480px             — Pixel 7 Pro (480) y similares
   · ≥ 820px             — iPad Air 5 (820) y superiores, incluido escritorio
   ════════════════════════════════════════════════════════════════════════════ */

/* Sidebar overlay — aplica en cualquier tamaño al abrir */
.is-sidebar-open .dash-sidebar         { transform: translateX(0); }
.is-sidebar-open .dash-sidebar-overlay { display: block; }

/* Tabla: scroll horizontal en todos los tamaños */
.rh-grid    { min-width: 640px; }
.table-wrap { -webkit-overflow-scrolling: touch; }

/* Modal: compacto en móvil */
.admin-modal-card { border-radius: var(--radius-lg); }

/* ≥ 480px — Pixel 7 Pro y similares */
@media (min-width: 480px) {
    .dash-main        { padding: 18px; }
    .login-form-panel { padding: 40px 32px; }
    .kpi-row          { gap: 12px; }
}

/* ≥ 820px — iPad Air 5 y superiores (escritorio incluido) */
@media (min-width: 820px) {
    /* Login */
    .login-shell       { grid-template-columns: 1.04fr .96fr; min-height: 640px; }
    .login-brand       { display: flex; }
    .login-form-panel  { padding: 60px 56px; min-height: auto; }
    .login-form-inner  { max-width: 360px; }

    /* Formularios */
    .form-grid         { grid-template-columns: 1fr 1fr; }
    .form-grid .span-2 { grid-column: 1 / -1; }
    .req-grid          { grid-template-columns: 1fr 1fr; }

    /* Dashboard — sidebar visible y colapsable */
    .dashboard-page {
        display: block;
        min-height: 100vh;
    }
    .dash-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        transform: none;
        height: 100vh;
        width: var(--sidebar-w);
    }
    .dashboard-page.is-sidebar-collapsed .dash-sidebar { width: 60px; }
    .dash-content {
        margin-left: var(--sidebar-w);
        width: calc(100% - var(--sidebar-w));
        min-height: 100vh;
    }
    .dashboard-page.is-sidebar-collapsed .dash-content {
        margin-left: 60px;
        width: calc(100% - 60px);
    }
    .dash-sidebar-overlay { display: none !important; }
    .dash-sidebar-handle {
        top: 16px;
        left: calc(var(--sidebar-w) - 19px);
        z-index: 220;
    }
    .dashboard-page.is-sidebar-collapsed .dash-sidebar-handle { left: 41px; }
    .dash-topbar { padding: 0 24px; }
    .dash-main   { padding: 24px 32px 40px; }

    /* KPIs */
    .kpi-value    { font-size: 2rem; }
    .kpi-row      { grid-template-columns: repeat(4, 1fr); gap: 14px; }
    .user-kpi-row { grid-template-columns: repeat(4, 1fr); }

    /* Modales */
    .admin-modal-card { max-width: 540px; border-radius: var(--radius-xl); }

    /* Vista de ticket */
    .ticket-view-layout   { grid-template-columns: 1fr 300px; }
    .ticket-actions-panel { position: sticky; top: calc(var(--topbar-h) + 16px); }

    /* Nuevo ticket */
    .new-ticket-grid { grid-template-columns: 1fr 280px; }
    .new-ticket-tips { position: sticky; top: calc(var(--topbar-h) + 16px); }
}

/* ════════════════════════════════════════════════════════════════════════════
   PORTAL DE USUARIO — layout compartido (user-dashboard, ticket-request)
   ════════════════════════════════════════════════════════════════════════════ */
.req-page {
    min-height: 100vh;
    background: linear-gradient(180deg, #eaf1f8 0%, #f7f9fc 100%);
    display: flex;
    flex-direction: column;
}
.req-topbar {
    height: 56px;
    background: var(--c-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 50;
}
.req-topbar-brand {
    font-family: var(--font-brand);
    font-weight: 700;
    font-size: .95rem;
    color: var(--c-white);
    display: flex;
    align-items: center;
    gap: 10px;
}
.req-topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .8125rem;
    color: rgba(255,255,255,.75);
}
.req-topbar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--c-action);
    color: var(--c-primary);
    font-weight: 700;
    font-size: .875rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.req-topbar-links            { display: flex; gap: 20px; align-items: center; }
.req-topbar-links a          { font-size: .8125rem; color: rgba(255,255,255,.7); text-decoration: none; }
.req-topbar-links a:hover    { color: var(--c-white); text-decoration: none; }
.req-topbar-cta {
    background: var(--c-action);
    color: var(--c-primary) !important;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-weight: 700;
}
.req-body {
    flex: 1;
    max-width: 960px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 16px 40px;
}
.req-page-header   { margin-bottom: 20px; }
.req-page-title    { font-family: var(--font-brand); font-weight: 800; font-size: 1.25rem; color: var(--c-primary); }
.req-page-subtitle { font-size: .875rem; color: var(--c-text-soft); margin-top: 4px; }

/* ════════════════════════════════════════════════════════════════════════════
   FORMULARIO DE SOLICITUD — ticket-request.php
   ════════════════════════════════════════════════════════════════════════════ */
.req-header           { margin-bottom: 20px; }
.req-header h1        { font-family: var(--font-brand); font-weight: 800; font-size: 1.25rem; color: var(--c-primary); }
.req-header p         { font-size: .875rem; color: var(--c-text-soft); margin-top: 4px; }
.req-info-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    background: var(--c-surface-card);
    border: 1px solid var(--c-line-soft);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: .8125rem;
    color: var(--c-text-soft);
}
.req-info-item strong { color: var(--c-text); font-weight: 600; }
.req-grid             { display: grid; grid-template-columns: 1fr; gap: 16px; }
.req-panel {
    background: var(--c-surface-card);
    border: 1px solid var(--c-line-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 20px;
}
.req-panel-title {
    font-family: var(--font-brand);
    font-weight: 700;
    font-size: .875rem;
    color: var(--c-primary);
    text-transform: uppercase;
    letter-spacing: .04em;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--c-action);
}
.req-fields    { display: flex; flex-direction: column; gap: 14px; }
.req-desc-panel {
    background: var(--c-surface-card);
    border: 1px solid var(--c-line-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 20px;
}
.req-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

/* ════════════════════════════════════════════════════════════════════════════
   DASHBOARD DE USUARIO — user-dashboard.php
   ════════════════════════════════════════════════════════════════════════════ */
.user-kpi-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
.user-kpi {
    background: var(--c-surface-card);
    border: 1px solid var(--c-line-soft);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    padding: 14px 16px;
    border-top: 2px solid transparent;
}
.user-kpi--open        { border-top-color: var(--c-action); }
.user-kpi--in-progress { border-top-color: var(--c-info); }
.user-kpi--resolved    { border-top-color: var(--c-success); }
.user-kpi-value {
    font-family: var(--font-brand);
    font-weight: 800;
    font-size: 1.6rem;
    color: var(--c-primary);
    line-height: 1;
}
.user-kpi--open        .user-kpi-value { color: var(--c-warn); }
.user-kpi--in-progress .user-kpi-value { color: var(--c-info); }
.user-kpi--resolved    .user-kpi-value { color: var(--c-success); }
.user-kpi-label { font-size: .75rem; color: var(--c-text-soft); margin-top: 4px; }
.user-table-card {
    background: var(--c-surface-card);
    border: 1px solid var(--c-line-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}
.user-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--c-line-soft);
}
.user-table-title { font-family: var(--font-brand); font-weight: 700; font-size: 1rem; color: var(--c-primary); }
.table-scroll     { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.req-table   { width: 100%; border-collapse: collapse; min-width: 560px; }
table.req-table th {
    background: var(--c-surface-soft);
    color: var(--c-text-soft);
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--c-line);
}
table.req-table td {
    padding: 12px 14px;
    font-size: .875rem;
    color: var(--c-text);
    border-bottom: 1px solid var(--c-line-soft);
    vertical-align: middle;
}
table.req-table tr:last-child td { border-bottom: none; }
table.req-table tr:hover td      { background: var(--c-surface-soft); }
.req-folio { font-family: var(--font-brand); font-weight: 700; font-size: .8125rem; color: var(--c-primary); }
.req-table-title-cell { max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.req-filters         { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.req-filters select  {
    font-size: .8125rem;
    padding: 6px 10px;
    border: 1px solid var(--c-line);
    border-radius: var(--radius-sm);
    background: var(--c-surface-card);
    color: var(--c-text);
}
.link-action { color: var(--c-action); font-weight: 600; }
/* Aliases de badge para user-dashboard (variante con doble guion) */
.badge-priority--low      { color: var(--c-neutral); background: rgba(112,144,173,.1); border: 1px solid rgba(112,144,173,.2); }
.badge-priority--medium   { color: var(--c-warn);    background: rgba(224,123,42,.1);  border: 1px solid rgba(224,123,42,.2); }
.badge-priority--high     { color: var(--c-danger);  background: rgba(201,64,64,.1);   border: 1px solid rgba(201,64,64,.2); }
.badge-priority--critical { color: #fff; background: var(--c-danger); border: 1px solid var(--c-danger); }
.badge-status--open        { color: var(--c-warn);    background: rgba(224,123,42,.1);  border: 1px solid rgba(224,123,42,.25); }
.badge-status--in_progress { color: var(--c-info);    background: rgba(58,130,196,.1);  border: 1px solid rgba(58,130,196,.25); }
.badge-status--resolved    { color: var(--c-success); background: rgba(26,171,126,.1);  border: 1px solid rgba(26,171,126,.25); }
.badge-status--closed      { color: var(--c-neutral); background: rgba(112,144,173,.1); border: 1px solid rgba(112,144,173,.25); }

/* ════════════════════════════════════════════════════════════════════════════
   MÓDULOS DE ADMINISTRACIÓN — users.php, smtp.php
   ════════════════════════════════════════════════════════════════════════════ */
.module-grid  { display: grid; grid-template-columns: 1fr; gap: 20px; }
.panel-heading {
    font-family: var(--font-brand);
    font-weight: 700;
    font-size: 1rem;
    color: var(--c-primary);
    margin-bottom: 18px;
}
.form-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; align-items: center; }

/* Barra de sección con título + botón acción */
.section-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}
.section-title {
    font-family: var(--font-brand);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--c-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}
.dash-panel--flush   { padding: 0; overflow: hidden; }
.panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--c-line-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.panel-header-title { font-family: var(--font-brand); font-weight: 700; font-size: .95rem; color: var(--c-primary); }
.count-badge {
    margin-left: 8px;
    background: var(--c-primary);
    color: #fff;
    font-size: .7rem;
    padding: 2px 8px;
    border-radius: 20px;
    display: inline-block;
}
.table-scroll-x  { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.module-table    { width: 100%; border-collapse: collapse; }
.module-table--users { min-width: 520px; }
.module-table--smtp  { min-width: 640px; }
.module-table th {
    background: var(--c-surface-soft);
    color: var(--c-text-soft);
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--c-line);
}
.module-table tr           { border-bottom: 1px solid var(--c-line-soft); }
.module-table tr.row--inactive { opacity: .6; }
.module-table td           { padding: 12px 14px; font-size: .875rem; color: var(--c-text); vertical-align: middle; }
.cell-id                   { font-size: .8125rem !important; color: var(--c-text-soft) !important; }
.cell-user                 { display: flex; align-items: center; gap: 10px; }
.user-avatar-sm {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--c-primary);
    color: #fff;
    font-weight: 700;
    font-size: .8125rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.cell-user-name      { font-weight: 600; font-size: .875rem; color: var(--c-text); }
.cell-muted          { font-size: .8125rem !important; color: var(--c-text-soft) !important; }
.cell-nowrap         { white-space: nowrap; }
.cell-two-line-main  { font-weight: 600; font-size: .875rem; color: var(--c-text); }
.cell-two-line-sub   { font-size: .75rem; color: var(--c-text-soft); }
.cell-ssl-label      { font-size: .7rem; color: var(--c-text-soft); }
.btn-group           { display: flex; gap: 6px; flex-wrap: wrap; }

.companies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.company-card {
    background: var(--c-surface-card);
    border: 1px solid var(--c-line-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.company-card.row--inactive { opacity: .62; }
.company-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.company-card-title {
    margin: 0;
    font-family: var(--font-brand);
    font-size: 1rem;
    color: var(--c-primary);
}
.company-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.company-domain-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(143,179,46,.12);
    border: 1px solid rgba(143,179,46,.26);
    color: #5f7b12;
    font-size: .8125rem;
    font-weight: 700;
}
.company-domain-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.company-domain-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(23,92,148,.08);
    border: 1px solid rgba(23,92,148,.16);
    color: var(--c-blue-1);
    font-size: .75rem;
    font-weight: 600;
}
.company-card-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid var(--c-line-soft);
    padding-top: 14px;
}
.company-stat {
    font-size: .8125rem;
    color: var(--c-text-muted);
}
.company-empty {
    padding: 28px;
    text-align: center;
    border: 1px dashed var(--c-line-soft);
    border-radius: var(--radius-lg);
    background: rgba(255,255,255,.65);
    color: var(--c-text-muted);
}
.form-inline         { display: inline; }
.btn-activate        { background: #E8F8F2; color: var(--c-success); border: 1px solid #9DE8C6; }
.btn-deactivate      { background: #FEF0E0; color: var(--c-warn);    border: 1px solid #F5C890; }

/* Badges de rol */
.role-badge {
    display: inline-block;
    font-size: .7rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.role-badge--user  { background: rgba(58,130,196,.12);  color: #3A82C4; border: 1px solid rgba(58,130,196,.25); }
.role-badge--agent { background: rgba(224,123,42,.12);  color: #E07B2A; border: 1px solid rgba(224,123,42,.25); }
.role-badge--admin { background: rgba(26,171,126,.12);  color: #1AAB7E; border: 1px solid rgba(26,171,126,.25); }

/* Badges de propósito SMTP */
.purpose-badge {
    display: inline-block;
    font-size: .7rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.purpose-badge--otp           { background: rgba(58,130,196,.12);  color: #3A82C4; border: 1px solid rgba(58,130,196,.25); }
.purpose-badge--notifications  { background: rgba(224,123,42,.12);  color: #E07B2A; border: 1px solid rgba(224,123,42,.25); }
.purpose-badge--general        { background: rgba(112,144,173,.12); color: #7090AD; border: 1px solid rgba(112,144,173,.25); }

/* Indicadores activo/inactivo */
.status-active   { color: var(--c-success); }
.status-inactive { color: var(--c-danger); }

/* Cajas de sección (formulario SMTP) */
.section-box {
    border: 1px solid var(--c-line-soft);
    border-radius: var(--radius-md);
    padding: 18px;
    margin-bottom: 16px;
}
.section-box-label           { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 14px; }
.section-box-label--green    { color: var(--c-action); }
.section-box-label--orange   { color: var(--c-warn); }
.section-box-label--muted    { color: var(--c-text-soft); }
.smtp-test-section           { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--c-line-soft); }
.smtp-status-row             { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.account-status-active       { font-weight: 700; color: var(--c-success); }
.account-status-inactive     { font-weight: 700; color: var(--c-danger); }

/* Estado vacío en tablas admin */
.empty-panel       { padding: 40px 20px; text-align: center; color: var(--c-text-soft); }
.empty-panel-icon  { font-size: 2rem; margin-bottom: 10px; }
.empty-panel-title { font-weight: 600; color: var(--c-text); }

/* Utilidades de campo */
.required-star { color: var(--c-danger); }
.field-hint    { font-size: .7rem; color: var(--c-text-soft); font-weight: 400; }

