/* ============================================================
   AVANZARP POWER · Sistema de diseño interno
   Paleta de marca, tipografías y componentes operativos.
   ============================================================ */

:root {
    /* Marca */
    --primary: #134381;
    --blue: #1F638A;
    --teal: #24758B;
    --accent: #44A081;
    --accent-2: #7fe0bd;
    --ink: #0F0F0F;
    --navy: #0d2a53;
    --navy-2: #123c72;

    /* Superficies */
    --surface: #FFFFFF;
    --bg: #FBFBFA;
    --muted: #EDEDE9;
    --line: #E2E2DC;
    --line-soft: #ECECE6;
    --text: #0F0F0F;
    --text-soft: #5B6472;
    --text-faint: #9aa1ac;

    /* Estados */
    --ok: #2f7d61;
    --ok-bg: rgba(68,160,129,.14);
    --ok-bd: rgba(68,160,129,.30);
    --info: #194f70;
    --info-bg: rgba(31,99,138,.10);
    --info-bd: rgba(31,99,138,.24);
    --warn: #9a6a13;
    --warn-bg: rgba(214,158,46,.14);
    --warn-bd: rgba(214,158,46,.30);
    --danger: #C0564B;
    --danger-bg: rgba(192,86,75,.12);
    --danger-bd: rgba(192,86,75,.28);

    /* Familias de estado en gráficos (paleta validada para daltonismo y contraste) */
    --st-pendiente: #7B5FBF;
    --st-preparacion: #B4801F;
    --st-transito: #2F6FB5;
    --st-entregado: #2E9E76;
    --st-excepcion: #C0453B;

    --brand-gradient: linear-gradient(100deg,#44A081 0%,#24758B 45%,#134381 100%);
    --radius: 10px;
    --radius-sm: 6px;
    --shadow-card: 0 24px 60px -44px rgba(9,30,60,.45);
    --shadow-pop: 0 18px 40px -20px rgba(9,30,60,.35);

    --sidebar-w: 264px;
    --topbar-h: 64px;

    --font-ui: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
    --font-head: 'Space Grotesk', var(--font-ui);
    --font-mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font-ui);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; letter-spacing: -.4px; margin: 0; }

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--primary); }

.mono { font-family: var(--font-mono); }

/* ---------- Layout general ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: linear-gradient(180deg, #0d2a53 0%, #0b2547 100%);
    color: #dfe7f2;
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    height: 100vh;
    z-index: 30;
    border-right: 1px solid rgba(255,255,255,.06);
}

.sidebar__brand {
    padding: 20px 22px 18px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar__nav { padding: 14px 12px; overflow-y: auto; flex: 1; }
.nav-group-label {
    font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase;
    color: #6f86a8; padding: 16px 12px 8px; font-weight: 600;
}

.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 8px;
    color: #b9c7dc; font-size: 14.5px; font-weight: 500;
    cursor: pointer; transition: background .15s, color .15s;
    text-decoration: none; margin-bottom: 2px;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: rgba(68,160,129,.16); color: #fff; }
.nav-item.active .nav-item__icon { color: var(--accent-2); }
.nav-item__icon { width: 20px; height: 20px; display: inline-flex; flex-shrink: 0; color: #8fa4c2; }
.nav-item.active .nav-item__icon { color: var(--accent-2); }

.sidebar__user {
    display: flex; align-items: center; gap: 11px;
    padding: 13px 16px; border-top: 1px solid rgba(255,255,255,.08);
    color: inherit; text-decoration: none; min-width: 0;
}
.sidebar__user:hover { background: rgba(255,255,255,.05); color: inherit; }
.sidebar__user .avatar { width: 34px; height: 34px; }
.sidebar__user-datos { display: flex; flex-direction: column; min-width: 0; }
.sidebar__user-nombre {
    display: block; font-size: 13.5px; font-weight: 500; color: #e8eefa; line-height: 1.25;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar__user-rol {
    display: block; font-size: 11px; font-weight: 600; letter-spacing: 1px;
    text-transform: uppercase; color: #7f93b3;
}

.sidebar__footer {
    padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.08);
    font-size: 12.5px; color: #7f93b3;
}

.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }

.topbar {
    height: var(--topbar-h);
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center; gap: 18px;
    padding: 0 28px; position: sticky; top: 0; z-index: 20;
}
.topbar__title { font-family: var(--font-head); font-weight: 600; font-size: 17px; }
.topbar__crumb { color: var(--text-faint); font-weight: 400; }
.topbar__spacer { flex: 1; }

/* Botón de menú: solo visible cuando el sidebar se oculta (pantallas angostas).
   Se califica con .topbar para ganarle a la regla genérica de .icon-btn. */
.topbar .topbar__menu { display: none; align-items: center; justify-content: center; padding: 8px; }

/* Interruptor del menú lateral en pantallas angostas (sin JavaScript). */
.nav-toggle { position: absolute; width: 0; height: 0; opacity: 0; pointer-events: none; }
.nav-backdrop { display: none; }

.content { padding: 28px; max-width: 1440px; width: 100%; }

.page-head { margin-bottom: 24px; }
.page-head__kicker {
    font-size: 12px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase;
    color: var(--teal); margin-bottom: 8px;
}
.page-head__title { font-size: 30px; line-height: 1.1; }
.page-head__sub { color: var(--text-soft); font-size: 15px; margin-top: 8px; max-width: 720px; }

/* ---------- Marca / logo ---------- */
.brand-mark { display: flex; flex-direction: column; align-items: flex-start; line-height: .95; }
.brand-mark__img { width: 100%; max-width: 196px; height: auto; display: block; }
.brand-mark__tag {
    font-family: var(--font-head); font-weight: 500; font-size: 10px; letter-spacing: 4px;
    color: #8fa4c2; margin-top: 7px; padding-left: 2px;
}
.brand-mark__tag.on-light { color: var(--text-soft); }
.auth__aside .brand-mark__img { max-width: 260px; }

/* ---------- Botones ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: var(--font-ui); font-size: 14.5px; font-weight: 600;
    padding: 10px 18px; border-radius: 8px; border: 1px solid transparent;
    cursor: pointer; transition: filter .15s, background .15s, border-color .15s;
    white-space: nowrap; text-decoration: none;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { filter: brightness(1.06); color: #fff; }
.btn-gradient { background: var(--brand-gradient); color: #fff; }
.btn-gradient:hover { filter: brightness(1.06); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--muted); color: var(--text); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-lg { padding: 13px 24px; font-size: 15.5px; }

/* ---------- Tarjetas ---------- */
.card {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow-card);
}
.card--flat { box-shadow: none; }
.card__head { padding: 18px 22px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; gap: 12px; }
.card__title { font-family: var(--font-head); font-weight: 600; font-size: 16px; }
.card__body { padding: 22px; }

/* ---------- KPI ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; }
.kpi {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 20px 22px; position: relative; overflow: hidden;
}
.kpi::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--brand-gradient);
}
.kpi__label { font-size: 13px; color: var(--text-soft); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.kpi__value { font-family: var(--font-mono); font-weight: 600; font-size: 34px; letter-spacing: -1px; line-height: 1; }
.kpi__delta { font-size: 12.5px; margin-top: 8px; color: var(--text-soft); }
.kpi__delta.up { color: var(--ok); }
.kpi__delta.down { color: var(--danger); }

/* ---------- Badges de estado ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 4px 11px; border-radius: 6px; font-size: 12.5px; font-weight: 600;
    border: 1px solid var(--line); background: var(--muted); color: var(--text-soft);
}
.badge .dot { width: 7px; height: 7px; border-radius: 2px; background: currentColor; }
.badge--ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-bd); }
.badge--info { background: var(--info-bg); color: var(--info); border-color: var(--info-bd); }
.badge--warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-bd); }
.badge--danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-bd); }
.badge--muted { background: var(--muted); color: var(--text-soft); border-color: var(--line); }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data thead th {
    text-align: left; font-weight: 600; color: var(--text-soft); font-size: 12.5px;
    text-transform: uppercase; letter-spacing: .4px;
    padding: 12px 16px; border-bottom: 1px solid var(--line);
}
table.data tbody td { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: #fafaf7; }
table.data .code { font-family: var(--font-mono); color: var(--primary); font-weight: 500; }

/* ---------- Formularios ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 500; color: var(--text-soft); margin-bottom: 7px; }
.input, .select, textarea.input {
    width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm);
    font-family: var(--font-ui); font-size: 14.5px; background: #fff; color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, textarea.input:focus {
    outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(36,117,139,.12);
}
.field-error { color: var(--danger); font-size: 12.5px; margin-top: 6px; }
.form-grid { display: grid; gap: 16px; }
.form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.form-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- Timeline de seguimiento ---------- */
.timeline { display: flex; flex-direction: column; }
.tl-row { display: grid; grid-template-columns: 30px 1fr; gap: 16px; }
.tl-mark { display: flex; flex-direction: column; align-items: center; }
.tl-dot { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; color: #fff; }
.tl-dot.done { background: var(--accent); }
.tl-dot.current { background: var(--primary); box-shadow: 0 0 0 5px rgba(19,67,129,.15); }
.tl-dot.pending { background: #F0F0EA; border: 2px solid #E0E0D9; }
.tl-line { width: 2px; flex: 1; min-height: 22px; background: var(--line); }
.tl-line.done { background: var(--accent); }
.tl-body { padding-bottom: 22px; }
.tl-title { font-size: 15px; font-weight: 500; }
.tl-title.strong { font-weight: 600; }
.tl-time { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-faint); margin-top: 3px; }

/* ---------- Wizard de pasos ---------- */
.steps { display: flex; align-items: center; gap: 12px; }
.step { display: flex; align-items: center; gap: 10px; }
.step__num {
    width: 32px; height: 32px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center;
    font-family: var(--font-mono); font-weight: 600; font-size: 14px;
    background: #fff; border: 1.5px solid var(--line); color: var(--text-faint);
}
.step.active .step__num { background: var(--primary); border-color: var(--primary); color: #fff; }
.step.done .step__num { background: var(--accent); border-color: var(--accent); color: #fff; }
.step__label { font-size: 14px; color: var(--text-soft); }
.step.active .step__label { color: var(--text); font-weight: 600; }
.step__bar { flex: 1; height: 2px; background: var(--line); min-width: 24px; }
.step__bar.done { background: var(--accent); }

/* ---------- Utilidades ---------- */
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.mt-8{margin-top:8px}.mt-16{margin-top:16px}.mt-24{margin-top:24px}.mb-16{margin-bottom:16px}.mb-24{margin-bottom:24px}
.grid { display: grid; }
.between { justify-content: space-between; }
.text-soft { color: var(--text-soft); }
.text-faint { color: var(--text-faint); }
.chip {
    display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px;
    border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; font-size: 13.5px; color: var(--text-soft);
}
.divider { height: 1px; background: var(--line-soft); margin: 20px 0; }
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-faint); }
.empty-state__icon { font-size: 34px; margin-bottom: 10px; opacity: .5; }

/* ---------- Pantalla de autenticación ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.auth__aside {
    background: linear-gradient(150deg, #123c72, #0d2a53);
    color: #fff; padding: 56px; position: relative; overflow: hidden;
    display: flex; flex-direction: column; justify-content: space-between;
}
.auth__aside-bg { position: absolute; inset: 0; opacity: .5; }
.auth__panel { display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--bg); }
.auth__card { width: 100%; max-width: 400px; }
.auth__headline { font-family: var(--font-head); font-weight: 700; font-size: 40px; line-height: 1.05; letter-spacing: -1.5px; position: relative; }
.auth__lead { font-size: 17px; color: #bcd0e8; margin-top: 18px; max-width: 420px; position: relative; }
.auth__feature { display: flex; gap: 12px; align-items: center; font-size: 15px; color: #d7e2f1; margin-top: 14px; }
.auth__feature .tick { color: var(--accent-2); font-weight: 700; }
/* Pantallas de cuenta de una sola columna (activación, invitación, avisos) */
.auth-simple {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 40px 20px; background: var(--bg);
}
.auth-simple__card {
    width: 100%; max-width: 460px; text-align: center;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-card); padding: 36px 32px;
}
.auth-simple__card .brand-mark { align-items: center; margin-bottom: 24px; }
.auth-simple__card .brand-mark__img { max-width: 190px; margin: 0 auto; }
.auth-simple__card .brand-mark__tag { align-self: center; }
.auth-simple__icon { font-size: 40px; line-height: 1; margin-bottom: 10px; }
.auth-simple__title { font-size: 24px; margin-bottom: 10px; }
.auth-simple__card .field label { text-align: left; }

.alert {
    padding: 12px 15px; border-radius: var(--radius-sm); font-size: 13.5px; margin-bottom: 18px;
    background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-bd);
}
.alert--ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-bd); }
.alert--warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-bd); }
.alert ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------- Modal ---------- */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(13,42,83,.42); backdrop-filter: blur(2px);
    display: flex; align-items: flex-start; justify-content: center; padding: 48px 20px; z-index: 100; overflow-y: auto;
}
.modal-card {
    background: var(--surface); border-radius: var(--radius); width: 100%; max-width: 620px;
    box-shadow: 0 40px 90px -40px rgba(9,30,60,.6); border: 1px solid var(--line); animation: modalIn .16s ease;
}
.modal-card.sm { max-width: 460px; }
.modal-card.lg { max-width: 820px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.modal-head { padding: 20px 24px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-head__title { font-family: var(--font-head); font-weight: 600; font-size: 18px; }
.modal-body { padding: 24px; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--line-soft); display: flex; justify-content: flex-end; gap: 10px; }
.icon-btn { background: none; border: none; cursor: pointer; color: var(--text-faint); padding: 6px; border-radius: 6px; display: inline-flex; }
.icon-btn:hover { background: var(--muted); color: var(--text); }

/* ---------- Barra de error de Blazor ----------
   Debe vivir en el CSS global: la dibujan MainLayout y AuthLayout, y con CSS aislado
   la regla solo alcanzaría a uno de los dos (el otro la mostraría siempre).
   Blazor la hace visible poniendo display:block en línea cuando ocurre un error. */
#blazor-error-ui {
    color-scheme: light only;
    display: none;
    position: fixed; left: 0; bottom: 0; width: 100%; z-index: 1000;
    box-sizing: border-box; padding: 12px 20px; font-size: 14px;
    background: #fff; border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px -12px rgba(9,30,60,.25);
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 16px; top: 10px; }

/* ---------- Toast ---------- */
.toast-host { position: fixed; right: 24px; bottom: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast {
    background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent);
    border-radius: var(--radius-sm); padding: 13px 18px; box-shadow: var(--shadow-pop); font-size: 14px;
    min-width: 260px; max-width: 380px; animation: modalIn .16s ease;
}
.toast.error { border-left-color: var(--danger); }

/* ---------- Tabs / segment ---------- */
.segment { display: inline-flex; background: var(--muted); border-radius: 8px; padding: 3px; gap: 3px; }
.segment button {
    border: none; background: none; padding: 8px 16px; border-radius: 6px; font-family: var(--font-ui);
    font-size: 14px; font-weight: 500; color: var(--text-soft); cursor: pointer;
}
.segment button.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(9,30,60,.12); font-weight: 600; }

/* ---------- Switch ---------- */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; cursor: pointer; inset: 0; background: #cfd3cf; border-radius: 999px; transition: .18s; }
.switch span::before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .18s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::before { transform: translateX(18px); }

/* ---------- Toolbar / filtros ---------- */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .input, .toolbar .select { width: auto; }
.search { position: relative; }
.search .input { padding-left: 38px; min-width: 260px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-faint); }

/* ---------- Roles / chips de datos ---------- */
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 5px; font-size: 12px; font-weight: 500; background: var(--muted); color: var(--text-soft); }
.tag--admin { background: rgba(19,67,129,.10); color: var(--primary); }
.tag--operador { background: rgba(36,117,139,.12); color: var(--teal); }
.tag--cliente { background: rgba(68,160,129,.12); color: var(--ok); }
.avatar { width: 34px; height: 34px; border-radius: 8px; background: var(--brand-gradient); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; font-family: var(--font-head); flex-shrink: 0; }
.cell-user { display: flex; align-items: center; gap: 12px; }
.cell-user__name { font-weight: 500; }
.cell-user__sub { font-size: 12.5px; color: var(--text-faint); }
.actions-row { display: flex; gap: 6px; }

/* ---------- Gráficos (CSS puro, sin dependencias) ---------- */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; }
.chart-note { font-size: 12.5px; color: var(--text-faint); margin-top: 14px; }

/* Barra apilada de composición */
.stacked-bar { display: flex; width: 100%; height: 16px; gap: 2px; margin-bottom: 20px; }
.stacked-bar__seg { border-radius: 4px; min-width: 5px; }

.chart-legend { display: flex; flex-wrap: wrap; gap: 12px 26px; }
.chart-legend__item { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--text-soft); }
.chart-legend__swatch { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }
.chart-legend__val { font-family: var(--font-mono); font-weight: 600; color: var(--text); }

/* Columnas: actividad por día */
.chart-cols { display: flex; align-items: flex-end; gap: 5px; height: 132px; }
.chart-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.chart-col__bar { background: var(--primary); border-radius: 4px 4px 0 0; min-height: 3px; }
.chart-col__bar.vacio { background: var(--muted); }
.chart-col__bar.hoy { background: var(--accent); }
.chart-axis { display: flex; gap: 5px; margin-top: 9px; }
.chart-axis span {
    flex: 1; text-align: center; font-family: var(--font-mono);
    font-size: 10.5px; color: var(--text-faint);
}

/* Barras horizontales: ranking */
.chart-rank { display: flex; flex-direction: column; gap: 13px; }
.chart-rank__row { display: grid; grid-template-columns: 130px 1fr 40px; align-items: center; gap: 12px; font-size: 13.5px; }
.chart-rank__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-rank__track { background: var(--muted); border-radius: 4px; height: 10px; }
.chart-rank__fill { background: var(--teal); height: 100%; border-radius: 4px; min-width: 5px; }
.chart-rank__val { font-family: var(--font-mono); font-weight: 600; font-size: 13px; text-align: right; }

@media (max-width: 900px) {
    .auth { grid-template-columns: 1fr; }
    .auth__aside { display: none; }
    .form-grid.cols-2, .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: 1fr; }
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
    .main { margin-left: 0; }

    /* Menú lateral deslizante */
    .topbar .topbar__menu { display: inline-flex; }
    .nav-toggle:checked ~ .sidebar { transform: none; box-shadow: 0 30px 70px -25px rgba(9,30,60,.6); }
    .nav-toggle:checked ~ .nav-backdrop {
        display: block; position: fixed; inset: 0; z-index: 25;
        background: rgba(13,42,83,.45); backdrop-filter: blur(2px);
    }

    .topbar { padding: 0 16px; gap: 12px; }
    .content { padding: 20px 16px; }
    .page-head__title { font-size: 24px; }
    .chart-rank__row { grid-template-columns: 96px 1fr 36px; }
}
