/* Detector de operador · estilos
   Gris de armario de telecomunicaciones de fondo, superficies blancas para trabajar,
   tinta grafito. Lo único que "grita" es el reparto por operador. */

@font-face { font-family: "Barlow"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("fonts/barlow-semi-condensed-latin-600-normal.woff2") format("woff2"); }

:root {
  --enclosure: #e9ecea;
  --panel: #ffffff;
  --ink: #1d2327;
  --ink-2: #4f5a60;
  --muted: #6c777d;
  --rule: #cdd3cf;
  --rule-soft: #e3e7e4;
  --tint: #f4f6f5;
  --brand: #11566b;
  --brand-ink: #ffffff;
  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --radius: 6px;
  --radius-sm: 4px;
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Barlow Semi Condensed", "Barlow", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--enclosure);
  color: var(--ink);
  font: 400 15px/1.5 var(--font);
}
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { margin: 0; color: var(--ink); }
h1 { font: 600 29px/1.15 var(--font-head); letter-spacing: -0.005em; }
h2 { font-size: 19px; font-weight: 600; line-height: 1.3; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0 0 12px; max-width: 72ch; }
small, .small { font-size: 13px; }
.muted { color: var(--muted); }
.ink-2 { color: var(--ink-2); }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------ cabecera */
.topbar { background: var(--panel); border-bottom: 1px solid var(--rule); }
.topbar-inner, .nav-inner, .page, .demo-inner { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.topbar-inner { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand img { height: 32px; width: auto; }
.brand-mark { width: 10px; height: 32px; border-radius: 2px; background: var(--brand); }
.brand-name { font: 600 22px/1 var(--font-head); }
.brand-tagline { display: block; font-size: 13px; color: var(--muted); margin-top: 3px; }
.balance { text-align: right; line-height: 1.2; }
.balance-value { font-weight: 600; font-size: 18px; }
.balance-label { font-size: 13px; color: var(--muted); }
.who { display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--ink-2); }
.who a { color: var(--ink-2); }

.nav { background: var(--panel); border-bottom: 1px solid var(--rule); }
.nav-inner { display: flex; gap: 4px; overflow-x: auto; }
.nav a {
  display: inline-block; padding: 11px 12px 10px; color: var(--ink-2); text-decoration: none;
  font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap;
}
.nav a:hover { color: var(--ink); }
.nav a.active { color: var(--ink); border-bottom-color: var(--brand); }
.nav .sep { width: 1px; background: var(--rule); margin: 10px 10px; }

.demo { background: var(--warning); color: var(--ink); }
.demo-inner { padding-top: 9px; padding-bottom: 9px; font-weight: 500; }
.demo strong { font-weight: 600; }

/* --------------------------------------------------------------- página */
.page { padding-top: 28px; padding-bottom: 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin: 6px 0 0; color: var(--ink-2); }
.stack > * + * { margin-top: 20px; }
.grid { display: grid; gap: 20px; }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 880px) { .grid-main, .grid-2 { grid-template-columns: 1fr; } }

.panel { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); padding: 22px; }
.panel > h2 + * { margin-top: 12px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.panel.flush { padding: 0; }
.panel.flush > .panel-head { padding: 18px 22px 0; }

/* -------------------------------------------------------------- avisos */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--panel); border: 1px solid var(--rule); border-left-width: 4px; margin-bottom: 16px; }
.flash.ok { border-left-color: var(--good); }
.flash.error { border-left-color: var(--critical); }
.flash.warn { border-left-color: var(--warning); }
.flash .icon { font-weight: 600; width: 18px; flex: none; text-align: center; }
.flash.ok .icon { color: #08750a; }
.flash.error .icon { color: var(--critical); }

/* ------------------------------------------------------------- botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink);
  font: 600 15px/1.2 var(--font); text-decoration: none; cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn-quiet { background: var(--panel); color: var(--ink); border-color: var(--rule); }
.btn-quiet:hover { border-color: var(--ink-2); filter: none; }
.btn-danger { background: var(--panel); color: var(--critical); border-color: #e5b4b4; }
.btn-danger:hover { border-color: var(--critical); filter: none; }
.btn-sm { min-height: 32px; padding: 5px 11px; font-size: 14px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
form.inline { display: inline; }

/* -------------------------------------------------------- formularios */
label { display: block; font-weight: 500; margin-bottom: 6px; }
.field { margin-bottom: 16px; }
.field .hint { font-size: 13px; color: var(--muted); margin-top: 5px; max-width: 70ch; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=url],
select, textarea {
  width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid var(--rule); border-radius: var(--radius-sm);
  background: var(--panel); color: var(--ink); font: 400 15px/1.4 var(--font);
}
textarea { min-height: 120px; resize: vertical; }
textarea.code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 13px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 4px; width: 16px; height: 16px; accent-color: var(--brand); }
fieldset { border: 0; padding: 0; margin: 0 0 8px; }
fieldset + fieldset { border-top: 1px solid var(--rule-soft); padding-top: 22px; margin-top: 10px; }
legend { font-size: 19px; font-weight: 600; padding: 0; margin-bottom: 4px; }
.fields-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.fields-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }
@media (max-width: 700px) { .fields-2, .fields-3 { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------- subida */
.dropzone {
  display: block; border: 2px dashed var(--rule); border-radius: var(--radius); padding: 30px 22px;
  background: var(--tint); text-align: left; cursor: pointer;
}
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: #eef4f5; }
.dropzone:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.dropzone strong { display: block; font-size: 19px; font-weight: 600; margin-bottom: 4px; }
.dropzone .btn { display: flex; width: max-content; }
details.paste { margin-top: 16px; }
details.paste summary { cursor: pointer; color: var(--brand); font-weight: 500; }
details.paste form { margin-top: 12px; }

/* --------------------------------------------------------------- tablas */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 600; color: var(--ink-2); padding: 10px 12px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--rule-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table td.r { color: var(--ink); }
.table tbody tr:hover { background: #fafbfa; }
.table .name { font-weight: 500; }
.table .sub { display: block; font-size: 13px; color: var(--muted); }
.table-empty { padding: 26px 22px; color: var(--ink-2); }
.table mark { background: #e2eef1; color: var(--ink); padding: 1px 4px; border-radius: 3px; }
.table th.col-picked, .table td.col-picked { background: #eef4f5; }

/* --------------------------------------------------------------- estado */
.status { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-weight: 500; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.status.terminado::before { background: var(--good); }
.status.procesando::before, .status.en_cola::before { background: var(--brand); }
.status.pausado::before, .status.revision::before { background: var(--warning); }
.status.error::before { background: var(--critical); }
.status.cancelado::before { background: #a7b0b5; }

/* ----------------------------------------------------- cifras y medidores */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0; }
.tile { padding: 4px 20px 4px 0; }
.tile + .tile { border-left: 1px solid var(--rule-soft); padding-left: 20px; }
@media (max-width: 700px) { .tile + .tile { border-left: 0; padding-left: 0; } .tile { padding: 8px 0; } }
.tile-label { font-size: 14px; color: var(--ink-2); }
.tile-value { font-size: 27px; font-weight: 600; line-height: 1.2; margin-top: 2px; }
.tile-note { font-size: 13px; color: var(--muted); }

.hero { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.hero-figure { font-size: 54px; font-weight: 600; line-height: 1; letter-spacing: -0.01em; }
.hero-text { font-size: 19px; color: var(--ink-2); }

.meter { height: 10px; border-radius: 5px; background: #d5e3e7; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--brand); border-radius: 5px; transition: width .4s ease; }

/* Reparto por operador: barra segmentada fina (8px), 2px de separación entre partes */
.split { display: flex; gap: 2px; height: 8px; margin: 18px 0 6px; }
.split .seg { position: relative; height: 100%; min-width: 3px; border-radius: 4px; outline-offset: 3px; }
.split .seg .tip {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 5;
  background: var(--ink); color: #fff; padding: 7px 10px; border-radius: var(--radius-sm);
  font-size: 13px; line-height: 1.35; white-space: nowrap; pointer-events: none; opacity: 0; visibility: hidden;
}
.split .seg:hover .tip, .split .seg:focus .tip { opacity: 1; visibility: visible; }
.split .seg:first-child .tip { left: 0; transform: none; }
.split .seg:last-child .tip { left: auto; right: 0; transform: none; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 9px; flex: none; }
.group-name { display: inline-flex; align-items: center; font-weight: 600; }
details.ops summary { cursor: pointer; color: var(--ink-2); font-size: 13px; }
details.ops ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 13px; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.facts dt { color: var(--ink-2); }
.facts dd { margin: 0; font-weight: 500; font-variant-numeric: tabular-nums; }

.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { padding: 8px 0; border-bottom: 1px solid var(--rule-soft); display: flex; justify-content: space-between; gap: 12px; }
.list-plain li:last-child { border-bottom: 0; }

.callout { background: var(--tint); border: 1px solid var(--rule-soft); border-radius: var(--radius); padding: 16px 18px; }
.callout.cost { border-color: var(--rule); }
.secret { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.secret code, code.inline {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 13px;
  background: var(--tint); border: 1px solid var(--rule-soft); border-radius: var(--radius-sm); padding: 6px 9px; word-break: break-all;
}
pre.code {
  background: #1f262a; color: #e6ecee; border-radius: var(--radius); padding: 14px 16px; overflow-x: auto;
  font: 13px/1.55 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; margin: 8px 0 18px;
}

/* ------------------------------------------------------------ login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login { width: 100%; max-width: 400px; }
.login .brand { margin-bottom: 26px; }
.login .panel { padding: 26px; }

.footer { max-width: 1160px; margin: 0 auto; padding: 0 24px 40px; color: var(--muted); font-size: 13px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media (max-width: 640px) {
  .hide-sm { display: none; }
  .topbar-inner { flex-wrap: wrap; gap: 10px 18px; padding-top: 10px; padding-bottom: 10px; }
  .page { padding-top: 20px; }
  h1 { font-size: 25px; }
  .hero-figure { font-size: 44px; }
}
