﻿/* =========================================================
   SGA · GRUPO JERÓNIMO — DESIGN SYSTEM 2025
   Inspirado en Linear · Vercel · Stripe · Cal.com
   ========================================================= */

/* ===================== TOKENS ===================== */
:root {
    /* Marca */
    --gj-primary:        #6FA388;
    --gj-primary-50:     #F1F7F4;
    --gj-primary-100:    #DDEDE4;
    --gj-primary-200:    #BADCC9;
    --gj-primary-300:    #8ABAA0;
    --gj-primary-500:    #6FA388;
    --gj-primary-600:    #4F8068;
    --gj-primary-700:    #3A6450;
    --gj-primary-grad:   linear-gradient(135deg, #8ABAA0 0%, #4F8068 100%);
    --gj-primary-ring:   rgba(111, 163, 136, 0.18);

    --gj-accent:         #FC5027;
    --gj-accent-50:      #FFF1ED;
    --gj-accent-100:     #FFE0D6;
    --gj-accent-600:     #E03E18;
    --gj-accent-grad:    linear-gradient(135deg, #FC5027 0%, #C8330F 100%);

    --gj-info:           #35B5E8;
    --gj-info-50:        #ECF8FD;
    --gj-info-100:       #D2EFFB;
    --gj-info-600:       #0E8DBE;
    --gj-info-grad:      linear-gradient(135deg, #4FC3F7 0%, #0E8DBE 100%);

    --gj-danger:         #E11D48;
    --gj-danger-50:      #FEF1F4;
    --gj-danger-100:     #FCE0E8;
    --gj-danger-600:     #B11338;

    --gj-warning:        #F59E0B;
    --gj-warning-50:     #FFFAEB;
    --gj-warning-100:    #FEF0C7;
    --gj-warning-600:    #B45309;

    --gj-purple:         #8B5CF6;
    --gj-purple-50:      #F5F3FF;
    --gj-purple-100:     #EDE9FE;
    --gj-purple-600:     #6D28D9;

    --gj-success:        #10B981;
    --gj-success-50:     #ECFDF5;
    --gj-success-100:    #D1FAE5;

    /* Escala de grises (zinc) */
    --gj-zinc-0:         #FFFFFF;
    --gj-zinc-25:        #FCFCFD;
    --gj-zinc-50:        #F9FAFB;
    --gj-zinc-100:       #F3F4F6;
    --gj-zinc-150:       #EBECF0;
    --gj-zinc-200:       #E4E7EC;
    --gj-zinc-300:       #D2D6DB;
    --gj-zinc-400:       #98A0AC;
    --gj-zinc-500:       #6B7280;
    --gj-zinc-600:       #4B5563;
    --gj-zinc-700:       #374151;
    --gj-zinc-800:       #1F2937;
    --gj-zinc-900:       #111827;
    --gj-zinc-950:       #0A0E14;

    /* Tokens semánticos */
    --gj-bg:             var(--gj-zinc-50);
    --gj-bg-subtle:      var(--gj-zinc-100);
    --gj-bg-elevated:    var(--gj-zinc-0);
    --gj-card:           var(--gj-zinc-0);
    --gj-fg:             var(--gj-zinc-900);
    --gj-fg-muted:       var(--gj-zinc-500);
    --gj-fg-soft:        var(--gj-zinc-400);
    --gj-text-muted:     var(--gj-zinc-500);
    --gj-text-soft:      var(--gj-zinc-400);
    --gj-border:         var(--gj-zinc-200);
    --gj-border-strong:  var(--gj-zinc-300);
    --gj-border-hairline: rgba(17, 24, 39, 0.06);

    /* Sidebar moderno: claro con hairline */
    --gj-sidebar-bg:     var(--gj-zinc-0);
    --gj-sidebar-fg:     var(--gj-zinc-600);
    --gj-sidebar-fg-active: var(--gj-primary-700);
    --gj-sidebar-active-bg: var(--gj-primary-50);
    --gj-sidebar-hover:  var(--gj-zinc-100);
    --gj-sidebar-border: var(--gj-zinc-150);

    /* Compat para código viejo */
    --gj-primary-soft:   var(--gj-primary-50);
    --gj-primary-dark:   var(--gj-primary-600);
    --gj-primary-darker: var(--gj-primary-700);
    --gj-accent-soft:    var(--gj-accent-50);
    --gj-info-soft:      var(--gj-info-50);
    --gj-danger-soft:    var(--gj-danger-50);
    --gj-warning-soft:   var(--gj-warning-50);
    --gj-purple-soft:    var(--gj-purple-50);
    --gj-blue:           #2563EB;
    --gj-sidebar:        var(--gj-sidebar-bg);
    --gj-sidebar-soft:   var(--gj-sidebar-hover);
    --gj-sidebar-active: var(--gj-sidebar-active-bg);

    /* Tipografía moderna (Inter) */
    --gj-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    --gj-font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --gj-font-mono: 'JetBrains Mono', 'SF Mono', 'Cascadia Code', Consolas, 'Courier New', monospace;

    /* Layout */
    --gj-sidebar-w:      256px;
    --gj-header-h:       60px;

    /* Radius — generosos */
    --gj-r-xs:           6px;
    --gj-r-sm:           10px;
    --gj-r:              14px;
    --gj-r-lg:           18px;
    --gj-r-xl:           22px;
    --gj-r-2xl:          28px;
    --gj-r-pill:         999px;

    /* Sombras "lifted" multinivel */
    --gj-shadow-xs:      0 1px 2px rgba(17,24,39,0.04);
    --gj-shadow-sm:      0 1px 3px rgba(17,24,39,0.05), 0 1px 2px rgba(17,24,39,0.03);
    --gj-shadow-md:      0 4px 6px -1px rgba(17,24,39,0.06), 0 2px 4px -2px rgba(17,24,39,0.04);
    --gj-shadow-lg:      0 10px 15px -3px rgba(17,24,39,0.08), 0 4px 6px -4px rgba(17,24,39,0.04);
    --gj-shadow-xl:      0 20px 25px -5px rgba(17,24,39,0.1), 0 8px 10px -6px rgba(17,24,39,0.04);
    --gj-shadow-2xl:     0 25px 50px -12px rgba(17,24,39,0.18);
    --gj-shadow-card:    0 1px 1px rgba(17,24,39,0.04), 0 4px 8px -2px rgba(17,24,39,0.05);
    --gj-shadow-card-hover: 0 4px 12px -2px rgba(17,24,39,0.08), 0 12px 28px -10px rgba(17,24,39,0.12);
    --gj-shadow-focus:   0 0 0 4px var(--gj-primary-ring);

    /* Animación */
    --gj-t-fast:         140ms cubic-bezier(0.16, 1, 0.3, 1);
    --gj-t:              260ms cubic-bezier(0.16, 1, 0.3, 1);
    --gj-t-slow:         420ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===================== MODO OSCURO ===================== */
/* Re-define los tokens semánticos cuando el HTML lleva data-theme="dark".
   Como toda la app consume estos tokens, el dark mode se aplica de un plumazo. */
:root[data-theme="dark"] {
    /* Escala invertida (los nombres se mantienen para no romper nada) */
    /* Las gamas medias se han SUBIDO de luminosidad respecto a una inversión literal
       para cumplir WCAG AA de contraste sobre fondo oscuro. */
    --gj-zinc-0:         #0A0E14;
    --gj-zinc-25:        #11161D;
    --gj-zinc-50:        #161C25;
    --gj-zinc-100:       #1E2530;
    --gj-zinc-150:       #262E3A;
    --gj-zinc-200:       #2E3744;
    --gj-zinc-300:       #3D4756;
    --gj-zinc-400:       #7A8494;     /* muted "soft" — antes #5C6675 era ilegible */
    --gj-zinc-500:       #9CA5B3;     /* muted normal — antes #8B95A4 era flojo */
    --gj-zinc-600:       #C1C8D2;
    --gj-zinc-700:       #DDE2E8;
    --gj-zinc-800:       #EBEEF2;
    --gj-zinc-900:       #F4F6F9;
    --gj-zinc-950:       #FFFFFF;

    /* Tokens semánticos para fondo y texto */
    --gj-bg:             #0D1219;
    --gj-bg-subtle:      var(--gj-zinc-50);
    --gj-bg-elevated:    var(--gj-zinc-25);
    --gj-card:           var(--gj-zinc-25);
    --gj-fg:             var(--gj-zinc-900);
    --gj-fg-muted:       var(--gj-zinc-500);
    --gj-fg-soft:        var(--gj-zinc-400);
    --gj-text-muted:     var(--gj-zinc-500);
    --gj-text-soft:      var(--gj-zinc-400);
    --gj-border:         var(--gj-zinc-200);
    --gj-border-strong:  var(--gj-zinc-300);
    --gj-border-hairline: rgba(255, 255, 255, 0.06);

    /* Marca: matices más saturados sobre fondo oscuro */
    --gj-primary-50:     rgba(138, 186, 160, 0.12);
    --gj-primary-100:    rgba(138, 186, 160, 0.18);
    --gj-primary-200:    rgba(138, 186, 160, 0.28);
    --gj-primary-700:    #A7D4BA;
    --gj-primary-ring:   rgba(138, 186, 160, 0.28);

    --gj-accent-50:      rgba(252, 80, 39, 0.14);
    --gj-accent-100:     rgba(252, 80, 39, 0.22);
    --gj-accent-600:     #FF8666;

    --gj-info-50:        rgba(53, 181, 232, 0.14);
    --gj-info-100:       rgba(53, 181, 232, 0.22);
    --gj-info-600:       #5FCCF1;

    --gj-danger-50:      rgba(225, 29, 72, 0.14);
    --gj-danger-100:     rgba(225, 29, 72, 0.22);
    --gj-danger-600:     #F4607A;

    --gj-warning-50:     rgba(245, 158, 11, 0.14);
    --gj-warning-100:    rgba(245, 158, 11, 0.22);
    --gj-warning-600:    #FBBF24;

    --gj-purple-50:      rgba(139, 92, 246, 0.14);
    --gj-purple-100:     rgba(139, 92, 246, 0.22);
    --gj-purple-600:     #B093F7;

    --gj-success-50:     rgba(16, 185, 129, 0.14);
    --gj-success-100:    rgba(16, 185, 129, 0.22);

    /* Sidebar oscuro */
    --gj-sidebar-bg:        #0F151D;
    --gj-sidebar-fg:        var(--gj-zinc-500);
    --gj-sidebar-fg-active: #A7D4BA;
    --gj-sidebar-active-bg: rgba(138, 186, 160, 0.14);
    --gj-sidebar-hover:     rgba(255, 255, 255, 0.04);
    --gj-sidebar-border:    rgba(255, 255, 255, 0.06);

    /* Sombras: más profundas, más negras */
    --gj-shadow-xs:      0 1px 2px rgba(0,0,0,0.4);
    --gj-shadow-sm:      0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
    --gj-shadow-md:      0 4px 6px -1px rgba(0,0,0,0.5), 0 2px 4px -2px rgba(0,0,0,0.4);
    --gj-shadow-lg:      0 10px 15px -3px rgba(0,0,0,0.55), 0 4px 6px -4px rgba(0,0,0,0.4);
    --gj-shadow-xl:      0 20px 25px -5px rgba(0,0,0,0.55), 0 8px 10px -6px rgba(0,0,0,0.4);
    --gj-shadow-2xl:     0 25px 50px -12px rgba(0,0,0,0.7);
    --gj-shadow-card:    0 1px 1px rgba(0,0,0,0.4), 0 4px 8px -2px rgba(0,0,0,0.4);
    --gj-shadow-card-hover: 0 4px 12px -2px rgba(0,0,0,0.55), 0 12px 28px -10px rgba(0,0,0,0.65);
}

/* En oscuro, el body cambia el patrón sutil */
:root[data-theme="dark"] body {
    background-color: var(--gj-bg);
    background-image:
        radial-gradient(at 0% 0%, rgba(138,186,160,0.05) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(53,181,232,0.04) 0px, transparent 50%),
        radial-gradient(at 50% 100%, rgba(252,80,39,0.03) 0px, transparent 50%);
}

/* Inversión sutil del logo en sidebar (en claro es negro, en oscuro debe ser blanco) */
:root[data-theme="dark"] .brand-logo {
    filter: brightness(0) invert(1);
    opacity: 0.92;
}

/* Inputs: en oscuro el fondo blanco puro es agresivo, usamos card */
:root[data-theme="dark"] .gj-input,
:root[data-theme="dark"] input[type="text"],
:root[data-theme="dark"] input[type="email"],
:root[data-theme="dark"] input[type="password"],
:root[data-theme="dark"] input[type="number"],
:root[data-theme="dark"] input[type="date"],
:root[data-theme="dark"] input[type="datetime-local"],
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] .auth-input,
:root[data-theme="dark"] .op-input,
:root[data-theme="dark"] .login-input,
:root[data-theme="dark"] .scan-input {
    background: var(--gj-zinc-100);
    color: var(--gj-fg);
    border-color: var(--gj-zinc-200);
}
:root[data-theme="dark"] .gj-input::placeholder,
:root[data-theme="dark"] .auth-input::placeholder,
:root[data-theme="dark"] .op-input::placeholder,
:root[data-theme="dark"] .login-input::placeholder,
:root[data-theme="dark"] .scan-input::placeholder {
    color: var(--gj-zinc-500);
}

/* Header glass más oscuro */
:root[data-theme="dark"] .app-header {
    background: rgba(15, 21, 29, 0.78);
    border-bottom-color: rgba(255,255,255,0.05);
}

/* Avatar usuario header: en oscuro queremos contraste */
:root[data-theme="dark"] .app-header .user-zone div[style*="color:var(--gj-fg)"] { color: var(--gj-zinc-900) !important; }

/* Tablas: zebra más sutil en oscuro */
:root[data-theme="dark"] .gj-table tbody tr:nth-child(even) { background: rgba(255,255,255,0.015); }
:root[data-theme="dark"] .gj-table tbody tr:hover { background: rgba(138,186,160,0.08); }
:root[data-theme="dark"] .gj-table thead th {
    background: linear-gradient(180deg, var(--gj-zinc-50) 0%, var(--gj-card) 100%);
    color: var(--gj-zinc-600);
}

/* Login auroras: ajustamos opacidad/saturación para que no se vean apagadas */
:root[data-theme="dark"] .auth-page { background: #0A0E14; }
:root[data-theme="dark"] .auth-card {
    background: rgba(22, 28, 37, 0.78);
    border-color: rgba(255,255,255,0.08);
}
:root[data-theme="dark"] .auth-brand img {
    filter: brightness(0) invert(1);
    opacity: 0.95;
}
:root[data-theme="dark"] .auth-cta { background: white; color: #0A0E14; }
:root[data-theme="dark"] .auth-cta:hover:not(:disabled) { background: var(--gj-zinc-800); color: #0A0E14; }

/* Chat input wrap base en oscuro */
:root[data-theme="dark"] .chat-input-wrap { background: var(--gj-card); }
:root[data-theme="dark"] .chat-body { background:
    radial-gradient(at top, rgba(138,186,160,0.05), transparent 50%),
    var(--gj-bg);
}

/* Cards inline con style="background:#fff" se sobreescriben — añadimos override común */
:root[data-theme="dark"] [style*="background:white"],
:root[data-theme="dark"] [style*="background: white"] {
    background: var(--gj-card) !important;
}

/* Chips/code/kbd con fondo white hardcoded → fondo elevado oscuro
   (cubre scan-example code, auth-help code, sga-kbd kbd, chat-md-table tbody, etc.) */
:root[data-theme="dark"] code,
:root[data-theme="dark"] kbd {
    background: var(--gj-zinc-100);
    color: var(--gj-zinc-800);
    border-color: var(--gj-zinc-200) !important;
}
:root[data-theme="dark"] .scan-example code,
:root[data-theme="dark"] .auth-help code,
:root[data-theme="dark"] .login-help code,
:root[data-theme="dark"] .traza-meta code,
:root[data-theme="dark"] .recep-meta-item code,
:root[data-theme="dark"] .nav-section-badge,
:root[data-theme="dark"] .alerta-meta code,
:root[data-theme="dark"] .op-badge code,
:root[data-theme="dark"] .op-actionbar-sub code,
:root[data-theme="dark"] .op-quick-chip code,
:root[data-theme="dark"] .op-est-meta code,
:root[data-theme="dark"] .approval-meta-row code {
    background: var(--gj-zinc-100);
    color: var(--gj-zinc-800);
    border-color: var(--gj-zinc-200);
}

/* Chips clicables (categorías) sobre fondo blanco en claro */
:root[data-theme="dark"] .chat-cat,
:root[data-theme="dark"] .op-est-item,
:root[data-theme="dark"] .marca-card,
:root[data-theme="dark"] .otp-box {
    background: var(--gj-card);
    color: var(--gj-fg);
}

/* Step inputs marcados con white */
:root[data-theme="dark"] .op-step-result {
    background: var(--gj-zinc-50);
}

/* "Pre" de código (chat markdown, etc.) */
:root[data-theme="dark"] .chat-bubble pre,
:root[data-theme="dark"] .chat-bubble code {
    background: var(--gj-zinc-100);
    color: var(--gj-zinc-800);
}

/* Marca-card del login: en oscuro queremos que siga siendo blanco con logos */
:root[data-theme="dark"] .auth-card .marca-card,
:root[data-theme="dark"] .login-hero .marca-card {
    background: rgba(255, 255, 255, 0.95);
    color: var(--gj-zinc-900);
}

/* Pill numérico OTP en login dark */
:root[data-theme="dark"] .otp-box {
    background: var(--gj-zinc-100);
    border-color: var(--gj-zinc-200);
    color: var(--gj-zinc-900);
}

/* Labels muted en oscuro: subir contraste para que sean legibles */
:root[data-theme="dark"] .scan-input-label { color: var(--gj-zinc-700); }
:root[data-theme="dark"] .scan-examples-label,
:root[data-theme="dark"] .filter-label,
:root[data-theme="dark"] .chat-followup-label,
:root[data-theme="dark"] .auth-help,
:root[data-theme="dark"] .login-help { color: var(--gj-zinc-500); }
:root[data-theme="dark"] .scan-example { color: var(--gj-zinc-600); }
:root[data-theme="dark"] .scan-example span { color: var(--gj-zinc-500); }

/* "tip" hint icon más visible en oscuro */
:root[data-theme="dark"] .tip { color: var(--gj-zinc-500); }

/* Transition global suave al cambiar tema (no afecta a animaciones existentes) */
html, body, .gj-card, .gj-kpi-card, .nav-item, .gj-input, .gj-btn,
.app-header, .app-sidebar, .gj-table, .gj-table thead th, .gj-table tbody tr,
.chat-panel, .notif-bell-panel, .auth-card, .op-step, .op-actionbar {
    transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease;
}

/* Botón toggle tema en el header */
.theme-toggle-btn {
    width: 36px; height: 36px;
    border-radius: var(--gj-r-pill);
    background: transparent;
    border: 1px solid var(--gj-border);
    color: var(--gj-zinc-700);
    font-size: var(--fs-callout);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--gj-t-fast);
}
.theme-toggle-btn:hover {
    background: var(--gj-zinc-100);
    transform: scale(1.05);
}
:root[data-theme="dark"] .theme-toggle-btn {
    color: var(--gj-zinc-700);
    border-color: var(--gj-border);
}
:root[data-theme="dark"] .theme-toggle-btn:hover {
    background: var(--gj-zinc-100);
}

/* ===================== RESET / BASE ===================== */
* { box-sizing: border-box; }
*::before, *::after { box-sizing: border-box; }

html, body {
    font-family: var(--gj-font);
    color: var(--gj-fg);
    background: var(--gj-bg);
    margin: 0;
    padding: 0;
    height: 100%;
    font-size: var(--fs-subhead);
    line-height: 1.5;
    font-feature-settings: 'cv02','cv03','cv04','cv11';     /* Inter ligatures + alt forms */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Reset crítico: button/input/select/textarea NO heredan la fuente del body
   por defecto (los navegadores les aplican la fuente del SO). Forzamos herencia
   para que toda la app use Inter consistentemente. */
button, input, select, textarea, optgroup {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

/* Fondo con mesh gradient sutil y patrón de puntos */
body {
    background-color: var(--gj-bg);
    background-image:
        radial-gradient(at 0% 0%, rgba(138,186,160,0.06) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(53,181,232,0.04) 0px, transparent 50%),
        radial-gradient(at 50% 100%, rgba(252,80,39,0.03) 0px, transparent 50%);
    background-attachment: fixed;
}

a {
    color: var(--gj-primary-600);
    text-decoration: none;
    transition: color var(--gj-t-fast);
}
a:hover { color: var(--gj-primary-700); }

h1 { font-family: var(--gj-font-display); font-size: var(--fs-title1); font-weight: 700; margin: 0 0 4px 0; letter-spacing: -0.025em; color: var(--gj-fg); line-height: 1.15; }
h2 { font-family: var(--gj-font-display); font-size: var(--fs-headline); font-weight: 650; margin: 0 0 14px 0; color: var(--gj-fg); letter-spacing: -0.015em; }
h3 { font-size: var(--fs-subhead); font-weight: 600; margin: 0 0 10px 0; color: var(--gj-fg); letter-spacing: -0.005em; }
p  { color: var(--gj-fg-muted); margin: 0 0 14px 0; }
hr { border: none; border-top: 1px solid var(--gj-border-hairline); margin: 22px 0; }
::selection { background: var(--gj-primary-100); color: var(--gj-primary-700); }

/* ===================== APP SHELL ===================== */
.app-shell {
    display: grid;
    grid-template-columns: var(--gj-sidebar-w) 1fr;
    grid-template-rows: var(--gj-header-h) 1fr;
    grid-template-areas:
        "sidebar header"
        "sidebar content";
    height: 100vh;
}

/* HEADER · glass effect */
.app-header {
    grid-area: header;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--gj-border-hairline);
    display: flex;
    align-items: center;
    padding: 0 28px;
    justify-content: space-between;
    z-index: 5;
    position: relative;
}
.app-header .crumbs {
    color: var(--gj-fg-muted);
    font-size: var(--fs-footnote);
    font-weight: 500;
    letter-spacing: -0.005em;
}
.app-header .user-zone {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: var(--fs-footnote);
    color: var(--gj-fg-muted);
}
.app-header .user-avatar {
    width: 34px; height: 34px;
    border-radius: var(--gj-r-pill);
    background: var(--gj-primary-grad);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600;
    font-size: var(--fs-caption);
    letter-spacing: 0.3px;
    box-shadow: 0 1px 3px rgba(111,163,136,0.4), inset 0 0 0 1px rgba(255,255,255,0.15);
    transition: transform var(--gj-t-fast);
}
.app-header .user-avatar:hover { transform: scale(1.05); }

/* SIDEBAR · light, hairline, pill nav */
.app-sidebar {
    grid-area: sidebar;
    background: var(--gj-sidebar-bg);
    color: var(--gj-sidebar-fg);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--gj-sidebar-border);
}
.app-sidebar .brand {
    height: var(--gj-header-h);
    display: flex;
    align-items: center;
    padding: 0 22px;
    border-bottom: 1px solid var(--gj-sidebar-border);
}
.brand-logo {
    height: 22px;
    width: auto;
    max-width: 180px;
    /* El PNG del logo es blanco; en sidebar claro lo invertimos a negro */
    filter: brightness(0) saturate(100%);
    opacity: 0.82;
    transition: opacity var(--gj-t-fast);
}
.brand-logo:hover { opacity: 1; }
.app-sidebar nav {
    padding: 14px 12px;
    flex: 1;
    overflow-y: auto;
}
.app-sidebar .nav-section {
    text-transform: uppercase;
    font-size: var(--fs-caption2);
    color: var(--gj-zinc-400);
    letter-spacing: 0.08em;
    padding: 16px 12px 6px 12px;
    font-weight: 600;
}

/* ─── Secciones colapsables del sidebar ─── */
.nav-section-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 12px 14px 6px 14px;
    margin-top: 8px;
    color: var(--gj-zinc-500);
    font-size: var(--fs-caption2);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-family: inherit;
    transition: color var(--gj-t-fast);
    text-align: left;
}
.nav-section-toggle:hover { color: var(--gj-zinc-700); }
.nav-section-toggle .nav-chevron {
    display: inline-block;
    font-size: var(--fs-caption2);
    color: var(--gj-zinc-400);
    transition: transform 180ms ease;
    width: 12px;
    text-align: center;
}
.nav-section-toggle.open .nav-chevron {
    transform: rotate(90deg);
    color: var(--gj-primary-600);
}
.nav-section-label { flex: 1; }
.nav-section-badge {
    background: var(--gj-accent);
    color: white;
    border-radius: 999px;
    padding: 1px 7px;
    font-size: var(--fs-caption2);
    font-weight: 700;
    min-width: 18px;
    text-align: center;
    text-transform: none;
    letter-spacing: 0;
}

.nav-group {
    display: flex;
    flex-direction: column;
    gap: 1px;
    animation: nav-group-in 180ms cubic-bezier(0.16, 1, 0.3, 1);
    padding-left: 4px;
    border-left: 1px solid var(--gj-zinc-150);
    margin-left: 18px;
}
.nav-group .nav-item {
    margin-left: 0;
    padding-left: 10px;
}
@keyframes nav-group-in {
    0%   { opacity: 0; transform: translateY(-4px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Tap targets más grandes en móvil para los dedos */
@media (max-width: 768px) {
    .app-sidebar .nav-item {
        padding: 12px 14px;
        font-size: var(--fs-subhead);
    }
    .nav-section-toggle {
        padding: 14px 14px 8px 14px;
        font-size: var(--fs-caption2);
    }
}
.app-sidebar .nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 8px 12px;
    color: var(--gj-sidebar-fg);
    text-decoration: none;
    font-size: var(--fs-footnote);
    font-weight: 500;
    border-radius: var(--gj-r-sm);
    margin: 1px 0;
    position: relative;
    transition: all var(--gj-t-fast);
    letter-spacing: -0.005em;
}
.app-sidebar .nav-item > span:first-child {
    width: 18px;
    display: inline-flex;
    justify-content: center;
    font-size: var(--fs-callout);
    opacity: 0.85;
}
.app-sidebar .nav-item:hover {
    background: var(--gj-sidebar-hover);
    color: var(--gj-zinc-900);
}
.app-sidebar .nav-item.active {
    background: var(--gj-sidebar-active-bg);
    color: var(--gj-sidebar-fg-active);
    font-weight: 600;
}
.app-sidebar .nav-item.active > span:first-child { opacity: 1; }
.app-sidebar .nav-item.active::before {
    content: none;     /* sin barra lateral: el pill habla por sí solo */
}
.app-sidebar .sidebar-footer {
    padding: 16px 22px;
    font-size: var(--fs-caption2);
    color: var(--gj-fg-soft);
    border-top: 1px solid var(--gj-sidebar-border);
    background: var(--gj-zinc-25);
}

.app-content {
    grid-area: content;
    padding: 28px 32px 60px;
    overflow-y: auto;
}

/* ===================== PAGE HEADER ===================== */
.page-header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 24px;
    padding: 20px 22px;
    background: var(--gj-card);
    border-radius: var(--gj-r-lg);
    border: 1px solid var(--gj-border-hairline);
    box-shadow: var(--gj-shadow-xs);
    position: relative;
    overflow: hidden;
}
.page-header::before {
    /* Glow esquina superior derecha */
    content: '';
    position: absolute;
    right: -80px; top: -80px;
    width: 240px; height: 240px;
    background: radial-gradient(circle, var(--gj-primary-300) 0%, transparent 65%);
    opacity: 0.10;
    border-radius: 50%;
    pointer-events: none;
}
.page-header.accent::before { background: radial-gradient(circle, var(--gj-accent) 0%, transparent 65%); }
.page-header.info::before   { background: radial-gradient(circle, var(--gj-info) 0%, transparent 65%); }
.page-header.purple::before { background: radial-gradient(circle, var(--gj-purple) 0%, transparent 65%); }
.page-header.warning::before{ background: radial-gradient(circle, var(--gj-warning) 0%, transparent 65%); }

.page-header .ph-icon {
    flex-shrink: 0;
    width: 52px; height: 52px;
    border-radius: var(--gj-r);
    background: var(--gj-primary-grad);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-title1);
    box-shadow: 0 6px 14px -4px rgba(111,163,136,0.45), inset 0 0 0 1px rgba(255,255,255,0.12);
    position: relative;
    z-index: 1;
}
.page-header.accent  .ph-icon { background: var(--gj-accent-grad); box-shadow: 0 6px 14px -4px rgba(252,80,39,0.4), inset 0 0 0 1px rgba(255,255,255,0.12); }
.page-header.info    .ph-icon { background: var(--gj-info-grad);   box-shadow: 0 6px 14px -4px rgba(53,181,232,0.4), inset 0 0 0 1px rgba(255,255,255,0.12); }
.page-header.purple  .ph-icon { background: linear-gradient(135deg, var(--gj-purple) 0%, var(--gj-purple-600) 100%); box-shadow: 0 6px 14px -4px rgba(139,92,246,0.4), inset 0 0 0 1px rgba(255,255,255,0.12); }
.page-header.warning .ph-icon { background: linear-gradient(135deg, var(--gj-warning) 0%, var(--gj-warning-600) 100%); box-shadow: 0 6px 14px -4px rgba(245,158,11,0.4), inset 0 0 0 1px rgba(255,255,255,0.12); }

.page-header h1 { margin: 0; font-size: var(--fs-title2); }
.page-header .ph-sub {
    color: var(--gj-fg-muted);
    font-size: var(--fs-footnote);
    margin: 3px 0 0 0;
    max-width: 720px;
    line-height: 1.5;
}
.page-header .ph-content { flex: 1; position: relative; z-index: 1; min-width: 0; }

/* ===================== CARDS ===================== */
.gj-card {
    background: var(--gj-card);
    border: 1px solid var(--gj-border-hairline);
    border-radius: var(--gj-r-lg);
    padding: 22px 24px;
    box-shadow: var(--gj-shadow-card);
    transition: box-shadow var(--gj-t), transform var(--gj-t), border-color var(--gj-t);
    position: relative;
}
.gj-card:hover {
    box-shadow: var(--gj-shadow-card-hover);
    border-color: var(--gj-border);
}
.gj-card.with-accent {
    border-left: 3px solid var(--gj-primary);
    padding-left: 22px;
}
.gj-card h2:first-child, .gj-card h3:first-child { margin-top: 0; }

/* KPI cards — estilo bento moderno */
.gj-kpi-card {
    background: var(--gj-card);
    border: 1px solid var(--gj-border-hairline);
    border-radius: var(--gj-r-lg);
    padding: 20px 22px;
    box-shadow: var(--gj-shadow-card);
    transition: all var(--gj-t);
    position: relative;
    overflow: hidden;
}
.gj-kpi-card::after {
    /* Brillo diagonal sutil al hover */
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0) 50%, rgba(255,255,255,0.4) 100%);
    opacity: 0;
    transition: opacity var(--gj-t);
    pointer-events: none;
}
.gj-kpi-card:hover {
    transform: translateY(0);
    box-shadow: var(--gj-shadow-card-hover);
    border-color: var(--gj-border);
}
.gj-kpi-card:hover::after { opacity: 1; }
.gj-kpi-card .kpi-icon {
    width: 42px; height: 42px;
    border-radius: var(--gj-r);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-title3);
    margin-bottom: 14px;
    box-shadow: inset 0 0 0 1px rgba(17,24,39,0.04);
}
.gj-kpi-card .kpi-icon.primary { background: var(--gj-primary-50);  color: var(--gj-primary-700); }
.gj-kpi-card .kpi-icon.accent  { background: var(--gj-accent-50);   color: var(--gj-accent-600); }
.gj-kpi-card .kpi-icon.info    { background: var(--gj-info-50);     color: var(--gj-info-600); }
.gj-kpi-card .kpi-icon.purple  { background: var(--gj-purple-50);   color: var(--gj-purple-600); }
.gj-kpi-card .kpi-icon.warning { background: var(--gj-warning-50);  color: var(--gj-warning-600); }
.gj-kpi-card .kpi-icon.success { background: var(--gj-success-50);  color: #047857; }
.gj-kpi-card .kpi-label {
    font-size: var(--fs-caption);
    color: var(--gj-fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}
.gj-kpi-card .kpi-value {
    font-family: var(--gj-font-display);
    font-size: 32px;
    font-weight: 700;
    color: var(--gj-fg);
    letter-spacing: -0.03em;
    line-height: 1.05;
    margin-top: 6px;
    font-variant-numeric: tabular-nums;
}
.gj-kpi-card .kpi-sub {
    font-size: var(--fs-caption);
    color: var(--gj-fg-soft);
    margin-top: 6px;
}

.gj-kpi { display: flex; flex-direction: column; gap: 4px; }
.gj-kpi .kpi-label { font-size: var(--fs-caption2); color: var(--gj-fg-muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.gj-kpi .kpi-value { font-family: var(--gj-font-display); font-size: var(--fs-title1); font-weight: 700; color: var(--gj-fg); letter-spacing: -0.025em; line-height: 1.1; margin-top: 4px; font-variant-numeric: tabular-nums; }
.gj-kpi .kpi-sub { font-size: var(--fs-caption); color: var(--gj-fg-soft); margin-top: 2px; }

/* ===================== BOTONES ===================== */
.gj-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: var(--gj-r-sm);
    border: 1px solid transparent;
    font-family: var(--gj-font);
    font-size: var(--fs-footnote);
    font-weight: 550;
    cursor: pointer;
    transition: all var(--gj-t-fast);
    line-height: 1.3;
    height: 38px;
    white-space: nowrap;
    letter-spacing: -0.005em;
    position: relative;
    user-select: none;
}
.gj-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.gj-btn:focus-visible { outline: none; box-shadow: var(--gj-shadow-focus); }

.gj-btn-primary {
    background: var(--gj-primary-grad);
    color: white;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(111,163,136,0.4), inset 0 0 0 1px rgba(255,255,255,0.12), inset 0 -1px 0 rgba(0,0,0,0.08);
}
.gj-btn-primary:hover:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 6px 12px -2px rgba(111,163,136,0.45), inset 0 0 0 1px rgba(255,255,255,0.18), inset 0 -1px 0 rgba(0,0,0,0.08);
}
.gj-btn-primary:active:not(:disabled) { transform: translateY(0); }

.gj-btn-accent {
    background: var(--gj-accent-grad);
    color: white;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(252,80,39,0.35), inset 0 0 0 1px rgba(255,255,255,0.12), inset 0 -1px 0 rgba(0,0,0,0.08);
}
.gj-btn-accent:hover:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 6px 12px -2px rgba(252,80,39,0.45), inset 0 0 0 1px rgba(255,255,255,0.18), inset 0 -1px 0 rgba(0,0,0,0.08);
}

.gj-btn-ghost {
    background: var(--gj-card);
    color: var(--gj-fg);
    border: 1px solid var(--gj-border);
    box-shadow: var(--gj-shadow-xs);
}
.gj-btn-ghost:hover:not(:disabled) {
    background: var(--gj-bg-subtle);
    border-color: var(--gj-border-strong);
    box-shadow: var(--gj-shadow-sm);
}

.gj-btn-soft {
    background: var(--gj-primary-50);
    color: var(--gj-primary-700);
    border: 1px solid var(--gj-primary-100);
}
.gj-btn-soft:hover:not(:disabled) {
    background: var(--gj-primary-100);
    border-color: var(--gj-primary-200);
}

.gj-btn-lg { height: 46px; padding: 12px 24px; font-size: var(--fs-subhead); border-radius: var(--gj-r); }
.gj-btn-sm { height: 32px; padding: 6px 12px; font-size: var(--fs-caption); border-radius: var(--gj-r-xs); }

/* ===================== INPUTS ===================== */
.gj-input,
select.gj-input,
textarea.gj-input {
    width: 100%;
    padding: 9px 13px;
    font-family: var(--gj-font);
    font-size: var(--fs-footnote);
    color: var(--gj-fg);
    background: var(--gj-card);
    border: 1px solid var(--gj-border);
    border-radius: var(--gj-r-sm);
    transition: all var(--gj-t-fast);
    line-height: 1.4;
    height: 38px;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: 0 1px 0 rgba(17,24,39,0.02);
}
textarea.gj-input { height: auto; min-height: 90px; resize: vertical; padding-top: 10px; }
.gj-input::placeholder { color: var(--gj-fg-soft); }
.gj-input:hover:not(:focus):not(:disabled) { border-color: var(--gj-border-strong); }
.gj-input:focus {
    outline: none;
    border-color: var(--gj-primary);
    box-shadow: var(--gj-shadow-focus);
    background: white;
}
.gj-input:disabled { background: var(--gj-bg-subtle); color: var(--gj-fg-muted); cursor: not-allowed; }

select.gj-input {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3e%3cpath fill='none' stroke='%236B7280' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round' d='M3 4.5l3 3 3-3'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 13px center;
    padding-right: 36px;
    cursor: pointer;
}

/* Input ESPECTACULAR para barcode */
.gj-input-barcode {
    font-family: var(--gj-font-mono);
    font-size: var(--fs-title2);
    letter-spacing: 0.05em;
    padding: 18px 22px;
    height: 64px;
    background: var(--gj-card);
    font-weight: 600;
    border-width: 1.5px;
    border-color: var(--gj-border);
    color: var(--gj-fg);
    border-radius: var(--gj-r);
}
.gj-input-barcode::placeholder {
    font-size: var(--fs-callout);
    letter-spacing: normal;
    color: var(--gj-fg-soft);
    font-weight: 400;
    font-family: var(--gj-font);
}
.gj-input-barcode:focus {
    border-color: var(--gj-primary);
    box-shadow: 0 0 0 5px var(--gj-primary-ring), 0 4px 12px -2px rgba(17,24,39,0.06);
    background: white;
}

.field-label,
label.field-label {
    display: block;
    font-size: var(--fs-caption);
    color: var(--gj-fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
    font-weight: 600;
}

/* ===================== TABLES — Linear-style 2025 ===================== */

/* Wrapper opcional para tablas: las envuelve en card con scroll horizontal */
.gj-table-wrap {
    background: var(--gj-card);
    border: 1px solid var(--gj-border-hairline);
    border-radius: var(--gj-r-lg);
    overflow: hidden;
    box-shadow: var(--gj-shadow-card);
}
.gj-table-wrap > .gj-table-scroll { overflow-x: auto; }
.gj-table-wrap > .gj-table-scroll > .gj-table { box-shadow: none; }

.gj-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: var(--fs-footnote);
    font-variant-numeric: tabular-nums;
}
.gj-table th, .gj-table td {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--gj-border-hairline);
    vertical-align: middle;
}

/* HEADER — fondo gris muy sutil, sticky-friendly, sin tipografía exagerada */
.gj-table thead th {
    color: var(--gj-zinc-600);
    font-weight: 600;
    font-size: var(--fs-caption2);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    background: linear-gradient(180deg, var(--gj-zinc-25) 0%, var(--gj-card) 100%);
    border-bottom: 1px solid var(--gj-border);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

/* Filas */
.gj-table tbody tr {
    transition: background var(--gj-t-fast);
    background: var(--gj-card);
}
.gj-table tbody tr:nth-child(even) { background: var(--gj-zinc-25); }
.gj-table tbody tr:hover {
    background: var(--gj-primary-50);
    box-shadow: inset 2px 0 0 var(--gj-primary-500);
}
.gj-table tbody tr:last-child td { border-bottom: none; }

/* Filas seleccionadas / destacadas */
.gj-table tbody tr.is-selected {
    background: var(--gj-primary-50);
    box-shadow: inset 3px 0 0 var(--gj-primary-600);
}

/* Variantes de celda */
.gj-table td.num,
.gj-table th.num    { text-align: right; font-variant-numeric: tabular-nums; }
.gj-table td.center,
.gj-table th.center { text-align: center; }
.gj-table td.actions { text-align: right; white-space: nowrap; padding-right: 12px; }
.gj-table td.mono   { font-family: var(--gj-font-mono); font-size: var(--fs-caption); color: var(--gj-zinc-700); }
.gj-table td.muted  { color: var(--gj-fg-muted); }

/* Cuando la tabla está vacía: una fila grande de empty state */
.gj-table tbody tr.empty td {
    padding: 36px 18px;
    text-align: center;
    color: var(--gj-fg-soft);
    font-size: var(--fs-footnote);
    background: var(--gj-zinc-25);
    border-bottom: none;
}

/* Variante densa para pantallas con MUCHAS filas */
.gj-table.dense th, .gj-table.dense td { padding: 8px 12px; font-size: var(--fs-caption); }

/* Variante "sin hover" cuando la tabla es solo informativa */
.gj-table.no-hover tbody tr:hover {
    background: inherit;
    box-shadow: none;
}

/* Variante sin cebra para tablas muy densas */
.gj-table.no-stripes tbody tr:nth-child(even) { background: var(--gj-card); }

/* ============================================================
   OPERATIVA — Pasos verticales mobile-first
   Patrón reutilizable para Movimientos / Salidas / Retiradas
   ============================================================ */

.op-step {
    background: var(--gj-card);
    border: 1px solid var(--gj-border-hairline);
    border-radius: var(--gj-r-lg);
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: var(--gj-shadow-sm);
    transition: all var(--gj-t);
}
.op-step.op-step-done {
    border-color: var(--gj-primary-300);
    background: linear-gradient(180deg, var(--gj-primary-50) 0%, var(--gj-card) 60%);
}
.op-step.op-step-disabled { opacity: 0.55; pointer-events: none; }

.op-step-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px 10px;
}
.op-step-num {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--gj-zinc-200);
    color: var(--gj-zinc-600);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: var(--fs-subhead);
    flex-shrink: 0;
    transition: all var(--gj-t);
}
.op-step.op-step-done .op-step-num {
    background: var(--gj-primary-grad);
    color: white;
    box-shadow: 0 2px 6px -1px var(--gj-primary-ring);
}
.op-step-title {
    font-size: var(--fs-callout);
    font-weight: 650;
    color: var(--gj-fg);
    letter-spacing: -0.01em;
    line-height: 1.2;
}
.op-step-sub {
    font-size: var(--fs-caption);
    color: var(--gj-fg-muted);
    margin-top: 2px;
}
.op-step-sub code {
    background: var(--gj-zinc-50);
    border: 1px solid var(--gj-border);
    padding: 1px 5px;
    border-radius: 4px;
    font-family: var(--gj-font-mono);
    font-size: var(--fs-caption2);
    color: var(--gj-zinc-700);
}
.op-step-check {
    margin-left: auto;
    color: #047857;
    font-size: var(--fs-headline);
    font-weight: 700;
}
.op-step-body { padding: 0 18px 16px; }

.op-input-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.op-input {
    flex: 1;
    height: 48px;
    border: 1.5px solid var(--gj-zinc-200);
    background: var(--gj-zinc-25);
    border-radius: var(--gj-r);
    padding: 0 16px;
    font-family: var(--gj-font-mono);
    font-size: var(--fs-callout);
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--gj-fg);
    outline: none;
    transition: all var(--gj-t-fast);
    text-transform: uppercase;
    min-width: 0;
}
/* Textarea variante: altura libre, tipografía normal sin mono ni uppercase,
   pensado para campos de texto largo (Observaciones, comentarios…). */
.op-input.op-textarea {
    height: auto;
    min-height: 120px;
    padding: 12px 16px;
    font-family: var(--gj-font);
    font-size: var(--fs-subhead);
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    line-height: 1.5;
    resize: vertical;
}
.op-input::placeholder {
    color: var(--gj-zinc-400);
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    font-family: var(--gj-font);
    font-size: var(--fs-subhead);
}
.op-input:focus {
    border-color: var(--gj-primary-500);
    background: white;
    box-shadow: var(--gj-shadow-focus);
}
.op-input[type="number"], select.op-input {
    font-family: var(--gj-font);
    font-size: var(--fs-callout);
    text-transform: none;
    letter-spacing: 0;
}
.op-btn-cam, .op-btn-go {
    width: 48px; height: 48px;
    border-radius: var(--gj-r);
    cursor: pointer;
    transition: all var(--gj-t-fast);
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.op-btn-cam {
    border: 1.5px solid var(--gj-zinc-200);
    background: var(--gj-card);
    color: var(--gj-zinc-700);
    font-size: var(--fs-title3);
}
.op-btn-cam:hover:not(:disabled) {
    background: var(--gj-primary-50);
    border-color: var(--gj-primary-300);
    color: var(--gj-primary-700);
}
.op-btn-cam:disabled { opacity: 0.4; cursor: not-allowed; }
.op-btn-go {
    border: none;
    background: var(--gj-primary-grad);
    color: white;
    font-size: var(--fs-title2);
    font-weight: 600;
    box-shadow: 0 4px 10px -2px rgba(79,128,104,0.35);
}
.op-btn-go:hover:not(:disabled) { transform: translateY(0) scale(1.04); }
.op-btn-go:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }

.op-step-result {
    margin-top: 10px;
    padding: 8px 12px;
    background: var(--gj-zinc-25);
    border: 1px solid var(--gj-border-hairline);
    border-radius: var(--gj-r-sm);
    font-size: var(--fs-footnote);
}
.op-badge {
    display: inline-block;
    line-height: 1.5;
}
.op-badge code {
    background: var(--gj-card);
    border: 1px solid var(--gj-border);
    padding: 1px 6px;
    border-radius: 4px;
    font-family: var(--gj-font-mono);
    font-size: var(--fs-caption);
    color: var(--gj-zinc-800);
    font-weight: 600;
}
.op-badge.err { color: var(--gj-danger-600); }

.op-extras {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--gj-border-hairline);
}
.op-extras-title {
    font-size: var(--fs-caption2);
    font-weight: 700;
    color: var(--gj-fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
}
.op-extras-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.op-extras-field label {
    display: block;
    font-size: var(--fs-caption2);
    color: var(--gj-fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
    font-weight: 600;
}

/* Banner verde de éxito tras confirmar */
.op-success-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(90deg, var(--gj-success-50) 0%, var(--gj-card) 100%);
    border: 1px solid var(--gj-success-100);
    border-radius: var(--gj-r);
    padding: 12px 16px;
    margin: 14px 0;
    font-size: var(--fs-footnote);
    color: #047857;
    font-weight: 600;
    animation: op-success-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
/* Banner ámbar para avisos no bloqueantes: confirma origen == destino, etc. */
.op-warning-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: linear-gradient(90deg, var(--gj-warning-50) 0%, var(--gj-card) 100%);
    border: 1px solid var(--gj-warning-100);
    border-left: 4px solid var(--gj-warning-500, #f59e0b);
    border-radius: var(--gj-r);
    padding: 12px 16px;
    margin: 14px 0;
    font-size: var(--fs-footnote);
    color: var(--gj-warning-700, #b45309);
}
.op-warning-icon { font-size: var(--fs-title3); line-height: 1; flex-shrink: 0; }
@keyframes op-success-in {
    0%   { opacity: 0; transform: translateY(-6px); }
    100% { opacity: 1; transform: translateY(0); }
}
.op-success-icon { font-size: var(--fs-title2); }

/* Barra de acción sticky abajo */
.op-actionbar {
    position: sticky;
    bottom: 0;
    background: var(--gj-card);
    border: 1px solid var(--gj-border-hairline);
    border-radius: var(--gj-r-lg);
    padding: 12px 18px;
    margin-top: 16px;
    box-shadow: 0 -4px 18px -6px rgba(17,24,39,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    transition: all var(--gj-t);
    z-index: 5;
}
.op-actionbar.ready {
    border-color: var(--gj-primary-300);
    box-shadow: 0 -4px 18px -6px var(--gj-primary-ring), 0 0 0 1px var(--gj-primary-300);
}
.op-actionbar-info { flex: 1; min-width: 200px; }
.op-actionbar-hint { font-size: var(--fs-caption); color: var(--gj-fg-soft); }
.op-actionbar-title { font-size: var(--fs-footnote); font-weight: 650; color: var(--gj-fg); }
.op-actionbar-sub {
    font-size: var(--fs-caption);
    color: var(--gj-fg-muted);
    margin-top: 2px;
}
.op-actionbar-sub code {
    background: var(--gj-zinc-50);
    border: 1px solid var(--gj-border);
    padding: 0 5px;
    border-radius: 3px;
    font-family: var(--gj-font-mono);
    font-size: var(--fs-caption2);
    color: var(--gj-zinc-700);
}
.op-actionbar-actions { display: flex; gap: 8px; flex-shrink: 0; }
.op-btn-confirm {
    height: 44px;
    padding: 0 22px;
    border: none;
    border-radius: var(--gj-r);
    background: var(--gj-primary-grad);
    color: white;
    font-size: var(--fs-subhead);
    font-weight: 650;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 14px -2px rgba(79,128,104,0.4);
    transition: all var(--gj-t-fast);
    font-family: var(--gj-font);
}
.op-btn-confirm:hover:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 8px 22px -4px rgba(79,128,104,0.55);
}
.op-btn-confirm:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

@media (max-width: 600px) {
    .op-input { font-size: var(--fs-callout); height: 46px; padding: 0 14px; }
    .op-btn-cam, .op-btn-go { width: 46px; height: 46px; }
    .op-step-head { padding: 12px 14px 8px; }
    .op-step-body { padding: 0 14px 14px; }
    .op-actionbar { padding: 10px 14px; }
    .op-actionbar-actions { width: 100%; justify-content: space-between; }
    .op-btn-confirm { flex: 1; justify-content: center; }
}

/* Chips de selección rápida (Retiradas: posición destino, motivo) */
.op-quick-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}
.op-quick-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    background: var(--gj-zinc-50);
    border: 1.5px solid var(--gj-border-hairline);
    border-radius: var(--gj-r-pill);
    cursor: pointer;
    font-family: inherit;
    font-size: var(--fs-caption);
    color: var(--gj-fg-muted);
    transition: all var(--gj-t-fast);
}
.op-quick-chip:hover {
    background: var(--gj-primary-50);
    border-color: var(--gj-primary-300);
    color: var(--gj-primary-700);
}
.op-quick-chip.active {
    background: var(--gj-primary-100);
    border-color: var(--gj-primary-500);
    color: var(--gj-primary-700);
    font-weight: 600;
}
.op-quick-chip code {
    background: white;
    border: 1px solid var(--gj-border);
    padding: 1px 6px;
    border-radius: 4px;
    font-family: var(--gj-font-mono);
    font-size: var(--fs-caption2);
    color: var(--gj-zinc-700);
}
.op-quick-chip.active code { border-color: var(--gj-primary-300); }

/* Lista de establecimientos (Salidas) */
.op-est-list {
    margin-top: 8px;
    border: 1px solid var(--gj-border);
    border-radius: var(--gj-r);
    background: var(--gj-card);
    max-height: 320px;
    overflow-y: auto;
    box-shadow: var(--gj-shadow-sm);
}
.op-est-item {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--gj-border-hairline);
    transition: background var(--gj-t-fast);
    font-family: inherit;
}
.op-est-item:last-child { border-bottom: none; }
.op-est-item:hover { background: var(--gj-primary-50); }
.op-est-name {
    font-size: var(--fs-subhead);
    font-weight: 600;
    color: var(--gj-fg);
}
.op-est-meta {
    font-size: var(--fs-caption);
    color: var(--gj-fg-soft);
    margin-top: 2px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.op-est-meta code {
    background: var(--gj-zinc-50);
    border: 1px solid var(--gj-border);
    padding: 0 6px;
    border-radius: 4px;
    font-family: var(--gj-font-mono);
    font-size: var(--fs-caption2);
    color: var(--gj-zinc-700);
}

/* ============================================================
   ESCANEO POR CÁMARA — Modal con stream + recuadro objetivo
   ============================================================ */
.sga-cam-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    z-index: 9997;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 14px;
    font-family: 'Inter', sans-serif;
}
.sga-cam-backdrop.open {
    display: flex;
    animation: notif-panel-in 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.sga-cam-backdrop.flash::after {
    content: '';
    position: absolute; inset: 0;
    background: rgba(16,185,129,0.35);
    pointer-events: none;
    animation: cam-flash 0.35s ease-out;
}
@keyframes cam-flash {
    0%   { opacity: 1; }
    100% { opacity: 0; }
}
.sga-cam-modal {
    background: #0F1418;
    color: white;
    border-radius: var(--gj-r-xl);
    box-shadow: var(--gj-shadow-2xl);
    width: 100%;
    max-width: 540px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.sga-cam-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 18px 22px;
    background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, transparent 100%);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sga-cam-eyebrow {
    font-size: var(--fs-caption2);
    font-weight: 700;
    color: var(--gj-primary-300);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 4px;
}
.sga-cam-title {
    font-family: var(--gj-font-display);
    font-size: var(--fs-title3);
    font-weight: 700;
    color: white;
    letter-spacing: -0.015em;
}
.sga-cam-close {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: white;
    cursor: pointer;
    width: 36px; height: 36px;
    border-radius: 50%;
    font-size: var(--fs-subhead);
    transition: all 140ms ease;
    display: flex; align-items: center; justify-content: center;
}
.sga-cam-close:hover { background: rgba(255,255,255,0.15); }

.sga-cam-stage {
    position: relative;
    aspect-ratio: 4 / 3;
    background: #000;
    overflow: hidden;
}
.sga-cam-video {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
}
.sga-cam-frame {
    position: absolute;
    top: 50%; left: 50%;
    width: 70%;
    aspect-ratio: 3 / 2;
    transform: translate(-50%, -50%);
    pointer-events: none;
}
.sga-cam-corner {
    position: absolute;
    width: 24px; height: 24px;
    border: 3px solid var(--gj-primary-300);
    box-shadow: 0 0 12px rgba(138,186,160,0.5);
}
.sga-cam-corner.tl { top: 0; left: 0;     border-right: none; border-bottom: none; border-top-left-radius: 6px; }
.sga-cam-corner.tr { top: 0; right: 0;    border-left:  none; border-bottom: none; border-top-right-radius: 6px; }
.sga-cam-corner.bl { bottom: 0; left: 0;  border-right: none; border-top: none;    border-bottom-left-radius: 6px; }
.sga-cam-corner.br { bottom: 0; right: 0; border-left:  none; border-top: none;    border-bottom-right-radius: 6px; }
.sga-cam-laser {
    position: absolute;
    top: 50%;
    left: 8%; right: 8%;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--gj-primary-300) 50%, transparent 100%);
    box-shadow: 0 0 8px var(--gj-primary-300);
    animation: cam-laser 2s ease-in-out infinite;
}
@keyframes cam-laser {
    0%, 100% { transform: translateY(-30px); opacity: 0.6; }
    50%      { transform: translateY(30px);  opacity: 1; }
}
.sga-cam-status {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    border-radius: 999px;
    font-size: var(--fs-caption);
    font-weight: 600;
    color: white;
    white-space: nowrap;
    max-width: calc(100% - 28px);
}
.sga-cam-status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #F59E0B;
    box-shadow: 0 0 10px currentColor;
    animation: cam-status-pulse 1.5s ease-in-out infinite;
}
@keyframes cam-status-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}
.sga-cam-foot {
    padding: 12px 22px 16px;
    font-size: var(--fs-caption);
    color: rgba(255,255,255,0.55);
    text-align: center;
    line-height: 1.5;
}

/* Botón cámara junto al input de Escaneo --------------------- */
.scan-btn-camera {
    width: 54px; height: 54px;
    border-radius: var(--gj-r);
    border: 1.5px solid var(--gj-zinc-200);
    background: var(--gj-card);
    color: var(--gj-zinc-700);
    font-size: var(--fs-title2);
    cursor: pointer;
    transition: all var(--gj-t-fast);
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.scan-btn-camera:hover {
    background: var(--gj-primary-50);
    border-color: var(--gj-primary-300);
    color: var(--gj-primary-700);
    transform: scale(1.05);
}
@media (max-width: 600px) {
    .scan-btn-camera { width: 50px; height: 50px; font-size: var(--fs-title3); }
}

/* ============================================================
   ATAJOS DE TECLADO — Modal de ayuda (sga-shortcuts.js)
   ============================================================ */
.sga-kbd-help-backdrop {
    position: fixed; inset: 0;
    background: rgba(17,24,39,0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.sga-kbd-help-backdrop.open {
    display: flex;
    animation: notif-panel-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.sga-kbd-help-panel {
    background: var(--gj-card);
    border: 1px solid var(--gj-border);
    border-radius: var(--gj-r-xl);
    box-shadow: var(--gj-shadow-2xl);
    width: 100%;
    max-width: 620px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    padding: 22px 26px;
}
.sga-kbd-help-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gj-border-hairline);
}
.sga-kbd-eyebrow {
    font-size: var(--fs-caption2);
    font-weight: 700;
    color: var(--gj-primary-600);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 4px;
}
.sga-kbd-title {
    font-family: var(--gj-font-display);
    font-size: var(--fs-title2);
    font-weight: 700;
    color: var(--gj-fg);
    letter-spacing: -0.025em;
}
.sga-kbd-close {
    background: transparent;
    border: none;
    cursor: pointer;
    width: 32px; height: 32px;
    border-radius: var(--gj-r-sm);
    color: var(--gj-fg-soft);
    font-size: var(--fs-subhead);
    transition: all 140ms ease;
    display: flex; align-items: center; justify-content: center;
}
.sga-kbd-close:hover { background: var(--gj-zinc-100); color: var(--gj-fg); }

.sga-kbd-section-title {
    font-size: var(--fs-caption2);
    font-weight: 700;
    color: var(--gj-fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 18px 0 10px;
}
.sga-kbd-section-title:first-of-type { margin-top: 0; }
.sga-kbd-section-title kbd {
    background: var(--gj-zinc-100);
    color: var(--gj-zinc-700);
    border: 1px solid var(--gj-border);
    border-radius: 4px;
    padding: 1px 5px;
    font-family: var(--gj-font-mono);
    font-size: var(--fs-caption2);
    font-weight: 700;
    box-shadow: 0 1px 0 var(--gj-zinc-200);
    text-transform: none;
    letter-spacing: 0;
}

.sga-kbd-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 14px;
}
@media (max-width: 560px) {
    .sga-kbd-grid { grid-template-columns: 1fr; }
}
.sga-kbd-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 10px;
    border-radius: var(--gj-r-sm);
    transition: background 140ms ease;
}
.sga-kbd-row:hover { background: var(--gj-zinc-25); }
.sga-kbd-keys {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.sga-kbd-keys kbd {
    background: linear-gradient(180deg, var(--gj-card) 0%, var(--gj-zinc-50) 100%);
    color: var(--gj-zinc-700);
    border: 1px solid var(--gj-border);
    border-radius: 5px;
    padding: 2px 8px;
    font-family: var(--gj-font-mono);
    font-size: var(--fs-caption2);
    font-weight: 700;
    box-shadow: 0 1px 0 var(--gj-border), 0 2px 0 var(--gj-zinc-150);
    min-width: 22px;
    text-align: center;
}
.sga-kbd-plus {
    font-size: var(--fs-caption2);
    color: var(--gj-fg-soft);
    padding: 0 2px;
    font-weight: 500;
    font-style: italic;
}
.sga-kbd-label {
    font-size: var(--fs-footnote);
    color: var(--gj-fg);
    text-align: right;
    font-weight: 500;
}

.sga-kbd-foot {
    margin-top: 22px;
    padding-top: 14px;
    border-top: 1px solid var(--gj-border-hairline);
    font-size: var(--fs-caption);
    color: var(--gj-fg-soft);
    text-align: center;
    line-height: 1.5;
}

/* Botón "?" en el sidebar footer */
.sidebar-kbd-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 2px;
    transition: opacity 140ms ease;
    opacity: 0.6;
}
.sidebar-kbd-btn:hover { opacity: 1; }
.sidebar-kbd-btn kbd {
    background: var(--gj-card);
    border: 1px solid var(--gj-border);
    border-radius: 4px;
    padding: 1px 7px;
    font-family: var(--gj-font-mono);
    font-size: var(--fs-caption2);
    font-weight: 700;
    color: var(--gj-fg-muted);
    box-shadow: 0 1px 0 var(--gj-zinc-150);
}
.sidebar-kbd-btn:hover kbd {
    color: var(--gj-primary-700);
    border-color: var(--gj-primary-300);
}

/* ============================================================
   RECEPCIONES — Cabecera de detalle con KPIs y progreso
   ============================================================ */
.recep-header {
    background: var(--gj-card);
    border: 1px solid var(--gj-border-hairline);
    border-radius: var(--gj-r-lg);
    box-shadow: var(--gj-shadow-card);
    margin-bottom: 18px;
    overflow: hidden;
    position: relative;
}
.recep-header-bar {
    height: 3px;
    background: var(--gj-primary-grad);
}
.recep-header-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    padding: 22px 26px 16px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--gj-border-hairline);
}
.recep-header-id { flex: 1; min-width: 260px; }
.recep-header-eyebrow {
    font-size: var(--fs-caption2);
    font-weight: 700;
    color: var(--gj-fg-soft);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 4px;
}
.recep-header-code {
    font-family: var(--gj-font-mono);
    font-size: var(--fs-title1);
    font-weight: 800;
    color: var(--gj-fg);
    letter-spacing: -0.015em;
    line-height: 1.1;
}
.recep-header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 10px;
    font-size: var(--fs-caption);
    color: var(--gj-fg-muted);
}
.recep-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.recep-meta-item strong { color: var(--gj-fg); font-weight: 650; }
.recep-meta-item code {
    background: var(--gj-zinc-50);
    border: 1px solid var(--gj-border);
    padding: 1px 7px;
    border-radius: 4px;
    font-family: var(--gj-font-mono);
    font-size: var(--fs-caption);
    color: var(--gj-zinc-700);
}
.recep-meta-item .meta-icon { font-size: var(--fs-footnote); opacity: 0.7; }

.recep-header-state { flex-shrink: 0; }
.recep-state-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: var(--gj-r-pill);
    font-size: var(--fs-footnote);
    font-weight: 700;
    letter-spacing: 0.02em;
}
.recep-state-badge.warn { background: var(--gj-warning-50); color: var(--gj-warning-600); border: 1px solid var(--gj-warning-100); }
.recep-state-badge.ok   { background: var(--gj-success-50); color: #047857;               border: 1px solid var(--gj-success-100); }
.recep-state-badge.err  { background: var(--gj-danger-50);  color: var(--gj-danger-600); border: 1px solid var(--gj-danger-100); }

/* KPIs row ------------------------------------------------ */
.recep-kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0;
    background: var(--gj-zinc-25);
}
.recep-kpi {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 22px;
    border-right: 1px solid var(--gj-border-hairline);
}
.recep-kpi:last-child { border-right: none; }
.recep-kpi.total {
    background: linear-gradient(90deg, var(--gj-accent-50) 0%, transparent 100%);
}
.recep-kpi-icon {
    width: 40px; height: 40px;
    border-radius: var(--gj-r);
    display: flex; align-items: center; justify-content: center;
    font-size: var(--fs-headline);
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(17,24,39,0.04);
}
.recep-kpi-icon.primary { background: var(--gj-primary-50); color: var(--gj-primary-700); }
.recep-kpi-icon.info    { background: var(--gj-info-50);    color: var(--gj-info-600); }
.recep-kpi-icon.success { background: var(--gj-success-50); color: #047857; }
.recep-kpi-icon.accent  { background: var(--gj-accent-50);  color: var(--gj-accent-600); }
.recep-kpi-icon.muted   { background: var(--gj-zinc-100);   color: var(--gj-zinc-500); }

.recep-kpi-value {
    font-family: var(--gj-font-display);
    font-size: var(--fs-title2);
    font-weight: 700;
    color: var(--gj-fg);
    letter-spacing: -0.025em;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
}
.recep-kpi-of {
    color: var(--gj-fg-soft);
    font-weight: 500;
    font-size: var(--fs-callout);
}
.recep-kpi-label {
    font-size: var(--fs-caption2);
    color: var(--gj-fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
    font-weight: 600;
}

@media (max-width: 700px) {
    .recep-kpi { border-right: none; border-bottom: 1px solid var(--gj-border-hairline); padding: 12px 22px; }
    .recep-kpi:last-child { border-bottom: none; }
}

/* Progreso ------------------------------------------------ */
.recep-progress {
    padding: 14px 26px 18px;
    border-top: 1px solid var(--gj-border-hairline);
}
.recep-progress-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.recep-progress-title {
    font-size: var(--fs-caption);
    font-weight: 700;
    color: var(--gj-fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.recep-progress-detail { font-size: var(--fs-caption); color: var(--gj-fg-muted); }
.recep-progress-detail .ok { color: #047857; font-weight: 650; }
.recep-progress-bar {
    height: 8px;
    background: var(--gj-zinc-150);
    border-radius: var(--gj-r-pill);
    overflow: hidden;
    position: relative;
}
.recep-progress-fill {
    position: absolute;
    top: 0; bottom: 0; left: 0;
    border-radius: var(--gj-r-pill);
    transition: width var(--gj-t);
}
.recep-progress-fill.conciliada {
    background: linear-gradient(90deg, var(--gj-info) 0%, var(--gj-info-600) 100%);
    z-index: 1;
}
.recep-progress-fill.procesada {
    background: linear-gradient(90deg, var(--gj-primary-500) 0%, var(--gj-primary-700) 100%);
    z-index: 2;
    box-shadow: 0 0 0 2px var(--gj-zinc-150);
}
.recep-progress-legend {
    display: flex;
    gap: 18px;
    margin-top: 8px;
    font-size: var(--fs-caption2);
    color: var(--gj-fg-muted);
}
.recep-progress-legend .dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle;
}
.recep-progress-legend .dot.conciliada { background: var(--gj-info); }
.recep-progress-legend .dot.procesada  { background: var(--gj-primary-500); }

/* ============================================================
   PERFIL — Hero + secciones de configuración
   ============================================================ */
.profile-hero {
    position: relative;
    border-radius: var(--gj-r-xl);
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: var(--gj-shadow-card);
    isolation: isolate;
}
.profile-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(at 95% 10%, rgba(138,186,160,0.4) 0%, transparent 55%),
        radial-gradient(at 5% 90%, rgba(53,181,232,0.18) 0%, transparent 55%),
        linear-gradient(135deg, #2D4F40 0%, #3A6450 50%, #4F8068 100%);
    z-index: -1;
}
.profile-hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.05) 1px, transparent 0);
    background-size: 22px 22px;
    opacity: 0.6;
}
.profile-hero-main {
    position: relative;
    z-index: 1;
    padding: 28px 32px;
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
    color: white;
}
.profile-avatar-big {
    width: 96px; height: 96px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.7) 100%);
    padding: 3px;
    box-shadow: 0 12px 28px -10px rgba(0,0,0,0.5);
    flex-shrink: 0;
}
.profile-avatar-inner {
    width: 100%; height: 100%;
    border-radius: 50%;
    background: var(--gj-primary-grad);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--gj-font-display);
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 0.04em;
    box-shadow: inset 0 0 0 2px rgba(255,255,255,0.15);
}
.profile-hero-info { flex: 1; min-width: 220px; }
.profile-hero-info h1 {
    color: white;
    margin: 0 0 4px;
    font-size: var(--fs-title1);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.15;
}
.profile-hero-sub {
    font-size: var(--fs-footnote);
    color: rgba(255,255,255,0.75);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 6px;
}
.profile-hero-sub code {
    background: rgba(255,255,255,0.15);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: var(--gj-font-mono);
    font-size: var(--fs-caption);
    color: white;
    border: 1px solid rgba(255,255,255,0.1);
}
.profile-hero-sep { opacity: 0.5; }
.profile-hero-roles {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.profile-hero-roles .gj-tag {
    background: rgba(255,255,255,0.18);
    color: white;
    border-color: rgba(255,255,255,0.18);
    backdrop-filter: blur(6px);
}
.profile-no-roles {
    background: var(--gj-warning-50);
    color: var(--gj-warning-600);
    padding: 4px 12px;
    border-radius: var(--gj-r-pill);
    font-size: var(--fs-caption);
    font-weight: 600;
}

/* Stats card a la derecha del hero */
.profile-hero-stats {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}
.profile-stat {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--gj-r);
    padding: 10px 14px;
    backdrop-filter: blur(10px);
    min-width: 130px;
}
.profile-stat-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex; align-items: center; justify-content: center;
    font-size: var(--fs-headline);
    flex-shrink: 0;
}
.profile-stat-icon.ok       { background: rgba(74,222,128,0.25); }
.profile-stat-icon.off      { background: rgba(255,255,255,0.08); opacity: 0.6; }
.profile-stat-icon.primary  { background: rgba(138,186,160,0.3); }
.profile-stat-value {
    font-size: var(--fs-callout);
    font-weight: 700;
    color: white;
    line-height: 1.1;
    letter-spacing: -0.01em;
}
.profile-stat-label {
    font-size: var(--fs-caption2);
    color: rgba(255,255,255,0.65);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 2px;
    font-weight: 600;
}

/* Sección grid 2-col */
.profile-section-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
@media (max-width: 800px) {
    .profile-section-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    .profile-hero-main { padding: 22px 20px; gap: 16px; }
    .profile-avatar-big { width: 76px; height: 76px; }
    .profile-avatar-inner { font-size: var(--fs-title1); }
    .profile-hero-info h1 { font-size: var(--fs-title2); }
    .profile-hero-stats { width: 100%; }
    .profile-stat { flex: 1; min-width: 0; }
}

/* ============================================================
   ESCANEO — Mobile-first, focus en lectura rápida
   ============================================================ */

.scan-input-card {
    background: var(--gj-card);
    border: 1px solid var(--gj-border-hairline);
    border-radius: var(--gj-r-lg);
    padding: 18px 20px 14px;
    margin-bottom: 18px;
    box-shadow: var(--gj-shadow-card);
}
.scan-input-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--fs-caption);
    font-weight: 700;
    color: var(--gj-zinc-700);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}
.scan-input-label .tip {
    color: var(--gj-fg-soft);
    cursor: help;
    font-size: var(--fs-footnote);
}
.scan-input-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.scan-input {
    flex: 1;
    height: 54px;
    border: 1.5px solid var(--gj-zinc-200);
    background: var(--gj-zinc-25);
    border-radius: var(--gj-r);
    padding: 0 18px;
    font-family: var(--gj-font-mono);
    font-size: var(--fs-headline);
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--gj-fg);
    outline: none;
    transition: all var(--gj-t-fast);
    text-transform: uppercase;
}
.scan-input::placeholder {
    color: var(--gj-zinc-400);
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    font-family: var(--gj-font);
    font-size: var(--fs-callout);
}
.scan-input:focus {
    border-color: var(--gj-primary-500);
    background: white;
    box-shadow: var(--gj-shadow-focus);
}
.scan-btn-primary {
    width: 54px; height: 54px;
    border-radius: var(--gj-r);
    border: none;
    background: var(--gj-primary-grad);
    color: white;
    font-size: var(--fs-title2);
    font-weight: 600;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 14px -2px rgba(79,128,104,0.4);
    transition: all var(--gj-t-fast);
    flex-shrink: 0;
}
.scan-btn-primary:hover:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 6px 18px -3px rgba(79,128,104,0.55);
}
.scan-btn-primary:disabled {
    opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none;
}
.scan-btn-ghost {
    width: 54px; height: 54px;
    border-radius: var(--gj-r);
    border: 1.5px solid var(--gj-zinc-200);
    background: transparent;
    color: var(--gj-fg-muted);
    font-size: var(--fs-headline);
    cursor: pointer;
    transition: all var(--gj-t-fast);
    flex-shrink: 0;
}
.scan-btn-ghost:hover {
    background: var(--gj-zinc-50);
    color: var(--gj-danger-600);
    border-color: var(--gj-danger-100);
}

.scan-examples {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.scan-examples-label {
    font-size: var(--fs-caption);
    color: var(--gj-fg-soft);
    font-weight: 600;
    margin-right: 2px;
}
.scan-example {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    background: var(--gj-zinc-50);
    border: 1px solid var(--gj-border-hairline);
    border-radius: var(--gj-r-pill);
    cursor: pointer;
    font-family: inherit;
    font-size: var(--fs-caption);
    color: var(--gj-fg-muted);
    transition: all var(--gj-t-fast);
}
.scan-example:hover {
    background: var(--gj-primary-50);
    border-color: var(--gj-primary-200);
    color: var(--gj-primary-700);
}
.scan-example code {
    font-family: var(--gj-font-mono);
    font-weight: 700;
    color: var(--gj-zinc-700);
    background: white;
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid var(--gj-border);
    font-size: var(--fs-caption2);
}
.scan-example:hover code { border-color: var(--gj-primary-300); color: var(--gj-primary-700); }
.scan-example span { font-size: var(--fs-caption2); }

/* CABECERA UBICACIÓN ---------------------------------------- */
.scan-loc-card {
    background: var(--gj-card);
    border: 1px solid var(--gj-border-hairline);
    border-radius: var(--gj-r-lg);
    padding: 22px 24px 18px;
    margin-bottom: 18px;
    box-shadow: var(--gj-shadow-card);
    position: relative;
    overflow: hidden;
}
.scan-loc-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--gj-primary-grad);
}
.scan-loc-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.scan-loc-eyebrow {
    font-size: var(--fs-caption2);
    font-weight: 700;
    color: var(--gj-fg-soft);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 4px;
}
.scan-loc-code {
    font-family: var(--gj-font-mono);
    font-size: var(--fs-title1);
    font-weight: 800;
    color: var(--gj-fg);
    letter-spacing: -0.02em;
    line-height: 1;
}
.scan-loc-barcode {
    font-size: var(--fs-caption);
    color: var(--gj-fg-soft);
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.scan-loc-barcode code {
    font-family: var(--gj-font-mono);
    background: var(--gj-zinc-50);
    border: 1px solid var(--gj-border);
    padding: 1px 7px;
    border-radius: 4px;
    font-size: var(--fs-caption2);
    color: var(--gj-zinc-700);
}

.scan-zone-badge {
    padding: 8px 16px;
    border-radius: var(--gj-r-pill);
    font-weight: 700;
    font-size: var(--fs-caption);
    letter-spacing: 0.04em;
    box-shadow: 0 2px 6px -2px rgba(0,0,0,0.15);
}

.scan-loc-crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-bottom: 16px;
}
.scan-crumb {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: var(--fs-caption);
}
.scan-crumb .lbl {
    font-size: var(--fs-caption2);
    color: var(--gj-fg-soft);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}
.scan-crumb strong { color: var(--gj-fg); font-weight: 650; }

.scan-kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--gj-border-hairline);
}
.scan-kpi {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px;
}
.scan-kpi.vacio {
    grid-column: 1 / -1;
}
.scan-kpi-icon {
    width: 44px; height: 44px;
    border-radius: var(--gj-r);
    display: flex; align-items: center; justify-content: center;
    font-size: var(--fs-title2);
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(17,24,39,0.04);
}
.scan-kpi-icon.primary { background: var(--gj-primary-50); color: var(--gj-primary-700); }
.scan-kpi-icon.info    { background: var(--gj-info-50);    color: var(--gj-info-600); }
.scan-kpi-icon.muted   { background: var(--gj-zinc-100);   color: var(--gj-zinc-500); }
.scan-kpi-value {
    font-family: var(--gj-font-display);
    font-size: var(--fs-title1);
    font-weight: 700;
    color: var(--gj-fg);
    letter-spacing: -0.025em;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
}
.scan-kpi-label {
    font-size: var(--fs-caption);
    color: var(--gj-fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 3px;
    font-weight: 600;
}

/* CONTENIDO ------------------------------------------------ */
.scan-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 900px) {
    .scan-content-grid { grid-template-columns: 1fr; }
}

/* NOT FOUND ------------------------------------------------ */
.scan-not-found {
    text-align: center;
    padding: 44px 24px;
}
.scan-not-found-icon {
    font-size: 56px;
    opacity: 0.4;
    margin-bottom: 14px;
}
.scan-not-found h3 { margin: 0 0 8px; font-size: var(--fs-headline); }
.scan-not-found p { color: var(--gj-fg-muted); margin: 4px 0; font-size: var(--fs-footnote); }
.scan-not-found code {
    background: var(--gj-zinc-100);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: var(--gj-font-mono);
    font-size: var(--fs-caption);
    color: var(--gj-danger-600);
}
.scan-not-found .gj-btn { margin-top: 18px; }

@media (max-width: 600px) {
    .scan-input { font-size: var(--fs-callout); height: 50px; padding: 0 14px; }
    .scan-btn-primary, .scan-btn-ghost { width: 50px; height: 50px; }
    .scan-loc-code { font-size: var(--fs-title2); }
    .scan-input-card { padding: 14px 14px 12px; }
    .scan-loc-card { padding: 18px 18px 14px; }
    .scan-kpi-value { font-size: var(--fs-title2); }
}

/* ============================================================
   CHATBOT — Asistente flotante 2025
   ============================================================ */
.chat-fab {
    position: fixed; bottom: 20px; right: 20px; z-index: 90;
    width: 56px; height: 56px;
    border-radius: 50%;
    border: none;
    background: var(--gj-primary-grad);
    color: white;
    cursor: pointer;
    box-shadow: 0 8px 24px -6px rgba(79,128,104,0.55), inset 0 1px 0 rgba(255,255,255,0.18);
    transition: all var(--gj-t);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    isolation: isolate;
}
.chat-fab .chat-fab-icon {
    font-size: var(--fs-title2);
    line-height: 1;
    transition: transform var(--gj-t-fast);
    z-index: 2;
}
.chat-fab:hover { transform: translateY(0) scale(1.06); box-shadow: 0 14px 32px -8px rgba(79,128,104,0.65); }
.chat-fab:hover .chat-fab-icon { transform: scale(1.1); }
.chat-fab.open {
    background: var(--gj-zinc-800);
    box-shadow: 0 8px 24px -6px rgba(0,0,0,0.35);
}
.chat-fab-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--gj-primary-500);
    opacity: 0.3;
    z-index: 1;
    animation: chat-fab-pulse 2.4s ease-out infinite;
}
@keyframes chat-fab-pulse {
    0%   { transform: scale(1);   opacity: 0.45; }
    100% { transform: scale(1.6); opacity: 0; }
}

.chat-panel {
    position: fixed;
    bottom: 88px; right: 20px;
    z-index: 89;
    width: 420px;
    max-width: calc(100vw - 24px);
    height: 620px;
    max-height: calc(100vh - 130px);
    background: var(--gj-card);
    border: 1px solid var(--gj-border);
    border-radius: var(--gj-r-lg);
    box-shadow: var(--gj-shadow-2xl), 0 0 0 1px var(--gj-border-hairline);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: notif-panel-in 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Header --------------------------------------------------- */
.chat-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px;
    background: linear-gradient(180deg, var(--gj-zinc-25) 0%, var(--gj-card) 100%);
    border-bottom: 1px solid var(--gj-border-hairline);
}
.chat-header-info { display: flex; align-items: center; gap: 10px; }
.chat-header-actions { display: flex; align-items: center; gap: 4px; }
.chat-header-title {
    font-size: var(--fs-subhead);
    font-weight: 650;
    color: var(--gj-fg);
    letter-spacing: -0.01em;
}
.chat-header-status {
    font-size: var(--fs-caption2);
    color: var(--gj-fg-soft);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 1px;
}
.chat-header-status .conn-dot {
    width: 6px; height: 6px;
    background: #10B981;
    animation: notif-pulse-green 2s ease-in-out infinite;
}

/* Avatar — bot SVG animado --------------------------------- */
.chat-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--gj-primary-grad);
    color: white;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18), 0 3px 8px -2px rgba(79,128,104,0.45);
    flex-shrink: 0;
    overflow: visible;
    position: relative;
}
.chat-avatar.small { width: 30px; height: 30px; }
.chat-avatar .bot-svg {
    width: 100%; height: 100%;
    display: block;
    animation: bot-float 3.2s ease-in-out infinite;
}

/* Antena pulsante */
.bot-antenna-dot {
    transform-origin: 20px 3.5px;
    animation: bot-antenna 1.8s ease-in-out infinite;
}
@keyframes bot-antenna {
    0%, 100% { transform: scale(1);   opacity: 1; }
    50%      { transform: scale(1.45); opacity: 0.65; }
}

/* Parpadeo de los ojos — ambos a la vez, cada ~3.5s */
.bot-eye {
    transform-origin: center;
    animation: bot-blink 3.5s ease-in-out infinite;
}
@keyframes bot-blink {
    0%, 92%, 100% { transform: scaleY(1); }
    94%, 96%      { transform: scaleY(0.1); }
}

/* Flotación suave del bot entero */
@keyframes bot-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-1.5px); }
}

/* En el FAB, el bot ocupa el 70% del botón */
.chat-fab-bot {
    width: 64%; height: 64%;
    display: block;
    z-index: 2;
    position: relative;
    animation: bot-float 3.2s ease-in-out infinite;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
}

/* Body ----------------------------------------------------- */
.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
    background:
        radial-gradient(at top, rgba(138,186,160,0.05), transparent 50%),
        var(--gj-zinc-25);
    display: flex; flex-direction: column; gap: 14px;
}
.chat-body::-webkit-scrollbar { width: 8px; }
.chat-body::-webkit-scrollbar-thumb { background: var(--gj-zinc-200); border-radius: 4px; }
.chat-body::-webkit-scrollbar-thumb:hover { background: var(--gj-zinc-300); }

/* Welcome state -------------------------------------------- */
.chat-welcome {
    text-align: center;
    padding: 16px 6px;
}
.chat-welcome-icon {
    font-size: 44px;
    margin-bottom: 10px;
    display: inline-block;
    animation: chat-wave 2s ease-in-out infinite;
}
@keyframes chat-wave {
    0%, 50%, 100% { transform: rotate(0); }
    10% { transform: rotate(-10deg); }
    20% { transform: rotate(8deg); }
    30% { transform: rotate(-6deg); }
    40% { transform: rotate(4deg); }
}
.chat-welcome h3 {
    margin: 0 0 6px;
    font-size: var(--fs-headline);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--gj-fg);
}
.chat-welcome p {
    font-size: var(--fs-footnote);
    color: var(--gj-fg-muted);
    margin: 0 0 18px;
    line-height: 1.5;
}
.chat-suggestions-title {
    font-size: var(--fs-caption2);
    font-weight: 700;
    color: var(--gj-fg-soft);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
    text-align: left;
}

/* === Grid de categorías del menú principal === */
.chat-cat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 12px;
}
.chat-cat {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 12px;
    background: var(--gj-card);
    border: 1px solid var(--gj-border-hairline);
    border-radius: var(--gj-r);
    cursor: pointer;
    text-align: left;
    transition: all var(--gj-t-fast);
    font-family: inherit;
}
.chat-cat:hover {
    background: var(--gj-primary-50);
    border-color: var(--gj-primary-300);
    transform: translateY(0);
    box-shadow: var(--gj-shadow-sm);
}
.chat-cat-icon { font-size: var(--fs-title2); line-height: 1; flex-shrink: 0; }
.chat-cat-text {
    font-size: var(--fs-footnote);
    font-weight: 650;
    color: var(--gj-fg);
    letter-spacing: -0.005em;
}

/* === Sub-opciones inline (chips dentro del flujo del chat) === */
.chat-subops {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    padding: 0 4px;
}
.chat-subop-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: var(--gj-card);
    border: 1.5px solid var(--gj-primary-300);
    color: var(--gj-primary-700);
    border-radius: var(--gj-r-pill);
    font-size: var(--fs-caption);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--gj-t-fast);
    font-family: inherit;
    white-space: nowrap;
}
.chat-subop-chip:hover {
    background: var(--gj-primary-50);
    border-color: var(--gj-primary-500);
    transform: translateY(0);
}
.chat-subop-chip.ghost {
    border-color: var(--gj-border);
    color: var(--gj-fg-muted);
    background: transparent;
}
.chat-subop-chip.ghost:hover {
    background: var(--gj-zinc-50);
    color: var(--gj-fg);
    border-color: var(--gj-zinc-300);
}

/* === Input inline (para pedir un código) === */
.chat-inline-input {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    padding: 0 4px;
}
.chat-inline-input input {
    flex: 1;
    height: 36px;
    border: 1.5px solid var(--gj-primary-300);
    border-radius: var(--gj-r-sm);
    padding: 0 12px;
    font-family: var(--gj-font);
    font-size: var(--fs-footnote);
    color: var(--gj-fg);
    outline: none;
    background: white;
    transition: all var(--gj-t-fast);
}
.chat-inline-input input:focus {
    border-color: var(--gj-primary-500);
    box-shadow: 0 0 0 3px var(--gj-primary-ring);
}
.chat-inline-btn {
    width: 36px; height: 36px;
    border: none;
    border-radius: var(--gj-r-sm);
    background: var(--gj-primary-grad);
    color: white;
    font-size: var(--fs-callout);
    cursor: pointer;
    transition: all var(--gj-t-fast);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.chat-inline-btn:hover:not(:disabled) { transform: scale(1.05); }
.chat-inline-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* === Follow-up chips (después de una respuesta) === */
.chat-followup {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 0 4px;
}
.chat-followup-label {
    font-size: var(--fs-caption2);
    color: var(--gj-fg-soft);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-right: 2px;
}
.chat-suggestions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.chat-suggestion {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px;
    background: var(--gj-card);
    border: 1px solid var(--gj-border-hairline);
    border-radius: var(--gj-r);
    cursor: pointer;
    text-align: left;
    transition: all var(--gj-t-fast);
    font-family: inherit;
}
.chat-suggestion:hover {
    background: var(--gj-primary-50);
    border-color: var(--gj-primary-300);
    transform: translateY(0);
    box-shadow: var(--gj-shadow-sm);
}
.chat-suggestion-icon { font-size: var(--fs-callout); flex-shrink: 0; }
.chat-suggestion-text {
    font-size: var(--fs-caption);
    font-weight: 600;
    color: var(--gj-fg);
    line-height: 1.3;
}

/* Mensajes -------------------------------------------------- */
.chat-msg {
    display: flex;
    gap: 8px;
    animation: chat-msg-in 0.22s ease-out;
}
@keyframes chat-msg-in {
    0%   { opacity: 0; transform: translateY(4px); }
    100% { opacity: 1; transform: translateY(0); }
}
.chat-msg.user { justify-content: flex-end; }
.chat-msg.bot  { justify-content: flex-start; align-items: flex-start; }

.chat-bubble-wrap { max-width: 78%; display: flex; flex-direction: column; }
.chat-msg.user .chat-bubble-wrap { align-items: flex-end; }
.chat-msg.bot  .chat-bubble-wrap { align-items: flex-start; }

.chat-bubble {
    padding: 10px 14px;
    border-radius: var(--gj-r-xl);
    font-size: var(--fs-footnote);
    line-height: 1.5;
    word-wrap: break-word;
    box-shadow: var(--gj-shadow-xs);
}
.chat-msg.user .chat-bubble {
    background: var(--gj-primary-grad);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px -2px rgba(79,128,104,0.35);
}
.chat-msg.bot .chat-bubble {
    background: var(--gj-card);
    border: 1px solid var(--gj-border-hairline);
    color: var(--gj-fg);
    border-bottom-left-radius: 4px;
}
.chat-bubble.typing { padding: 12px 16px; }
.chat-bubble strong { font-weight: 650; }
.chat-bubble code {
    background: var(--gj-zinc-100);
    color: var(--gj-zinc-800);
    padding: 1px 6px;
    border-radius: 4px;
    font-family: var(--gj-font-mono);
    font-size: var(--fs-caption);
}
.chat-msg.user .chat-bubble code {
    background: rgba(255,255,255,0.2);
    color: white;
}
.chat-bubble ul {
    margin: 6px 0 0;
    padding-left: 18px;
    font-size: var(--fs-footnote);
}
.chat-bubble ul li { margin: 2px 0; }

.chat-time {
    font-size: var(--fs-caption2);
    color: var(--gj-fg-soft);
    font-variant-numeric: tabular-nums;
}

/* Footer de cada burbuja: hora + botones */
.chat-bubble-foot {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    padding: 0 6px;
    opacity: 0.6;
    transition: opacity var(--gj-t-fast);
}
.chat-msg:hover .chat-bubble-foot { opacity: 1; }
.chat-msg-btn {
    background: transparent;
    border: none;
    width: 22px; height: 22px;
    border-radius: 4px;
    cursor: pointer;
    font-size: var(--fs-caption2);
    color: var(--gj-fg-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--gj-t-fast);
    padding: 0;
}
.chat-msg-btn:hover {
    background: var(--gj-zinc-100);
    color: var(--gj-fg);
}

/* Tools usadas (pie de respuesta del LLM) */
.chat-tools-used {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed var(--gj-border-hairline);
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    font-size: var(--fs-caption2);
    color: var(--gj-fg-soft);
}
.chat-tools-label { margin-right: 4px; font-weight: 600; }
.chat-tools-used code {
    background: var(--gj-zinc-100);
    color: var(--gj-zinc-700);
    padding: 1px 6px;
    border-radius: 4px;
    font-family: var(--gj-font-mono);
    font-size: var(--fs-caption2);
    border: 1px solid var(--gj-border-hairline);
}

/* Markdown rendering — headers, code blocks, tablas, italic */
.chat-bubble h2 { font-size: var(--fs-callout); font-weight: 700; margin: 8px 0 4px; letter-spacing: -0.01em; }
.chat-bubble h3 { font-size: var(--fs-subhead); font-weight: 650; margin: 6px 0 3px; }
.chat-bubble h4 { font-size: var(--fs-footnote); font-weight: 600; margin: 6px 0 2px; color: var(--gj-fg-muted); }
.chat-bubble em { font-style: italic; }
.chat-bubble p { margin: 6px 0; }
.chat-bubble pre {
    background: var(--gj-zinc-100);
    border: 1px solid var(--gj-border);
    border-radius: var(--gj-r-sm);
    padding: 8px 10px;
    overflow-x: auto;
    margin: 8px 0;
}
.chat-bubble pre code {
    background: transparent;
    color: var(--gj-zinc-800);
    padding: 0;
    border: none;
    font-size: var(--fs-caption);
    font-family: var(--gj-font-mono);
    white-space: pre;
}
.chat-bubble a {
    color: var(--gj-primary-700);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.chat-msg.user .chat-bubble a {
    color: white;
    text-decoration-color: rgba(255,255,255,0.6);
}
/* Tablas markdown del bot */
.chat-md-table {
    margin: 8px 0;
    border-collapse: collapse;
    font-size: var(--fs-caption);
    width: 100%;
    border: 1px solid var(--gj-border-hairline);
    border-radius: var(--gj-r-sm);
    overflow: hidden;
}
.chat-md-table th {
    background: var(--gj-zinc-50);
    color: var(--gj-zinc-700);
    text-align: left;
    padding: 5px 8px;
    font-size: var(--fs-caption2);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
    border-bottom: 1px solid var(--gj-border-hairline);
}
.chat-md-table td {
    padding: 5px 8px;
    border-bottom: 1px solid var(--gj-border-hairline);
}
.chat-md-table tr:last-child td { border-bottom: none; }
.chat-md-table tr:nth-child(even) td { background: var(--gj-zinc-25); }

/* Tablas dentro de respuestas */
.chat-tabla {
    margin-top: 10px;
    width: 100%;
    font-size: var(--fs-caption);
    border-collapse: collapse;
    border: 1px solid var(--gj-border-hairline);
    border-radius: var(--gj-r-sm);
    overflow: hidden;
}
.chat-tabla tr:nth-child(even) { background: var(--gj-zinc-25); }
.chat-tabla td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--gj-border-hairline);
}
.chat-tabla tr:last-child td { border-bottom: none; }
.chat-tabla td:first-child {
    color: var(--gj-fg-muted);
    white-space: nowrap;
    font-weight: 500;
}
.chat-tabla td:last-child { text-align: right; }

.chat-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
    padding: 5px 10px;
    background: var(--gj-primary-50);
    color: var(--gj-primary-700);
    border-radius: var(--gj-r-sm);
    text-decoration: none;
    font-size: var(--fs-caption);
    font-weight: 600;
    border: 1px solid var(--gj-primary-100);
    transition: all var(--gj-t-fast);
}
.chat-link:hover {
    background: var(--gj-primary-100);
    color: var(--gj-primary-700);
    transform: translateX(2px);
}

/* Dots de typing ------------------------------------------- */
.chat-dots { display: inline-flex; gap: 5px; padding: 2px 0; }
.chat-dots span {
    width: 7px; height: 7px;
    background: var(--gj-primary-500);
    border-radius: 50%;
    animation: chat-blink 1.2s infinite ease-in-out both;
}
.chat-dots span:nth-child(1) { animation-delay: -0.32s; }
.chat-dots span:nth-child(2) { animation-delay: -0.16s; }
@keyframes chat-blink {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
    40%           { opacity: 1;   transform: scale(1); }
}

/* Input ---------------------------------------------------- */
.chat-input-wrap {
    display: flex;
    gap: 8px;
    padding: 12px 14px 6px;
    border-top: 1px solid var(--gj-border-hairline);
    background: var(--gj-card);
    align-items: flex-end;
}
.chat-input {
    flex: 1;
    border: 1.5px solid var(--gj-zinc-200);
    background: var(--gj-zinc-25);
    border-radius: var(--gj-r);
    padding: 10px 14px;
    font-family: var(--gj-font);
    font-size: var(--fs-footnote);
    line-height: 1.4;
    outline: none;
    resize: none;
    max-height: 120px;
    min-height: 40px;
    transition: all var(--gj-t-fast);
    color: var(--gj-fg);
}
.chat-input::placeholder { color: var(--gj-zinc-400); }
.chat-input:focus {
    border-color: var(--gj-primary-500);
    background: white;
    box-shadow: var(--gj-shadow-focus);
}
.chat-send {
    width: 40px; height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--gj-primary-grad);
    color: white;
    font-size: var(--fs-headline);
    font-weight: 600;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--gj-t-fast);
    flex-shrink: 0;
    box-shadow: 0 4px 10px -2px rgba(79,128,104,0.4);
}
.chat-send:hover:not(:disabled) {
    transform: translateY(0) scale(1.04);
    box-shadow: 0 6px 14px -2px rgba(79,128,104,0.55);
}
.chat-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}
.chat-hint {
    padding: 0 14px 8px;
    background: var(--gj-card);
    font-size: var(--fs-caption2);
    color: var(--gj-fg-soft);
    text-align: center;
}

@media (max-width: 768px) {
    .chat-panel { right: 10px; bottom: 80px; width: calc(100vw - 20px); height: calc(100vh - 110px); }
    .chat-fab { bottom: 16px; right: 16px; }
    .chat-suggestions { grid-template-columns: 1fr; }
}

/* ============================================================
   PANEL DE NOTIFICACIONES — Header bell 2025
   ============================================================ */
.notif-bell-wrap { position: relative; }

.notif-bell-btn {
    position: relative;
    background: transparent;
    border: none;
    border-radius: var(--gj-r-pill);
    width: 36px; height: 36px;
    cursor: pointer;
    font-size: var(--fs-headline);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--gj-t-fast);
    color: var(--gj-zinc-600);
}
.notif-bell-btn:hover {
    background: var(--gj-zinc-100);
    color: var(--gj-fg);
    transform: scale(1.05);
}
.notif-bell-btn.has-unread .notif-bell-icon {
    animation: notif-bell-shake 1.2s ease-in-out;
    animation-iteration-count: 1;
    transform-origin: top center;
}
@keyframes notif-bell-shake {
    0%, 100% { transform: rotate(0deg); }
    15%      { transform: rotate(-12deg); }
    30%      { transform: rotate(10deg); }
    45%      { transform: rotate(-8deg); }
    60%      { transform: rotate(6deg); }
    75%      { transform: rotate(-3deg); }
}

.notif-bell-badge {
    position: absolute;
    top: 2px; right: 2px;
    background: var(--gj-accent-grad);
    color: white;
    font-size: var(--fs-caption2);
    font-weight: 800;
    padding: 0 5px;
    border-radius: 999px;
    min-width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px var(--gj-card), 0 2px 6px -1px rgba(252,80,39,0.5);
    letter-spacing: -0.02em;
    animation: notif-badge-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes notif-badge-pop {
    0%   { transform: scale(0); }
    60%  { transform: scale(1.25); }
    100% { transform: scale(1); }
}

.notif-bell-backdrop {
    position: fixed; inset: 0; z-index: 80;
    background: transparent;
}

.notif-bell-panel {
    position: absolute;
    top: 46px; right: -8px;
    width: 400px;
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 100px);
    background: var(--gj-card);
    border: 1px solid var(--gj-border);
    border-radius: var(--gj-r-lg);
    box-shadow: var(--gj-shadow-xl), 0 0 0 1px var(--gj-border-hairline);
    z-index: 90;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: notif-panel-in 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes notif-panel-in {
    0%   { opacity: 0; transform: translateY(-6px) scale(0.98); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.notif-bell-head {
    padding: 14px 16px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid var(--gj-border-hairline);
}
.notif-head-title {
    font-size: var(--fs-callout);
    font-weight: 650;
    color: var(--gj-fg);
    letter-spacing: -0.015em;
    display: flex;
    align-items: center;
    gap: 10px;
}
.notif-head-pill {
    background: var(--gj-accent-50);
    color: var(--gj-accent-600);
    font-size: var(--fs-caption2);
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--gj-r-pill);
    letter-spacing: 0;
}
.notif-close-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    width: 28px; height: 28px;
    border-radius: var(--gj-r-sm);
    color: var(--gj-fg-soft);
    font-size: var(--fs-footnote);
    transition: all var(--gj-t-fast);
    display: flex; align-items: center; justify-content: center;
}
.notif-close-btn:hover { background: var(--gj-zinc-100); color: var(--gj-fg); }

/* Tabs ---------------------------------------------------- */
.notif-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-bottom: 1px solid var(--gj-border-hairline);
    background: var(--gj-zinc-25);
}
.notif-tab {
    background: transparent;
    border: none;
    padding: 5px 10px;
    border-radius: var(--gj-r-sm);
    font-size: var(--fs-caption);
    font-weight: 600;
    color: var(--gj-fg-muted);
    cursor: pointer;
    transition: all var(--gj-t-fast);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.notif-tab:hover { background: var(--gj-zinc-100); color: var(--gj-fg); }
.notif-tab.active {
    background: var(--gj-card);
    color: var(--gj-primary-700);
    box-shadow: var(--gj-shadow-xs), inset 0 0 0 1px var(--gj-border-hairline);
}
.notif-tab-count {
    background: var(--gj-zinc-150);
    color: var(--gj-zinc-700);
    font-size: var(--fs-caption2);
    font-weight: 700;
    padding: 1px 6px;
    border-radius: var(--gj-r-pill);
    min-width: 18px;
    text-align: center;
}
.notif-tab.active .notif-tab-count {
    background: var(--gj-primary-100);
    color: var(--gj-primary-700);
}
.notif-action-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    width: 28px; height: 28px;
    border-radius: var(--gj-r-sm);
    color: var(--gj-fg-muted);
    font-size: var(--fs-footnote);
    transition: all var(--gj-t-fast);
    display: inline-flex; align-items: center; justify-content: center;
}
.notif-action-btn:hover { background: var(--gj-zinc-100); color: var(--gj-fg); }

/* Lista --------------------------------------------------- */
.notif-bell-list {
    flex: 1;
    overflow-y: auto;
    min-height: 80px;
    max-height: 520px;
}
.notif-bell-list::-webkit-scrollbar { width: 8px; }
.notif-bell-list::-webkit-scrollbar-thumb {
    background: var(--gj-zinc-200);
    border-radius: 4px;
}
.notif-bell-list::-webkit-scrollbar-thumb:hover { background: var(--gj-zinc-300); }

.notif-group-sep {
    padding: 10px 16px 4px;
    font-size: var(--fs-caption2);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gj-fg-soft);
    background: var(--gj-zinc-25);
    border-bottom: 1px solid var(--gj-border-hairline);
    position: sticky;
    top: 0;
    z-index: 1;
}

.notif-item {
    padding: 12px 16px;
    display: flex;
    gap: 12px;
    border-bottom: 1px solid var(--gj-border-hairline);
    transition: all var(--gj-t-fast);
    position: relative;
}
.notif-item:hover { background: var(--gj-zinc-25); }
.notif-item:last-child { border-bottom: none; }
.notif-item.unread {
    background: linear-gradient(90deg, var(--gj-primary-50) 0%, transparent 90%);
}
.notif-item.unread::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--gj-primary-500);
}
.notif-item.unread:hover {
    background: linear-gradient(90deg, var(--gj-primary-100) 0%, var(--gj-zinc-25) 90%);
}

.notif-icon {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--gj-zinc-100);
    display: flex; align-items: center; justify-content: center;
    font-size: var(--fs-callout);
    flex-shrink: 0;
}
.notif-item.lv-aviso .notif-icon { background: var(--gj-warning-50); color: var(--gj-warning-600); }
.notif-item.lv-error .notif-icon { background: var(--gj-danger-50);  color: var(--gj-danger-600); }
.notif-item.lv-exito .notif-icon { background: var(--gj-success-50); color: #047857; }
.notif-item.lv-info  .notif-icon { background: var(--gj-info-50);    color: var(--gj-info-600); }

.notif-content { flex: 1; min-width: 0; }
.notif-titulo {
    font-size: var(--fs-footnote);
    font-weight: 650;
    color: var(--gj-fg);
    letter-spacing: -0.005em;
    line-height: 1.35;
    display: flex;
    align-items: center;
    gap: 8px;
}
.notif-unread-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--gj-primary-500);
    box-shadow: 0 0 0 2px var(--gj-primary-100);
    flex-shrink: 0;
}
.notif-mensaje {
    font-size: var(--fs-caption);
    color: var(--gj-fg-muted);
    margin-top: 3px;
    line-height: 1.45;
    /* Truncate a 2 líneas */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.notif-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    font-size: var(--fs-caption2);
    color: var(--gj-fg-soft);
}
.notif-cat-pill {
    background: var(--gj-zinc-100);
    color: var(--gj-zinc-600);
    padding: 1px 7px;
    border-radius: var(--gj-r-pill);
    font-size: var(--fs-caption2);
    font-weight: 600;
    letter-spacing: 0.02em;
}
.notif-time { font-variant-numeric: tabular-nums; }
.notif-arrow {
    margin-left: auto;
    color: var(--gj-primary-600);
    font-weight: 600;
    transition: transform var(--gj-t-fast);
}
.notif-item:hover .notif-arrow { transform: translateX(2px); }

/* Empty state -------------------------------------------- */
.notif-empty {
    padding: 50px 20px;
    text-align: center;
    color: var(--gj-fg-muted);
}
.notif-empty-icon {
    font-size: 42px;
    opacity: 0.55;
    margin-bottom: 12px;
}
.notif-empty-title {
    font-size: var(--fs-subhead);
    font-weight: 650;
    color: var(--gj-fg);
    margin-bottom: 4px;
}
.notif-empty-sub {
    font-size: var(--fs-caption);
    color: var(--gj-fg-soft);
    line-height: 1.5;
    max-width: 260px;
    margin: 0 auto;
}

/* Footer -------------------------------------------------- */
.notif-bell-foot {
    padding: 8px 14px;
    border-top: 1px solid var(--gj-border-hairline);
    background: var(--gj-zinc-25);
    font-size: var(--fs-caption2);
    color: var(--gj-fg-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}
.conn-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}
.conn-status.connected { color: #047857; }
.conn-status.reconnecting { color: var(--gj-warning-600); }
.conn-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 3px rgba(0,0,0,0);
}
.conn-status.connected .conn-dot {
    animation: notif-pulse-green 2s ease-in-out infinite;
}
@keyframes notif-pulse-green {
    0%, 100% { box-shadow: 0 0 0 3px rgba(16,185,129,0.18); }
    50%      { box-shadow: 0 0 0 6px rgba(16,185,129,0.05); }
}

@media (max-width: 480px) {
    .notif-bell-panel {
        width: calc(100vw - 16px);
        right: -8px;
    }
}

/* Link tipográfico mono para códigos de unidad en tablas */
.mono-link {
    font-family: var(--gj-font-mono);
    font-size: var(--fs-caption);
    color: var(--gj-primary-700);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px dashed var(--gj-primary-300);
    transition: all var(--gj-t-fast);
}
.mono-link:hover {
    color: var(--gj-primary-600);
    border-bottom-color: var(--gj-primary-500);
    background: var(--gj-primary-50);
    padding: 0 2px;
    margin: 0 -2px;
    border-radius: 3px;
}

/* ===================== TAGS / BADGES ===================== */
.gj-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--gj-r-pill);
    font-size: var(--fs-caption2);
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.5;
    white-space: nowrap;
    border: 1px solid transparent;
}
.gj-tag-primary { background: var(--gj-primary-50); color: var(--gj-primary-700); border-color: var(--gj-primary-100); }
.gj-tag-accent  { background: var(--gj-accent-50);  color: var(--gj-accent-600); border-color: var(--gj-accent-100); }
.gj-tag-info    { background: var(--gj-info-50);    color: var(--gj-info-600);   border-color: var(--gj-info-100); }
.gj-tag-danger  { background: var(--gj-danger-50);  color: var(--gj-danger-600); border-color: var(--gj-danger-100); }
.gj-tag-warning { background: var(--gj-warning-50); color: var(--gj-warning-600); border-color: var(--gj-warning-100); }
.gj-tag-muted   { background: var(--gj-zinc-100); color: var(--gj-zinc-600); border-color: var(--gj-zinc-200); }
.gj-tag-purple  { background: var(--gj-purple-50); color: var(--gj-purple-600); border-color: var(--gj-purple-100); }
.gj-tag-success { background: var(--gj-success-50); color: #047857; border-color: var(--gj-success-100); }

/* Status dot — para indicadores en vivo */
.gj-tag .status-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 3px rgba(0,0,0,0);
}
.gj-tag-success .status-dot { animation: gj-pulse 2s infinite; }
@keyframes gj-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.4); }
    50%      { box-shadow: 0 0 0 4px rgba(16,185,129,0); }
}

/* Píldoras de ejemplos */
.example-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: var(--gj-r-pill);
    background: var(--gj-card);
    border: 1px solid var(--gj-border);
    color: var(--gj-fg-muted);
    font-size: var(--fs-caption);
    cursor: pointer;
    transition: all var(--gj-t-fast);
    text-decoration: none;
    font-family: var(--gj-font);
}
.example-pill:hover {
    background: var(--gj-primary-50);
    border-color: var(--gj-primary-200);
    color: var(--gj-primary-700);
    transform: translateY(0);
    box-shadow: var(--gj-shadow-sm);
    text-decoration: none;
}
.example-pill .code-mono { background: transparent; padding: 0; }

/* ===================== ESTADOS ===================== */
.gj-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--gj-fg-soft);
    font-size: var(--fs-footnote);
}
.gj-empty .empty-icon {
    font-size: 32px;
    opacity: 0.4;
    margin-bottom: 8px;
}

.gj-loading {
    color: var(--gj-fg-muted);
    font-size: var(--fs-footnote);
    padding: 14px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.gj-loading::before {
    content: '';
    width: 13px; height: 13px;
    border: 2px solid var(--gj-border-strong);
    border-top-color: var(--gj-primary);
    border-radius: 50%;
    animation: gj-spin 0.7s linear infinite;
}
@keyframes gj-spin { to { transform: rotate(360deg); } }

.gj-error {
    background: var(--gj-danger-50);
    color: var(--gj-danger-600);
    padding: 13px 16px;
    border-radius: var(--gj-r-sm);
    border: 1px solid var(--gj-danger-100);
    border-left: 3px solid var(--gj-danger);
    margin: 14px 0;
    font-size: var(--fs-footnote);
    line-height: 1.5;
}

.gj-success {
    background: var(--gj-success-50);
    color: #047857;
    padding: 13px 16px;
    border-radius: var(--gj-r-sm);
    border: 1px solid var(--gj-success-100);
    border-left: 3px solid var(--gj-success);
    margin: 14px 0;
    font-size: var(--fs-footnote);
    line-height: 1.5;
}

/* Aviso de operación encolada offline */
.gj-offline-notice {
    background: var(--gj-warning-50);
    color: var(--gj-warning-600);
    padding: 13px 16px;
    border-radius: var(--gj-r-sm);
    border: 1px solid var(--gj-warning-100);
    border-left: 3px solid var(--gj-warning);
    margin: 14px 0;
    font-size: var(--fs-footnote);
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 10px;
}
.gj-offline-notice::before {
    content: '📴';
    font-size: var(--fs-headline);
}

/* ===================== TIPS / TOOLTIPS ===================== */
.tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--gj-info-50);
    color: var(--gj-info-600);
    font-size: var(--fs-caption2);
    margin-left: 5px;
    cursor: help;
    user-select: none;
    transition: all var(--gj-t-fast);
    border: 1px solid var(--gj-info-100);
    font-weight: 600;
}
.tip:hover {
    background: var(--gj-info);
    color: white;
    border-color: var(--gj-info);
    transform: scale(1.12);
}

/* ===================== MISC ===================== */
/* .code-mono: código interno de trazabilidad (unidades, IDs). Discreto a propósito —
   lo que importa es el nombre del modelo, no el número. Para códigos que SÍ deben
   destacar (ubicaciones escaneables, almacenes) usa .code-prom. */
.code-mono {
    font-family: var(--gj-font-mono);
    color: var(--gj-fg-soft);
    font-size: var(--fs-caption2);
    font-weight: 400;
    letter-spacing: -0.01em;
    opacity: 0.75;
}

/* .code-prom: código que SÍ destaca — ubicaciones, etiquetas escaneables, almacenes. */
.code-prom {
    font-family: var(--gj-font-mono);
    color: var(--gj-fg);
    background: var(--gj-bg-subtle);
    padding: 1px 7px;
    border-radius: 5px;
    font-size: var(--fs-caption);
    font-weight: 500;
    letter-spacing: -0.005em;
    border: 1px solid var(--gj-border-hairline);
}

/* Animaciones de entrada */
.gj-card, .gj-kpi-card, .page-header {
    animation: gj-fade-in 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes gj-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Scrollbar moderno */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--gj-zinc-200);
    border-radius: 5px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--gj-zinc-300); background-clip: padding-box; border: 2px solid transparent; }

/* Connection / Offline indicator */
.connection-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: var(--gj-r-pill);
    font-size: var(--fs-caption);
    font-weight: 600;
    background: var(--gj-success-50);
    color: #047857;
    border: 1px solid var(--gj-success-100);
    transition: all var(--gj-t);
}
.connection-pill.offline {
    background: var(--gj-warning-50);
    color: var(--gj-warning-600);
    border-color: var(--gj-warning-100);
}
.connection-pill .dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 0 currentColor;
    animation: gj-pulse-dot 2s infinite;
}
@keyframes gj-pulse-dot {
    0%, 100% { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
    50%      { box-shadow: 0 0 0 4px transparent; opacity: 0.6; }
}

/* =========================================================
   /escaneo · selector cuando un código existe en varios almacenes
   (muelles RECEP-01 en CT y MA, BAJA-01, etc.)
   ========================================================= */
.scan-ambiguo-card {
    border-left: 4px solid var(--gj-warning-500, #f59e0b);
}
.scan-ambiguo-head {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 4px 0 14px 0;
    border-bottom: 1px solid var(--gj-border);
    margin-bottom: 10px;
}
.scan-ambiguo-icon {
    font-size: var(--fs-title1);
    line-height: 1;
}
.scan-ambiguo-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.scan-ambiguo-item {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 16px;
    background: var(--gj-bg-subtle);
    border: 1px solid var(--gj-border);
    border-radius: var(--gj-r-md);
    cursor: pointer;
    text-align: left;
    font-family: var(--gj-font);
    transition: all var(--gj-t-fast);
}
.scan-ambiguo-item:hover {
    background: var(--gj-primary-50, #eff6ff);
    border-color: var(--gj-primary-300, #93c5fd);
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(29, 78, 216, 0.08);
}
.scan-ambiguo-item-body {
    flex: 1;
    min-width: 0;
}
.scan-ambiguo-item-alm {
    font-weight: 800;
    font-size: var(--fs-callout);
    color: var(--gj-primary-700, #1d4ed8);
    letter-spacing: 0.3px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.scan-ambiguo-item-name {
    font-weight: 600;
    font-size: var(--fs-footnote);
    color: var(--gj-fg);
    margin-bottom: 2px;
}
.scan-ambiguo-item-sub {
    font-size: var(--fs-caption);
    color: var(--gj-fg-soft);
}
.scan-ambiguo-item-arrow {
    font-size: var(--fs-title3);
    color: var(--gj-fg-soft);
    transition: transform var(--gj-t-fast);
}
.scan-ambiguo-item:hover .scan-ambiguo-item-arrow {
    transform: translateX(2px);
    color: var(--gj-primary-600);
}

/* =========================================================
   SELECTOR INICIAL DE ALMACÉN (modal post-login bloqueante)
   ========================================================= */
.sel-alm-backdrop {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
    z-index: 2000;
    animation: gj-fade-in 180ms ease-out;
}
.sel-alm-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: min(580px, 92vw);
    max-height: 88vh;
    overflow-y: auto;
    background: var(--gj-card);
    border-radius: var(--gj-r-lg, 14px);
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.28);
    z-index: 2001;
    padding: 24px;
    animation: gj-pop-in 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes gj-fade-in { from { opacity: 0 } to { opacity: 1 } }
.sel-alm-head {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--gj-border);
}
.sel-alm-icon {
    font-size: 32px;
    line-height: 1;
    flex-shrink: 0;
}
.sel-alm-loading {
    padding: 30px;
    text-align: center;
    color: var(--gj-fg-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.sel-alm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}
.sel-alm-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 20px 14px;
    background: var(--gj-bg-subtle);
    border: 2px solid var(--gj-border);
    border-radius: var(--gj-r);
    cursor: pointer;
    text-align: center;
    font-family: var(--gj-font);
    transition: all var(--gj-t-fast);
}
.sel-alm-card:hover {
    background: var(--gj-primary-50, #eff6ff);
    border-color: var(--gj-primary-400, #60a5fa);
    transform: translateY(0);
    box-shadow: 0 6px 16px rgba(29, 78, 216, 0.12);
}
.sel-alm-card-icon { font-size: 32px; line-height: 1; }
.sel-alm-card-name {
    font-weight: 700;
    font-size: var(--fs-subhead);
    color: var(--gj-fg);
    margin-top: 4px;
}
.sel-alm-card-code {
    font-family: var(--gj-font-mono);
    font-size: var(--fs-caption2);
    color: var(--gj-fg-soft);
    letter-spacing: 0.3px;
}
.sel-alm-card-todos {
    grid-column: 1 / -1;
    background: var(--gj-info-50, #e0f2fe);
    border-color: var(--gj-info-200, #bae6fd);
    border-style: dashed;
}
.sel-alm-card-todos:hover {
    background: var(--gj-info-100, #bae6fd);
    border-color: var(--gj-info-400, #38bdf8);
}

/* Chip discreto de almacén activo en cabecera */
.alm-ind {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    height: 28px;
    border-radius: var(--gj-r-pill);
    background: var(--gj-card);
    border: 1px solid var(--gj-border);
    cursor: pointer;
    font-size: var(--fs-caption);
    font-weight: 600;
    color: var(--gj-fg);
    transition: all var(--gj-t-fast);
    font-family: var(--gj-font);
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
}
.alm-ind:hover {
    background: var(--gj-bg-subtle);
    border-color: var(--gj-border-strong);
}
.alm-ind-icon { font-size: var(--fs-footnote); line-height: 1; flex-shrink: 0; }
.alm-ind-text {
    overflow: hidden;
    text-overflow: ellipsis;
}
.alm-ind-edit {
    font-size: var(--fs-caption2);
    color: var(--gj-fg-soft);
    margin-left: 2px;
}
@media (max-width: 640px) {
    .alm-ind-text { display: none; }
    .alm-ind-edit { display: none; }
}

/* =========================================================
   RESPONSIVE · MÓVIL Y TABLET
   ========================================================= */

.menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--gj-border);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--gj-r-sm);
    color: var(--gj-fg);
    font-size: var(--fs-headline);
    line-height: 1;
    width: 36px; height: 36px;
    align-items: center; justify-content: center;
    background: var(--gj-card);
    transition: all var(--gj-t-fast);
}
.menu-toggle:hover { background: var(--gj-bg-subtle); border-color: var(--gj-border-strong); }

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(17,24,39,0.45);
    backdrop-filter: blur(2px);
    z-index: 9;
}

@media (max-width: 1024px) {
    .app-content { padding: 22px 22px 50px; }
    h1 { font-size: var(--fs-title2); }
    .page-header { padding: 18px 20px; }
    .page-header .ph-icon { width: 46px; height: 46px; font-size: var(--fs-title2); }
}

@media (max-width: 768px) {
    .app-shell {
        grid-template-columns: 1fr;
        grid-template-rows: var(--gj-header-h) 1fr;
        grid-template-areas: "header" "content";
    }

    .app-sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        width: 82vw;
        max-width: 290px;
        z-index: 10;
        transform: translateX(-100%);
        transition: transform var(--gj-t);
        box-shadow: var(--gj-shadow-xl);
    }
    .app-shell.sidebar-open .app-sidebar { transform: translateX(0); }
    .app-shell.sidebar-open .sidebar-backdrop { display: block; }

    .menu-toggle { display: inline-flex; }

    .app-content { padding: 16px 14px 40px; }
    .app-header { padding: 0 14px; }
    .app-header .crumbs { font-size: var(--fs-caption); }
    .app-header .user-zone > div > div:first-child { display: none; }
    .app-header .user-avatar { width: 30px; height: 30px; font-size: var(--fs-caption2); }
    .app-header .user-zone .gj-btn { padding: 4px 8px; font-size: var(--fs-caption2); height: 28px; }

    h1 { font-size: var(--fs-title3); }
    h2 { font-size: var(--fs-callout); }

    .page-header {
        padding: 14px 16px;
        gap: 12px;
        flex-direction: column;
        align-items: flex-start;
    }
    .page-header .ph-icon { width: 40px; height: 40px; font-size: var(--fs-title3); border-radius: var(--gj-r-sm); }
    .page-header .ph-sub { font-size: var(--fs-caption); }

    .gj-card { padding: 16px 18px; border-radius: var(--gj-r); }
    .gj-card h2 { font-size: var(--fs-callout); }

    .gj-input { font-size: var(--fs-subhead); padding: 9px 12px; }
    .gj-input-barcode { font-size: var(--fs-headline); padding: 14px 16px; height: 56px; }

    .gj-btn { padding: 8px 14px; font-size: var(--fs-footnote); }
    .gj-btn-lg { height: 44px; font-size: var(--fs-subhead); }

    .gj-table { font-size: var(--fs-caption); }
    .gj-table th, .gj-table td { padding: 9px 10px; }

    [style*="grid-template-columns:1.3fr 1fr"],
    [style*="grid-template-columns:1.4fr 1fr"],
    [style*="grid-template-columns:1fr 1fr"],
    [style*="grid-template-columns:1fr 1fr 1fr"],
    [style*="grid-template-columns:1fr 1.4fr"] {
        grid-template-columns: 1fr !important;
    }
}

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Botón de búsqueda global en la cabecera */
.header-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    height: 34px;
    background: var(--gj-card);
    border: 1px solid var(--gj-border);
    border-radius: var(--gj-r-pill);
    font-size: var(--fs-caption);
    color: var(--gj-fg-muted);
    cursor: pointer;
    transition: all var(--gj-t-fast);
    font-family: var(--gj-font);
    min-width: 200px;
}
.header-search-btn:hover {
    background: var(--gj-bg-subtle);
    border-color: var(--gj-border-strong);
    color: var(--gj-fg);
}
.header-search-btn kbd {
    margin-left: auto;
    font-family: var(--gj-font-mono);
    font-size: var(--fs-caption2);
    background: var(--gj-zinc-100);
    border: 1px solid var(--gj-border);
    border-radius: 4px;
    padding: 1px 6px;
    color: var(--gj-fg-muted);
}
@media (max-width: 768px) {
    .header-search-btn { min-width: 0; padding: 6px 10px; }
    .header-search-btn .hide-mobile { display: none; }
    .header-search-btn kbd { display: none; }
}

/* QR de 2FA inline (SVG generado por el backend con QRCoder) */
.totp-qr {
    width: 260px;
    aspect-ratio: 1 / 1;
    display: block;
    /* image-rendering: pixelated para que los módulos del QR mantengan bordes
       nítidos al escalar — clave para que el móvil lo lea bien. */
    image-rendering: pixelated;
}
.totp-qr svg {
    width: 100%;
    height: 100%;
    display: block;
    shape-rendering: crispEdges;
}

/* ============================================================
   HOME — Diseño moderno 2025
   ============================================================ */

/* HERO ----------------------------------------------------- */
.home-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 22px;
    padding: 6px 4px 4px;
}
.home-hero-saludo {
    font-family: var(--gj-font-display);
    font-size: var(--fs-title1);
    font-weight: 700;
    color: var(--gj-fg);
    letter-spacing: -0.025em;
    line-height: 1.15;
}
.home-hero-saludo span {
    background: var(--gj-primary-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.home-hero-sub {
    margin-top: 4px;
    font-size: var(--fs-footnote);
    color: var(--gj-fg-muted);
    text-transform: capitalize;
}
.home-hero-sub .home-hero-status {
    color: var(--gj-primary-600);
    font-weight: 600;
    text-transform: none;
    margin-left: 6px;
}
.home-hero-clock {
    font-family: var(--gj-font-mono);
    font-size: var(--fs-title1);
    font-weight: 600;
    color: var(--gj-zinc-700);
    letter-spacing: -0.01em;
    line-height: 1;
    padding: 8px 16px;
    background: var(--gj-zinc-25);
    border: 1px solid var(--gj-border-hairline);
    border-radius: var(--gj-r);
    box-shadow: var(--gj-shadow-xs);
    font-variant-numeric: tabular-nums;
}

/* BANNER tareas -------------------------------------------- */
.home-banner-tareas {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    background: linear-gradient(135deg, #FF7B47 0%, #FC5027 60%, #E03E18 100%);
    color: white;
    border-radius: var(--gj-r-lg);
    margin-bottom: 22px;
    box-shadow: 0 6px 18px -4px rgba(252,80,39,0.4), 0 2px 4px rgba(252,80,39,0.2);
    text-decoration: none;
    transition: transform var(--gj-t), box-shadow var(--gj-t);
    position: relative;
    overflow: hidden;
}
.home-banner-tareas::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(255,255,255,0.18), transparent 60%);
    pointer-events: none;
}
.home-banner-tareas:hover { transform: translateY(0); box-shadow: 0 12px 28px -6px rgba(252,80,39,0.5); }
.home-banner-tareas .banner-title { font-size: var(--fs-headline); font-weight: 700; letter-spacing: -0.01em; }
.home-banner-tareas .banner-sub { font-size: var(--fs-footnote); opacity: 0.92; margin-top: 4px; }
.home-banner-tareas .banner-icon { font-size: 36px; opacity: 0.9; }

/* Empty-state seed banner (admin) ---------------------------- */
.home-banner-seed {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 22px;
    background: linear-gradient(135deg, #F0F9FF 0%, #E0F2FE 100%);
    border: 1px solid var(--gj-info-100, #BAE6FD);
    border-left: 4px solid var(--gj-info-600, #0284C7);
    border-radius: var(--gj-r);
    margin-bottom: 18px;
}
.home-banner-seed.loaded {
    background: linear-gradient(135deg, #FAF5FF 0%, #F3E8FF 100%);
    border-color: #E9D5FF;
    border-left-color: #9333EA;
}
.home-banner-seed-icon {
    font-size: 32px;
    flex-shrink: 0;
}
.home-banner-seed-body { flex: 1; min-width: 0; }
.home-banner-seed .banner-title {
    font-weight: 700;
    font-size: var(--fs-callout);
    color: var(--gj-fg);
    margin-bottom: 4px;
}
.home-banner-seed .banner-sub {
    font-size: var(--fs-footnote);
    color: var(--gj-fg-muted);
    line-height: 1.5;
}
.home-banner-seed .banner-sub code {
    background: rgba(255,255,255,0.7);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: var(--fs-caption);
    font-family: var(--gj-font-mono);
}
@media (max-width: 700px) {
    .home-banner-seed { flex-direction: column; align-items: flex-start; }
}

/* KPI MODERN ---------------------------------------------- */
.home-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

/* Widget grid del inicio configurable por rol -------------- */
/* 4 columnas en escritorio; cada widget aplica grid-column:span N inline */
.home-widget-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}
@media (max-width: 1200px) {
    .home-widget-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
    .home-widget-grid { grid-template-columns: repeat(2, 1fr); }
    /* Forzamos a que un widget 2x1 no se rompa cuando solo hay 2 columnas */
    .home-widget-grid > [style*="span 4"],
    .home-widget-grid > [style*="span 3"] { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
    .home-widget-grid { grid-template-columns: 1fr; }
    .home-widget-grid > * { grid-column: 1 / -1 !important; }
}

/* /admin/inicio-por-rol -------------------------------------- */
.dashboard-admin-grid {
    display: grid;
    grid-template-columns: 220px 1fr 280px;
    gap: 14px;
    align-items: stretch;
}
@media (max-width: 1100px) {
    .dashboard-admin-grid { grid-template-columns: 200px 1fr; }
    .dashboard-admin-library { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
    .dashboard-admin-grid { grid-template-columns: 1fr; }
}
.dashboard-admin-roles { display: flex; flex-direction: column; padding: 10px; gap: 2px; align-self: flex-start; }
.dashboard-admin-role {
    padding: 9px 12px; border-radius: var(--gj-r-xs); font-size: var(--fs-footnote); cursor: pointer;
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    border: 1px solid transparent;
}
.dashboard-admin-role:hover { background: rgba(138,186,160,.12); }
.dashboard-admin-role.selected { background: var(--gj-card); border-color: var(--gj-primary); font-weight: 600; }
.dashboard-admin-role-count {
    background: var(--gj-surface); color: var(--gj-fg-muted);
    border: 1px solid var(--gj-border); padding: 1px 7px; border-radius: var(--gj-r-sm); font-size: var(--fs-caption2);
}
.dashboard-admin-canvas { padding: 14px; }
.dashboard-admin-widget-list { display: flex; flex-direction: column; gap: 8px; }
.dashboard-admin-widget {
    display: flex; align-items: center; gap: 12px;
    background: var(--gj-card); border: 1px solid var(--gj-border-hairline);
    border-radius: var(--gj-r-sm); padding: 10px 12px;
}
.dashboard-admin-widget.inactive { opacity: 0.45; }
.dashboard-admin-widget-pos {
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--gj-primary); color: #fff; font-weight: 700; font-size: var(--fs-caption);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.dashboard-admin-widget-icon { font-size: var(--fs-title2); flex-shrink: 0; }
.dashboard-admin-widget-meta { flex: 1; min-width: 0; }
.dashboard-admin-widget-name { font-weight: 600; }
.dashboard-admin-widget-sub { display: flex; gap: 6px; font-size: var(--fs-caption2); color: var(--gj-fg-muted); margin-top: 3px; flex-wrap: wrap; }
.dashboard-admin-widget-actions { display: flex; gap: 4px; flex-shrink: 0; }
.gj-btn.icon { padding: 4px 8px; font-size: var(--fs-caption); min-width: 28px; }
.gj-btn.icon.danger:hover { background: rgba(222,44,106,.12); color: var(--gj-danger); }
.dashboard-admin-library { padding: 12px; }
.dashboard-admin-libitem {
    display: flex; align-items: center; gap: 8px;
    background: var(--gj-card); border: 1px solid var(--gj-border-hairline);
    border-radius: var(--gj-r-xs); padding: 6px 8px;
}
.dashboard-admin-libitem.disabled { opacity: 0.5; }

/* Pantalla /escaneo · rediseño híbrido (caja + atajos) -------- */
.scan-card-v2 {
    background: #fff;
    border: 2px solid var(--gj-primary);
    border-radius: var(--gj-r);
    padding: 14px 14px 10px;
    margin-bottom: 14px;
    box-shadow: 0 4px 14px rgba(138,186,160,.22);
    transition: box-shadow .15s ease, border-color .15s ease;
}
.scan-card-v2:focus-within { box-shadow: 0 6px 18px rgba(138,186,160,.32); }
.scan-input-row-v2 { display: flex; gap: 8px; align-items: center; }
.scan-input-v2 {
    flex: 1; min-width: 0;
    border: none; outline: none; background: transparent;
    font-size: var(--fs-title2); font-weight: 500; padding: 6px 4px;
    color: var(--gj-fg);
    font-family: 'Consolas', 'SF Mono', monospace;
    letter-spacing: 0.5px;
}
.scan-input-v2::placeholder { color: var(--gj-text-soft); font-weight: 400; font-family: var(--gj-font, 'Segoe UI'); letter-spacing: 0; }
.scan-btn-icon {
    background: var(--gj-surface);
    border: 1px solid var(--gj-border);
    border-radius: var(--gj-r-sm);
    padding: 9px 12px;
    font-size: var(--fs-headline);
    cursor: pointer;
    transition: all .12s;
}
.scan-btn-icon:hover { background: rgba(138,186,160,.12); border-color: var(--gj-primary); }
.scan-btn-icon.ghost { background: transparent; }
.scan-btn-go {
    background: var(--gj-primary); color: #fff; border: none;
    border-radius: var(--gj-r-sm); padding: 9px 16px;
    font-size: var(--fs-title3); font-weight: 700; cursor: pointer;
    min-width: 50px; display: flex; align-items: center; justify-content: center;
}
.scan-btn-go:disabled { opacity: 0.6; cursor: wait; }
.scan-status-row { margin-top: 8px; font-size: var(--fs-caption2); }
.scan-pill {
    display: inline-block; padding: 3px 10px; border-radius: var(--gj-r-sm);
    font-weight: 600; letter-spacing: .3px;
}
.scan-pill.on { background: rgba(138,186,160,.22); color: #1B7A3E; }
.scan-pill.on.accent { background: rgba(252,80,39,.18); color: #9C3A18; animation: scan-pulse 1.5s ease-in-out infinite; }
.scan-pill.off { background: var(--gj-surface); color: var(--gj-text-soft); border: 1px solid var(--gj-border); }
@keyframes scan-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Tarjeta de resultado v2 (más compacta) */
.scan-result-card {
    background: #fff; border: 1px solid var(--gj-border-hairline);
    border-radius: var(--gj-r-sm); overflow: hidden; margin-bottom: 14px;
    box-shadow: var(--gj-shadow-sm);
}
.scan-result-head {
    padding: 12px 16px;
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    border-bottom: 1px solid var(--gj-border-hairline);
}
.scan-result-eyebrow { font-size: var(--fs-caption2); opacity: .8; text-transform: uppercase; letter-spacing: .5px; }
.scan-result-code { font-size: var(--fs-title2); font-weight: 700; font-family: 'Consolas', monospace; margin-top: 2px; }
/* Variantes "humanas": título en grande (descripción/modelo) + código mono en pequeño debajo.
   Patrón usado en /escaneo para que el operario identifique la máquina por nombre, no por código. */
.scan-result-titulo {
    font-size: var(--fs-title2);
    font-weight: 700;
    margin-top: 2px;
    line-height: 1.2;
    letter-spacing: -0.01em;
}
.scan-result-codigo-sub {
    font-size: var(--fs-caption);
    font-family: 'Consolas', monospace;
    margin-top: 2px;
    opacity: 0.7;
    letter-spacing: 0.02em;
}
.scan-result-zone {
    background: rgba(255,255,255,.85); color: var(--gj-fg);
    padding: 4px 10px; border-radius: var(--gj-r); font-size: var(--fs-caption2); font-weight: 700;
    text-transform: uppercase; letter-spacing: .3px;
}
.scan-result-body { padding: 12px 16px; }
.scan-result-row {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 6px 0; font-size: var(--fs-footnote);
    border-bottom: 1px dashed var(--gj-border);
}
.scan-result-row:last-child { border-bottom: none; }
.scan-result-row .lbl { color: var(--gj-fg-muted); font-size: var(--fs-caption); }
.scan-result-row .mono { font-family: 'Consolas', monospace; font-weight: 600; }
.scan-result-actions {
    display: flex; gap: 8px; padding: 10px 16px;
    background: var(--gj-surface); border-top: 1px solid var(--gj-border-hairline);
}
.scan-result-actions .gj-btn { flex: 1; }

/* Historial de escaneos recientes */
.scan-history-card {
    background: #fff; border: 1px solid var(--gj-border-hairline);
    border-radius: var(--gj-r-sm); padding: 12px 14px; margin-bottom: 14px;
}
.scan-history-head {
    display: flex; justify-content: space-between; align-items: center;
    font-size: var(--fs-caption2); color: var(--gj-fg-muted);
    text-transform: uppercase; letter-spacing: .4px; margin-bottom: 8px;
}
.scan-history-clear {
    background: none; border: none; color: var(--gj-blue);
    cursor: pointer; font-size: var(--fs-caption2); text-transform: none; letter-spacing: 0;
    font-weight: 500;
}
.scan-history-clear:hover { text-decoration: underline; }
.scan-history-list { display: flex; flex-wrap: wrap; gap: 6px; }
.scan-history-item {
    background: var(--gj-surface); border: 1px solid var(--gj-border);
    border-radius: var(--gj-r-xs); padding: 6px 10px;
    font-family: 'Consolas', monospace; font-size: var(--fs-footnote);
    cursor: pointer; color: var(--gj-fg);
}
.scan-history-item:hover { background: rgba(138,186,160,.12); border-color: var(--gj-primary); }

/* Atajos de operación cuando no hay código */
.scan-shortcuts {
    background: #fff; border: 1px solid var(--gj-border-hairline);
    border-radius: var(--gj-r-sm); padding: 14px;
}
.scan-shortcuts-title {
    font-size: var(--fs-caption); color: var(--gj-fg-muted);
    text-transform: uppercase; letter-spacing: .4px; margin-bottom: 10px;
}
.scan-shortcuts-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
@media (max-width: 600px) {
    .scan-shortcuts-grid { grid-template-columns: 1fr; }
}
.scan-shortcut {
    background: var(--gj-surface); border: 1px solid var(--gj-border);
    border-radius: var(--gj-r-sm); padding: 14px 12px;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    cursor: pointer; transition: all .12s; text-align: center;
}
.scan-shortcut:hover {
    background: #fff; border-color: var(--gj-primary);
    transform: translateY(0); box-shadow: var(--gj-shadow-sm);
}
.scan-shortcut .ico { font-size: var(--fs-title1); }
.scan-shortcut .lab { font-size: var(--fs-subhead); font-weight: 600; color: var(--gj-fg); }
.scan-shortcut .sub { font-size: var(--fs-caption2); color: var(--gj-fg-soft); }

/* Toggle "¿a dónde va?" (usado en /retiradas) ---------------------- */
.dest-toggle {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.dest-toggle.dest-toggle-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 1000px) { .dest-toggle.dest-toggle-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) {
    .dest-toggle, .dest-toggle.dest-toggle-3 { grid-template-columns: 1fr; }
}

/* Selector de almacén destino para retirada-pendiente */
.dest-alm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.dest-alm-btn {
    display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
    background: var(--gj-zinc-50, #F7F8F8); border: 2px solid var(--gj-border);
    border-radius: var(--gj-r-sm); padding: 12px 16px; cursor: pointer; text-align: left;
}
.dest-alm-btn:hover:not(.active) { border-color: var(--gj-primary); }
.dest-alm-btn.active { background: rgba(138,186,160,.14); border-color: var(--gj-primary); }
.dest-alm-btn strong { font-family: var(--gj-font-mono, 'Consolas'); font-size: var(--fs-callout); }
.dest-alm-btn span { font-size: var(--fs-caption); color: var(--gj-fg-muted); }
.dest-toggle-btn {
    display: flex; align-items: center; gap: 14px; text-align: left;
    background: var(--gj-zinc-50, #F7F8F8);
    border: 2px solid var(--gj-border);
    border-radius: var(--gj-r-sm); padding: 14px 16px; cursor: pointer;
    transition: all .12s;
}
.dest-toggle-btn:hover:not(:disabled):not(.active) {
    border-color: var(--gj-primary); background: rgba(138,186,160,.06);
}
.dest-toggle-btn.active {
    background: rgba(138,186,160,.14); border-color: var(--gj-primary);
    box-shadow: 0 1px 3px rgba(138,186,160,.25);
}
.dest-toggle-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.dest-toggle-ico { font-size: 32px; flex-shrink: 0; }
.dest-toggle-titulo { font-weight: 600; font-size: var(--fs-subhead); color: var(--gj-fg); }
.dest-toggle-sub { font-size: var(--fs-caption); color: var(--gj-fg-muted); margin-top: 2px; }

/* FotoCapture (subir foto desde cámara/galería) --------------------- */
.foto-capture { width: 100%; }
.foto-btn {
    position: relative; display: flex; align-items: center; justify-content: center;
    gap: 10px;
    width: 100%; min-height: 56px;
    background: var(--gj-zinc-50, #F7F8F8);
    border: 1.5px dashed var(--gj-border);
    border-radius: var(--gj-r-sm);
    color: var(--gj-fg-muted);
    font-weight: 500; font-size: var(--fs-subhead);
    cursor: pointer;
    transition: all .12s;
}
.foto-btn:hover { background: rgba(138,186,160,.08); border-color: var(--gj-primary); color: var(--gj-fg); }
.foto-procesando {
    margin-top: 8px; font-size: var(--fs-caption); color: var(--gj-fg-soft); text-align: center;
}
.foto-preview-wrap { display: flex; flex-direction: column; gap: 8px; }
.foto-preview {
    width: 100%; max-height: 320px; object-fit: contain;
    border: 1px solid var(--gj-border); border-radius: var(--gj-r-sm); background: #000;
}
.foto-preview-meta {
    display: flex; justify-content: space-between; align-items: center; font-size: var(--fs-caption);
}
.foto-preview-size { color: var(--gj-fg-soft); font-family: var(--gj-font-mono, 'Consolas', monospace); }
.foto-preview-quitar {
    background: none; border: 1px solid var(--gj-border); padding: 4px 10px;
    border-radius: var(--gj-r-xs); font-size: var(--fs-caption); cursor: pointer; color: var(--gj-fg);
}
.foto-preview-quitar:hover { background: rgba(222,44,106,.08); border-color: var(--gj-danger); color: var(--gj-danger); }

/* /traspasos -------------------------------------------------------- */
.tabs-row { display: flex; gap: 6px; flex-wrap: wrap; }
.tab-btn {
    background: var(--gj-surface); border: 1px solid var(--gj-border);
    border-radius: var(--gj-r-sm); padding: 7px 14px; font-size: var(--fs-footnote); cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
}
.tab-btn.active { background: var(--gj-primary); color: #fff; border-color: transparent; font-weight: 600; }
.tab-btn:hover:not(.active) { background: rgba(138,186,160,.12); }
.tab-pill { background: rgba(255,255,255,.25); padding: 0 7px; border-radius: var(--gj-r-sm); font-size: var(--fs-caption2); font-weight: 700; }
.tab-btn:not(.active) .tab-pill { background: var(--gj-fg-muted); color: #fff; }
.tab-btn .tab-pill.warn { background: var(--gj-accent); color: #fff; }
.tab-btn .tab-pill.info { background: var(--gj-info); color: #fff; }

.traspaso-card { position: relative; transition: all .12s; }
.traspaso-card:hover { transform: translateY(0); box-shadow: var(--gj-shadow-md); border-color: var(--gj-primary); }
.traspaso-card.urgent { border-left: 4px solid var(--gj-accent); }
.traspaso-codigo { font-family: 'Consolas', monospace; font-size: var(--fs-callout); font-weight: 700; }
.traspaso-flow { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: var(--fs-footnote); }
.flow-arrow { color: var(--gj-primary); font-weight: bold; font-size: var(--fs-headline); }
.alm-tag {
    background: var(--gj-surface); border: 1px solid var(--gj-border);
    padding: 3px 10px; border-radius: var(--gj-r-xs); font-family: 'Consolas', monospace; font-weight: 600;
}
.traspaso-motivo { font-size: var(--fs-caption); color: var(--gj-fg-muted); margin-top: 8px; font-style: italic; }
.traspaso-meta { display: flex; gap: 10px; align-items: center; margin-top: 10px; font-size: var(--fs-caption); flex-wrap: wrap; }

/* Timeline detalle */
.trasp-timeline { display: flex; flex-direction: column; gap: 0; padding: 8px 0; }
.trasp-timeline-item {
    display: flex; gap: 14px; padding: 10px 0; position: relative;
    border-left: 2px solid var(--gj-border); margin-left: 16px; padding-left: 22px;
}
.trasp-timeline-item:last-child { border-left: 2px solid transparent; }
.trasp-timeline-item.active { border-left-color: var(--gj-primary); }
.trasp-timeline-dot {
    position: absolute; left: -16px; top: 6px;
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--gj-surface); border: 2px solid var(--gj-border);
    display: flex; align-items: center; justify-content: center; font-size: var(--fs-subhead);
}
.trasp-timeline-item.active .trasp-timeline-dot {
    background: var(--gj-primary); border-color: var(--gj-primary); color: #fff;
}
.trasp-timeline-titulo { font-weight: 600; }
.trasp-timeline-meta { font-size: var(--fs-caption); color: var(--gj-fg-muted); margin-top: 2px; display: flex; gap: 6px; }
.trasp-timeline-extra { font-size: var(--fs-caption); color: var(--gj-danger); margin-top: 4px; font-style: italic; }

/* Filas con discrepancia */
.row-warning { background: rgba(252,80,39,.06); }

/* Modal genérico (reutilizable) ---------------------------------- */
.gj-modal-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 1000;
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.gj-modal {
    background: #fff; border-radius: var(--gj-r-sm); width: 100%; max-width: 600px;
    max-height: 90vh; display: flex; flex-direction: column; box-shadow: var(--gj-shadow-md);
}
.gj-modal-head {
    padding: 14px 18px; border-bottom: 1px solid var(--gj-border);
    display: flex; justify-content: space-between; align-items: center;
}
.gj-modal-head h2 { margin: 0; font-size: var(--fs-callout); }
.gj-modal-close { background: none; border: none; font-size: var(--fs-title3); cursor: pointer; color: var(--gj-fg-muted); }
.gj-modal-close:hover { color: var(--gj-fg); }
.gj-modal-body { padding: 16px 18px; overflow-y: auto; flex: 1; }
.gj-modal-actions {
    padding: 12px 18px; border-top: 1px solid var(--gj-border);
    display: flex; gap: 8px; justify-content: flex-end;
}

/* Líneas dentro de NuevaSolicitudModal */
.lineas-list { display: flex; flex-direction: column; gap: 6px; }
.linea-row { display: flex; gap: 8px; align-items: flex-start; }
.autocomplete-list {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 10;
    background: #fff; border: 1px solid var(--gj-border); border-radius: var(--gj-r-xs);
    box-shadow: var(--gj-shadow-md); max-height: 240px; overflow-y: auto;
}
.autocomplete-item {
    padding: 8px 10px; cursor: pointer; font-size: var(--fs-footnote);
    border-bottom: 1px solid var(--gj-border);
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover { background: rgba(138,186,160,.12); }

/* Placeholder para widgets aún no implementados */
.widget-placeholder {
    background: var(--gj-card);
    border: 1.5px dashed var(--gj-border);
    border-radius: var(--gj-r-lg);
    padding: 16px 18px;
    display: flex;
    gap: 14px;
    align-items: center;
    min-height: 80px;
    opacity: 0.85;
}
.widget-placeholder-icon { font-size: var(--fs-title1); flex-shrink: 0; }
.widget-placeholder-body { display: flex; flex-direction: column; gap: 2px; }
.widget-placeholder-title { font-weight: 600; color: var(--gj-fg); }
.widget-placeholder-sub { font-size: var(--fs-caption); color: var(--gj-fg-soft); }
.kpi-modern {
    background: var(--gj-card);
    border: 1px solid var(--gj-border-hairline);
    border-radius: var(--gj-r-lg);
    padding: 18px 20px 16px;
    box-shadow: var(--gj-shadow-card);
    transition: all var(--gj-t);
}
.kpi-modern:hover {
    transform: translateY(0);
    box-shadow: var(--gj-shadow-card-hover);
    border-color: var(--gj-border);
}
.kpi-modern-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.kpi-modern-head .kpi-icon {
    width: 38px; height: 38px;
    border-radius: var(--gj-r);
    display: flex; align-items: center; justify-content: center;
    font-size: var(--fs-headline);
    margin: 0;
    box-shadow: inset 0 0 0 1px rgba(17,24,39,0.04);
}
.kpi-modern-head .kpi-icon.primary { background: var(--gj-primary-50);  color: var(--gj-primary-700); }
.kpi-modern-head .kpi-icon.accent  { background: var(--gj-accent-50);   color: var(--gj-accent-600); }
.kpi-modern-head .kpi-icon.info    { background: var(--gj-info-50);     color: var(--gj-info-600); }
.kpi-modern-head .kpi-icon.purple  { background: var(--gj-purple-50);   color: var(--gj-purple-600); }
.kpi-modern-head .kpi-icon.warning { background: var(--gj-warning-50);  color: var(--gj-warning-600); }
.kpi-modern-head .kpi-icon.success { background: var(--gj-success-50);  color: #047857; }
.kpi-modern-value {
    font-family: var(--gj-font-display);
    font-size: 34px;
    font-weight: 700;
    color: var(--gj-fg);
    letter-spacing: -0.035em;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
}
.kpi-modern-label {
    font-size: var(--fs-caption);
    color: var(--gj-fg-muted);
    margin-top: 4px;
    letter-spacing: -0.005em;
}
.kpi-pill {
    font-size: var(--fs-caption2);
    font-weight: 600;
    padding: 3px 9px;
    border-radius: var(--gj-r-pill);
    letter-spacing: 0;
    line-height: 1.5;
}
.kpi-pill.ok       { background: var(--gj-success-50); color: #047857; }
.kpi-pill.warn     { background: var(--gj-warning-50); color: var(--gj-warning-600); }
.kpi-pill.neutral  { background: var(--gj-zinc-100);   color: var(--gj-zinc-600); }
.kpi-pill.err      { background: var(--gj-danger-50);  color: var(--gj-danger-600); }
.kpi-spark { width: 70px; height: 24px; opacity: 0.85; }
.kpi-modern-head .kpi-icon.danger { background: var(--gj-danger-50);  color: var(--gj-danger-600); }

/* KPI compactos para la segunda fila ----------------------- */
.kpi-modern.compact {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
}
.kpi-modern.compact .kpi-icon-inline {
    width: 36px;
    height: 36px;
    border-radius: var(--gj-r-sm);
    font-size: var(--fs-headline);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.kpi-modern.compact .kpi-icon-inline.primary { background: var(--gj-primary-50);  color: var(--gj-primary-700); }
.kpi-modern.compact .kpi-icon-inline.accent  { background: var(--gj-accent-50);   color: var(--gj-accent-600); }
.kpi-modern.compact .kpi-icon-inline.info    { background: var(--gj-info-50);     color: var(--gj-info-600); }
.kpi-modern.compact .kpi-icon-inline.purple  { background: var(--gj-purple-50);   color: var(--gj-purple-600); }
.kpi-modern.compact .kpi-icon-inline.warning { background: var(--gj-warning-50);  color: var(--gj-warning-600); }
.kpi-modern-value-sm {
    font-family: var(--gj-font-display);
    font-size: var(--fs-title2);
    font-weight: 700;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}
.kpi-modern.kpi-link {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.kpi-modern.kpi-link:hover { transform: translateY(0); box-shadow: var(--gj-shadow-lg); }

/* Top operarios / Stock por almacén — horizontal bars ----- */
.hbar-list { display: flex; flex-direction: column; gap: 12px; }
.hbar-row { font-size: var(--fs-footnote); }
.hbar-row-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}
.hbar-name {
    font-weight: 550;
    color: var(--gj-fg);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}
.hbar-num {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--gj-fg);
    font-size: var(--fs-subhead);
}
.hbar-bar {
    height: 8px;
    background: var(--gj-zinc-100);
    border-radius: 999px;
    overflow: hidden;
}
.hbar-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.4s ease-out;
}
.hbar-bar-fill.primary { background: linear-gradient(90deg, var(--gj-primary-500), var(--gj-primary-600)); }
.hbar-bar-fill.info    { background: linear-gradient(90deg, var(--gj-info-500, var(--gj-info-600)), var(--gj-info-600)); }
.hbar-bar-fill.danger  { background: linear-gradient(90deg, var(--gj-danger-500, var(--gj-danger-600)), var(--gj-danger-600)); }

/* Stock crítico — lista actionable ------------------------- */
.critico-list { display: flex; flex-direction: column; gap: 14px; }
.critico-row {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 14px;
    align-items: center;
}
.critico-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.critico-code { font-size: var(--fs-caption); color: var(--gj-fg-soft); }
.critico-desc {
    font-size: var(--fs-footnote);
    font-weight: 550;
    color: var(--gj-fg);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.critico-bar-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}
.critico-bar {
    flex: 1;
    height: 10px;
    background: var(--gj-zinc-100);
    border-radius: 999px;
    overflow: hidden;
}
.critico-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gj-danger-500, var(--gj-danger-600)), var(--gj-danger-600));
    border-radius: 999px;
}
.critico-num {
    font-size: var(--fs-footnote);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    min-width: 80px;
    text-align: right;
}
.card-head-link {
    font-size: var(--fs-caption);
    color: var(--gj-primary-700);
    text-decoration: none;
    font-weight: 550;
}
.card-head-link:hover { text-decoration: underline; }

@media (max-width: 700px) {
    .critico-row { grid-template-columns: 1fr; gap: 6px; }
    .critico-bar-wrap { grid-column: 1 / -1; }
}

.kpi-skeleton {
    height: 124px;
    border-radius: var(--gj-r-lg);
    background: linear-gradient(90deg, var(--gj-zinc-100) 0%, var(--gj-zinc-150) 50%, var(--gj-zinc-100) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* CHARTS ROW ---------------------------------------------- */
.home-charts-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 18px;
    margin-bottom: 22px;
}
@media (max-width: 900px) {
    .home-charts-grid { grid-template-columns: 1fr; }
}
.card-head {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 8px;
}
.card-head h2 { margin: 0; font-size: var(--fs-callout); }
.card-head-sub { font-size: var(--fs-caption); color: var(--gj-fg-soft); font-variant-numeric: tabular-nums; }

/* Area chart SVG ------------------------------------------ */
.area-chart {
    position: relative;
    margin-top: 6px;
}
.area-chart svg { display: block; }
.area-chart .area-labels {
    position: relative;
    margin-top: 6px;
    height: 14px;
}
.area-chart .area-label {
    position: absolute;
    transform: translateX(-50%);
    font-size: var(--fs-caption2);
    color: var(--gj-fg-soft);
    font-variant-numeric: tabular-nums;
}

/* Tipo list ----------------------------------------------- */
.tipo-list { display: flex; flex-direction: column; gap: 11px; margin-top: 6px; }
.tipo-row-head {
    display: flex; align-items: center; gap: 8px;
    font-size: var(--fs-caption);
    margin-bottom: 5px;
}
.tipo-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.tipo-name { color: var(--gj-fg); font-weight: 500; flex: 1; }
.tipo-num  { color: var(--gj-fg-muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.tipo-bar  { height: 6px; background: var(--gj-zinc-100); border-radius: 3px; overflow: hidden; }
.tipo-bar-fill { height: 100%; border-radius: 3px; transition: width var(--gj-t); }

/* BOTTOM ROW ---------------------------------------------- */
.home-bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 18px;
}
@media (max-width: 900px) {
    .home-bottom-grid { grid-template-columns: 1fr; }
}

/* Marca list ---------------------------------------------- */
.marca-list { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.marca-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 6px;
    border-bottom: 1px solid var(--gj-border-hairline);
}
.marca-row:last-child { border-bottom: none; }
.marca-id img { height: 22px; max-width: 90px; }
.marca-id .marca-name { font-size: var(--fs-footnote); color: var(--gj-fg-muted); }
.marca-total {
    font-family: var(--gj-font-display);
    font-size: var(--fs-title2);
    font-weight: 700;
    color: var(--gj-fg);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

/* TILES (accesos rápidos) --------------------------------- */
.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}
.tile {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 14px;
    background: var(--gj-zinc-25);
    border: 1px solid var(--gj-border-hairline);
    border-radius: var(--gj-r);
    cursor: pointer;
    text-align: left;
    transition: all var(--gj-t-fast);
    font-family: inherit;
}
.tile:hover {
    background: var(--gj-card);
    border-color: var(--gj-border);
    transform: translateY(0);
    box-shadow: var(--gj-shadow-sm);
}
.tile-icon {
    width: 38px; height: 38px;
    flex-shrink: 0;
    border-radius: var(--gj-r);
    display: flex; align-items: center; justify-content: center;
    font-size: var(--fs-headline);
    box-shadow: inset 0 0 0 1px rgba(17,24,39,0.04);
}
.tile-icon.primary { background: var(--gj-primary-50);  color: var(--gj-primary-700); }
.tile-icon.accent  { background: var(--gj-accent-50);   color: var(--gj-accent-600); }
.tile-icon.info    { background: var(--gj-info-50);     color: var(--gj-info-600); }
.tile-icon.purple  { background: var(--gj-purple-50);   color: var(--gj-purple-600); }
.tile-icon.warning { background: var(--gj-warning-50);  color: var(--gj-warning-600); }
.tile-icon.success { background: var(--gj-success-50);  color: #047857; }
.tile-title { font-size: var(--fs-footnote); font-weight: 600; color: var(--gj-fg); letter-spacing: -0.005em; }
.tile-sub   { font-size: var(--fs-caption); color: var(--gj-fg-muted); margin-top: 1px; }

@media (max-width: 600px) {
    .home-hero { flex-direction: column; gap: 10px; }
    .home-hero-clock { font-size: var(--fs-title2); }
    .home-hero-saludo { font-size: var(--fs-title2); }
}

/* ============================================================
   AUTH PAGE 2025 — Centered card + aurora background
   Estética actual: Vercel / Linear / Stripe — mucho aire,
   gradientes blob animados, glass card, foco en tipografía.
   ============================================================ */
.auth-page {
    position: relative;
    min-height: 100vh;
    background: #FAFBFB;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-family: var(--gj-font);
}

/* Aurora animada: 3 blobs grandes que se mueven lentos */
.auth-aurora {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}
.aurora-blob {
    position: absolute;
    width: 60vmax;
    height: 60vmax;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    will-change: transform;
}
.aurora-blob.a {
    background: radial-gradient(circle, rgba(138,186,160,0.55) 0%, transparent 65%);
    top: -25vmax; left: -20vmax;
    animation: aurora-float-a 22s ease-in-out infinite alternate;
}
.aurora-blob.b {
    background: radial-gradient(circle, rgba(252,80,39,0.18) 0%, transparent 65%);
    bottom: -30vmax; right: -25vmax;
    animation: aurora-float-b 28s ease-in-out infinite alternate;
}
.aurora-blob.c {
    background: radial-gradient(circle, rgba(79,128,104,0.25) 0%, transparent 65%);
    top: 30vh; right: -10vmax;
    width: 40vmax; height: 40vmax;
    animation: aurora-float-c 26s ease-in-out infinite alternate;
}
@keyframes aurora-float-a {
    0%   { transform: translate(0,0) scale(1); }
    100% { transform: translate(8vmax, 4vmax) scale(1.1); }
}
@keyframes aurora-float-b {
    0%   { transform: translate(0,0) scale(1); }
    100% { transform: translate(-6vmax, -3vmax) scale(1.15); }
}
@keyframes aurora-float-c {
    0%   { transform: translate(0,0) scale(1); }
    100% { transform: translate(-4vmax, 6vmax) scale(0.9); }
}

/* Grid sutil de puntos sobre la aurora */
.auth-grid {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 1px 1px, rgba(17,24,39,0.04) 1px, transparent 0);
    background-size: 28px 28px;
    pointer-events: none;
}

/* Shell centrada */
.auth-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    animation: auth-shell-in 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes auth-shell-in {
    0%   { opacity: 0; transform: translateY(12px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Logo arriba */
.auth-brand {
    text-align: center;
}
.auth-brand img {
    height: 34px;
    width: auto;
    /* Logo es blanco — lo invertimos a negro/oscuro para fondo claro */
    filter: brightness(0) saturate(100%);
    opacity: 0.78;
}

/* Card principal — glass mórfica */
.auth-card {
    width: 100%;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    border: 1px solid rgba(17, 24, 39, 0.06);
    border-radius: var(--gj-r-xl);
    padding: 32px 30px 28px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.6) inset,
        0 24px 60px -16px rgba(17, 24, 39, 0.18),
        0 8px 20px -8px rgba(17, 24, 39, 0.1);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Cabecera */
.auth-head { text-align: center; margin-bottom: 4px; }
.auth-head h1 {
    font-family: var(--gj-font-display);
    font-size: var(--fs-title1);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--gj-zinc-900);
    margin: 0 0 4px 0;
    line-height: 1.15;
}
.auth-head p {
    font-size: var(--fs-footnote);
    color: var(--gj-zinc-500);
    margin: 0;
    line-height: 1.5;
}
.auth-badge {
    width: 44px; height: 44px;
    border-radius: var(--gj-r);
    background: var(--gj-primary-50);
    color: var(--gj-primary-700);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: var(--fs-title2);
    margin: 0 auto 12px;
    box-shadow: inset 0 0 0 1px var(--gj-primary-100);
}

/* Campos */
.auth-field { display: flex; flex-direction: column; gap: 5px; }
.auth-field-label-row { display: flex; justify-content: space-between; align-items: center; }
.auth-field label {
    font-size: var(--fs-caption);
    font-weight: 600;
    color: var(--gj-zinc-700);
    letter-spacing: -0.005em;
}
.auth-input-wrap { position: relative; }
.auth-input {
    width: 100%;
    height: 44px;
    border: 1px solid rgba(17, 24, 39, 0.12);
    border-radius: var(--gj-r-sm);
    padding: 0 14px;
    font-size: var(--fs-subhead);
    font-family: var(--gj-font);
    background: white;
    color: var(--gj-zinc-900);
    transition: all 160ms ease;
    outline: none;
}
.auth-input::placeholder { color: var(--gj-zinc-400); }
.auth-input:hover { border-color: rgba(17, 24, 39, 0.2); }
.auth-input:focus {
    border-color: var(--gj-zinc-900);
    box-shadow: 0 0 0 4px rgba(17, 24, 39, 0.08);
}
.auth-input-icon {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px; height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: var(--gj-r-sm);
    font-size: var(--fs-subhead);
    opacity: 0.6;
    transition: all 140ms ease;
}
.auth-input-icon:hover { background: rgba(17, 24, 39, 0.05); opacity: 1; }

/* Error */
.auth-error {
    padding: 9px 12px;
    background: rgba(225, 29, 72, 0.07);
    color: var(--gj-danger-600);
    border-radius: var(--gj-r-sm);
    font-size: var(--fs-footnote);
    font-weight: 500;
    border: 1px solid rgba(225, 29, 72, 0.12);
    animation: auth-shake 0.35s ease;
}
@keyframes auth-shake {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-4px); }
    75%      { transform: translateX(4px); }
}

/* CTA principal */
.auth-cta {
    margin-top: 4px;
    height: 46px;
    border: none;
    border-radius: var(--gj-r-sm);
    background: var(--gj-zinc-900);
    color: white;
    font-size: var(--fs-subhead);
    font-weight: 600;
    letter-spacing: -0.005em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 160ms ease;
    font-family: var(--gj-font);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.15) inset;
}
.auth-cta:hover:not(:disabled) {
    background: black;
    transform: translateY(0);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.15) inset,
        0 8px 22px -6px rgba(17, 24, 39, 0.4);
}
.auth-cta:active:not(:disabled) { transform: translateY(0); }
.auth-cta:disabled { opacity: 0.55; cursor: not-allowed; }
.auth-cta .arrow { transition: transform 180ms ease; }
.auth-cta:hover:not(:disabled) .arrow { transform: translateX(4px); }
.auth-cta .spinner {
    width: 15px; height: 15px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.auth-back {
    margin-top: 4px;
    height: 38px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--gj-zinc-500);
    font-size: var(--fs-caption);
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--gj-r-sm);
    transition: all 140ms ease;
    font-family: var(--gj-font);
}
.auth-back:hover {
    background: rgba(17, 24, 39, 0.04);
    color: var(--gj-zinc-900);
}

/* Bloque de ayuda (dev hints) */
.auth-help {
    margin-top: 6px;
    padding: 10px 12px;
    background: rgba(17, 24, 39, 0.03);
    border: 1px dashed rgba(17, 24, 39, 0.08);
    border-radius: var(--gj-r-sm);
    font-size: var(--fs-caption);
    color: var(--gj-zinc-500);
    line-height: 1.5;
}
.auth-help code {
    background: white;
    border: 1px solid rgba(17, 24, 39, 0.1);
    border-radius: 4px;
    padding: 1px 6px;
    font-family: var(--gj-font-mono);
    font-size: var(--fs-caption2);
    color: var(--gj-zinc-700);
}

/* Footer minimal */
.auth-foot {
    font-size: var(--fs-caption);
    color: var(--gj-zinc-400);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}
.auth-foot strong { color: var(--gj-zinc-600); font-weight: 600; }
.auth-foot-dot { opacity: 0.5; }
.auth-foot-version { font-family: var(--gj-font-mono); font-size: var(--fs-caption2); }

@media (max-width: 480px) {
    .auth-shell { padding: 24px 18px; }
    .auth-card { padding: 26px 22px 22px; border-radius: var(--gj-r-xl); }
    .auth-head h1 { font-size: var(--fs-title2); }
}

/* ============================================================
   LOGIN 2025 — split layout (DEPRECATED, mantengo por compat)
   ============================================================ */
.login-shell {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    min-height: 100vh;
    background: var(--gj-zinc-25);
}
@media (max-width: 960px) {
    .login-shell { grid-template-columns: 1fr; }
    .login-hero { display: none !important; }
}

/* ---- HERO IZQUIERDO --------------------------------------- */
.login-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px;
    color: white;
    isolation: isolate;
}
.login-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(at 100% 0%, rgba(138,186,160,0.4) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(252,80,39,0.18) 0px, transparent 55%),
        linear-gradient(135deg, #2D4F40 0%, #3A6450 35%, #4F8068 100%);
    z-index: -2;
}
.login-hero-grain {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 1px 1px, rgba(255,255,255,0.06) 1px, transparent 0);
    background-size: 22px 22px;
    z-index: -1;
    opacity: 0.7;
}
.login-hero::before {
    content: '';
    position: absolute;
    width: 520px; height: 520px;
    right: -180px; top: -180px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 60%);
    border-radius: 50%;
    z-index: -1;
}
.login-hero-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 460px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}
.login-brand img {
    height: 36px;
    /* El PNG es blanco, no necesita invert. Ajuste leve para que se vea limpio. */
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.25));
    opacity: 0.98;
}
.login-hero-claim h1 {
    font-family: var(--gj-font-display);
    font-size: 38px;
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.03em;
    color: white;
    margin: 0 0 14px 0;
}
.login-hero-claim p {
    font-size: var(--fs-callout);
    line-height: 1.65;
    color: rgba(255,255,255,0.78);
    margin: 0;
    max-width: 420px;
}
.login-hero-marcas {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
.marca-card {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(8px);
    border-radius: var(--gj-r);
    padding: 14px 22px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px -8px rgba(0,0,0,0.35), inset 0 0 0 1px rgba(255,255,255,0.4);
    transition: transform var(--gj-t), box-shadow var(--gj-t);
}
.marca-card:hover {
    transform: translateY(0);
    box-shadow: 0 14px 30px -10px rgba(0,0,0,0.45), inset 0 0 0 1px rgba(255,255,255,0.5);
}
.marca-card img {
    height: 28px;
    width: auto;
    max-width: 130px;
    display: block;
}
.login-hero-foot {
    margin-top: auto;
    font-size: var(--fs-caption);
    color: rgba(255,255,255,0.6);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.01em;
}
.login-hero-foot .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 0 4px rgba(74,222,128,0.18);
    animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(74,222,128,0.18); }
    50%      { box-shadow: 0 0 0 8px rgba(74,222,128,0.05); }
}

/* ---- PANEL FORMULARIO ------------------------------------- */
.login-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 28px;
    background: var(--gj-zinc-25);
}
.login-form-card {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.login-step-head {
    margin-bottom: 6px;
}
.login-step-head .step-eyebrow {
    font-size: var(--fs-caption);
    color: var(--gj-primary-600);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
    margin-bottom: 8px;
}
.login-step-head h2 {
    margin: 0 0 8px 0;
    font-size: var(--fs-title1);
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--gj-fg);
    line-height: 1.15;
}
.login-step-head p {
    margin: 0;
    color: var(--gj-fg-muted);
    font-size: var(--fs-footnote);
    line-height: 1.55;
}
.login-step-head .otp-badge {
    width: 48px; height: 48px;
    border-radius: var(--gj-r);
    background: var(--gj-primary-50);
    color: var(--gj-primary-700);
    display: flex; align-items: center; justify-content: center;
    font-size: var(--fs-title2);
    margin-bottom: 12px;
    box-shadow: inset 0 0 0 1px var(--gj-primary-100);
}

/* Campos del formulario ------------------------------------- */
.login-field { display: flex; flex-direction: column; gap: 6px; }
.login-field label {
    font-size: var(--fs-caption);
    font-weight: 600;
    color: var(--gj-zinc-700);
    letter-spacing: -0.005em;
}
.login-input-wrap { position: relative; }
.login-input {
    width: 100%;
    height: 46px;
    border: 1.5px solid var(--gj-zinc-200);
    border-radius: var(--gj-r);
    padding: 0 16px;
    font-size: var(--fs-subhead);
    font-family: var(--gj-font);
    background: white;
    color: var(--gj-fg);
    transition: all var(--gj-t-fast);
    outline: none;
}
.login-input::placeholder { color: var(--gj-zinc-400); }
.login-input:hover { border-color: var(--gj-zinc-300); }
.login-input:focus {
    border-color: var(--gj-primary-500);
    box-shadow: var(--gj-shadow-focus);
}
.login-input-icon {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: var(--gj-r-sm);
    font-size: var(--fs-callout);
    opacity: 0.7;
    transition: all var(--gj-t-fast);
}
.login-input-icon:hover { background: var(--gj-zinc-100); opacity: 1; }

/* Error inline ---------------------------------------------- */
.login-error {
    padding: 10px 14px;
    background: var(--gj-danger-50);
    color: var(--gj-danger-600);
    border-radius: var(--gj-r-sm);
    font-size: var(--fs-footnote);
    font-weight: 500;
    border: 1px solid var(--gj-danger-100);
    animation: shake 0.3s;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-4px); }
    75%      { transform: translateX(4px); }
}

/* Botón principal ------------------------------------------- */
.login-cta {
    height: 50px;
    border: none;
    border-radius: var(--gj-r);
    background: var(--gj-primary-grad);
    color: white;
    font-size: var(--fs-subhead);
    font-weight: 600;
    letter-spacing: -0.005em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px -2px rgba(79,128,104,0.4), inset 0 1px 0 rgba(255,255,255,0.15);
    transition: all var(--gj-t-fast);
    margin-top: 6px;
    font-family: var(--gj-font);
}
.login-cta:hover:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 8px 22px -4px rgba(79,128,104,0.55), inset 0 1px 0 rgba(255,255,255,0.2);
}
.login-cta:active:not(:disabled) { transform: translateY(0); }
.login-cta:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}
.login-cta .arrow { transition: transform var(--gj-t-fast); }
.login-cta:hover:not(:disabled) .arrow { transform: translateX(4px); }
.login-cta .spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.login-back {
    height: 42px;
    background: transparent;
    border: 1px solid var(--gj-zinc-200);
    border-radius: var(--gj-r);
    color: var(--gj-fg-muted);
    font-size: var(--fs-footnote);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--gj-t-fast);
    font-family: var(--gj-font);
}
.login-back:hover {
    background: var(--gj-zinc-50);
    color: var(--gj-fg);
    border-color: var(--gj-zinc-300);
}

/* Help box -------------------------------------------------- */
.login-help {
    margin-top: 8px;
    padding: 12px 14px;
    background: var(--gj-zinc-50);
    border: 1px dashed var(--gj-zinc-200);
    border-radius: var(--gj-r-sm);
    font-size: var(--fs-caption);
    color: var(--gj-fg-muted);
    line-height: 1.55;
}
.login-help code {
    background: white;
    border: 1px solid var(--gj-border);
    border-radius: 4px;
    padding: 1px 6px;
    font-family: var(--gj-font-mono);
    font-size: var(--fs-caption2);
    color: var(--gj-primary-700);
}

/* OTP boxes (6 dígitos) ------------------------------------- */
.otp-input-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-top: 4px;
}
.otp-box {
    aspect-ratio: 1 / 1.15;
    border: 1.5px solid var(--gj-zinc-200);
    border-radius: var(--gj-r);
    background: white;
    text-align: center;
    font-size: var(--fs-title2);
    font-weight: 700;
    color: var(--gj-fg);
    font-family: var(--gj-font-mono);
    outline: none;
    transition: all var(--gj-t-fast);
    width: 100%;
    min-width: 0;
    padding: 0;
}
.otp-box:focus {
    border-color: var(--gj-primary-500);
    box-shadow: var(--gj-shadow-focus);
    transform: scale(1.04);
}

@media (max-width: 600px) {
    .login-form-panel { padding: 28px 20px; }
    .login-step-head h2 { font-size: var(--fs-title2); }
    .otp-box { font-size: var(--fs-headline); }
}

/* Push approval — número grande que el user toca en el móvil --------- */
.push-number-box {
    background: linear-gradient(135deg, var(--gj-primary-50) 0%, white 100%);
    border: 1.5px solid var(--gj-primary-100);
    border-radius: var(--gj-r-lg);
    padding: 26px 22px 22px;
    text-align: center;
    box-shadow: var(--gj-shadow-sm);
}
.push-number-label {
    font-size: var(--fs-caption2);
    font-weight: 700;
    color: var(--gj-primary-700);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    margin-bottom: 14px;
}
.push-number {
    font-family: var(--gj-font-display);
    font-size: 76px;
    font-weight: 800;
    color: var(--gj-primary-700);
    letter-spacing: -0.05em;
    line-height: 1;
    margin-bottom: 18px;
    font-variant-numeric: tabular-nums;
    animation: bounceIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes bounceIn {
    0%   { opacity: 0; transform: scale(0.4); }
    100% { opacity: 1; transform: scale(1); }
}
.push-timer {
    height: 5px;
    background: var(--gj-zinc-150);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 7px;
}
.push-timer-bar {
    height: 100%;
    background: var(--gj-primary-grad);
    border-radius: 999px;
    transition: width 1s linear;
}
.push-timer-text {
    font-size: var(--fs-caption);
    color: var(--gj-fg-muted);
    font-variant-numeric: tabular-nums;
}

/* ============================================================
   APROBACIÓN MÓVIL (/aprobar/{id})
   ============================================================ */
.approval-shell {
    min-height: 100vh;
    background: var(--gj-zinc-25);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}
.approval-card {
    background: white;
    border: 1px solid var(--gj-border-hairline);
    border-radius: var(--gj-r-xl);
    padding: 28px 22px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--gj-shadow-lg);
}
.approval-head { text-align: center; margin-bottom: 22px; }
.approval-badge {
    width: 64px; height: 64px;
    border-radius: var(--gj-r-lg);
    background: var(--gj-primary-50);
    color: var(--gj-primary-700);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 32px;
    margin-bottom: 16px;
    box-shadow: inset 0 0 0 1px var(--gj-primary-100);
}
.approval-head h2 {
    font-size: var(--fs-title2);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 8px 0;
    color: var(--gj-fg);
}
.approval-head p {
    font-size: var(--fs-footnote);
    color: var(--gj-fg-muted);
    line-height: 1.5;
    margin: 0;
}
.approval-meta {
    background: var(--gj-zinc-50);
    border: 1px solid var(--gj-border-hairline);
    border-radius: var(--gj-r-sm);
    padding: 12px 14px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.approval-meta-row {
    display: flex; justify-content: space-between; align-items: center;
    font-size: var(--fs-caption);
    color: var(--gj-fg-muted);
}
.approval-meta-row strong { color: var(--gj-fg); font-weight: 600; }
.approval-meta-row code {
    background: white;
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid var(--gj-border);
    font-family: var(--gj-font-mono);
    font-size: var(--fs-caption2);
    color: var(--gj-zinc-700);
}
.approval-choices {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 14px;
}
.approval-choice {
    aspect-ratio: 1 / 1;
    font-family: var(--gj-font-display);
    font-size: 36px;
    font-weight: 700;
    color: var(--gj-fg);
    background: white;
    border: 2px solid var(--gj-zinc-200);
    border-radius: var(--gj-r);
    cursor: pointer;
    transition: all var(--gj-t-fast);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}
.approval-choice:hover:not(:disabled),
.approval-choice:active:not(:disabled) {
    border-color: var(--gj-primary-500);
    background: var(--gj-primary-50);
    color: var(--gj-primary-700);
    transform: scale(1.04);
    box-shadow: 0 6px 20px -6px var(--gj-primary-ring);
}
.approval-choice:disabled { opacity: 0.5; cursor: not-allowed; }
.approval-deny {
    width: 100%;
    height: 44px;
    background: transparent;
    border: 1px solid var(--gj-danger-100);
    color: var(--gj-danger-600);
    border-radius: var(--gj-r);
    font-size: var(--fs-footnote);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--gj-t-fast);
    font-family: var(--gj-font);
}
.approval-deny:hover:not(:disabled) {
    background: var(--gj-danger-50);
}

/* Resultado / skeleton ------------------------------------- */
.approval-skel, .approval-result {
    text-align: center;
    padding: 30px 14px;
}
.approval-skel p, .approval-result p {
    color: var(--gj-fg-muted);
    font-size: var(--fs-subhead);
    margin: 12px 0 22px;
    line-height: 1.55;
}
.approval-result h2 {
    margin: 16px 0 4px;
    font-size: var(--fs-title2);
    font-weight: 700;
    letter-spacing: -0.02em;
}
.approval-icon {
    width: 72px; height: 72px;
    border-radius: var(--gj-r-lg);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 36px;
    box-shadow: inset 0 0 0 1.5px rgba(17,24,39,0.04);
}
.approval-icon.ok    { background: var(--gj-success-50); color: #047857; }
.approval-icon.err   { background: var(--gj-danger-50);  color: var(--gj-danger-600); }
.approval-icon.warn  { background: var(--gj-warning-50); color: var(--gj-warning-600); }
.approval-go-home {
    display: inline-block;
    padding: 10px 18px;
    background: var(--gj-primary-grad);
    color: white;
    border-radius: var(--gj-r);
    text-decoration: none;
    font-weight: 600;
    font-size: var(--fs-footnote);
    box-shadow: 0 4px 14px -2px rgba(79,128,104,0.4);
    transition: transform var(--gj-t-fast);
}
.approval-go-home:hover { transform: translateY(0); color: white; }
.spinner.big {
    width: 36px; height: 36px;
    border-width: 3px;
    border-color: var(--gj-zinc-200);
    border-top-color: var(--gj-primary-500);
    border-radius: 50%;
    display: inline-block;
    border-style: solid;
    animation: spin 0.8s linear infinite;
}

/* ============================================================
   TRAZABILIDAD — Cabecera + Timeline
   ============================================================ */
.traza-search { display: flex; gap: 10px; align-items: center; }
.traza-search .gj-input { flex: 1; }

.traza-header { padding: 0; overflow: hidden; }
.traza-header-main {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px 26px 18px;
    border-bottom: 1px solid var(--gj-border-hairline);
}
.traza-header-icon {
    width: 64px; height: 64px;
    border-radius: var(--gj-r-lg);
    background: var(--gj-primary-50);
    color: var(--gj-primary-700);
    display: flex; align-items: center; justify-content: center;
    font-size: var(--fs-title1);
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px var(--gj-primary-100);
}
.traza-header-info { flex: 1; min-width: 0; }
/* Título humano: lo primero que ve el operario al escanear (descripción + modelo).
   Más grande que el código porque identificamos la máquina por nombre, no por número. */
.traza-titulo-humano {
    font-size: var(--fs-title2);
    font-weight: 700;
    color: var(--gj-fg);
    line-height: 1.2;
    letter-spacing: -0.01em;
}
/* Código de unidad: secundario, mono, debajo del título. */
.traza-codigo-unidad {
    font-family: var(--gj-font-mono);
    font-size: var(--fs-footnote);
    color: var(--gj-fg-soft);
    margin-top: 4px;
    letter-spacing: 0.02em;
}
/* Clases antiguas conservadas por si alguna pantalla todavía las usa. */
.traza-codigo {
    font-family: var(--gj-font-mono);
    font-size: var(--fs-title2);
    font-weight: 700;
    color: var(--gj-fg);
    letter-spacing: -0.01em;
    line-height: 1;
}
.traza-descripcion {
    font-size: var(--fs-subhead);
    color: var(--gj-fg);
    margin-top: 4px;
    font-weight: 500;
}
.traza-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 18px;
    margin-top: 8px;
    font-size: var(--fs-caption);
    color: var(--gj-fg-muted);
}
.traza-meta-item strong {
    color: var(--gj-zinc-700);
    font-weight: 600;
    margin-right: 4px;
}
.traza-meta code {
    background: var(--gj-zinc-50);
    border: 1px solid var(--gj-border);
    border-radius: 4px;
    padding: 1px 6px;
    font-family: var(--gj-font-mono);
    font-size: var(--fs-caption2);
    color: var(--gj-zinc-700);
}
.traza-header-state { flex-shrink: 0; }
.traza-state-pill {
    display: inline-block;
    padding: 6px 14px;
    border-radius: var(--gj-r-pill);
    font-size: var(--fs-caption);
    font-weight: 700;
    letter-spacing: 0.04em;
}
.traza-state-pill.state-primary { background: var(--gj-primary-50);  color: var(--gj-primary-700); }
.traza-state-pill.state-success { background: var(--gj-success-50);  color: #047857; }
.traza-state-pill.state-info    { background: var(--gj-info-50);     color: var(--gj-info-600); }
.traza-state-pill.state-warning { background: var(--gj-warning-50);  color: var(--gj-warning-600); }
.traza-state-pill.state-danger  { background: var(--gj-danger-50);   color: var(--gj-danger-600); }
.traza-state-pill.state-muted   { background: var(--gj-zinc-100);    color: var(--gj-zinc-600); }

.traza-header-where {
    background: var(--gj-zinc-25);
    padding: 14px 26px 18px;
}
.traza-where-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--fs-footnote);
    color: var(--gj-fg);
    margin-bottom: 12px;
}
.traza-where-row strong { color: var(--gj-fg); font-weight: 600; }
.traza-where-row code {
    background: white;
    border: 1px solid var(--gj-border);
    border-radius: 4px;
    padding: 1px 6px;
    font-family: var(--gj-font-mono);
    font-size: var(--fs-caption2);
    color: var(--gj-zinc-700);
    margin-left: 4px;
}

.traza-where-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
}
.traza-stat {
    background: white;
    border: 1px solid var(--gj-border-hairline);
    border-radius: var(--gj-r);
    padding: 10px 14px;
    text-align: center;
}
.traza-stat-value {
    font-family: var(--gj-font-display);
    font-size: var(--fs-title2);
    font-weight: 700;
    color: var(--gj-fg);
    letter-spacing: -0.025em;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.traza-stat-label {
    font-size: var(--fs-caption2);
    color: var(--gj-fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 4px;
    font-weight: 600;
}

/* Timeline ------------------------------------------------- */
.traza-timeline {
    position: relative;
    margin-left: 20px;
    padding-left: 26px;
}
.traza-timeline::before {
    content: '';
    position: absolute;
    left: 17px; top: 0; bottom: 0;
    width: 2px;
    background: linear-gradient(
        to bottom,
        var(--gj-border) 0%,
        var(--gj-border) calc(100% - 60px),
        transparent 100%);
    z-index: 0;
}
.traza-day-sep {
    font-size: var(--fs-caption);
    font-weight: 700;
    color: var(--gj-fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    /* Sin margen negativo: el contenedor ya tiene padding-left para alojar los
       markers, así el día queda alineado con el cuerpo de los eventos. */
    margin: 18px 0 10px 0;
    padding-left: 6px;
}
.traza-day-sep:first-child { margin-top: 0; }
.traza-event {
    position: relative;
    display: flex;
    gap: 14px;
    padding-bottom: 18px;
}
.traza-event-marker {
    position: absolute;
    left: -34px;
    top: 0;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--gj-border);
    display: flex; align-items: center; justify-content: center;
    font-size: var(--fs-callout);
    z-index: 1;
    box-shadow: 0 0 0 4px var(--gj-bg);
}
.traza-event-marker.color-primary { border-color: var(--gj-primary-500); background: var(--gj-primary-50); }
.traza-event-marker.color-info    { border-color: var(--gj-info-600);    background: var(--gj-info-50); }
.traza-event-marker.color-accent  { border-color: var(--gj-accent-600);  background: var(--gj-accent-50); }
.traza-event-marker.color-purple  { border-color: var(--gj-purple-600);  background: var(--gj-purple-50); }
.traza-event-marker.color-warning { border-color: var(--gj-warning-600); background: var(--gj-warning-50); }
.traza-event-marker.color-success { border-color: #047857;               background: var(--gj-success-50); }
.traza-event-marker.color-danger  { border-color: var(--gj-danger-600);  background: var(--gj-danger-50); }
.traza-event-marker.color-muted   { border-color: var(--gj-zinc-300);    background: var(--gj-zinc-50); }

.traza-event-body {
    flex: 1;
    background: var(--gj-card);
    border: 1px solid var(--gj-border-hairline);
    border-radius: var(--gj-r);
    padding: 12px 16px;
    box-shadow: var(--gj-shadow-xs);
    transition: box-shadow var(--gj-t-fast);
}
.traza-event:hover .traza-event-body {
    box-shadow: var(--gj-shadow-sm);
    border-color: var(--gj-border);
}
.traza-event-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
}
.traza-event-titulo {
    font-size: var(--fs-subhead);
    font-weight: 600;
    color: var(--gj-fg);
    letter-spacing: -0.005em;
}
.traza-event-hora {
    font-family: var(--gj-font-mono);
    font-size: var(--fs-caption);
    color: var(--gj-fg-muted);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}
.traza-event-detalle {
    font-size: var(--fs-caption);
    color: var(--gj-fg-muted);
    margin-top: 4px;
    line-height: 1.5;
}
.traza-event-obs {
    font-size: var(--fs-caption);
    color: var(--gj-zinc-700);
    margin-top: 6px;
    padding: 6px 10px;
    background: var(--gj-zinc-50);
    border-radius: var(--gj-r-sm);
    border-left: 2px solid var(--gj-zinc-300);
}
.traza-event-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    font-size: var(--fs-caption);
}
.traza-event-user { color: var(--gj-fg-soft); }
.traza-event-link {
    color: var(--gj-primary-600);
    font-weight: 600;
    text-decoration: none;
}
.traza-event-link:hover { color: var(--gj-primary-700); text-decoration: underline; }

@media (max-width: 600px) {
    .traza-header-main { flex-wrap: wrap; }
    .traza-header-state { width: 100%; }
    .traza-where-stats { grid-template-columns: 1fr 1fr; }
    .traza-timeline { margin-left: 14px; padding-left: 22px; }
    .traza-event-marker { left: -30px; width: 32px; height: 32px; font-size: var(--fs-subhead); }
}

/* ============================================================
   PANEL COORDINADOR — Métricas de equipo
   ============================================================ */
.coord-periodo-tabs {
    display: inline-flex;
    background: var(--gj-zinc-100);
    border-radius: var(--gj-r);
    padding: 3px;
}
.coord-periodo-tabs button {
    background: transparent;
    border: none;
    padding: 6px 14px;
    border-radius: var(--gj-r-sm);
    font-size: var(--fs-caption);
    font-weight: 600;
    color: var(--gj-fg-muted);
    cursor: pointer;
    transition: all var(--gj-t-fast);
    font-family: inherit;
}
.coord-periodo-tabs button:hover { color: var(--gj-fg); }
.coord-periodo-tabs button.active {
    background: white;
    color: var(--gj-primary-700);
    box-shadow: var(--gj-shadow-xs);
}

.coord-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.coord-kpi-prev {
    font-size: var(--fs-caption2);
    color: var(--gj-fg-soft);
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
}

.coord-charts-grid {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 16px;
}
@media (max-width: 900px) {
    .coord-charts-grid { grid-template-columns: 1fr; }
}

/* Barras de alertas creadas vs resueltas */
.alertas-bars {
    display: flex;
    align-items: flex-end;
    height: 160px;
    gap: 8px;
    margin-top: 16px;
    padding: 0 4px;
}
.alertas-bar-day {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    gap: 4px;
}
.alertas-bar-grp {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    padding: 0 2px;
}
.alertas-bar {
    flex: 1;
    border-radius: 4px 4px 0 0;
    min-height: 2px;
    transition: height 0.3s ease;
    cursor: help;
}
.alertas-bar.creadas   { background: var(--gj-warning); }
.alertas-bar.resueltas { background: #10B981; }
.alertas-bar-label {
    font-size: var(--fs-caption2);
    color: var(--gj-fg-soft);
    font-variant-numeric: tabular-nums;
}
.alertas-bars-legend {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-top: 14px;
    font-size: var(--fs-caption);
    color: var(--gj-fg-muted);
}
.alertas-bars-legend .dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle;
}

/* Métricas pequeñas */
.coord-metric-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-top: 16px;
}
.coord-metric {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px !important;
}
.coord-metric-icon {
    width: 44px; height: 44px;
    background: var(--gj-primary-50);
    color: var(--gj-primary-700);
    border-radius: var(--gj-r);
    display: flex; align-items: center; justify-content: center;
    font-size: var(--fs-title3);
    flex-shrink: 0;
}
.coord-metric-value {
    font-family: var(--gj-font-display);
    font-size: var(--fs-title2);
    font-weight: 700;
    color: var(--gj-fg);
    letter-spacing: -0.02em;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.coord-metric-label {
    font-size: var(--fs-caption);
    color: var(--gj-fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 3px;
    font-weight: 600;
}

/* ============================================================
   HISTÓRICO DE NOTIFICACIONES (página /notificaciones)
   ============================================================ */
.notif-historial-list { display: flex; flex-direction: column; gap: 8px; }
.notif-historial-day-sep {
    font-size: var(--fs-caption2);
    font-weight: 700;
    color: var(--gj-fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 18px 4px 4px;
}
.notif-historial-day-sep:first-child { margin-top: 0; }

.notif-historial-item {
    display: flex;
    gap: 12px;
    background: var(--gj-card);
    border: 1px solid var(--gj-border-hairline);
    border-radius: var(--gj-r);
    padding: 12px 16px;
    box-shadow: var(--gj-shadow-xs);
    transition: all var(--gj-t-fast);
    position: relative;
}
.notif-historial-item:hover {
    box-shadow: var(--gj-shadow-sm);
    border-color: var(--gj-border);
}
.notif-historial-item.unread {
    background: linear-gradient(90deg, var(--gj-primary-50) 0%, var(--gj-card) 70%);
    border-color: var(--gj-primary-100);
}
.notif-historial-item.unread::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--gj-primary-500);
    border-radius: var(--gj-r) 0 0 var(--gj-r);
}
.notif-historial-body { flex: 1; min-width: 0; }
.notif-historial-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 4px;
}
.notif-historial-time {
    font-size: var(--fs-caption2);
    color: var(--gj-fg-soft);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .notif-historial-item { padding: 10px 14px; }
    .notif-historial-head { flex-direction: column; gap: 2px; }
}

/* ============================================================
   ALERTAS — Lista con prioridad visual
   ============================================================ */
.alertas-filters {
    display: flex;
    gap: 26px;
    align-items: center;
    flex-wrap: wrap;
}
.filter-group { display: flex; gap: 6px; align-items: center; }
.filter-label {
    font-size: var(--fs-caption2);
    font-weight: 700;
    color: var(--gj-fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-right: 4px;
}

.alertas-list { display: flex; flex-direction: column; gap: 10px; }
.alerta-card {
    display: flex;
    gap: 14px;
    background: var(--gj-card);
    border: 1px solid var(--gj-border-hairline);
    border-radius: var(--gj-r);
    padding: 14px 18px;
    box-shadow: var(--gj-shadow-sm);
    transition: all var(--gj-t-fast);
    border-left-width: 4px;
}
.alerta-card:hover { box-shadow: var(--gj-shadow-md); }
.alerta-card.is-selected {
    background: var(--gj-primary-50);
    border-color: var(--gj-primary-300);
    box-shadow: 0 0 0 1px var(--gj-primary-300), var(--gj-shadow-sm);
}
.alerta-check {
    display: flex;
    align-items: center;
    padding-top: 4px;
    flex-shrink: 0;
}
.alerta-check input[type="checkbox"] {
    width: 18px; height: 18px;
    accent-color: var(--gj-primary-600);
    cursor: pointer;
}

/* ─── Barra de acciones en lote (sticky arriba) ─── */
.bulk-bar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--gj-card);
    border: 1px solid var(--gj-border-hairline);
    border-radius: var(--gj-r);
    margin-bottom: 10px;
    transition: all var(--gj-t);
    box-shadow: var(--gj-shadow-xs);
}
.bulk-bar.active {
    background: linear-gradient(90deg, var(--gj-primary-50) 0%, var(--gj-card) 100%);
    border-color: var(--gj-primary-300);
    box-shadow: 0 4px 14px -4px var(--gj-primary-ring), var(--gj-shadow-sm);
}
.bulk-check-all {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: var(--fs-footnote);
    font-weight: 600;
    color: var(--gj-fg);
    user-select: none;
}
.bulk-check-all input[type="checkbox"] {
    width: 18px; height: 18px;
    accent-color: var(--gj-primary-600);
    cursor: pointer;
}
.bulk-bar.active .bulk-check-all { color: var(--gj-primary-700); }
.bulk-bar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    animation: bulk-bar-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes bulk-bar-in {
    0%   { opacity: 0; transform: translateX(8px); }
    100% { opacity: 1; transform: translateX(0); }
}

@media (max-width: 600px) {
    .bulk-bar { flex-direction: column; align-items: stretch; }
    .bulk-bar-actions { justify-content: flex-end; flex-wrap: wrap; }
}
.alerta-card.alerta-nivel-critico { border-left-color: var(--gj-danger);  }
.alerta-card.alerta-nivel-error   { border-left-color: var(--gj-danger);  }
.alerta-card.alerta-nivel-aviso   { border-left-color: var(--gj-warning); }
.alerta-card.alerta-nivel-info    { border-left-color: var(--gj-info);    }

.alerta-icon {
    flex-shrink: 0;
    width: 40px; height: 40px;
    border-radius: var(--gj-r);
    background: var(--gj-zinc-50);
    display: flex; align-items: center; justify-content: center;
    font-size: var(--fs-title3);
}
.alerta-card.alerta-nivel-critico .alerta-icon,
.alerta-card.alerta-nivel-error   .alerta-icon { background: var(--gj-danger-50);  color: var(--gj-danger-600); }
.alerta-card.alerta-nivel-aviso   .alerta-icon { background: var(--gj-warning-50); color: var(--gj-warning-600); }
.alerta-card.alerta-nivel-info    .alerta-icon { background: var(--gj-info-50);    color: var(--gj-info-600); }

.alerta-body { flex: 1; min-width: 0; }
.alerta-head {
    display: flex; align-items: center; gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.alerta-titulo {
    font-size: var(--fs-subhead);
    font-weight: 650;
    color: var(--gj-fg);
    letter-spacing: -0.005em;
}
.alerta-nivel-pill {
    font-size: var(--fs-caption2);
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--gj-r-pill);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.alerta-nivel-pill.nivel-critico,
.alerta-nivel-pill.nivel-error { background: var(--gj-danger-50);  color: var(--gj-danger-600); }
.alerta-nivel-pill.nivel-aviso { background: var(--gj-warning-50); color: var(--gj-warning-600); }
.alerta-nivel-pill.nivel-info  { background: var(--gj-info-50);    color: var(--gj-info-600); }

.alerta-tipo {
    font-size: var(--fs-caption2);
    background: var(--gj-zinc-100);
    color: var(--gj-zinc-600);
    padding: 2px 8px;
    border-radius: var(--gj-r-pill);
    font-family: var(--gj-font-mono);
}
.alerta-mensaje { font-size: var(--fs-footnote); color: var(--gj-fg-muted); line-height: 1.5; margin-bottom: 6px; }
.alerta-meta {
    display: flex; flex-wrap: wrap; gap: 8px 16px;
    font-size: var(--fs-caption);
    color: var(--gj-fg-soft);
    margin-top: 6px;
}
.alerta-meta code {
    background: var(--gj-zinc-50);
    border: 1px solid var(--gj-border);
    padding: 1px 6px;
    border-radius: 4px;
    font-family: var(--gj-font-mono);
    font-size: var(--fs-caption2);
    color: var(--gj-zinc-700);
}
.alerta-meta a { color: var(--gj-primary-600); }
.alerta-meta a:hover { color: var(--gj-primary-700); text-decoration: underline; }
.alerta-obs {
    margin-top: 8px;
    font-size: var(--fs-caption);
    color: var(--gj-zinc-700);
    background: var(--gj-zinc-50);
    border-left: 2px solid var(--gj-zinc-300);
    padding: 6px 10px;
    border-radius: var(--gj-r-sm);
}

.alerta-ubicar-form {
    margin-top: 12px;
    padding: 12px 14px;
    background: var(--gj-primary-50);
    border: 1px solid var(--gj-primary-200);
    border-radius: var(--gj-r-sm);
}
.alerta-ubicar-form .field-label {
    margin-bottom: 6px;
    color: var(--gj-fg);
    font-weight: 500;
}

.alerta-actions {
    display: flex; flex-direction: column; gap: 6px;
    align-items: flex-end;
    flex-shrink: 0;
}
.alerta-estado {
    font-size: var(--fs-caption2);
    font-weight: 700;
    padding: 3px 9px;
    border-radius: var(--gj-r-pill);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.alerta-estado.estado-pendiente { background: var(--gj-warning-50);  color: var(--gj-warning-600); }
.alerta-estado.estado-vista     { background: var(--gj-info-50);     color: var(--gj-info-600); }
.alerta-estado.estado-resuelta  { background: var(--gj-success-50);  color: #047857; }
.alerta-estado.estado-descartada{ background: var(--gj-zinc-100);    color: var(--gj-zinc-600); }

@media (max-width: 600px) {
    .alerta-card { flex-wrap: wrap; }
    .alerta-actions { flex-direction: row; align-items: center; width: 100%; }
}

/* Selector de método 2FA (Perfil) -------------------------- */
.method-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}
.method-selector-title {
    font-size: var(--fs-caption);
    font-weight: 700;
    color: var(--gj-fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}
.method-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1.5px solid var(--gj-zinc-200);
    border-radius: var(--gj-r);
    background: var(--gj-zinc-25);
    cursor: pointer;
    transition: all var(--gj-t-fast);
}
.method-option:hover:not(.disabled) {
    border-color: var(--gj-zinc-300);
    background: white;
}
.method-option.active {
    border-color: var(--gj-primary-500);
    background: var(--gj-primary-50);
    box-shadow: 0 0 0 4px var(--gj-primary-ring);
}
.method-option.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.method-option input[type="radio"] {
    margin-top: 4px;
    accent-color: var(--gj-primary-600);
    flex-shrink: 0;
}
.method-option-body { flex: 1; min-width: 0; }
.method-option-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-size: var(--fs-subhead);
    color: var(--gj-fg);
}
.method-icon { font-size: var(--fs-headline); }
.method-badge {
    background: var(--gj-primary-100);
    color: var(--gj-primary-700);
    font-size: var(--fs-caption2);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 8px;
    border-radius: var(--gj-r-pill);
}
.method-option-desc {
    font-size: var(--fs-caption);
    color: var(--gj-fg-muted);
    line-height: 1.5;
}

/* =========================================================
   Módulo TAREAS · kanban + cards + timeline
   ========================================================= */
.tareas-kanban {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    align-items: start;
}
@media (max-width: 1100px) {
    .tareas-kanban { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .tareas-kanban { grid-template-columns: 1fr; }
}

.kanban-col {
    background: var(--gj-card);
    border: 1px solid var(--gj-border-hairline);
    border-radius: var(--gj-r);
    box-shadow: var(--gj-shadow-sm);
    overflow: hidden;
}
.kanban-col-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 3px solid var(--gj-primary);
    font-weight: 600;
    font-size: var(--fs-footnote);
}
.kanban-col-count {
    background: var(--gj-zinc-100);
    color: var(--gj-fg-muted);
    border-radius: 999px;
    padding: 1px 8px;
    font-size: var(--fs-caption2);
    font-weight: 700;
}
.kanban-col-body {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 60px;
}
.kanban-empty {
    text-align: center;
    color: var(--gj-fg-soft);
    font-size: var(--fs-caption);
    padding: 14px 0;
}

.tarea-card {
    background: var(--gj-bg);
    border: 1px solid var(--gj-border-hairline);
    border-left: 3px solid var(--gj-zinc-300);
    border-radius: var(--gj-r-sm);
    padding: 10px 12px;
    cursor: pointer;
    transition: all var(--gj-t-fast);
}
.tarea-card:hover {
    border-color: var(--gj-primary-300);
    box-shadow: var(--gj-shadow-sm);
    transform: translateY(0);
}
.tarea-card.prio-urgente { border-left-color: var(--gj-danger); }
.tarea-card.prio-alta    { border-left-color: var(--gj-warning); }
.tarea-card.prio-normal  { border-left-color: var(--gj-zinc-400); }
.tarea-card.prio-baja    { border-left-color: var(--gj-zinc-200); }

.tarea-card-head {
    display: flex; justify-content: space-between; align-items: center; gap: 6px;
    margin-bottom: 6px;
}
.tarea-tipo {
    color: white;
    font-size: var(--fs-caption2);
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
}
.tarea-prio-pill {
    font-size: var(--fs-caption2); font-weight: 700; letter-spacing: 0.05em;
    padding: 2px 6px; border-radius: 4px;
}
.tarea-prio-pill.urg  { background: var(--gj-danger-50);  color: var(--gj-danger); }
.tarea-prio-pill.alta { background: var(--gj-warning-50); color: var(--gj-warning-600); }

.tarea-titulo {
    margin: 0 0 6px;
    font-size: var(--fs-subhead);
    line-height: 1.35;
    color: var(--gj-fg);
}
.tarea-meta {
    display: flex; flex-wrap: wrap; gap: 8px;
    font-size: var(--fs-caption);
    color: var(--gj-fg-muted);
}
.tarea-unidad {
    margin-top: 6px;
    font-size: var(--fs-caption);
    color: var(--gj-fg-soft);
    background: var(--gj-zinc-50);
    padding: 3px 6px;
    border-radius: 4px;
    display: inline-block;
}
.tarea-actions {
    display: flex; gap: 6px; flex-wrap: wrap;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--gj-border-hairline);
}

/* Timeline en detalle */
.tarea-timeline {
    list-style: none;
    padding: 0;
    margin: 0;
}
.tl-item {
    display: flex; gap: 12px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--gj-border-hairline);
}
.tl-item:last-child { border-bottom: 0; }
.tl-dot {
    flex-shrink: 0;
    width: 10px; height: 10px; border-radius: 50%;
    margin-top: 6px;
    background: var(--gj-primary);
}
.tl-dot.tl-creacion       { background: var(--gj-info); }
.tl-dot.tl-cambio_estado  { background: var(--gj-primary); }
.tl-dot.tl-reasignacion   { background: var(--gj-warning); }
.tl-dot.tl-comentario     { background: var(--gj-zinc-500); }
.tl-dot.tl-foto           { background: var(--gj-success-600); }
.tl-body { flex: 1; min-width: 0; }
.tl-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tl-detalle {
    margin-top: 4px;
    color: var(--gj-fg-muted);
    font-size: var(--fs-footnote);
    line-height: 1.45;
    white-space: pre-wrap;
}
.tl-foto {
    margin-top: 8px;
    max-width: 200px; max-height: 200px;
    border-radius: var(--gj-r-sm);
    border: 1px solid var(--gj-border-hairline);
    display: block;
}

/* Lista K-V de info en aside */
.kv-list {
    margin: 0;
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 6px 14px;
    font-size: var(--fs-footnote);
}
.kv-list dt { color: var(--gj-fg-soft); }
.kv-list dd { margin: 0; color: var(--gj-fg); }

.gj-warning-banner {
    margin-top: 12px;
    padding: 10px 14px;
    background: var(--gj-warning-50);
    border-left: 3px solid var(--gj-warning);
    border-radius: var(--gj-r-sm);
    color: var(--gj-warning-600);
    font-size: var(--fs-footnote);
}

/* =========================================================
   Monitor público de sala — kanban a pantalla grande
   ========================================================= */
.monitor-page {
    min-height: 100vh;
    background: #0f1115;
    color: #f5f7fa;
    padding: 24px 32px;
    box-sizing: border-box;
}
.monitor-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 18px;
}
.monitor-titulo {
    font-size: 38px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
}
.monitor-reloj {
    font-family: var(--gj-font-mono);
    font-size: var(--fs-title1);
    color: #aaa;
}
.monitor-kanban {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}
.monitor-col {
    background: #1c1f27;
    border-radius: var(--gj-r-xl);
    padding: 16px;
    min-height: 60vh;
}
.monitor-col-head {
    font-size: var(--fs-title2);
    font-weight: 700;
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 3px solid;
    display: flex;
    justify-content: space-between;
}
.monitor-tarea {
    background: #2a2f3a;
    border-radius: var(--gj-r-sm);
    padding: 14px 16px;
    margin-bottom: 10px;
    border-left: 4px solid #888;
}
.monitor-tarea.prio-urgente { border-left-color: #ff5a55; }
.monitor-tarea.prio-alta    { border-left-color: #f6b73c; }
.monitor-tarea-titulo {
    font-size: var(--fs-headline);
    font-weight: 600;
    margin: 0 0 6px;
}
.monitor-tarea-meta {
    display: flex; gap: 14px; flex-wrap: wrap;
    font-size: var(--fs-subhead);
    color: #c5cad3;
}
.monitor-empty {
    color: #6f7686;
    font-size: var(--fs-callout);
    padding: 30px 0;
    text-align: center;
}

/* ============================================================
   📱 AUDITORÍA RESPONSIVE — PDA / Móvil / Tablet pequeña
   Bloque incremental. Solo activo en ≤768px (PDA/móvil); por encima
   nada cambia. Objetivos:
     · Touch target mínimo 44px en botones de operativa.
     · Tablas de info se apilan (label arriba / valor abajo) para no
       cortar texto largo.
     · Modales encajan en 360px de ancho sin scroll-X.
     · Evitar zoom doble-tap en botones (touch-action: manipulation).
   ============================================================ */

/* GLOBAL · prevenir scroll horizontal a nivel de página. Si una pantalla
   tuviera algún elemento que se desborda, queda contenido y no aparece la
   barra horizontal fea en mobile. */
html, body { overflow-x: hidden; }
.app-content { min-width: 0; overflow-x: hidden; }

/* UTILITY · grid de formulario auto-responsive. Reemplaza el inline
   "display:grid;grid-template-columns:1fr 1fr 1fr" que se aplasta en móvil.
   En desktop se reparte en columnas según quepa (mínimo 240px), en móvil
   se apila automáticamente sin necesidad de media queries adicionales. */
.gj-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px 18px;
}

/* UTILITY · KPIs compactos en cabeceras de detalle (/inventario, /recepciones…).
   En desktop son una fila; en móvil 3 columnas pequeñas para que sigan a la
   vista de un golpe en vez de apilarse. */
.inv-kpis {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}
@media (max-width: 640px) {
    .inv-kpis {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        width: 100%;
    }
    .inv-kpis .gj-kpi { min-width: 0; }
    .inv-kpis .kpi-value { font-size: var(--fs-headline); }
    .inv-kpis .kpi-label { font-size: var(--fs-caption2); }
}

@media (max-width: 768px) {
    /* ───── CABECERA en móvil ─────
       Reducimos padding y comprimimos lo que ocupa espacio:
       - Las "miguitas" Grupo Jerónimo · Almacén se ocultan (ya hay logo + sidebar).
       - El nombre/rol del usuario se oculta (queda el avatar como acceso a /perfil).
       - Botón Salir → solo icono, sin "Salir". */
    .app-header {
        padding: 0 12px;
        gap: 6px;
    }
    .app-header .crumbs { display: none; }
    .app-header .user-zone { gap: 8px; flex-shrink: 1; min-width: 0; }
    .app-header .user-zone > div[style*="display:flex"][style*="gap:12px"] > div[style*="text-align:right"] {
        display: none;   /* nombre + rol del usuario */
    }
    .app-header .gj-btn-ghost {
        padding: 6px 10px !important;
        font-size: var(--fs-caption2) !important;
        height: 32px !important;
    }
    .app-header .theme-toggle-btn { display: none; }   /* fuera en móvil — opción del menú admin */

    /* ───── OPERATIVA (pasos verticales: /movimientos, /escaneo, /retiradas...) ─────
       Que el input + botones del paso (escanear, cámara, →) no se salgan a la derecha. */
    .op-step { padding: 12px; min-width: 0; }
    .op-step-head { gap: 10px; }
    .op-input-row { gap: 6px; min-width: 0; }
    .op-input { min-width: 0; flex: 1 1 0; font-size: var(--fs-callout); }   /* 16px evita zoom iOS al focus */
    .op-btn-cam, .op-btn-go { flex-shrink: 0; }

    /* Actionbar sticky inferior: en móvil pasa a column para que los botones
       grandes ocupen todo el ancho y no se corten. */
    .op-actionbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px;
    }
    .op-actionbar-info { width: 100%; }
    .op-actionbar-actions {
        display: flex;
        gap: 8px;
        width: 100%;
    }
    .op-actionbar-actions > * { flex: 1; min-width: 0; }
    .op-btn-confirm {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    /* PDA estrecha: cabecera aún más compacta y panel de contenido con menos padding. */
    .app-header { padding: 0 8px; }
    .app-content { padding: 14px 12px 50px; }

    /* Page header (icono + título + subtítulo) se apila para no aplastar la subtítulo. */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .ph-icon { width: 40px; height: 40px; font-size: var(--fs-title2); }
    .page-header h1 { font-size: var(--fs-title3); }
    .ph-sub { font-size: var(--fs-caption); }

    /* Tablas en móvil: padding lateral reducido y tipografía un poco menor
       para que entren más columnas antes del scroll horizontal. .table-scroll
       sigue activo, sólo cambiamos densidad. */
    .gj-table { font-size: var(--fs-caption); }
    .gj-table th, .gj-table td { padding: 8px 10px; }
    .gj-table.dense th, .gj-table.dense td { padding: 6px 8px; }

    /* Inputs dentro de tablas (ej. cantidad a contar en /inventario) deben tener
       hit-area táctil mínima sin romper el ancho. */
    .gj-table td input.gj-input {
        height: 38px;
        font-size: var(--fs-callout);        /* evita zoom iOS */
        padding: 4px 8px;
    }
}

/* ============================================================
   📱 LISTADOS (tablas grandes) en móvil
   En vez de envolver una a una las 24 páginas con .table-scroll, hacemos que
   cualquier .gj-card que contenga una tabla permita scroll horizontal interno
   cuando el contenido excede el ancho. Las tablas con .table-scroll explícito
   ya funcionaban; ésto cubre el resto.
   ============================================================ */
@media (max-width: 768px) {
    .gj-card { max-width: 100%; }
    /* Solo aplicamos overflow-x:auto cuando el card pinta una tabla, no a los
       cards de formularios (que podrían encoger sus selects/inputs por accidente). */
    .gj-card:has(> .gj-table),
    .gj-card:has(> .table-scroll),
    .gj-card:has(> div > .gj-table) {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    /* Las celdas no se rompen verticalmente (mejor scroll-x que apilar líneas). */
    .gj-table th, .gj-table td { white-space: nowrap; }
    /* Excepción: descripciones largas en columnas marcadas con .wrap pueden romper. */
    .gj-table th.wrap, .gj-table td.wrap { white-space: normal; }
}



@media (max-width: 768px) {
    /* Touch target global en botones: 44x44px mínimo */
    .gj-btn, .scan-btn-icon, .scan-btn-go, .op-btn-go, .op-btn-cam {
        min-height: 44px;
        touch-action: manipulation;
    }
    /* Evita zoom accidental con doble-tap en cards clicables */
    .scan-result-actions .gj-btn,
    .scan-ambiguo-item,
    .sel-alm-card {
        touch-action: manipulation;
    }

    /* /escaneo · card de resultado: las filas "label · valor" se aplastan
       cuando el valor es largo. Pasamos a column para que cada dato tenga
       su línea propia, más legible en móvil. */
    .scan-result-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    .scan-result-row .lbl {
        font-size: var(--fs-caption2);
        text-transform: uppercase;
        letter-spacing: 0.4px;
    }
    /* La cabecera del card (eyebrow + título + zone-pill) puede ser ancha;
       permitimos wrap para no cortar el título largo (descripción de máquina). */
    .scan-result-head {
        flex-wrap: wrap;
        row-gap: 6px;
    }
    .scan-result-titulo, .scan-result-code {
        font-size: var(--fs-title3);       /* un poco más pequeño en pantalla estrecha */
        word-break: break-word;
    }

    /* /escaneo · card AMBIGUO: dejamos el item respirando, sin la flecha
       que ya es opcional en táctil. */
    .scan-ambiguo-item-arrow { display: none; }
    .scan-ambiguo-item { padding: 14px 12px; }
}

@media (max-width: 480px) {
    /* PDA estrecha: el card de scan apila label + valor con menos padding. */
    .scan-result-card { border-radius: var(--gj-r-sm); }
    .scan-result-head { padding: 10px 12px; }
    .scan-result-body { padding: 10px 12px; }
    .scan-result-actions {
        flex-direction: column;
        padding: 10px 12px;
    }
    .scan-result-actions .gj-btn {
        width: 100%;
        justify-content: center;
    }

    /* Input scanner: aún más grande para dedos. Ya estaba bien (24px),
       garantizamos altura mínima cómoda. */
    .scan-input-v2 {
        font-size: var(--fs-title2);
        padding: 10px 6px;
    }
    .scan-btn-go {
        min-width: 56px;
        padding: 12px 18px;
    }

    /* Modal selector almacén inicial: ocupa casi todo el ancho con menos
       padding interno para que las tarjetas se vean bien apiladas. */
    .sel-alm-modal { padding: 18px 14px; width: 94vw; }
    .sel-alm-grid { gap: 10px; }
    .sel-alm-card { padding: 16px 10px; }
    .sel-alm-card-icon { font-size: var(--fs-title1); }
    .sel-alm-card-name { font-size: var(--fs-footnote); }
}

/* ===== MOVIL: escala legible (generado por tools/generar-movil.py) ===== */
@media (max-width: 640px) {

    /* suelo de legibilidad 12.5px */
    .app-sidebar .nav-section,
    .nav-section-toggle,
    .nav-section-toggle .nav-chevron,
    .nav-section-badge,
    .op-step-sub code,
    .sga-cam-eyebrow,
    .sga-kbd-section-title kbd,
    .sga-kbd-plus,
    .sidebar-kbd-btn kbd,
    .recep-header-eyebrow,
    .profile-stat-label,
    .scan-example span,
    .scan-loc-eyebrow,
    .chat-suggestions-title,
    .chat-followup-label,
    .chat-time,
    .chat-tools-used,
    .chat-tools-used code,
    .chat-md-table th,
    .chat-hint,
    .notif-bell-badge,
    .notif-head-pill,
    .notif-tab-count,
    .notif-group-sep,
    .notif-cat-pill,
    .tip,
    .alm-ind-edit,
    .header-search-btn kbd,
    .area-chart .area-label,
    .push-number-label,
    .coord-kpi-prev,
    .alertas-bar-label,
    .alerta-nivel-pill,
    .alerta-estado,
    .method-badge,
    .tarea-prio-pill,
    .inv-kpis .kpi-label {
        font-size: 12.5px;
    }

    /* suelo de legibilidad 13.5px */
    .app-header .user-avatar,
    .nav-section-toggle,
    .app-sidebar .sidebar-footer,
    .gj-kpi-card .kpi-label,
    .gj-kpi-card .kpi-sub,
    .gj-kpi .kpi-label,
    .gj-kpi .kpi-sub,
    .gj-btn-sm,
    label.field-label,
    .gj-table thead th,
    .gj-table td.mono,
    .gj-table.dense th, .gj-table.dense td,
    .op-step-sub,
    .op-badge code,
    .op-extras-title,
    .op-extras-field label,
    .op-actionbar-hint,
    .op-actionbar-sub,
    .op-actionbar-sub code,
    .op-quick-chip,
    .op-quick-chip code,
    .op-est-meta,
    .op-est-meta code,
    .sga-cam-status,
    .sga-cam-foot,
    .sga-kbd-eyebrow,
    .sga-kbd-section-title,
    .sga-kbd-keys kbd,
    .sga-kbd-foot,
    .recep-header-meta,
    .recep-meta-item code,
    .recep-kpi-label,
    .recep-progress-title,
    .recep-progress-detail,
    .recep-progress-legend,
    .profile-hero-sub code,
    .profile-no-roles,
    .scan-input-label,
    .scan-examples-label,
    .scan-example,
    .scan-example code,
    .scan-loc-barcode,
    .scan-loc-barcode code,
    .scan-zone-badge,
    .scan-crumb,
    .scan-crumb .lbl,
    .scan-kpi-label,
    .scan-not-found code,
    .chat-header-status,
    .chat-subop-chip,
    .chat-suggestion-text,
    .chat-bubble code,
    .chat-msg-btn,
    .chat-bubble pre code,
    .chat-md-table,
    .chat-tabla,
    .chat-link,
    .notif-tab,
    .notif-mensaje,
    .notif-meta,
    .notif-empty-sub,
    .notif-bell-foot,
    .mono-link,
    .gj-tag,
    .example-pill,
    .code-mono,
    .code-prom,
    .connection-pill,
    .scan-ambiguo-item-sub,
    .sel-alm-card-code,
    .alm-ind,
    .app-header .crumbs,
    .app-header .user-zone .gj-btn,
    .page-header .ph-sub,
    .gj-table,
    .header-search-btn,
    .home-banner-seed .banner-sub code,
    .dashboard-admin-role-count,
    .dashboard-admin-widget-pos,
    .dashboard-admin-widget-sub,
    .gj-btn.icon,
    .scan-status-row,
    .scan-result-eyebrow,
    .scan-result-codigo-sub,
    .scan-result-zone,
    .scan-result-row .lbl,
    .scan-history-head,
    .scan-history-clear,
    .scan-shortcuts-title,
    .scan-shortcut .sub,
    .dest-alm-btn span,
    .dest-toggle-sub,
    .foto-procesando,
    .foto-preview-meta,
    .foto-preview-quitar,
    .tab-pill,
    .traspaso-motivo,
    .traspaso-meta,
    .trasp-timeline-meta,
    .trasp-timeline-extra,
    .widget-placeholder-sub,
    .kpi-modern-label,
    .kpi-pill,
    .critico-code,
    .card-head-link,
    .card-head-sub,
    .tipo-row-head,
    .tile-sub,
    .auth-field label,
    .auth-back,
    .auth-help,
    .auth-help code,
    .auth-foot,
    .auth-foot-version,
    .login-hero-foot,
    .login-step-head .step-eyebrow,
    .login-field label,
    .login-help,
    .login-help code,
    .push-timer-text,
    .approval-meta-row,
    .approval-meta-row code,
    .traza-meta,
    .traza-meta code,
    .traza-state-pill,
    .traza-where-row code,
    .traza-stat-label,
    .traza-day-sep,
    .traza-event-hora,
    .traza-event-detalle,
    .traza-event-obs,
    .traza-event-foot,
    .coord-periodo-tabs button,
    .alertas-bars-legend,
    .coord-metric-label,
    .notif-historial-day-sep,
    .notif-historial-time,
    .filter-label,
    .alerta-tipo,
    .alerta-meta,
    .alerta-meta code,
    .alerta-obs,
    .method-selector-title,
    .method-option-desc,
    .kanban-col-count,
    .kanban-empty,
    .tarea-tipo,
    .tarea-meta,
    .tarea-unidad,
    .app-header .gj-btn-ghost,
    .ph-sub {
        font-size: 13.5px;
    }

    /* Tamanos escritos en linea dentro de los .razor */
    [style*="font-size:9px"],
    [style*="font-size: 9px"],
    [style*="font-size:10px"],
    [style*="font-size: 10px"],
    [style*="font-size:10.5px"],
    [style*="font-size: 10.5px"],
    [style*="font-size:11px"],
    [style*="font-size: 11px"],
    [style*="font-size:11.5px"],
    [style*="font-size: 11.5px"],
    [style*="font-size:12px"],
    [style*="font-size: 12px"],
    [style*="font-size:12.5px"],
    [style*="font-size: 12.5px"] {
        font-size: 13.5px !important;
    }

    /* Objetivos tactiles: nada por debajo de 44px de alto util */
    button, .btn, .gj-btn, [role="button"], .nav-link, .nav-item, .quick-action,
    input:not([type="checkbox"]):not([type="radio"]), select, textarea {
        min-height: 44px;
    }
    /* El menu lateral en movil es un cajon a dedo, no una lista de escritorio */
    .nav-item { display: flex; align-items: center; }
    .user-avatar { min-height: 40px; min-width: 40px; }
    .btn-sm, .btn-icon, .chip, .badge { min-height: 32px; }

    /* Respiracion: el amontonamiento venia de margenes de escritorio.
       box-sizing explicito para que el padding no ensanche el armazon. */
    .app-header, .app-content { box-sizing: border-box; max-width: 100%; }
    .app-content { padding-left: 14px; padding-right: 14px; }
    .card, .panel, .surface, .list-item { margin-bottom: 14px; }

    /* Las tablas densas se leen mejor desplazando que comprimiendo */
    .table-wrap, .tabla-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table { min-width: 520px; }
}
