/* =========================================================================
   Argoris | panel del cliente, panel de Argoris (super) y acceso.
   La plataforma usa la identidad de Argoris (grafito y acero); el color lo pone cada módulo
   (TruckPoint: rojo señal). Verde, ámbar y rojo de estado son solo semánticos.
   ========================================================================= */

@font-face { font-family: "Inter"; src: url("../fonts/Inter-Variable.woff2") format("woff2"), url("../fonts/Inter-Variable.woff") format("woff"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("../fonts/Montserrat-Variable.woff2") format("woff2"), url("../fonts/Montserrat-Variable.woff") format("woff"); font-weight: 100 900; font-display: swap; }

:root {
  /* Identidad Argoris */
  --brand: #18191d;       /* grafito */
  --brand-dark: #3a3d45;  /* grafito medio (hover sobre grafito) */
  --brand-soft: #eceef1;
  --steel: #8d939e;       /* acero: acentos de plataforma sobre fondo oscuro */
  --steel-light: #c9cdd4;
  --night: #18191d;
  /* Módulo TruckPoint */
  --tp: #d0142c;
  --tp-dark: #a80f22;
  --ink: #11131a;
  --ink-soft: #3b4252;
  --muted: #646b7d;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --border: #e3e5ea;
  --ok: #0b8457;
  --ok-soft: #e3f8ef;
  --bad: #c8142c;
  --bad-soft: #fde8eb;
  --warn: #9a5b00;
  --info: #0b6bcb;
  --info-soft: #e5f0fb;
  --entry: #121316;
  --exit: #d0142c;
  --radius: 10px;
  /* Superficies y tintas que cambian con el tema */
  --surface-2: #f7f8fa;      /* fondos secundarios: filas, códigos, campos de búsqueda */
  --line2: #d9dce3;          /* bordes de campos y hover */
  --hover: rgb(17 19 26 / .045);
  --on-brand: #ffffff;       /* texto sobre el botón principal */
  --bad-line: #f2c2ca;
  --warn-soft: #fff4e0;
  --warn-text: #7a4a00;
  --tp-soft: #fde8eb;
  --tp-text: #a80f22;
  --tip-bg: #18191d;
  --shadow: 0 1px 2px rgb(24 25 29 / .04);
  --shadow-2: 0 1px 2px rgb(24 25 29 / .04), 0 12px 32px -8px rgb(24 25 29 / .14);
  --heat-0: #f1f3f6; --heat-1: #dcdfe4; --heat-2: #b9bdc5; --heat-3: #8d939e; --heat-4: #555a64; --heat-5: #18191d;
  color-scheme: light;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Montserrat", "Inter", system-ui, sans-serif;
}

/* Modo oscuro (predeterminado del panel): grafito profundo, texto claro y acero como acento */
[data-theme="dark"] {
  --brand: #eceef1;
  --brand-dark: #ffffff;
  --brand-soft: rgb(255 255 255 / .07);
  --on-brand: #16171b;
  --night: #0b0c0f;
  --ink: #f2f3f5;
  --ink-soft: #babec7;
  --muted: #8b909b;
  --bg: #0e0f12;
  --surface: #16171b;
  --surface-2: #1c1d22;
  --border: rgb(255 255 255 / .08);
  --line2: rgb(255 255 255 / .14);
  --hover: rgb(255 255 255 / .04);
  --ok: #4ade80;
  --ok-soft: rgb(74 222 128 / .12);
  --bad: #ff6b7a;
  --bad-soft: rgb(255 90 105 / .13);
  --bad-line: rgb(255 90 105 / .35);
  --warn: #ffb54d;
  --warn-soft: rgb(255 170 60 / .12);
  --warn-text: #ffc266;
  --info: #7aa2ff;
  --info-soft: rgb(100 140 255 / .13);
  --entry: #c9cdd4;
  --tp-soft: rgb(208 20 44 / .16);
  --tp-text: #ff6b7a;
  --tip-bg: #2a2c33;
  --shadow: 0 1px 2px rgb(0 0 0 / .5);
  --shadow-2: 0 1px 2px rgb(0 0 0 / .5), 0 12px 32px -8px rgb(0 0 0 / .7);
  --heat-0: #1b1c21; --heat-1: #2a2c33; --heat-2: #464a54; --heat-3: #737985; --heat-4: #aab0ba; --heat-5: #eceef1;
  color-scheme: dark;
}
.theme-anim, .theme-anim * { transition: background-color .2s ease, border-color .2s ease, color .2s ease !important; }

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font: 400 15px/1.55 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.02em; line-height: 1.2; margin: 0; }
h1 { font-size: 1.625rem; font-weight: 800; }
h2 { font-size: 1.0625rem; font-weight: 700; margin-bottom: .9rem; }
h3 { font-size: .9375rem; font-weight: 700; margin: 1.25rem 0 .5rem; }
p { margin: 0; }
a { color: var(--brand); text-underline-offset: .18em; }
a:hover { color: var(--brand-dark); }
code { font-size: .875em; background: var(--surface-2); padding: .05rem .3rem; border-radius: 4px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 3px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.prewrap { white-space: pre-wrap; }
.text-bad { color: var(--bad); }
.text-ok { color: var(--ok); }
.text-warn { color: var(--warn); font-weight: 600; }
.skip { position: absolute; left: 1rem; top: -100px; background: var(--ink); color: #fff; padding: .5rem 1rem; border-radius: 6px; z-index: 100; }
.skip:focus { top: 1rem; color: #fff; }

/* ---------------------------------------------------------------- Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 42px; padding: .55rem 1.05rem;
  border: 1.5px solid transparent; border-radius: var(--radius);
  font: 600 .9375rem/1.2 var(--font); text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-dark); color: var(--on-brand); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--line2); color: var(--ink); background: var(--surface-2); }
.btn-danger { background: var(--surface); color: var(--bad); border-color: var(--bad-line); }
.btn-danger:hover { background: var(--bad-soft); }
.btn-block { width: 100%; }
.btn-lg { min-height: 52px; font-size: 1.0625rem; }
.btn-sm { min-height: 34px; padding: .35rem .75rem; font-size: .875rem; }

/* ---------------------------------------------------------------- Formularios */
.form { display: grid; gap: 1.05rem; }
.form-narrow { max-width: 560px; }
.form h2 { margin: .5rem 0 -.25rem; }
.field { display: grid; gap: .35rem; }
.field label, legend { font-weight: 600; font-size: .9375rem; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 44px; padding: .55rem .75rem;
  font: inherit; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 8px;
}
.field input[type="color"] { padding: .2rem; width: 80px; }
.field input[type="file"] { padding: .45rem; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--bad); }
.field-error { color: var(--bad); font-size: .875rem; font-weight: 600; }
.field-hint { color: var(--muted); font-size: .8125rem; }
.check { display: inline-flex; align-items: center; gap: .5rem; font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.form-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .35rem; }
.inline-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.inline-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center; }
fieldset legend { margin-bottom: .4rem; width: 100%; }
textarea.code { font: 13px/1.5 ui-monospace, "Cascadia Code", Consolas, monospace; tab-size: 2; min-height: 520px; white-space: pre; }

.alert { padding: .8rem 1rem; border-radius: var(--radius); margin-bottom: 1.25rem; font-weight: 500; }
.alert-success { background: var(--ok-soft); color: var(--ok); }
.alert-error { background: var(--bad-soft); color: var(--bad); }

/* ---------------------------------------------------------------- Acceso */
.auth-body { min-height: 100dvh; display: grid; place-content: center; justify-items: center; padding: 1.25rem; background: linear-gradient(180deg, var(--night) 0 42%, var(--bg) 42%); }
.auth-card { width: min(100%, 420px); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 2rem 1.75rem; box-shadow: 0 30px 60px -30px rgb(18 19 22 / .45); border-top: 4px solid var(--brand); }
.auth-card .form { margin-top: 1.5rem; }
.auth-card .field input { min-height: 52px; font-size: 1.0625rem; }
.auth-logo { width: 130px; height: auto; margin-bottom: 1.75rem; }
.auth-card h1 { font-size: 1.5rem; }
.auth-lede { color: var(--muted); margin-top: .35rem; }
.auth-foot { text-align: center; color: var(--muted); font-size: .8125rem; margin-top: 1.25rem; }
.debug { white-space: pre-wrap; font-size: 11px; background: var(--surface-2); padding: .75rem; border-radius: 8px; max-height: 300px; overflow: auto; margin: 1rem 0; }

/* ---------------------------------------------------------------- Estructura del panel */
/* Sin barra lateral: encabezado arriba, pestañas del área y contenido centrado */
.panel { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: .9rem; padding: .7rem clamp(1rem, 3vw, 1.75rem); background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-brand { display: flex; align-items: center; flex: none; }
.topbar-brand .ar-logo { width: 124px; height: auto; }
.ar-logo.is-light { display: none; }
[data-theme="light"] .ar-logo.is-light, :root:not([data-theme]) .ar-logo.is-light { display: block; }
[data-theme="light"] .ar-logo.is-dark, :root:not([data-theme]) .ar-logo.is-dark { display: none; }
.topbar-org { padding-left: .9rem; border-left: 1px solid var(--border); color: var(--ink-soft); font-weight: 600; font-size: .875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.topbar-spacer { flex: 1; }
.topbar-link { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .75rem; border-radius: 9px; color: var(--ink-soft); font-weight: 600; font-size: .8125rem; text-decoration: none; white-space: nowrap; }
.topbar-link:hover { background: var(--hover); color: var(--ink); }
.icon-btn { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--border); background: transparent; color: var(--ink-soft); cursor: pointer; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn .when-light { display: none; }
[data-theme="light"] .icon-btn .when-light { display: block; }
[data-theme="light"] .icon-btn .when-dark { display: none; }
.ic { display: block; flex: none; }
.user-menu { position: relative; }
.user-menu summary { list-style: none; display: flex; align-items: center; gap: .55rem; padding: .25rem .5rem .25rem .25rem; border-radius: 999px; cursor: pointer; color: var(--ink-soft); }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover, .user-menu[open] summary { background: var(--hover); color: var(--ink); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: var(--on-brand); font-weight: 700; font-size: .75rem; letter-spacing: .02em; }
.user-name { font-size: .8125rem; font-weight: 600; color: var(--ink); max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-pop { position: absolute; right: 0; top: calc(100% + .45rem); width: 250px; padding: .4rem; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-2); }
.user-id { display: grid; padding: .55rem .65rem .7rem; border-bottom: 1px solid var(--border); margin-bottom: .3rem; font-size: .8125rem; }
.user-id strong { color: var(--ink); }
.user-id span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.user-pop a, .user-pop button { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .55rem .65rem; border: 0; border-radius: 9px; background: none; color: var(--ink-soft); font: 500 .875rem var(--font); text-decoration: none; cursor: pointer; text-align: left; }
.user-pop a:hover, .user-pop button:hover { background: var(--hover); color: var(--ink); }

.subnav { border-bottom: 1px solid var(--border); background: var(--bg); }
.subnav-inner { display: flex; align-items: center; gap: .35rem; max-width: 1280px; margin: 0 auto; padding: .7rem clamp(1rem, 3vw, 1.75rem); overflow-x: auto; scrollbar-width: none; }
.subnav-inner::-webkit-scrollbar { display: none; }
.subnav-back { display: inline-flex; align-items: center; gap: .35rem; padding: .45rem .7rem; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: .8125rem; text-decoration: none; white-space: nowrap; }
.subnav-back:hover { background: var(--hover); color: var(--ink); }
.subnav-area { display: inline-flex; align-items: center; gap: .45rem; margin: 0 .5rem 0 .2rem; padding-left: .8rem; border-left: 1px solid var(--border); font-weight: 700; font-size: .875rem; color: var(--ink); white-space: nowrap; }
.subnav-area img { width: 18px; height: 18px; border-radius: 4px; }
.subnav-area i { width: 8px; height: 8px; border-radius: 2px; background: var(--steel); }
.subnav-tab { display: inline-flex; align-items: center; gap: .45rem; padding: .48rem .8rem; border: 1px solid transparent; border-radius: 10px; color: var(--ink-soft); font-weight: 600; font-size: .875rem; text-decoration: none; white-space: nowrap; }
.subnav-tab:hover { background: var(--hover); color: var(--ink); }
.subnav-tab[aria-current="page"] { background: var(--surface); border-color: var(--border); color: var(--ink); box-shadow: var(--shadow); }
.tone-tp .subnav-tab[aria-current="page"] { background: var(--tp-soft); border-color: transparent; color: var(--tp-text); box-shadow: none; }

.content { flex: 1; padding: 1.75rem clamp(1rem, 3vw, 1.75rem) 3rem; max-width: 1280px; width: 100%; margin: 0 auto; }
.content.is-home { max-width: 1220px; }

.page-head { margin-bottom: 1.5rem; }
.page-head p { color: var(--muted); margin-top: .3rem; }
.page-head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.page-head h1 { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.crumbs { font-size: .875rem; margin-bottom: .3rem !important; }
.head-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.panel-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem 1.35rem; margin-bottom: 1.25rem; }
.panel-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .9rem; }
.panel-card-head h2 { margin: 0; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.detail-grid > .panel-card { margin-bottom: 0; }
.detail-grid + .panel-card, .detail-grid + section { margin-top: 1.25rem; }
.empty { color: var(--muted); padding: 1.5rem 0; text-align: center; }

/* Indicadores */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.kpi { display: grid; gap: .2rem; padding: 1.1rem 1.25rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: inherit; text-decoration: none; }
.kpi-link:hover { border-color: var(--bad-line); color: inherit; }
.kpi-label { color: var(--muted); font-size: .875rem; font-weight: 500; }
.kpi-value { font-family: var(--display); font-size: 2rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-bad .kpi-value { color: var(--bad); }

/* Gráfica de barras */
.legend { display: flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .8125rem; }
.sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-left: .6rem; }
.sw-in, .bar-in { background: var(--entry); }
.sw-out, .bar-out { background: var(--exit); }
.bars { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: .4rem; height: 200px; align-items: end; }
.bar-day { display: grid; grid-template-rows: 1fr auto; height: 100%; gap: .35rem; }
.bar-pair { display: flex; align-items: flex-end; justify-content: center; gap: 3px; border-bottom: 1px solid var(--border); }
.bar { width: 40%; max-width: 14px; height: 2%; border-radius: 3px 3px 0 0; }
.bar-label { text-align: center; font-size: .6875rem; color: var(--muted); line-height: 1.25; }

/* Tablas */
.table-wrap { overflow-x: auto; margin: 0 -1.35rem; padding: 0 1.35rem; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .8125rem; font-weight: 600; color: var(--muted); padding: .55rem .7rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: .7rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:hover { background: var(--hover); }
.table tr:last-child td { border-bottom: 0; }
.row-off td { color: var(--muted); }

.pill { display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 700; color: #fff; vertical-align: middle; }
.pill-entrada { background: var(--entry); }
.pill-salida { background: var(--exit); }
.badge { display: inline-block; padding: .05rem .45rem; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.status { display: inline-block; padding: .14rem .55rem; border-radius: 6px; font-size: .8125rem; font-weight: 600; white-space: nowrap; }
.status-ok { background: var(--ok-soft); color: var(--ok); }
.status-bad { background: var(--bad-soft); color: var(--bad); }
.status-info { background: var(--info-soft); color: var(--info); }
.status-muted { background: var(--surface-2); color: var(--muted); }

/* Filtros */
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .9rem; }
.filters .field { min-width: 150px; }
.field-grow { flex: 1 1 260px; }
.filters .check { min-height: 44px; }
.filters-actions { display: flex; gap: .5rem; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1rem; color: var(--muted); font-size: .875rem; }

/* Detalle */
.dl { margin: 0; display: grid; }
.dl > div { display: grid; grid-template-columns: 44% 1fr; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--border); }
.dl > div:last-child { border-bottom: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 600; }
.dl-stack > div { grid-template-columns: 1fr; gap: .2rem; }
.dl-stack dd { font-weight: 400; color: var(--ink-soft); }
.checks { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 2rem; }
.checks li { break-inside: avoid; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid var(--border); }
.checks li small { display: block; color: var(--bad); font-size: .8125rem; }
.checks li.is-bad > span:first-child { font-weight: 600; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; }
.gallery figure, .signatures figure { margin: 0; }
.gallery img { width: 100%; height: 150px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); display: block; }
.gallery figcaption, .signatures figcaption { font-size: .8125rem; font-weight: 600; margin-top: .35rem; }
.gallery-empty { height: 150px; display: grid; place-items: center; border: 1.5px dashed var(--border); border-radius: 8px; color: var(--muted); font-size: .875rem; }
.signatures { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.25rem; }
.signatures img { width: 100%; height: 120px; object-fit: contain; border-bottom: 1.5px solid var(--ink); }
.log { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .6rem; font-size: .875rem; }
.log li { padding: .6rem .75rem; border-radius: 8px; background: var(--surface-2); }
.log-bad { background: var(--bad-soft) !important; }
.resend { display: grid; gap: .6rem; border-top: 1px solid var(--border); padding-top: 1rem; }

/* Correos */
.recipients { list-style: none; padding: 0; margin: 0; }
.recipients li { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; padding: .8rem 0; border-bottom: 1px solid var(--border); }
.recipients li:last-child { border-bottom: 0; }
.recipient-id { flex: 1 1 220px; display: grid; }
.recipient-form { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem; }
.logo-preview { padding: .75rem; border: 1px solid var(--border); border-radius: 8px; background: #fafafd; width: fit-content; }
.logo-preview img { max-height: 56px; display: block; }

/* Plantillas */
.template-list { list-style: none; padding: 0; margin: 0; }
.template-list li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--border); }
.template-list li:last-child { border-bottom: 0; }
.template-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.25rem; align-items: start; }
.guide { position: sticky; top: 1rem; font-size: .875rem; }
.add-user .btn { justify-self: start; }
.add-user { border-top: 1px solid var(--border); margin-top: 1rem; padding-top: .5rem; }

/* ---------------------------------------------------------------- Responsivo */
@media (max-width: 1080px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-grid, .template-grid { grid-template-columns: 1fr; }
  .inline-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide { position: static; }
}
@media (max-width: 820px) {
  .topbar { gap: .5rem; }
  .topbar-org, .user-name, .topbar-link span { display: none; }
  .content { padding: 1.25rem 1rem 2.5rem; }
  .checks { columns: 1; }
  .inline-fields, .inline-4 { grid-template-columns: 1fr; }
  .bars { gap: .2rem; }
}

/* ---------------------------------------------------------------- Marca Argoris y módulos */
.tp-logo, .ar-logo { display: block; height: auto; }
.auth-brand { margin-bottom: 1.75rem; }
.auth-brand .ar-logo { width: 190px; }
.auth-card { border-top-color: var(--brand); }
.auth-modules { display: flex; align-items: center; gap: .45rem; margin: -1rem 0 1.5rem; color: var(--muted); font-size: .8125rem; }
.auth-modules img { width: 18px; height: 18px; border-radius: 4px; }
.module-tag { display: inline-flex; align-items: center; gap: .4rem; padding: .2rem .6rem .2rem .3rem; border-radius: 999px; background: var(--tp-soft); color: var(--tp-text); font-size: .75rem; font-weight: 700; vertical-align: middle; }
.module-tag img { width: 18px; height: 18px; border-radius: 4px; }

/* ---------------------------------------------------------------- Tablero de análisis */
/* Paleta de gráficas validada (daltonismo y contraste): entradas azul, salidas rojo */
:root { --c-entry: #3a3d45; --c-exit: #d0142c; --c-ink: #3a3d45; --c-track: #eef0f4; --c-grid: #e6e8ee; --c-axis: #c9ccd5; } /* identidad Argoris: grafito; salidas en rojo TruckPoint */
[data-theme="dark"] { --c-entry: #c9cdd4; --c-exit: #ef3b52; --c-ink: #aab0ba; --c-track: rgb(255 255 255 / .07); --c-grid: rgb(255 255 255 / .06); --c-axis: rgb(255 255 255 / .16); }
.ch-grid { stroke: var(--c-grid); }
.ch-axis { stroke: var(--c-axis); }
.ch-bar-entry { fill: var(--c-entry); }
.ch-bar-exit { fill: var(--c-exit); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sw-in { background: var(--c-entry); }
.sw-out { background: var(--c-exit); }
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem 1.5rem; flex-wrap: wrap; }
.dash-tools { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; position: relative; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 3px; }
.seg a { padding: .42rem .8rem; border-radius: 6px; color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: .875rem; white-space: nowrap; }
.seg a:hover { background: var(--bg); color: var(--ink); }
.seg a[aria-current] { background: var(--brand); color: var(--on-brand); }
.range-pop summary { list-style: none; cursor: pointer; }
.range-pop summary::-webkit-details-marker { display: none; }
.range-pop[open] summary { border-color: var(--brand); }
.range-form { position: absolute; right: 0; top: calc(100% + .5rem); z-index: 20; display: flex; gap: .6rem; align-items: flex-end; padding: .9rem; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-2); }
.range-form label { display: grid; gap: .2rem; font-size: .8125rem; font-weight: 600; color: var(--muted); }
.range-form input { padding: .45rem .5rem; border: 1px solid var(--line2); border-radius: 7px; font: inherit; color: var(--ink); background: var(--surface-2); }
.btn-excel { background: var(--brand); color: var(--on-brand); }
.btn-excel:hover { background: var(--brand-dark); color: var(--on-brand); }
.btn-excel::before { content: ""; width: 16px; height: 16px; margin-right: .45rem; background: url("../img/icon-excel.svg") center / contain no-repeat; }

.today-strip { display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; align-items: baseline; margin: -.5rem 0 1rem; color: var(--ink-soft); font-size: .9375rem; }
.today-strip strong { font-family: var(--display); color: var(--ink); }

.kpis-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpi-value-sm { font-size: 1.5rem; padding: .2rem 0 .1rem; }
.kpi-delta { font-size: .8125rem; color: var(--muted); }
.kpi-delta.is-good { color: var(--ok); }
.kpi-delta.is-bad { color: var(--bad); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: .4rem; vertical-align: 1px; }
.dot-entry { background: var(--c-entry); }
.dot-exit { background: var(--c-exit); }
.card-sub { color: var(--muted); font-size: .875rem; margin-top: .25rem; max-width: 62ch; }
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.25rem; }

/* Columnas SVG */
.chart-scroll { overflow-x: auto; }
.chart { display: block; width: 100%; min-width: 620px; height: auto; }
.ch-tick { font: 500 11px var(--font); fill: var(--muted); }
.ch-sub { fill: var(--muted); font-size: 10px; }
.ch-hit { fill: transparent; }
.ch-group:hover .ch-hit { fill: var(--hover); }
.data-table { margin-top: .75rem; font-size: .875rem; }
.data-table summary { cursor: pointer; color: var(--muted); font-weight: 600; width: max-content; }
.data-table .table { margin-top: .6rem; max-height: 320px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Barras horizontales */
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.hbars li { display: grid; grid-template-columns: minmax(7rem, 38%) minmax(0, 1fr) 3.2rem; align-items: center; gap: .75rem; font-size: .875rem; border-radius: 6px; }
.hbars li:hover .hb-label { color: var(--ink); }
.hb-label { color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-track { display: flex; gap: 2px; height: 14px; background: var(--c-track); border-radius: 4px; overflow: hidden; }
.hb-fill { height: 100%; border-radius: 0 4px 4px 0; }
.hb-entry:has(+ .hb-exit:not(.w-0)) { border-radius: 0; }
.hb-fill.w-0 { display: none; }
.hb-ink { background: var(--c-ink); }
.hb-entry { background: var(--c-entry); }
.hb-exit { background: var(--c-exit); }
.hb-value { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.ch-empty { color: var(--muted); font-size: .9rem; padding: 1rem 0; }

/* Mapa de calor: secuencial en un solo tono (azul), de claro a oscuro */
.heat-wrap { overflow-x: auto; }
.heat { border-collapse: separate; border-spacing: 2px; width: 100%; min-width: 620px; table-layout: fixed; }
.heat th { font: 500 11px var(--font); color: var(--muted); text-align: left; padding: 0 0 .2rem; }
.heat thead th { text-align: left; }
.heat tbody th { width: 2.6rem; padding-right: .4rem; }
.heat td { height: 26px; border-radius: 4px; }
.heat td:hover { outline: 2px solid var(--ink); outline-offset: -1px; }
.q0 { background: var(--heat-0); }
.q1 { background: var(--heat-1); }
.q2 { background: var(--heat-2); }
.q3 { background: var(--heat-3); }
.q4 { background: var(--heat-4); }
.q5 { background: var(--heat-5); }
.heat-scale { display: flex; align-items: center; gap: 3px; margin-top: .7rem; font-size: .75rem; color: var(--muted); }
.heat-scale span:first-child { margin-right: .3rem; }
.heat-scale span:last-child { margin-left: .4rem; }
.heat-scale i { width: 18px; height: 12px; border-radius: 3px; display: inline-block; }

/* Tooltip */
.ch-tip { position: fixed; z-index: 50; pointer-events: none; background: var(--tip-bg); color: #fff; padding: .5rem .7rem; border-radius: 8px; font-size: .8125rem; line-height: 1.45; box-shadow: 0 8px 24px rgb(17 19 26 / .25); max-width: 260px; }
.ch-tip strong { display: block; font-weight: 600; margin-bottom: .1rem; }
.ch-tip .tip-row { display: flex; align-items: center; gap: .4rem; color: #d7dae2; }

@media (max-width: 1280px) { .kpis-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1080px) { .dash-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .kpis-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .range-form { left: 0; right: auto; flex-wrap: wrap; }
  .hbars li { grid-template-columns: minmax(0, 1fr) 3rem; }
  .hb-track { grid-column: 1 / -1; grid-row: 2; }
}
.w-0 { width: 0%; }
.w-1 { width: 1%; }
.w-2 { width: 2%; }
.w-3 { width: 3%; }
.w-4 { width: 4%; }
.w-5 { width: 5%; }
.w-6 { width: 6%; }
.w-7 { width: 7%; }
.w-8 { width: 8%; }
.w-9 { width: 9%; }
.w-10 { width: 10%; }
.w-11 { width: 11%; }
.w-12 { width: 12%; }
.w-13 { width: 13%; }
.w-14 { width: 14%; }
.w-15 { width: 15%; }
.w-16 { width: 16%; }
.w-17 { width: 17%; }
.w-18 { width: 18%; }
.w-19 { width: 19%; }
.w-20 { width: 20%; }
.w-21 { width: 21%; }
.w-22 { width: 22%; }
.w-23 { width: 23%; }
.w-24 { width: 24%; }
.w-25 { width: 25%; }
.w-26 { width: 26%; }
.w-27 { width: 27%; }
.w-28 { width: 28%; }
.w-29 { width: 29%; }
.w-30 { width: 30%; }
.w-31 { width: 31%; }
.w-32 { width: 32%; }
.w-33 { width: 33%; }
.w-34 { width: 34%; }
.w-35 { width: 35%; }
.w-36 { width: 36%; }
.w-37 { width: 37%; }
.w-38 { width: 38%; }
.w-39 { width: 39%; }
.w-40 { width: 40%; }
.w-41 { width: 41%; }
.w-42 { width: 42%; }
.w-43 { width: 43%; }
.w-44 { width: 44%; }
.w-45 { width: 45%; }
.w-46 { width: 46%; }
.w-47 { width: 47%; }
.w-48 { width: 48%; }
.w-49 { width: 49%; }
.w-50 { width: 50%; }
.w-51 { width: 51%; }
.w-52 { width: 52%; }
.w-53 { width: 53%; }
.w-54 { width: 54%; }
.w-55 { width: 55%; }
.w-56 { width: 56%; }
.w-57 { width: 57%; }
.w-58 { width: 58%; }
.w-59 { width: 59%; }
.w-60 { width: 60%; }
.w-61 { width: 61%; }
.w-62 { width: 62%; }
.w-63 { width: 63%; }
.w-64 { width: 64%; }
.w-65 { width: 65%; }
.w-66 { width: 66%; }
.w-67 { width: 67%; }
.w-68 { width: 68%; }
.w-69 { width: 69%; }
.w-70 { width: 70%; }
.w-71 { width: 71%; }
.w-72 { width: 72%; }
.w-73 { width: 73%; }
.w-74 { width: 74%; }
.w-75 { width: 75%; }
.w-76 { width: 76%; }
.w-77 { width: 77%; }
.w-78 { width: 78%; }
.w-79 { width: 79%; }
.w-80 { width: 80%; }
.w-81 { width: 81%; }
.w-82 { width: 82%; }
.w-83 { width: 83%; }
.w-84 { width: 84%; }
.w-85 { width: 85%; }
.w-86 { width: 86%; }
.w-87 { width: 87%; }
.w-88 { width: 88%; }
.w-89 { width: 89%; }
.w-90 { width: 90%; }
.w-91 { width: 91%; }
.w-92 { width: 92%; }
.w-93 { width: 93%; }
.w-94 { width: 94%; }
.w-95 { width: 95%; }
.w-96 { width: 96%; }
.w-97 { width: 97%; }
.w-98 { width: 98%; }
.w-99 { width: 99%; }
.w-100 { width: 100%; }
.ch-partial path { opacity: .4; }
.features { border: 1px solid var(--border); border-radius: 10px; padding: .8rem 1rem .9rem; margin: .25rem 0 0; }
.features legend { padding: 0 .35rem; width: auto; font-size: .875rem; }
.feature { align-items: flex-start; }
.feature input { margin-top: .25rem; }
.feature span { display: grid; gap: .1rem; }
.feature small { color: var(--muted); font-size: .8125rem; font-weight: 400; }
.content, .panel-card, .dash-grid > * { min-width: 0; }
@media (max-width: 640px) {
  .dash-tools { width: 100%; }
  .seg { max-width: 100%; overflow-x: auto; }
  .seg a { padding: .42rem .65rem; }
  .btn-excel { flex: 1 1 auto; justify-content: center; }
  .card-sub { font-size: .8125rem; }
}
.heat td, .heat th { position: relative; }

/* ---------------------------------------------------------------- Estatus de hoy (en vivo) */
/* En fondo oscuro se usan tonos más claros de la misma paleta para mantener el contraste */
.live { --l-bg: #121316; --l-panel: #1a1c21; --l-line: rgb(255 255 255 / .08); --l-ink: #fff; --l-muted: #9aa0ad; --l-entry: #c9cdd4; --l-exit: #f04d63;
  background: var(--l-bg); color: var(--l-ink); border-radius: 14px; border-top: 3px solid var(--tp); padding: 1.25rem 1.4rem 1.4rem; margin-bottom: 1.75rem; box-shadow: 0 12px 32px rgb(17 19 26 / .18); }
.live-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.1rem; }
.live-head h2 { color: #fff; margin: 0; font-size: 1.125rem; }
.live-date { color: var(--l-muted); font-size: .875rem; margin-top: .15rem; }
.live-badge { display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .75rem; border: 1px solid var(--l-line); border-radius: 999px; font-size: .8125rem; color: var(--l-muted); white-space: nowrap; }
.live-badge strong { color: #fff; font-weight: 600; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #2fd08a; box-shadow: 0 0 0 0 rgb(47 208 138 / .6); animation: live-pulse 2s infinite; }
.live-badge.is-off .live-dot { background: #9aa0ad; animation: none; }
.live-badge.is-off strong { color: var(--l-muted); }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 rgb(47 208 138 / .55); } 70% { box-shadow: 0 0 0 8px rgb(47 208 138 / 0); } 100% { box-shadow: 0 0 0 0 rgb(47 208 138 / 0); } }
.live-body { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 1.25rem; }
.live-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.live-stat { position: relative; display: grid; align-content: start; gap: .15rem; padding: .9rem 1rem 1rem; background: var(--l-panel); border-radius: 10px; color: #fff; text-decoration: none; overflow: hidden; transition: background .15s; }
.live-stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #4a5060; }
.live-stat.is-entry::before { background: var(--l-entry); }
.live-stat.is-exit::before { background: var(--l-exit); }
.live-stat.is-damage.has-bad::before { background: var(--l-exit); }
.live-stat.is-yard::before { background: #fff; }
a.live-stat:hover { background: #22252b; color: #fff; }
.live-label { color: var(--l-muted); font-size: .8125rem; font-weight: 500; }
.live-stat strong { font-family: var(--display); font-size: 2.5rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.live-stat.is-damage.has-bad strong { color: var(--l-exit); }
.live-note { font-size: .75rem; color: var(--l-muted); }
.live-note.is-bad { color: #ff8a99; }
.live-stat strong.is-updated { animation: live-bump .9s ease; }
@keyframes live-bump { 0% { color: #2fd08a; transform: translateY(-2px); } 100% { transform: none; } }

.live-hours { margin-top: 1rem; padding: .9rem 1rem .7rem; background: var(--l-panel); border-radius: 10px; }
.lh-head { display: flex; justify-content: space-between; gap: 1rem; font-size: .8125rem; color: var(--l-muted); margin-bottom: .6rem; }
.lh-head > span:first-child { color: #fff; font-weight: 600; }
.lh-legend { display: inline-flex; align-items: center; gap: .1rem .5rem; }
.lh-legend .dot { margin-right: .2rem; }
.live .dot-entry { background: var(--l-entry); }
.live .dot-exit { background: var(--l-exit); }
.lh-bars { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 3px; height: 72px; align-items: end; }
.lh-col { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; border-radius: 3px; background: rgb(255 255 255 / .03); overflow: hidden; }
.lh-col.is-now { background: rgb(255 255 255 / .09); box-shadow: inset 0 -2px 0 #fff; }
.lh-col.is-future { background: transparent; }
.lh-e { background: var(--l-entry); }
.lh-s { background: var(--l-exit); }
.lh-e + .lh-s, .lh-s + .lh-e { margin-top: 0; }
.lh-axis { display: flex; justify-content: space-between; margin-top: .35rem; font-size: .6875rem; color: var(--l-muted); }

.live-feed { background: var(--l-panel); border-radius: 10px; padding: .9rem 1rem; min-width: 0; }
.live-feed h3 { margin: 0 0 .5rem; color: #fff; font-size: .875rem; }
.live-feed ol { list-style: none; margin: 0; padding: 0; }
.live-feed li { border-top: 1px solid var(--l-line); }
.live-feed li:first-child { border-top: 0; }
.live-feed a { display: grid; grid-template-columns: 2.8rem 4.4rem minmax(0, 1fr) auto; align-items: center; gap: .6rem; padding: .55rem .2rem; color: #fff; text-decoration: none; font-size: .8125rem; border-radius: 6px; }
.live-feed a:hover { background: rgb(255 255 255 / .05); color: #fff; }
.live-feed time { color: var(--l-muted); font-variant-numeric: tabular-nums; }
.lf-type { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; }
.lf-type::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--l-entry); }
.lf-type.is-salida::before { background: var(--l-exit); }
.lf-main { display: grid; min-width: 0; line-height: 1.3; }
.lf-main strong { font-weight: 600; }
.lf-main span { color: var(--l-muted); font-size: .75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lf-bad { color: #ff8a99; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.lf-empty { color: var(--l-muted); padding: .6rem 0; font-size: .875rem; }
.live-feed li.is-new a { animation: live-new 2.4s ease; }
@keyframes live-new { 0% { background: rgb(47 208 138 / .22); } 100% { background: transparent; } }

.period-bar { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem 1.5rem; flex-wrap: wrap; margin: 0 0 1rem; }
.period-bar h2 { margin: 0; font-size: 1.25rem; }
.period-bar p { color: var(--muted); margin-top: .2rem; }

@media (prefers-reduced-motion: reduce) { .live-dot, .live-stat strong.is-updated, .live-feed li.is-new a { animation: none; } }
@media (max-width: 1180px) { .live-body { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .live { padding: 1rem; }
  .live-head { flex-direction: column; }
  .live-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .live-stat strong { font-size: 2rem; }
  .live-feed a { grid-template-columns: 2.6rem 4.2rem minmax(0, 1fr); }
  .lf-bad { grid-column: 3; }
}
.h-0 { height: 0%; }
.h-1 { height: 1%; }
.h-2 { height: 2%; }
.h-3 { height: 3%; }
.h-4 { height: 4%; }
.h-5 { height: 5%; }
.h-6 { height: 6%; }
.h-7 { height: 7%; }
.h-8 { height: 8%; }
.h-9 { height: 9%; }
.h-10 { height: 10%; }
.h-11 { height: 11%; }
.h-12 { height: 12%; }
.h-13 { height: 13%; }
.h-14 { height: 14%; }
.h-15 { height: 15%; }
.h-16 { height: 16%; }
.h-17 { height: 17%; }
.h-18 { height: 18%; }
.h-19 { height: 19%; }
.h-20 { height: 20%; }
.h-21 { height: 21%; }
.h-22 { height: 22%; }
.h-23 { height: 23%; }
.h-24 { height: 24%; }
.h-25 { height: 25%; }
.h-26 { height: 26%; }
.h-27 { height: 27%; }
.h-28 { height: 28%; }
.h-29 { height: 29%; }
.h-30 { height: 30%; }
.h-31 { height: 31%; }
.h-32 { height: 32%; }
.h-33 { height: 33%; }
.h-34 { height: 34%; }
.h-35 { height: 35%; }
.h-36 { height: 36%; }
.h-37 { height: 37%; }
.h-38 { height: 38%; }
.h-39 { height: 39%; }
.h-40 { height: 40%; }
.h-41 { height: 41%; }
.h-42 { height: 42%; }
.h-43 { height: 43%; }
.h-44 { height: 44%; }
.h-45 { height: 45%; }
.h-46 { height: 46%; }
.h-47 { height: 47%; }
.h-48 { height: 48%; }
.h-49 { height: 49%; }
.h-50 { height: 50%; }
.h-51 { height: 51%; }
.h-52 { height: 52%; }
.h-53 { height: 53%; }
.h-54 { height: 54%; }
.h-55 { height: 55%; }
.h-56 { height: 56%; }
.h-57 { height: 57%; }
.h-58 { height: 58%; }
.h-59 { height: 59%; }
.h-60 { height: 60%; }
.h-61 { height: 61%; }
.h-62 { height: 62%; }
.h-63 { height: 63%; }
.h-64 { height: 64%; }
.h-65 { height: 65%; }
.h-66 { height: 66%; }
.h-67 { height: 67%; }
.h-68 { height: 68%; }
.h-69 { height: 69%; }
.h-70 { height: 70%; }
.h-71 { height: 71%; }
.h-72 { height: 72%; }
.h-73 { height: 73%; }
.h-74 { height: 74%; }
.h-75 { height: 75%; }
.h-76 { height: 76%; }
.h-77 { height: 77%; }
.h-78 { height: 78%; }
.h-79 { height: 79%; }
.h-80 { height: 80%; }
.h-81 { height: 81%; }
.h-82 { height: 82%; }
.h-83 { height: 83%; }
.h-84 { height: 84%; }
.h-85 { height: 85%; }
.h-86 { height: 86%; }
.h-87 { height: 87%; }
.h-88 { height: 88%; }
.h-89 { height: 89%; }
.h-90 { height: 90%; }
.h-91 { height: 91%; }
.h-92 { height: 92%; }
.h-93 { height: 93%; }
.h-94 { height: 94%; }
.h-95 { height: 95%; }
.h-96 { height: 96%; }
.h-97 { height: 97%; }
.h-98 { height: 98%; }
.h-99 { height: 99%; }
.h-100 { height: 100%; }
.live-main { display: flex; flex-direction: column; min-width: 0; }
.live-hours { flex: 1; display: flex; flex-direction: column; }
.lh-bars { flex: 1; min-height: 72px; height: auto; }


/* ---------- Instalar en celulares ---------- */
.alert-warn { background: var(--warn-soft); color: var(--warn-text); font-weight: 400; }
.install-grid { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.install-qr-card { text-align: center; }
.install-qr-card h2 { text-align: left; }
.install-qr { width: min(100%, 280px); aspect-ratio: 1; margin: .5rem auto 0; display: grid; place-items: center; color: var(--muted); font-size: .875rem; }
.install-qr svg, .ps-qr svg { width: 100%; height: auto; display: block; }
.install-url { margin: .9rem 0 1.1rem; font-size: .875rem; word-break: break-all; }
.install-actions { display: grid; gap: .6rem; }
.install-actions .btn { width: 100%; justify-content: center; }
.install-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.install-os h3, .install-sub { font-size: 1rem; margin: 0 0 .5rem; }
.install-os small { font-weight: 400; color: var(--muted); font-size: .8125rem; margin-left: .3rem; }
.install-os ol { margin: 0; padding-left: 1.2rem; display: grid; gap: .45rem; }
.install-sub { margin-top: 1.6rem; padding-top: 1.2rem; border-top: 1px solid var(--border); }
.install-tips { margin: 0; padding-left: 1.2rem; display: grid; gap: .45rem; color: var(--ink-soft); }
.print-sheet { display: none; }
@media (max-width: 900px) {
  .install-grid, .install-steps { grid-template-columns: minmax(0, 1fr); }
}

/* Hoja para la caseta: una página carta, solo el póster */
@media print {
  @page { size: letter; margin: 14mm; }
  :root { color-scheme: light; }
  body { background: #fff; }
  .topbar, .subnav, .skip, .content > :not(.print-sheet) { display: none !important; }
  body.panel, .content { display: block !important; padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .print-sheet { display: block !important; color: #18191d; font-family: var(--font); }
  .ps-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 6mm; border-bottom: 1.5pt solid #18191d; }
  .ps-head img { height: 11mm; width: auto; }
  .ps-module { display: inline-flex; align-items: center; gap: 2mm; font: 700 14pt var(--display); }
  .ps-module img { height: 7mm; width: 7mm; }
  .print-sheet h1 { font: 800 26pt/1.1 var(--display); margin: 9mm 0 3mm; text-align: center; }
  .ps-lede { text-align: center; font-size: 12pt; margin: 0 auto; max-width: 150mm; color: #3a3d45; }
  .ps-qr { width: 78mm; margin: 8mm auto 2mm; }
  .ps-url { text-align: center; font-size: 11pt; margin: 0 0 8mm; word-break: break-all; }
  .ps-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 8mm; border-top: 0.75pt solid #c9cdd4; padding-top: 6mm; }
  .ps-steps h2 { font: 700 13pt var(--display); margin: 0 0 2mm; }
  .ps-steps small { font: 400 10pt var(--font); color: #5b606b; }
  .ps-steps ol { margin: 0; padding-left: 5mm; font-size: 10.5pt; line-height: 1.45; }
  .ps-steps li + li { margin-top: 1.5mm; }
  .ps-foot { margin-top: 8mm; text-align: center; font-size: 10pt; color: #5b606b; }
}

/* ---------- Plan y pagos (panel de Argoris) ---------- */
.status-warn { background: var(--warn-soft); color: var(--warn-text); }
.plan-card .panel-card-head { align-items: center; }
.plan-summary { margin: 0 0 1.1rem; color: var(--ink-soft); }
.plan-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.plan-block { border: 1px solid var(--border); border-radius: 10px; padding: 1rem; display: grid; gap: .7rem; align-content: start; }
.plan-block h3 { margin: 0; font-size: 1rem; }
.plan-block .field-hint { margin: -.4rem 0 0; }
.plan-months { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
.plan-months .btn { padding-inline: .4rem; justify-content: center; }
.plan-inline { display: flex; align-items: flex-end; gap: .75rem; flex-wrap: wrap; }
.plan-inline .field { flex: 1 1 140px; }
.plan-more { margin-top: 1rem; }
.plan-more summary { cursor: pointer; font-weight: 600; color: var(--ink-soft); padding: .3rem 0; }
.plan-more .plan-actions { margin-top: .75rem; }
.plan-danger { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-start; }
.plan-log-title { font-size: 1rem; margin: 1.4rem 0 .5rem; }
.plan-log { list-style: none; margin: 0; padding: 0; font-size: .875rem; }
.plan-log li { display: grid; grid-template-columns: 9rem minmax(0, 1fr) auto; gap: .75rem; padding: .5rem 0; border-top: 1px solid var(--border); }
.plan-alert a { color: inherit; }
@media (max-width: 900px) {
  .plan-actions { grid-template-columns: minmax(0, 1fr); }
  .plan-months { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan-log li { grid-template-columns: minmax(0, 1fr); gap: .1rem; }
}

/* ---------- Aviso de suspensión ---------- */
.suspended-tag { display: inline-block; background: var(--bad-soft); color: var(--bad); font-weight: 600; font-size: .8125rem; padding: .2rem .6rem; border-radius: 6px; margin: 0 0 .9rem; }
.suspended h1 { font: 800 1.5rem/1.2 var(--display); margin: 0 0 .75rem; }
.suspended p { color: var(--ink-soft); margin: 0 0 .8rem; }
.suspended-actions { display: grid; gap: .6rem; margin: 1.25rem 0; }
.suspended-actions .btn { justify-content: center; }
.suspended-note { font-size: .875rem; color: var(--muted) !important; }
.suspended-out { width: 100%; justify-content: center; margin-top: .5rem; }

/* =========================================================================
   Inicio del panel: saludo, buscador, secciones por área y pendientes
   ========================================================================= */
.tone-tp { --c: var(--tp-text); --cs: var(--tp-soft); }
.tone-steel { --c: var(--ink-soft); --cs: var(--surface-2); }
[data-theme="dark"] .tone-steel { --c: #c9cdd4; --cs: rgb(255 255 255 / .06); }
.n-bad { --k: var(--bad); --s: var(--bad-soft); }
.n-warn { --k: var(--warn-text); --s: var(--warn-soft); }
.n-info { --k: var(--info); --s: var(--info-soft); }

.hero { position: relative; overflow: hidden; padding: 1.15rem 1.4rem 1.05rem; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); }
.hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(620px 230px at 0% 0%, var(--brand-soft), transparent 70%); }
.hero-deco { position: absolute; right: -40px; top: -48px; width: 260px; height: auto; opacity: .05; pointer-events: none; }
[data-theme="light"] .hero-deco { filter: invert(1); opacity: .045; }
.hero-row { position: relative; display: flex; align-items: center; gap: 1.5rem; }
.hero-hola { flex: 1; min-width: 0; }
.hero-eyebrow { display: flex; align-items: center; gap: .5rem; font-size: .75rem; font-weight: 600; color: var(--ink-soft); }
.hero-eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.hero-hola h1 { font-size: 1.5rem; margin: .4rem 0 .6rem; }
.hero-sum { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; min-height: 28px; font-size: .875rem; color: var(--ink-soft); }
.hero-sum b { color: var(--ink); }
.urg { display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .65rem .3rem .5rem; border-radius: 999px; background: var(--s); color: var(--k); font-weight: 600; font-size: .8125rem; text-decoration: none; }
.urg:hover { color: var(--k); filter: brightness(1.08); }
.urg i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: urg-blink 2s infinite; }
@keyframes urg-blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.hero-clock { position: relative; text-align: right; padding-left: 1.5rem; }
.hero-clock b { display: block; font: 700 1.75rem/1 var(--font); letter-spacing: -.04em; font-variant-numeric: tabular-nums; color: var(--ink); }
.hero-clock sup { font-size: .8125rem; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-left: 3px; vertical-align: 14px; }
.hero-clock span { display: block; margin-top: .4rem; font-size: .8125rem; color: var(--muted); }
.hero-search { position: relative; display: block; margin-top: .9rem; }
.hero-search input { width: 100%; height: 42px; padding: 0 100px 0 44px; border: 1px solid var(--line2); border-radius: 12px; background: var(--surface-2); font: inherit; font-size: .875rem; color: var(--ink); outline: none; }
.hero-search input:focus { background: var(--surface); border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.hero-search input::placeholder { color: var(--muted); }
.hero-search > .ic { position: absolute; left: 15px; top: 12px; color: var(--muted); }
.hero-search kbd { position: absolute; right: 12px; top: 9px; display: flex; gap: 3px; font: inherit; }
.hero-search kbd span { font-size: 11px; font-weight: 600; color: var(--ink-soft); border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 6px; padding: 2px 6px; background: var(--surface); }

.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.25rem; margin-top: 1.15rem; align-items: start; }
.area + .area { margin-top: 1rem; }
.area[hidden], .tile[hidden] { display: none; }
.area header { display: flex; align-items: center; gap: .5rem; margin: 0 2px .6rem; }
.area header img { width: 18px; height: 18px; border-radius: 4px; }
.area header i { width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.area header h2 { margin: 0; font: 650 .8125rem var(--font); letter-spacing: 0; color: var(--ink); }
.area header span { font-size: .75rem; color: var(--muted); }
.area header::after { content: ""; flex: 1; height: 1px; background: var(--border); margin-left: .4rem; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; }
.tile { display: flex; align-items: center; gap: .7rem; min-height: 60px; padding: .65rem .7rem; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
.tile:hover { color: inherit; border-color: color-mix(in srgb, var(--c) 35%, var(--border)); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.tile:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }
.tile-ic { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--cs); color: var(--c); }
.tile-tx { flex: 1; min-width: 0; }
.tile-tx strong { display: block; font-size: .8125rem; font-weight: 600; line-height: 1.3; color: var(--ink); }
.tile-tx small { display: block; margin-top: 1px; font-size: .75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-n { font-style: normal; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 7px; display: grid; place-items: center; background: var(--tp); color: #fff; font-size: .75rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tone-steel .tile-n { background: var(--warn-text); color: var(--surface); }
.tile-go { color: var(--muted); opacity: 0; transform: translateX(-3px); transition: .15s; }
.tile:hover .tile-go { opacity: 1; transform: none; color: var(--c); }
.home-none, .home-empty { padding: 1.75rem; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line2); border-radius: 14px; }

.home-side { position: sticky; top: 76px; display: grid; gap: .9rem; }
.side-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.side-card[hidden] { display: none; }
.side-h { display: flex; align-items: center; gap: .5rem; padding: .85rem 1rem .6rem; }
.side-h h2 { margin: 0; font: 650 .8125rem var(--font); letter-spacing: 0; color: var(--ink); }
.side-pill { margin-left: auto; padding: 2px 8px; border-radius: 999px; background: var(--bad-soft); color: var(--bad); font-size: .75rem; font-weight: 700; }
.pi { display: flex; align-items: center; gap: .75rem; padding: .65rem 1rem; border-top: 1px solid var(--border); color: inherit; text-decoration: none; }
.pi:hover { background: var(--hover); color: inherit; }
.pi-k { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--s); color: var(--k); }
.pi-tx { flex: 1; min-width: 0; font-size: .8125rem; line-height: 1.35; color: var(--ink); }
.pi-tx small { display: block; font-size: .75rem; color: var(--muted); }
.pi b { font-size: 1rem; font-weight: 750; color: var(--k); font-variant-numeric: tabular-nums; }
.side-empty { padding: .2rem 1rem 1rem; font-size: .8125rem; color: var(--muted); }
.side-empty b { color: var(--ok); }
.side-today { display: grid; gap: .45rem; padding: .8rem 1rem .95rem; border-top: 1px solid var(--border); color: inherit; text-decoration: none; }
.side-today:hover { background: var(--hover); color: inherit; }
.st-h { display: flex; align-items: center; font-size: .8125rem; font-weight: 650; color: var(--ink); }
.st-h em { margin-left: auto; font-style: normal; font-weight: 600; font-size: .75rem; color: var(--muted); }
.st-n { font-size: .8125rem; color: var(--ink-soft); }
.st-n b { font-size: 1.125rem; font-weight: 750; color: var(--ink); font-variant-numeric: tabular-nums; margin-right: .2rem; }
.st-n b + b, .st-n b:nth-of-type(2) { margin-left: .6rem; }
.st-bar { display: flex; gap: 2px; height: 6px; border-radius: 99px; overflow: hidden; background: var(--c-track); }
.st-bar i { display: block; height: 100%; }
.st-in { background: var(--c-entry); }
.st-out { background: var(--c-exit); }
.rec { display: flex; align-items: center; gap: .6rem; padding: .5rem 1rem; font-size: .8125rem; font-weight: 550; color: var(--ink); text-decoration: none; }
.rec:last-child { padding-bottom: .8rem; }
.rec:hover { background: var(--hover); color: var(--ink); }
.rec-ic { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--cs); color: var(--c); }
.rec-ic .ic { width: 14px; height: 14px; }
.rec small { margin-left: auto; font-size: .75rem; color: var(--muted); font-weight: 500; }

@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1000px) { .home-grid { grid-template-columns: minmax(0, 1fr); } .home-side { position: static; order: -1; } .hero-deco { display: none; } }
@media (max-width: 600px) {
  .hero { padding: 1.1rem; }
  .hero-hola h1 { font-size: 1.375rem; }
  .hero-clock, .hero-search kbd, .side-recent { display: none; }
  .tiles { grid-template-columns: minmax(0, 1fr); }
  .hero-search input { padding-right: 14px; font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { .urg i { animation: none; } .tile, .tile-go { transition: none; } }

/* El panel en vivo ya es oscuro: en modo oscuro se separa del fondo con un borde */
[data-theme="dark"] .live { box-shadow: none; outline: 1px solid var(--border); }
[data-theme="dark"] .pill-entrada { color: #16171b; }
