:root {
    --ink: #0b0d0f;
    --ink-soft: #171a1e;
    --paper: #f3f4f1;
    --surface: #ffffff;
    --surface-soft: #f8f9f7;
    --line: #dfe2dc;
    --line-dark: rgba(255, 255, 255, 0.13);
    --muted: #686e73;
    --accent: #e4002b;
    --accent-dark: #b90023;
    --success: #0f7a4d;
    --warning: #a86000;
    --danger: #b42318;
    --info: #1456a0;
    --sidebar-width: 280px;
    --sidebar-compact: 84px;
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 22px;
    --shadow: 0 18px 50px rgba(14, 17, 20, 0.08);
    --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-width: 320px;
    background: var(--paper);
    color: var(--ink);
    font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

.skip-link {
    position: fixed;
    left: 16px;
    top: -80px;
    z-index: 3000;
    padding: 10px 16px;
    background: white;
    border-radius: var(--radius-sm);
    transition: top .2s ease;
}

.skip-link:focus { top: 12px; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1000;
    display: flex;
    width: var(--sidebar-width);
    flex-direction: column;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 12% 5%, rgba(228, 0, 43, .2), transparent 27%),
        linear-gradient(155deg, #101316 0%, #070809 74%);
    border-right: 1px solid rgba(255,255,255,.08);
    transition: width .35s var(--ease), transform .35s var(--ease);
}

.brand {
    display: flex;
    min-height: 92px;
    align-items: center;
    gap: 14px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--line-dark);
    text-decoration: none;
}

.brand-logo {
    width: 70px;
    height: 30px;
    flex: 0 0 70px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.brand-copy {
    min-width: 0;
    transition: opacity .2s ease, transform .25s var(--ease);
}

.brand-name {
    display: block;
    font-size: 14px;
    font-weight: 760;
    letter-spacing: .01em;
    white-space: nowrap;
}

.brand-caption {
    display: block;
    margin-top: 2px;
    color: #aeb3b7;
    font-size: 11px;
    letter-spacing: .13em;
    text-transform: uppercase;
    white-space: nowrap;
}

.sidebar-scroll {
    flex: 1;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 18px 14px;
    scrollbar-width: thin;
    scrollbar-color: #444 transparent;
}

.menu-titulo {
    margin: 19px 12px 8px;
    color: #757b80;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: opacity .2s ease;
}

.menu-titulo:first-child { margin-top: 2px; }

.nav-link {
    position: relative;
    display: flex;
    min-height: 46px;
    align-items: center;
    gap: 14px;
    margin: 3px 0;
    padding: 11px 13px;
    color: #c9cdd0;
    border: 1px solid transparent;
    border-radius: 11px;
    text-decoration: none;
    transition: color .2s ease, background .2s ease, transform .2s ease;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,.07);
    transform: translateX(2px);
}

.nav-link.activo {
    color: #fff;
    background: rgba(255,255,255,.11);
    border-color: rgba(255,255,255,.07);
}

.nav-link.activo::before {
    position: absolute;
    left: -14px;
    width: 3px;
    height: 24px;
    border-radius: 0 4px 4px 0;
    background: var(--accent);
    content: "";
}

.nav-icon {
    display: grid;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    place-items: center;
}

.nav-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.nav-text {
    overflow: hidden;
    font-size: 13px;
    font-weight: 570;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: opacity .2s ease, transform .25s var(--ease);
}

.sidebar-footer {
    padding: 14px;
    border-top: 1px solid var(--line-dark);
}

.nav-link.salir { color: #ff9cab; }

.main {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    transition: margin-left .35s var(--ease);
}

body.menu-compacto .sidebar { width: var(--sidebar-compact); }
body.menu-compacto .main { margin-left: var(--sidebar-compact); }
body.menu-compacto .brand { padding-inline: 7px; justify-content: center; }
body.menu-compacto .brand-logo { width: 58px; flex-basis: 58px; }
body.menu-compacto .brand-copy,
body.menu-compacto .menu-titulo,
body.menu-compacto .nav-text { opacity: 0; pointer-events: none; transform: translateX(-8px); }
body.menu-compacto .nav-link { justify-content: center; padding-inline: 10px; }
body.menu-compacto .nav-link.activo::before { left: -14px; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 700;
    display: flex;
    min-height: 76px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 clamp(18px, 3vw, 42px);
    background: rgba(255,255,255,.88);
    border-bottom: 1px solid rgba(18, 21, 24, .09);
    backdrop-filter: blur(16px);
}

.topbar-izquierda,
.topbar-usuario { display: flex; align-items: center; }
.topbar-izquierda { min-width: 0; gap: 18px; }
.topbar-usuario { gap: 12px; }

.menu-toggle,
.icon-button {
    display: inline-grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    color: var(--ink);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}

.menu-toggle:hover,
.icon-button:hover { background: #ebece8; transform: scale(1.03); }
.menu-toggle svg,
.icon-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.topbar-titulo {
    overflow: hidden;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .02em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.usuario {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 8px;
}

.usuario-avatar {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    color: #fff;
    background: var(--ink);
    border-radius: 50%;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.usuario-datos { line-height: 1.2; }
.usuario-nombre { display: block; font-size: 13px; font-weight: 750; }
.usuario-rol { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }

.notificaciones-enlace { position: relative; }
.notificaciones-contador {
    position: absolute;
    top: 1px;
    right: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    color: #fff;
    background: var(--accent);
    border: 2px solid #fff;
    border-radius: 12px;
    font-size: 9px;
    font-weight: 800;
    line-height: 14px;
    text-align: center;
}

.contenido {
    width: min(100%, 1540px);
    margin: 0 auto;
    padding: clamp(24px, 3.3vw, 52px);
    animation: page-in .42s var(--ease) both;
}

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

.encabezado-pagina {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.encabezado-pagina h1,
.contenido > h1 {
    margin: 0;
    font-size: clamp(28px, 3vw, 44px);
    font-weight: 760;
    letter-spacing: -.045em;
    line-height: 1.05;
}

.contenido > h2,
.encabezado-pagina + h2 {
    margin: 40px 0 18px;
    font-size: 18px;
    font-weight: 760;
    letter-spacing: -.015em;
}

.subtitulo {
    max-width: 760px;
    margin-top: 9px;
    color: var(--muted);
    font-size: 14px;
}

.boton {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    color: var(--ink);
    background: #e7e9e4;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 730;
    line-height: 1.2;
    text-decoration: none;
    transition: transform .2s var(--ease), background .2s ease, box-shadow .2s ease;
}

.boton:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(10,12,14,.1); }
.boton-principal { color: #fff; background: var(--ink); }
.boton-principal:hover { background: #2a2e31; }
.boton-secundario { color: var(--ink); background: transparent; border-color: #cdd1cb; }
.boton-ver { color: var(--info); background: #eaf2fb; }
.boton-editar { color: #704800; background: #fff1ce; }
.boton-aprobar { color: #fff; background: var(--success); }
.boton-danger, .boton-rechazar { color: #fff; background: var(--danger); }
.boton.secundario { color: var(--ink); background: transparent; border-color: #cdd1cb; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-head h1 { margin: 0; font-size: clamp(28px, 3vw, 42px); letter-spacing: -.04em; line-height: 1.08; }
.page-head .eyebrow { margin: 0 0 7px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.muted { color: var(--muted); }
.panel { margin-bottom: 24px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 0 rgba(0,0,0,.02); }
.panel h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.table-wrap { width: 100%; overflow-x: auto; }
.form-panel { max-width: 820px; }
.form-field { margin-bottom: 18px; }
.form-field ul.errorlist, .errorlist { margin: 6px 0 0; padding: 0; color: var(--danger); font-size: 12px; list-style: none; }
.form-actions, .acciones-grupo { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.inline-form { display: grid; grid-template-columns: minmax(280px, 1fr) 140px auto; gap: 14px; align-items: end; }
.inline-form .form-field { margin: 0; }
.estado-enviada, .estado-consolidada, .estado-pendiente_aprobacion { color: var(--warning); background: #fff0cd; }
.estado-en_revision, .estado-en_recepcion { color: var(--info); background: #eaf2fb; }
.estado-devuelta { color: var(--danger); background: #fde8e5; }
.valor-negativo { color: var(--danger); font-weight: 750; }
.empty-state { padding: 32px; color: var(--muted); text-align: center; }
.catalogo-tabs { display: flex; gap: 8px; margin: 18px 0; }
.catalogo-tab { min-height: 36px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; font-weight: 700; }
.catalogo-tab.activo { color: #fff; background: var(--ink); border-color: var(--ink); }
.catalogo-oculto { display: none; }
.catalogo-categoria { padding: 16px 22px; }
.catalogo-categoria td { padding: 8px 14px; }
.cantidad-control { display: inline-flex; align-items: center; gap: 5px; }
.cantidad-control input { width: 54px; min-height: 32px; padding: 4px 6px; text-align: center; }
.cantidad-boton { width: 32px; height: 32px; padding: 0; border: 1px solid #cfd3cc; border-radius: 7px; background: #fff; font-size: 18px; cursor: pointer; }
.catalogo-categoria { font-size: 13px; }
.catalogo-categoria th { padding: 7px 10px; font-size: 9px; }
.catalogo-oficina thead, .catalogo-limpieza thead { display: none; }
.catalogo-oficina tbody, .catalogo-limpieza tbody { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.catalogo-oficina tbody tr, .catalogo-limpieza tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; }
.catalogo-oficina tbody td, .catalogo-limpieza tbody td { padding: 0; border: 0; }
.catalogo-oficina tbody td:nth-child(1), .catalogo-limpieza tbody td:nth-child(1) { grid-column: 1; font-size: 12px; font-weight: 650; }
.catalogo-oficina tbody td:nth-child(2), .catalogo-oficina tbody td:nth-child(3), .catalogo-limpieza tbody td:nth-child(2), .catalogo-limpieza tbody td:nth-child(3) { color: var(--muted); font-size: 11px; }
.catalogo-oficina tbody td:nth-child(4), .catalogo-limpieza tbody td:nth-child(4) { grid-column: 2; grid-row: 1 / span 2; }
.catalogo-cafeteria { padding: 12px 18px; }
.catalogo-cafeteria td { padding: 6px 10px; font-size: 12px; }
.catalogo-cafeteria .cantidad-control input { min-height: 28px; }
.catalogo-cafeteria .cantidad-boton { width: 28px; height: 28px; font-size: 16px; }
@media (max-width: 1100px) { .catalogo-oficina tbody, .catalogo-limpieza tbody { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .catalogo-oficina tbody, .catalogo-limpieza tbody { grid-template-columns: 1fr; } }

.tarjetas {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    margin-bottom: 28px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}

.tarjeta {
    margin-bottom: 24px;
    padding: clamp(20px, 2.2vw, 30px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 1px 0 rgba(0,0,0,.02);
}

.tarjetas .tarjeta {
    min-height: 132px;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.tarjetas .tarjeta h3,
.metric-label {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.tarjetas .tarjeta p,
.metric-value {
    margin: 13px 0 0;
    font-size: clamp(26px, 3vw, 38px);
    font-weight: 760;
    letter-spacing: -.04em;
    line-height: 1;
}

.tarjeta > h2:first-child,
.tarjeta > h3:first-child { margin-top: 0; }
.tarjeta > h3:first-child { font-size: 17px; letter-spacing: -.015em; }

.table-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: -6px 0 18px;
}

.table-search {
    width: min(100%, 360px);
    min-height: 42px;
    padding: 9px 14px 9px 40px;
    background-color: var(--surface-soft);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23686e73'%3E%3Cpath stroke-linecap='round' stroke-width='1.8' d='m21 21-4.3-4.3m2.3-5.2a7.5 7.5 0 1 1-15 0 7.5 7.5 0 0 1 15 0Z'/%3E%3C/svg%3E");
    background-position: 13px center;
    background-repeat: no-repeat;
    background-size: 18px;
}

.table-count { color: var(--muted); font-size: 12px; }
.table-scroll { width: 100%; overflow-x: auto; }

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
}

th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 11px 14px;
    color: var(--muted);
    background: var(--surface-soft);
    border-bottom: 1px solid var(--line);
    font-size: 10px;
    font-weight: 820;
    letter-spacing: .08em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

td {
    padding: 15px 14px;
    border-bottom: 1px solid #eceeea;
    font-size: 13px;
    vertical-align: middle;
}

tbody tr { transition: background .18s ease, transform .18s ease; }
tbody tr:hover { background: #f8f9f7; }
tbody tr:last-child td { border-bottom: 0; }

.estado {
    display: inline-flex;
    min-height: 26px;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 820;
    letter-spacing: .035em;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
}

.estado-borrador { color: #555b60; background: #e9ebe7; }
.estado-pendiente { color: var(--warning); background: #fff0cd; }
.estado-aprobada { color: var(--success); background: #dff3e9; }
.estado-rechazada { color: var(--danger); background: #fde8e5; }

.formulario { max-width: 920px; }
.filtros-lista {
    display: grid;
    grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(140px, 1fr)) auto;
    gap: 14px;
    align-items: end;
    margin-bottom: 22px;
}
.filtros-lista label { display: block; margin-bottom: 7px; color: #34383b; font-size: 12px; font-weight: 760; }
.filtros-acciones { display: flex; gap: 8px; }
.paginacion { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 20px; color: var(--muted); font-size: 13px; }
form p { margin: 0 0 20px; }
form label {
    display: block;
    margin-bottom: 7px;
    color: #34383b;
    font-size: 12px;
    font-weight: 760;
}

input, select, textarea {
    width: 100%;
    min-height: 46px;
    padding: 11px 13px;
    color: var(--ink);
    background: var(--surface-soft);
    border: 1px solid #cfd3cc;
    border-radius: 10px;
    outline: none;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus {
    background: #fff;
    border-color: var(--ink);
    box-shadow: 0 0 0 3px rgba(11,13,15,.08);
}

input[type="checkbox"], input[type="radio"] { width: auto; min-height: auto; }
input[type="file"] { padding: 9px; }
.helptext { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; }
.errorlist { margin: 6px 0; padding-left: 20px; color: var(--danger); font-size: 12px; }

.acciones { display: flex; flex-wrap: wrap; gap: 9px; }

.detalle-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 34px;
}

.dato {
    min-width: 0;
    padding: 16px 0;
    border-bottom: 1px solid #eceeea;
}

.dato-titulo {
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .075em;
    text-transform: uppercase;
}

.dato-valor { overflow-wrap: anywhere; font-size: 14px; font-weight: 670; }

.mensaje {
    position: relative;
    margin-bottom: 18px;
    padding: 14px 46px 14px 17px;
    color: #134375;
    background: #e8f2fc;
    border-left: 3px solid var(--info);
    border-radius: 8px;
    box-shadow: var(--shadow);
    animation: toast-in .35s var(--ease) both;
}

.mensaje.success { color: #075f3a; background: #e2f4eb; border-color: var(--success); }
.mensaje.warning { color: #754600; background: #fff2d5; border-color: var(--warning); }
.mensaje.error { color: #821c15; background: #fde9e7; border-color: var(--danger); }

@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

.notificacion-item {
    display: block;
    margin-bottom: 9px;
    padding: 17px 18px;
    color: inherit;
    background: var(--surface-soft);
    border: 1px solid transparent;
    border-radius: 11px;
    text-decoration: none;
    transition: background .2s ease, transform .2s ease;
}
.notificacion-item:hover { background: #f0f1ee; transform: translateX(2px); }
.notificacion-item.no-leida { background: #fff4f5; border-color: #f6c6ce; }
.notificacion-encabezado { display: flex; justify-content: space-between; gap: 16px; }
.notificacion-fecha { flex: 0 0 auto; color: var(--muted); font-size: 11px; }

.menu-overlay,
.drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: none;
    background: rgba(4,6,7,.5);
    border: 0;
    backdrop-filter: blur(2px);
}

.notification-drawer {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 1300;
    display: flex;
    width: min(92vw, 390px);
    padding: 26px;
    flex-direction: column;
    color: white;
    background: var(--ink);
    box-shadow: -20px 0 60px rgba(0,0,0,.25);
    transform: translateX(105%);
    transition: transform .35s var(--ease);
}

body.drawer-abierto .notification-drawer { transform: translateX(0); }
body.drawer-abierto .drawer-overlay { display: block; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.drawer-title { margin: 0; font-size: 24px; letter-spacing: -.03em; }
.drawer-close { color: white; }
.drawer-body { display: flex; flex: 1; flex-direction: column; justify-content: center; }
.drawer-kicker { color: #9ca1a5; font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.drawer-number { margin: 12px 0; font-size: 72px; font-weight: 760; letter-spacing: -.065em; line-height: .9; }
.drawer-copy { max-width: 290px; color: #b9bec2; }
.drawer-action { width: 100%; margin-top: 26px; color: var(--ink); background: white; }

.dashboard-hero {
    position: relative;
    display: grid;
    min-height: 300px;
    margin-bottom: 1px;
    padding: clamp(30px, 5vw, 66px);
    overflow: hidden;
    align-content: end;
    color: #fff;
    background:
        radial-gradient(circle at 82% 23%, rgba(228,0,43,.72), transparent 22%),
        radial-gradient(circle at 68% 77%, rgba(96,16,31,.55), transparent 25%),
        linear-gradient(125deg, #080a0b 0%, #171a1d 58%, #090a0b 100%);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.dashboard-hero::before,
.dashboard-hero::after {
    position: absolute;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 50%;
    content: "";
    animation: orbit 10s ease-in-out infinite alternate;
}
.dashboard-hero::before { top: -130px; right: -40px; width: 390px; height: 390px; }
.dashboard-hero::after { top: -25px; right: 75px; width: 220px; height: 220px; animation-delay: -4s; }
@keyframes orbit { to { transform: translate3d(-16px, 12px, 0) scale(1.04); } }

.hero-content { position: relative; z-index: 1; max-width: 760px; }
.hero-kicker { margin-bottom: 12px; color: #c9cdd0; font-size: 10px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.hero-title { margin: 0; font-size: clamp(36px, 5vw, 68px); font-weight: 720; letter-spacing: -.06em; line-height: .98; }
.hero-copy { max-width: 600px; margin: 17px 0 0; color: #c8ccd0; font-size: 15px; }
.hero-action { margin-top: 26px; color: var(--ink); background: #fff; }

.metric-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 30px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-top: 0;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.metric-item { position: relative; min-height: 118px; padding: 26px; }
.metric-item + .metric-item { border-left: 1px solid var(--line); }

.process-panel {
    margin-bottom: 30px;
    padding: clamp(24px, 3vw, 36px);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.section-title { margin: 0; font-size: 21px; letter-spacing: -.025em; }
.section-copy { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.process-track { display: grid; grid-template-columns: repeat(7, minmax(110px, 1fr)); overflow-x: auto; padding: 6px 0 4px; }
.process-step { position: relative; min-width: 110px; padding: 0 14px 0 0; }
.process-step:not(:last-child)::after { position: absolute; top: 15px; right: 0; left: 34px; height: 1px; background: #cfd3ce; content: ""; }
.process-dot { position: relative; z-index: 1; display: grid; width: 31px; height: 31px; place-items: center; color: #fff; background: var(--ink); border: 5px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px var(--ink); font-size: 9px; font-weight: 800; }
.process-name { display: block; margin-top: 12px; font-size: 11px; font-weight: 760; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 24px; }
.dashboard-panel { min-width: 0; margin: 0; }
.quick-actions { display: grid; gap: 9px; }
.quick-link { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 2px; border-bottom: 1px solid var(--line); text-decoration: none; transition: padding .2s ease; }
.quick-link:hover { padding-left: 7px; }
.quick-link:last-child { border-bottom: 0; }
.quick-link span:first-child { font-weight: 700; }
.quick-arrow { font-size: 20px; }

.login-page {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(420px, 1.15fr) minmax(420px, .85fr);
    background: #fff;
}

.login-visual {
    position: relative;
    display: flex;
    min-height: 100vh;
    padding: clamp(34px, 5vw, 78px);
    overflow: hidden;
    flex-direction: column;
    justify-content: space-between;
    color: #fff;
    background:
        radial-gradient(circle at 82% 19%, rgba(228,0,43,.68), transparent 20%),
        radial-gradient(circle at 18% 86%, rgba(87,94,101,.28), transparent 25%),
        linear-gradient(135deg, #060708, #171a1d 60%, #08090a);
}
.login-visual::before { position: absolute; inset: 12% -23% auto auto; width: 70vw; height: 70vw; max-width: 780px; max-height: 780px; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; content: ""; }
.login-brand, .login-story { position: relative; z-index: 1; }
.login-brand img { width: 112px; height: 48px; object-fit: contain; filter: brightness(0) invert(1); }
.login-eyebrow { color: #aeb4b8; font-size: 10px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; }
.login-story p { max-width: 580px; margin: 0; color: #bdc2c6; font-size: 15px; }
.login-steps { position: relative; z-index: 1; display: flex; gap: 7px; margin-top: 40px; }
.login-steps span { height: 3px; flex: 1; background: rgba(255,255,255,.16); }
.login-steps span:first-child { background: var(--accent); }

.login-form-side { display: grid; min-height: 100vh; padding: clamp(30px, 6vw, 90px); place-items: center; }
.login-box { width: min(100%, 430px); }
.login-box h2 { margin: 0; font-size: clamp(30px, 4vw, 46px); letter-spacing: -.05em; line-height: 1; }
.login-intro { margin: 13px 0 36px; color: var(--muted); }
.login-box label { margin-top: 18px; }
.login-box .login-submit { width: 100%; margin-top: 8px; }
.login-meta { margin-top: 28px; color: var(--muted); font-size: 11px; text-align: center; }

@media (max-width: 1120px) {
    .tarjetas, .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .metric-item:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
    .metric-item:nth-child(4) { border-top: 1px solid var(--line); }
    .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .sidebar { width: min(84vw, 300px); transform: translateX(-105%); box-shadow: 18px 0 55px rgba(0,0,0,.28); }
    .main, body.menu-compacto .main { margin-left: 0; }
    body.menu-movil-abierto .sidebar { transform: translateX(0); }
    body.menu-movil-abierto .menu-overlay { display: block; }
    body.menu-compacto .sidebar { width: min(84vw, 300px); }
    body.menu-compacto .brand { padding-inline: 24px; justify-content: flex-start; }
    body.menu-compacto .brand-logo { width: 70px; flex-basis: 70px; }
    body.menu-compacto .brand-copy,
    body.menu-compacto .menu-titulo,
    body.menu-compacto .nav-text { opacity: 1; pointer-events: auto; transform: none; }
    body.menu-compacto .nav-link { justify-content: flex-start; padding-inline: 13px; }
    .usuario-datos { display: none; }
    .contenido { padding: 24px 18px 40px; }
    .login-page { grid-template-columns: 1fr; }
    .login-visual { min-height: 42vh; padding: 34px 28px; }
    .login-visual::before { width: 100vw; height: 100vw; }
    .login-form-side { min-height: 58vh; padding: 46px 24px; }
}

@media (max-width: 660px) {
    .topbar { min-height: 66px; padding-inline: 13px; }
    .topbar-izquierda { gap: 9px; }
    .encabezado-pagina { align-items: flex-start; flex-direction: column; }
    .encabezado-pagina .acciones, .encabezado-pagina > .boton { width: 100%; }
    .encabezado-pagina .boton { flex: 1; }
    .tarjetas, .metric-strip { grid-template-columns: 1fr 1fr; }
    .tarjetas .tarjeta, .metric-item { min-height: 104px; padding: 20px 16px; }
    .metric-item:nth-child(3) { border-left: 0; }
    .detalle-grid { grid-template-columns: 1fr; }
    .dashboard-hero { min-height: 340px; padding: 28px 22px; }
    .hero-title { font-size: 42px; }
    .table-tools { align-items: stretch; flex-direction: column; }
    .table-search { width: 100%; }
    table.responsive-table thead { display: none; }
    table.responsive-table, table.responsive-table tbody, table.responsive-table tr, table.responsive-table td { display: block; width: 100%; }
    table.responsive-table tr { margin-bottom: 12px; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
    table.responsive-table td { display: grid; grid-template-columns: minmax(90px, .7fr) minmax(0, 1.3fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid #eceeea; text-align: right; }
    table.responsive-table td::before { color: var(--muted); content: attr(data-label); font-size: 9px; font-weight: 800; letter-spacing: .07em; text-align: left; text-transform: uppercase; }
    table.responsive-table td:last-child { border-bottom: 0; }
    table.responsive-table .acciones { justify-content: flex-end; }
}

@media (max-width: 430px) {
    .tarjetas, .metric-strip { grid-template-columns: 1fr; }
    .metric-item + .metric-item { border-top: 1px solid var(--line); border-left: 0; }
    .topbar-titulo { max-width: 130px; }
    .login-visual { min-height: 38vh; }
    .login-story p, .login-steps { display: none; }
}

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

.empresa-chip { padding: 6px 10px; color: #fff; background: var(--ink); border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.boton-cambiar-empresa { padding: 7px 10px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 11px; font-weight: 700; }
.company-page { min-height: 100vh; background: #f1f2ef; }
.company-shell { width: min(1380px, calc(100% - 48px)); margin: 0 auto; padding: clamp(44px, 7vw, 100px) 0; }
.company-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 42px; }
.company-header h1, .company-access-form h1 { margin: 5px 0 10px; font-size: clamp(38px, 5vw, 68px); letter-spacing: -.06em; line-height: .95; }
.company-header p, .company-access-form > p { max-width: 650px; margin: 0; color: var(--muted); }
.company-eyebrow { color: var(--accent) !important; font-size: 10px; font-weight: 850; letter-spacing: .18em; text-transform: uppercase; }
.company-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.company-card { display: flex; min-height: 390px; overflow: hidden; flex-direction: column; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 12px 35px rgba(10,12,14,.05); text-decoration: none; transition: transform .28s var(--ease), box-shadow .28s ease, border-color .28s ease; }
.company-card:hover { border-color: #9da29c; box-shadow: 0 24px 60px rgba(10,12,14,.12); transform: translateY(-7px); }
.company-logo-frame { display: grid; min-height: 305px; padding: 42px; flex: 1; place-items: center; background: #fff; }
.company-logo-frame img { display: block; width: 100%; height: 190px; object-fit: contain; }
.company-card-footer { display: flex; min-height: 86px; align-items: center; justify-content: space-between; gap: 20px; padding: 19px 22px; color: #fff; background: var(--ink); }
.company-card-footer strong, .company-card-footer small { display: block; }
.company-card-footer strong { font-size: 17px; }
.company-card-footer small { margin-top: 4px; color: #aeb3b6; font-size: 10px; }
.company-arrow { font-size: 28px; transition: transform .25s ease; }
.company-card:hover .company-arrow { transform: translateX(5px); }
.company-access-shell { width: min(1040px, calc(100% - 40px)); margin: 0 auto; padding: clamp(34px, 7vw, 90px) 0; }
.company-back { display: inline-block; margin-bottom: 22px; color: var(--muted); font-size: 12px; font-weight: 750; text-decoration: none; }
.company-access-card { display: grid; min-height: 570px; overflow: hidden; grid-template-columns: 1.05fr .95fr; background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 24px 70px rgba(10,12,14,.1); }
.company-access-brand { display: grid; padding: 60px; place-items: center; background: #f7f8f6; border-right: 1px solid var(--line); }
.company-access-brand img { width: 100%; height: 250px; object-fit: contain; }
.company-access-form { display: flex; padding: clamp(38px, 6vw, 72px); flex-direction: column; justify-content: center; }
.company-access-form h1 { font-size: clamp(34px, 4vw, 54px); }
.company-access-form form { margin-top: 30px; }
.company-access-submit { width: 100%; margin-top: 10px; }
.filter-bar { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)) auto; align-items: end; gap: 12px; margin: 0 0 18px; padding: 14px; background: #f7f8f6; border: 1px solid var(--line); border-radius: 10px; }
.filter-bar .form-field { margin: 0; }
.filter-bar label { margin: 0 0 5px; font-size: 10px; }
.filter-bar .form-actions { display: flex; gap: 7px; margin: 0; }
.filter-bar .boton { white-space: nowrap; }
.acciones-consolidado { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.acciones-consolidado form { margin: 0; }
.confirmar-autorizacion { padding: 0; color: #a86500; background: transparent; border: 0; cursor: pointer; font: inherit; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 900px) {
    .company-grid { grid-template-columns: 1fr; }
    .company-card { min-height: 300px; }
    .company-logo-frame { min-height: 230px; }
    .company-access-card { grid-template-columns: 1fr; }
    .company-access-brand { min-height: 250px; border-right: 0; border-bottom: 1px solid var(--line); }
    .company-access-brand img { height: 170px; }
}

@media (max-width: 660px) {
    .filter-bar { grid-template-columns: 1fr; }
    .filtros-lista { grid-template-columns: 1fr; }
    .paginacion { align-items: stretch; flex-direction: column; }
    .company-shell { width: min(100% - 28px, 1380px); padding-top: 34px; }
    .company-header { align-items: flex-start; flex-direction: column; }
    .company-header .boton { width: 100%; }
    .company-logo-frame { padding: 28px; }
    .company-header h1 { font-size: 42px; }
    .empresa-chip, .boton-cambiar-empresa { display: none; }
}
