/* =====================================================================
   COMEDOR GRUPO CORIS · Sistema visual neumórfico
   Base gris perla con relieve suave + acentos de marca (cian / rojo)
   ===================================================================== */

:root {
    /* Superficie */
    --bg: #e6eaf0;
    --bg-hi: #f2f5f9;
    --bg-lo: #d6dce5;
    --sd: 158, 171, 192;          /* sombra oscura (rgb) */
    --sl: 255, 255, 255;          /* sombra clara (rgb) */

    /* Tinta */
    --ink: #22303f;
    --ink-2: #536176;
    --ink-3: #8794a8;

    /* Marca */
    --cyan: #14b4c6;
    --cyan-deep: #0a8b9c;
    --cyan-soft: rgba(20, 180, 198, .14);
    --red: #e3202d;
    --red-deep: #b5121d;
    --red-soft: rgba(227, 32, 45, .12);
    --green: #1d9a68;
    --green-soft: rgba(29, 154, 104, .14);
    --amber: #cf8414;
    --amber-soft: rgba(207, 132, 20, .15);
    --violet: #6a5bd6;
    --violet-soft: rgba(106, 91, 214, .13);

    /* Relieve */
    --raise-xs: 3px 3px 6px rgba(var(--sd), .45), -3px -3px 6px rgba(var(--sl), .9);
    --raise-sm: 5px 5px 11px rgba(var(--sd), .5), -5px -5px 11px rgba(var(--sl), .92);
    --raise: 9px 9px 20px rgba(var(--sd), .5), -9px -9px 20px rgba(var(--sl), .95);
    --raise-lg: 18px 18px 40px rgba(var(--sd), .5), -14px -14px 34px rgba(var(--sl), .95);
    --inset-sm: inset 3px 3px 6px rgba(var(--sd), .5), inset -3px -3px 6px rgba(var(--sl), .9);
    --inset: inset 6px 6px 13px rgba(var(--sd), .55), inset -6px -6px 13px rgba(var(--sl), .95);
    --inset-lg: inset 10px 10px 22px rgba(var(--sd), .55), inset -10px -10px 22px rgba(var(--sl), .95);

    /* Forma */
    --r-sm: 12px;
    --r: 20px;
    --r-lg: 30px;
    --side-w: 272px;
    --gap: 18px;

    /* Tipografía */
    --font-display: 'Lexend', 'Segoe UI', sans-serif;
    --font-body: 'Figtree', 'Segoe UI', sans-serif;

    --ease: cubic-bezier(.22, .8, .24, 1);
}

/* ---------------------------------------------------------------------
   Base
   --------------------------------------------------------------------- */
html { -webkit-text-size-adjust: 100%; }

body.gc {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--ink);
    background-color: var(--bg);
    background-image:
        radial-gradient(1100px 600px at -10% -10%, rgba(20, 180, 198, .07), transparent 60%),
        radial-gradient(900px 520px at 110% 110%, rgba(227, 32, 45, .05), transparent 60%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

.gc h1, .gc h2, .gc h3, .gc h4, .gc h5 {
    font-family: var(--font-display);
    color: var(--ink);
    letter-spacing: -.02em;
}

.gc ::selection { background: var(--cyan-soft); color: var(--ink); }

.gc a { color: var(--cyan-deep); }

.num { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------------
   Superficies
   --------------------------------------------------------------------- */
.neu {
    background: var(--bg);
    border-radius: var(--r-lg);
    box-shadow: var(--raise);
}

.neu-inset {
    background: var(--bg);
    border-radius: var(--r);
    box-shadow: var(--inset);
}

.panel {
    padding: 26px;
}

.gc .panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px;
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: var(--ink-3);
    font-family: var(--font-body);
}

.gc .panel-title i { color: var(--cyan); }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .18em;
    color: var(--cyan-deep);
}

.eyebrow::before {
    content: '';
    width: 22px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--cyan), var(--red));
}

/* ---------------------------------------------------------------------
   Loader
   --------------------------------------------------------------------- */
#loader {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    justify-content: center;
    align-items: center;
    background: rgba(230, 234, 240, .72);
    backdrop-filter: blur(6px);
}

.spinner {
    position: relative;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: var(--bg);
    box-shadow: var(--raise);
}

.spinner::before {
    content: '';
    position: absolute;
    inset: 14px;
    border-radius: 50%;
    box-shadow: var(--inset-sm);
}

.spinner::after {
    content: '';
    position: absolute;
    inset: 14px;
    border-radius: 50%;
    border: 4px solid transparent;
    border-top-color: var(--cyan);
    border-right-color: var(--red);
    animation: gc-spin .9s linear infinite;
}

@keyframes gc-spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------------
   Shell: barra lateral + contenido
   --------------------------------------------------------------------- */
.gc-side {
    position: fixed;
    top: var(--gap);
    bottom: var(--gap);
    left: var(--gap);
    width: var(--side-w);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    padding: 26px 18px 18px;
    background: var(--bg);
    border-radius: var(--r-lg);
    box-shadow: var(--raise);
    transition: transform .45s var(--ease);
}

.gc-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 0 10px 22px;
    text-decoration: none;
}

.gc-brand img { height: 26px; width: auto; }

.gc-brand small {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .26em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.gc-nav {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gc-nav-label {
    padding: 14px 12px 4px;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.gc-nav a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    border-radius: 16px;
    text-decoration: none;
    font-weight: 600;
    color: var(--ink-2);
    transition: color .25s, box-shadow .3s var(--ease), background .3s;
}

.gc-nav a .ico {
    flex: none;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--bg);
    box-shadow: var(--raise-xs);
    color: var(--ink-3);
    font-size: .95rem;
    transition: color .25s, box-shadow .3s var(--ease);
}

.gc-nav a:hover { color: var(--ink); }
.gc-nav a:hover .ico { color: var(--cyan); }

.gc-nav a.active {
    color: var(--ink);
    box-shadow: var(--inset);
}

.gc-nav a.active .ico {
    color: #fff;
    background: linear-gradient(145deg, var(--cyan), var(--cyan-deep));
    box-shadow: 3px 3px 8px rgba(10, 139, 156, .35), -2px -2px 6px rgba(var(--sl), .8);
}

.gc-nav a.active::after {
    content: '';
    position: absolute;
    right: 14px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--red);
    box-shadow: 0 0 0 4px var(--red-soft);
}

.gc-user {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--r);
    box-shadow: var(--inset);
}

.avatar {
    flex: none;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: .95rem;
    color: #fff;
    background: linear-gradient(145deg, var(--red), var(--red-deep));
    box-shadow: 3px 3px 8px rgba(181, 18, 29, .3);
}

.gc-user-info { min-width: 0; flex: 1; line-height: 1.25; }

.gc-user-info strong {
    display: block;
    font-size: .88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gc-user-info span {
    display: block;
    font-size: .74rem;
    color: var(--ink-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.icon-btn {
    flex: none;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 12px;
    background: var(--bg);
    color: var(--ink-2);
    box-shadow: var(--raise-xs);
    cursor: pointer;
    transition: color .2s, box-shadow .2s;
}

.icon-btn:hover { color: var(--red); }
.icon-btn:active { box-shadow: var(--inset-sm); }

.gc-main {
    margin-left: calc(var(--side-w) + var(--gap) * 2);
    padding: var(--gap) calc(var(--gap) + 8px) var(--gap) 8px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.gc-top {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 6px 4px 20px;
}

.gc-top .crumbs {
    font-size: .82rem;
    color: var(--ink-3);
    font-weight: 600;
}

.gc-top .crumbs b { color: var(--ink); font-weight: 700; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--bg);
    box-shadow: var(--raise-xs);
    font-size: .8rem;
    font-weight: 600;
    color: var(--ink-2);
}

.chip i { color: var(--cyan); }

.gc-menu-btn { display: none; }

.gc-content { flex: 1; }

.gc-scrim { display: none; }

/* Entrada escalonada */
.rise { animation: gc-rise .7s var(--ease) both; }
.rise-1 { animation-delay: .05s; }
.rise-2 { animation-delay: .12s; }
.rise-3 { animation-delay: .19s; }
.rise-4 { animation-delay: .26s; }

@keyframes gc-rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------------
   Encabezado de página
   --------------------------------------------------------------------- */
.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 26px;
}

.page-title {
    margin: 10px 0 6px;
    font-size: clamp(1.9rem, 3vw, 2.6rem);
    font-weight: 600;
    line-height: 1.05;
}

.page-title em { font-style: normal; color: var(--cyan); }

.page-sub { margin: 0; color: var(--ink-2); max-width: 56ch; }

.page-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* Indicadores */
.stat {
    min-width: 150px;
    padding: 14px 20px;
    border-radius: var(--r);
    background: var(--bg);
    box-shadow: var(--raise-sm);
}

.stat small {
    display: block;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.stat strong {
    display: block;
    margin-top: 4px;
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.stat strong:empty::before { content: '—'; color: var(--ink-3); }

.stat--accent strong { color: var(--cyan-deep); }

/* ---------------------------------------------------------------------
   Botones
   --------------------------------------------------------------------- */
.btn-neu,
.gc .gc-content .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px 24px;
    border: 0;
    border-radius: 16px;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: .92rem;
    letter-spacing: .02em;
    box-shadow: var(--raise-sm);
    cursor: pointer;
    transition: box-shadow .25s var(--ease), transform .25s var(--ease), color .2s, filter .2s;
}

.btn-neu:hover,
.gc .gc-content .btn:hover { transform: translateY(-1px); color: var(--ink); }

.btn-neu:active,
.gc .gc-content .btn:active { transform: translateY(1px); box-shadow: var(--inset-sm); }

.btn-neu:focus-visible,
.gc .gc-content .btn:focus-visible { outline: 3px solid var(--cyan-soft); outline-offset: 3px; }

/* Variantes con color: cara de color, relieve conservado */
.btn-neu--primary,
.gc .gc-content .btn-primary,
.gc .gc-content .btn-info {
    color: #fff !important;
    background: linear-gradient(145deg, #1cc4d6, var(--cyan-deep));
    box-shadow: 6px 6px 14px rgba(10, 139, 156, .32), -5px -5px 12px rgba(var(--sl), .9);
}

.btn-neu--success,
.gc .gc-content .btn-success {
    color: #fff !important;
    background: linear-gradient(145deg, #23b07a, #157a52);
    box-shadow: 6px 6px 14px rgba(21, 122, 82, .3), -5px -5px 12px rgba(var(--sl), .9);
}

.btn-neu--danger,
.gc .gc-content .btn-danger {
    color: #fff !important;
    background: linear-gradient(145deg, #ef3a46, var(--red-deep));
    box-shadow: 6px 6px 14px rgba(181, 18, 29, .3), -5px -5px 12px rgba(var(--sl), .9);
}

.btn-neu--primary:hover,
.btn-neu--success:hover,
.btn-neu--danger:hover,
.gc .gc-content .btn-primary:hover,
.gc .gc-content .btn-info:hover,
.gc .gc-content .btn-success:hover,
.gc .gc-content .btn-danger:hover { filter: brightness(1.06); }

.btn-neu--primary:active,
.btn-neu--success:active,
.btn-neu--danger:active,
.gc .gc-content .btn-primary:active,
.gc .gc-content .btn-info:active,
.gc .gc-content .btn-success:active,
.gc .gc-content .btn-danger:active {
    box-shadow: inset 4px 4px 10px rgba(0, 0, 0, .22), inset -2px -2px 6px rgba(255, 255, 255, .15);
}

/* Botón suave (sin color de fondo) */
.btn-neu--ghost { color: var(--ink-2); }
.btn-neu--ghost i { color: var(--cyan); }

.btn-xl { padding: 20px 34px; font-size: 1.05rem; border-radius: 20px; letter-spacing: .06em; text-transform: uppercase; }
.btn-block { width: 100%; }

.gc .gc-content .btn-sm { padding: 8px 14px; font-size: .8rem; border-radius: 12px; }

/* Botón icono de tabla */
.row-action {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 11px;
    background: var(--bg);
    color: var(--ink-3);
    box-shadow: var(--raise-xs);
    cursor: pointer;
    transition: color .2s, box-shadow .2s;
}

.row-action:hover { color: var(--red); }
.row-action:active { box-shadow: var(--inset-sm); }

/* ---------------------------------------------------------------------
   Campos
   --------------------------------------------------------------------- */
.field-label {
    display: block;
    margin: 0 0 10px 4px;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.neu-field {
    position: relative;
    display: flex;
    align-items: center;
    border-radius: 16px;
    background: var(--bg);
    box-shadow: var(--inset);
    transition: box-shadow .25s;
}

.neu-field > i {
    position: absolute;
    left: 18px;
    color: var(--ink-3);
    pointer-events: none;
    transition: color .2s;
}

.neu-field input,
.neu-field select {
    width: 100%;
    padding: 15px 18px 15px 48px;
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: var(--ink);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: .98rem;
    outline: none;
    appearance: none;
}

.neu-field select { cursor: pointer; }

.neu-field--select::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 18px;
    color: var(--ink-3);
    pointer-events: none;
}

.neu-field:focus-within {
    box-shadow: var(--inset), 0 0 0 3px var(--cyan-soft);
}

.neu-field:focus-within > i { color: var(--cyan); }

.neu-field input::placeholder { color: var(--ink-3); font-weight: 500; }

.field-error {
    display: block;
    margin: 8px 0 0 6px;
    font-size: .82rem;
    font-weight: 600;
    color: var(--red);
}

/* Checkbox neumórfico */
.gc input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    margin: 0;
    border-radius: 7px;
    background: var(--bg);
    box-shadow: var(--inset-sm);
    cursor: pointer;
    vertical-align: middle;
    position: relative;
    transition: background .2s, box-shadow .2s;
}

.gc input[type="checkbox"]:checked {
    background: linear-gradient(145deg, #1cc4d6, var(--cyan-deep));
    box-shadow: 2px 2px 5px rgba(10, 139, 156, .35);
}

.gc input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 7px;
    top: 3px;
    width: 7px;
    height: 12px;
    border: solid #fff;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

/* ---------------------------------------------------------------------
   Etiquetas de estado
   --------------------------------------------------------------------- */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px 5px 10px;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .02em;
    line-height: 1.4;
}

.tag::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.tag--p { color: var(--amber); background: var(--amber-soft); }
.tag--a { color: var(--green); background: var(--green-soft); }
.tag--t { color: var(--violet); background: var(--violet-soft); }
.tag--e { color: var(--cyan-deep); background: var(--cyan-soft); }
.tag--x { color: var(--ink-2); background: rgba(var(--sd), .2); }

/* ---------------------------------------------------------------------
   Tabulator
   --------------------------------------------------------------------- */
.neu-table { padding: 10px 14px 16px; }

.neu-table .tabulator {
    border: 0;
    background: transparent;
    font-size: .93rem;
    font-family: var(--font-body);
    margin: 0;
}

.neu-table .tabulator .tabulator-header {
    background: transparent;
    border-bottom: 1px solid rgba(var(--sd), .35);
    color: var(--ink-3);
    font-weight: 700;
}

.neu-table .tabulator .tabulator-header .tabulator-col {
    background: transparent;
    border-right: 0;
}

.neu-table .tabulator .tabulator-header .tabulator-col .tabulator-col-content {
    padding: 14px 12px 12px;
}

.neu-table .tabulator .tabulator-header .tabulator-col .tabulator-col-title {
    font-size: .7rem;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.neu-table .tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover {
    background: transparent;
    color: var(--ink);
}

.neu-table .tabulator .tabulator-header-filter {
    margin-top: 8px;
    padding: 0;
    background: transparent;
}

.neu-table .tabulator .tabulator-header-filter input {
    width: 100%;
    padding: 8px 12px !important;
    border: 0 !important;
    border-radius: 10px !important;
    background: var(--bg) !important;
    box-shadow: var(--inset-sm) !important;
    color: var(--ink);
    font-size: .82rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}

.neu-table .tabulator .tabulator-header-filter input:focus {
    outline: none;
    box-shadow: var(--inset-sm), 0 0 0 3px var(--cyan-soft) !important;
}

.neu-table .tabulator .tabulator-tableholder,
.neu-table .tabulator .tabulator-tableholder .tabulator-table {
    background: transparent;
    color: var(--ink);
}

.neu-table .tabulator .tabulator-row,
.neu-table .tabulator .tabulator-row.tabulator-row-even,
.neu-table .tabulator .tabulator-row.tabulator-row-odd {
    background: transparent !important;
    border-bottom: 1px solid rgba(var(--sd), .2);
    transition: background .2s;
}

.neu-table .tabulator .tabulator-row:hover {
    background: rgba(var(--sl), .5) !important;
}

.neu-table .tabulator .tabulator-row .tabulator-cell {
    padding: 15px 12px;
    border-right: 0;
    vertical-align: middle;
}

.neu-table .tabulator .tabulator-placeholder span {
    color: var(--ink-3) !important;
    font-weight: 600;
    font-size: .95rem;
}

.neu-table .tabulator .tabulator-footer {
    background: transparent;
    border-top: 0;
    padding: 16px 4px 0;
    color: var(--ink-3);
    font-weight: 600;
}

.neu-table .tabulator .tabulator-footer .tabulator-page {
    margin: 0 4px;
    padding: 7px 13px;
    border: 0;
    border-radius: 11px;
    background: var(--bg);
    color: var(--ink-2);
    font-weight: 700;
    box-shadow: var(--raise-xs);
    transition: box-shadow .2s, color .2s;
}

.neu-table .tabulator .tabulator-footer .tabulator-page:not(.disabled):hover {
    background: var(--bg);
    color: var(--cyan-deep);
}

.neu-table .tabulator .tabulator-footer .tabulator-page.active {
    color: var(--cyan-deep);
    box-shadow: var(--inset-sm);
}

.neu-table .tabulator .tabulator-footer .tabulator-page.disabled { opacity: .45; }

/* ---------------------------------------------------------------------
   SweetAlert (v1)
   --------------------------------------------------------------------- */
.sweet-overlay {
    background: rgba(34, 48, 63, .28) !important;
    backdrop-filter: blur(5px);
}

.sweet-alert {
    background: var(--bg) !important;
    border-radius: 28px !important;
    padding: 30px 28px 26px !important;
    box-shadow: var(--raise-lg) !important;
    font-family: var(--font-body) !important;
}

.sweet-alert h2 {
    font-family: var(--font-display) !important;
    font-weight: 600 !important;
    color: var(--ink) !important;
    letter-spacing: -.01em;
}

.sweet-alert p {
    color: var(--ink-2) !important;
    font-weight: 500 !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
}

.sweet-alert button {
    border-radius: 15px !important;
    padding: 12px 28px !important;
    font-family: var(--font-body) !important;
    font-weight: 700 !important;
    font-size: .92rem !important;
    color: #fff !important;
    background: linear-gradient(145deg, #1cc4d6, var(--cyan-deep)) !important;
    box-shadow: 5px 5px 12px rgba(10, 139, 156, .3), -4px -4px 10px rgba(var(--sl), .9) !important;
}

.sweet-alert button.cancel {
    color: var(--ink-2) !important;
    background: var(--bg) !important;
    box-shadow: var(--raise-sm) !important;
}

.sweet-alert button.confirm.btn-danger {
    background: linear-gradient(145deg, #ef3a46, var(--red-deep)) !important;
    box-shadow: 5px 5px 12px rgba(181, 18, 29, .3), -4px -4px 10px rgba(var(--sl), .9) !important;
}

.sweet-alert button:active { box-shadow: var(--inset-sm) !important; }

.sweet-alert .sa-icon.sa-success .sa-fix,
.sweet-alert .sa-icon.sa-success::before,
.sweet-alert .sa-icon.sa-success::after,
.sweet-alert .sa-icon.sa-success .sa-placeholder ~ * { background: var(--bg) !important; }

/* ---------------------------------------------------------------------
   CAJA (kiosco)
   --------------------------------------------------------------------- */
.caja {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 26px;
    min-height: calc(100vh - 120px);
}

.caja-scan {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(28px, 5vw, 64px);
}

/* Marca de agua grabada en relieve */
.caja-scan::before {
    content: 'GC';
    position: absolute;
    right: -30px;
    bottom: -90px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 340px;
    line-height: 1;
    letter-spacing: -.06em;
    color: var(--bg);
    text-shadow: 6px 6px 12px rgba(var(--sd), .35), -6px -6px 12px rgba(var(--sl), .9);
    pointer-events: none;
    user-select: none;
}

.caja-scan > * { position: relative; }

.caja-title {
    margin: 16px 0 10px;
    font-size: clamp(2.4rem, 4.6vw, 4rem);
    font-weight: 600;
    line-height: 1;
}

.caja-title em { font-style: normal; color: var(--cyan); }

.caja-lead { margin: 0 0 38px; font-size: 1.08rem; color: var(--ink-2); max-width: 46ch; }

.scan-well {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 760px;
    border-radius: 26px;
    background: var(--bg);
    box-shadow: var(--inset-lg);
    overflow: hidden;
    transition: box-shadow .35s var(--ease), opacity .3s;
}

.scan-well .scan-ico {
    flex: none;
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin-left: 16px;
    border-radius: 18px;
    background: var(--bg);
    box-shadow: var(--raise-sm);
    font-size: 1.6rem;
    color: var(--ink-3);
    transition: color .3s;
}

.scan-well input {
    flex: 1;
    min-width: 0;
    height: 104px;
    padding: 0 26px;
    border: 0;
    background: transparent;
    outline: none;
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 2.6vw, 2.2rem);
    font-weight: 500;
    letter-spacing: .08em;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.scan-well input::placeholder {
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--ink-3);
}

/* Láser de escaneo */
.scan-beam {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 2px;
    opacity: 0;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, var(--cyan) 30%, var(--red) 70%, transparent);
    box-shadow: 0 0 14px 2px rgba(20, 180, 198, .45);
}

.scan-well:focus-within {
    box-shadow: var(--inset-lg), 0 0 0 4px var(--cyan-soft);
}

.scan-well:focus-within .scan-ico { color: var(--cyan); }

.scan-well:focus-within .scan-beam {
    opacity: .85;
    animation: gc-beam 2.4s ease-in-out infinite;
}

@keyframes gc-beam {
    0%, 100% { top: 18%; }
    50% { top: 82%; }
}

.scan-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px 26px;
    margin-top: 30px;
}

.scan-hint { color: var(--ink-3); font-size: .88rem; font-weight: 600; }

.scan-hint kbd {
    display: inline-block;
    padding: 3px 9px;
    margin: 0 3px;
    border-radius: 8px;
    background: var(--bg);
    box-shadow: var(--raise-xs);
    color: var(--ink-2);
    font-family: var(--font-body);
    font-size: .78rem;
    font-weight: 700;
}

.tipos {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 46px;
}

.tipo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px 12px 12px;
    border-radius: 16px;
    box-shadow: var(--inset-sm);
}

.tipo .tipo-dot {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    font-size: .85rem;
}

.tipo b { display: block; font-size: .86rem; }
.tipo span { display: block; font-size: .76rem; color: var(--ink-3); font-weight: 600; }

.tipo--interno .tipo-dot { color: var(--amber); background: var(--amber-soft); }
.tipo--practicante .tipo-dot { color: var(--violet); background: var(--violet-soft); }
.tipo--externo .tipo-dot { color: var(--cyan-deep); background: var(--cyan-soft); }

.caja-closed-note {
    display: none;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
    padding: 14px 18px;
    max-width: 760px;
    border-radius: 16px;
    color: var(--red-deep);
    background: var(--red-soft);
    font-weight: 600;
}

.caja[data-state="closed"] .caja-closed-note { display: flex; }
.caja[data-state="closed"] .scan-well,
.caja[data-state="closed"] .scan-actions { opacity: .45; pointer-events: none; }

/* Panel lateral de la caja */
.caja-side { display: flex; flex-direction: column; gap: 26px; }

.status-card { padding: 26px; }

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px 8px 12px;
    border-radius: 999px;
    box-shadow: var(--inset-sm);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.status-pill .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--ink-3);
}

.caja[data-state="open"] .status-pill { color: var(--green); }
.caja[data-state="open"] .status-pill .dot {
    background: var(--green);
    animation: gc-pulse 2s ease-out infinite;
}

.caja[data-state="closed"] .status-pill { color: var(--red); }
.caja[data-state="closed"] .status-pill .dot { background: var(--red); }

@keyframes gc-pulse {
    0% { box-shadow: 0 0 0 0 rgba(29, 154, 104, .5); }
    100% { box-shadow: 0 0 0 12px rgba(29, 154, 104, 0); }
}

.caja-num {
    margin: 26px 0 6px;
}

.caja-num small,
.meta-row small {
    display: block;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.caja-num strong {
    display: block;
    margin-top: 2px;
    font-family: var(--font-display);
    font-size: 4.4rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -.04em;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    text-shadow: 3px 3px 6px rgba(var(--sd), .35), -2px -2px 4px rgba(var(--sl), .9);
}

.caja-num strong:empty::before,
.meta-row span:empty::before { content: '—'; color: var(--ink-3); }

.meta-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 16px 0;
    border-top: 1px solid rgba(var(--sd), .3);
}

.meta-row span { font-weight: 700; font-variant-numeric: tabular-nums; }

.status-card #abrircaja { margin-top: 14px; width: 100%; padding: 16px; text-transform: uppercase; letter-spacing: .08em; }

.clock-card {
    padding: 26px;
    text-align: center;
}

.clock {
    font-family: var(--font-display);
    font-size: 3.2rem;
    font-weight: 300;
    letter-spacing: -.03em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.clock .sec { font-size: 1.4rem; color: var(--cyan); font-weight: 500; margin-left: 4px; }

.clock-date {
    margin-top: 10px;
    font-weight: 600;
    color: var(--ink-3);
}

.clock-date::first-letter { text-transform: uppercase; }

/* ---------------------------------------------------------------------
   Diseños de página
   --------------------------------------------------------------------- */
.split {
    display: grid;
    grid-template-columns: 330px minmax(0, 1fr);
    gap: 26px;
    align-items: start;
}

.info-list { margin: 22px 0 0; }

.info-list .meta-row span { text-align: right; }

.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 24px; }

.bi-frame {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    border-radius: var(--r);
    overflow: hidden;
    box-shadow: var(--inset);
}

.bi-frame iframe {
    position: absolute;
    inset: 10px;
    width: calc(100% - 20px);
    height: calc(100% - 20px);
    border: 0;
    border-radius: 14px;
    background: #fff;
}

/* 403 */
.denied {
    max-width: 620px;
    margin: 6vh auto 0;
    padding: 56px 40px;
    text-align: center;
}

.denied .lock {
    display: grid;
    place-items: center;
    width: 96px;
    height: 96px;
    margin: 0 auto 26px;
    border-radius: 30px;
    box-shadow: var(--inset);
    font-size: 2.2rem;
    color: var(--red);
}

.denied .code {
    font-family: var(--font-display);
    font-size: 5rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -.05em;
    color: var(--bg);
    text-shadow: 4px 4px 8px rgba(var(--sd), .55), -4px -4px 8px rgba(var(--sl), .95);
}

/* ---------------------------------------------------------------------
   Autenticación
   --------------------------------------------------------------------- */
.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px 16px;
}

.auth-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: min(980px, 100%);
    overflow: hidden;
}

.auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 40px;
    padding: 48px;
    margin: 14px;
    border-radius: 24px;
    box-shadow: var(--inset);
    overflow: hidden;
}

.auth-brand img { width: 150px; height: auto; }

.auth-brand h1 {
    margin: 0;
    font-size: clamp(2rem, 3.4vw, 2.9rem);
    font-weight: 600;
    line-height: 1.05;
}

.auth-brand h1 em { font-style: normal; color: var(--cyan); }

.auth-brand p { margin: 14px 0 0; color: var(--ink-2); }

.auth-brand > :not(.ring) { position: relative; z-index: 1; }

.auth-brand .ring {
    position: absolute;
    z-index: 0;
    right: -110px;
    bottom: -110px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    box-shadow: var(--raise);
}

.auth-brand .ring::after {
    content: '';
    position: absolute;
    inset: 46px;
    border-radius: 50%;
    box-shadow: var(--inset);
}

.auth-form { padding: 56px 48px; }

.auth-form h2 { margin: 0 0 6px; font-size: 1.6rem; font-weight: 600; }

.auth-form .sub { margin: 0 0 32px; color: var(--ink-3); font-weight: 500; }

.auth-form .form-block + .form-block { margin-top: 22px; }

.auth-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 22px 0 30px;
    font-size: .88rem;
    font-weight: 600;
    color: var(--ink-2);
}

.auth-foot label { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }

.auth-foot a { color: var(--cyan-deep); text-decoration: none; }
.auth-foot a:hover { text-decoration: underline; }

/* Vistas de autenticación heredadas (restablecer contraseña, etc.) */
.auth-legacy .card {
    border: 0;
    border-radius: var(--r-lg);
    background: var(--bg);
    box-shadow: var(--raise);
    overflow: hidden;
}

.auth-legacy .card-header {
    background: transparent;
    border-bottom: 1px solid rgba(var(--sd), .3);
    font-family: var(--font-display);
    font-weight: 600;
    padding: 20px 26px;
}

.auth-legacy .card-body { padding: 26px; }

.auth-legacy .form-control {
    border: 0;
    border-radius: 14px;
    background: var(--bg);
    box-shadow: var(--inset-sm);
    padding: 12px 16px;
}

.auth-legacy .form-control:focus { box-shadow: var(--inset-sm), 0 0 0 3px var(--cyan-soft); }

.auth-legacy .btn {
    border: 0;
    border-radius: 14px;
    padding: 11px 22px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(145deg, #1cc4d6, var(--cyan-deep));
    box-shadow: 5px 5px 12px rgba(10, 139, 156, .3), -4px -4px 10px rgba(var(--sl), .9);
}

/* ---------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------- */
@media (max-width: 1199.98px) {
    .caja { grid-template-columns: minmax(0, 1fr); min-height: 0; }
    .caja-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .split { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 991.98px) {
    :root { --gap: 14px; }

    .gc-side { transform: translateX(calc(-100% - 40px)); }

    body.side-open .gc-side { transform: none; }

    body.side-open .gc-scrim {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1030;
        background: rgba(34, 48, 63, .25);
        backdrop-filter: blur(3px);
    }

    .gc-main { margin-left: 0; padding: var(--gap) 16px; }

    .gc-menu-btn { display: grid; }

    .auth-card { grid-template-columns: 1fr; }
    .auth-brand { padding: 32px; gap: 18px; }
    .auth-brand .ring { display: none; }
    .auth-form { padding: 32px 28px 40px; }
}

@media (max-width: 767.98px) {
    .caja-side { grid-template-columns: minmax(0, 1fr); }
    .caja-scan::before { font-size: 220px; bottom: -50px; }
    .scan-well input { height: 84px; }
    .scan-well .scan-ico { width: 52px; height: 52px; }
    .scan-actions .btn-neu { width: 100%; }
    .page-actions { width: 100%; }
    .page-actions .stat { flex: 1 1 calc(50% - 7px); min-width: 0; }
    .stat strong { white-space: nowrap; font-size: 1.25rem; }
    .gc-top .chip-date { display: none; }
    .panel { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
