/* ============================================================
   Sistema de diseño del panel RUUTS
   Marca: Passion One (títulos) + Fustat (texto) · verde lima, tinta oscura, rosado, rojo
   Botones y tarjetas: borde de 2px con sombra dura desplazada
   ============================================================ */
:root {
  --ink: #152018;
  --ink-2: #3a463c;
  --muted: #6e7a6c;
  --line: #e4e0cf;
  --bg: #f5f3eb;
  --card: #ffffff;
  --lime: #cdee5a;
  --lime-2: #ecfca1;
  --lime-d: #bfe23f;
  --pink: #f9d6dc;
  --pink-2: #fbe9ec;
  --red: #e23744;
  --red-2: #fadfe0;
  --amber: #e89548;
  --amber-2: #fbe9d6;
  --blue: #3b6fd9;
  --blue-2: #e1eafb;
  --ok: #2f9e3a;
  --ok-2: #e4f0de;
  --shadow: 3px 4px 0 0 var(--ink);
  --radius: 14px;
  --hdr-h: 64px;   /* alto del encabezado fijo: lo que se pega arriba va debajo de él */
  color-scheme: light;
  --font: "Fustat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --deep: #0e6429;
  --font-h: "Passion One", Impact, "Arial Narrow Bold", sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--font-h); font-weight: 400; text-transform: uppercase; letter-spacing: .02em; margin: 0; line-height: 1.05; text-wrap: balance; }
h1 { font-size: 34px; } h2 { font-size: 24px; } h3 { font-size: 19px; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.right { text-align: right; } .center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- Estructura ---------- */
.app { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100%; }
.app--auth { display: block; }
.sidebar { background: #fff; color: var(--ink); border-right: 1px solid var(--line); padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.brand { font-family: var(--font-h); font-size: 30px; letter-spacing: .04em; color: var(--deep); padding: 4px 10px 14px; text-transform: uppercase; line-height: 1; }
.brand small { display: block; font-family: var(--font); font-size: 11px; letter-spacing: .12em; color: var(--muted); margin-top: 4px; text-transform: uppercase; }
.nav-group { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #94a091; padding: 14px 10px 4px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-weight: 600; border: 2px solid transparent; }
.nav a:hover { background: var(--bg); }
.nav a[aria-current="page"] { background: var(--lime-2); color: var(--deep); border-color: transparent; font-weight: 800; }
.nav .ico { width: 20px; text-align: center; }
.nav .count { margin-left: auto; background: var(--red); color: #fff; border-radius: 999px; font-size: 11px; min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 6px; font-weight: 700; }
.nav .count--soft { background: var(--lime); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }   /* cantidad (no alerta): suscripciones activas */
.sidebar .me { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.sidebar .me b { display: block; color: var(--ink); }
.main { padding: 22px 28px 60px; min-width: 0; }
.topbar { display: none; }
.page-head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

.banner { border: 2px solid var(--ink); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 18px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.banner--test { background: var(--amber-2); } .banner--prod { background: var(--ok-2); }
.banner--critical { background: var(--red); color: #fff; border-color: #000; box-shadow: var(--shadow); }
.banner--critical a { color: #fff; font-weight: 700; }

/* ---------- Tarjetas, KPIs ---------- */
.card { background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.card > h3 { margin-bottom: 12px; }
.card--flat { box-shadow: none; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.kpi { background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .n { font-family: var(--font-h); font-size: 38px; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.kpi--lime { background: var(--lime); color: #152018; } .kpi--lime .l { color: #26330a; }
.kpi--alert { background: var(--red-2); } .kpi--alert .n { color: var(--red); }

/* ---------- Botones ---------- */
.btn { font: inherit; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; padding: 8px 14px; border: 2px solid var(--ink); border-radius: 8px; background: var(--card); color: var(--ink); box-shadow: 3px 4px 0 0 var(--ink); text-decoration: none; transition: transform .08s, box-shadow .08s; }
.btn:hover { transform: translate(1px, 1px); box-shadow: 2px 3px 0 0 var(--ink); }
.btn:active { transform: translate(3px, 4px); box-shadow: 0 0 0 0 var(--ink); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: 3px 4px 0 0 var(--ink); }
.btn--primary { background: var(--lime); color: #152018; }
.btn--danger { background: var(--red); color: #fff; border-color: #000; box-shadow: 3px 4px 0 0 #000; }
.btn--pink { background: var(--pink); color: #152018; }
.btn--ghost { background: transparent; box-shadow: none; border-color: transparent; }
.btn--ghost:hover { background: rgba(0,0,0,.06); box-shadow: none; transform: none; }
.btn--sm { padding: 4px 10px; font-size: 13px; box-shadow: 2px 3px 0 0 var(--ink); }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }

/* ---------- Formularios ---------- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; min-width: 0; }
.field > label, .field > .lbl { font-weight: 700; font-size: 13px; }
.field .help { font-size: 12.5px; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=date], select, textarea {
  font: inherit; width: 100%; padding: 9px 11px; border: 2px solid var(--ink); border-radius: 8px; background: var(--card); color: var(--ink); min-width: 0;
}
textarea { min-height: 90px; resize: vertical; }
input:disabled, select:disabled { opacity: .6; background: var(--bg); }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--ink); flex: none; }
/* Interruptor Sí/No (Panel.sw): el checkbox real va encima, invisible; la pista dibuja el estado. */
.sw { position: relative; display: inline-flex; flex: none; }
.check > .sw { margin-top: -2px; }
.sw > input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.sw > input:disabled { cursor: not-allowed; }
.sw__track { position: relative; display: inline-flex; align-items: center; justify-content: flex-end; box-sizing: border-box; width: 56px; height: 28px; padding: 0 8px; border: 2px solid var(--ink); border-radius: 999px; background: #e9e6da; box-shadow: 2px 2px 0 0 var(--ink); color: var(--ink-2); font: 800 11px/1 var(--font); letter-spacing: .06em; transition: background-color .15s ease; }
.sw__track::before { content: "NO"; }
.sw__track::after { content: ""; position: absolute; top: 2px; left: 2px; box-sizing: border-box; width: 20px; height: 20px; border: 2px solid var(--ink); border-radius: 50%; background: #fff; transition: transform .15s ease; }
.sw > input:checked + .sw__track { background: #2f7d4f; color: #fff; justify-content: flex-start; }
.sw > input:checked + .sw__track::before { content: "SÍ"; }
.sw > input:checked + .sw__track::after { transform: translateX(28px); }
.sw > input:focus-visible + .sw__track { outline: 3px solid var(--pink); outline-offset: 2px; }
.sw > input:disabled + .sw__track { opacity: .55; }
@media (prefers-reduced-motion: reduce) { .sw__track, .sw__track::after { transition: none; } }
.form-grid { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 2px solid var(--ink); background: var(--lime-2); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.click { cursor: pointer; } .table tbody tr.click:hover td { background: var(--lime-2); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input[type=search], .toolbar select { width: auto; min-width: 180px; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 12px; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; border: 2px solid var(--ink); background: var(--card); white-space: nowrap; }
.badge--active, .badge--paid, .badge--sent, .badge--ok, .badge--created { background: var(--ok-2); }
.badge--pending, .badge--queued, .badge--warn, .badge--paused { background: var(--amber-2); }
.badge--cancelled, .badge--failed, .badge--critical, .badge--fraud, .badge--review { background: var(--red-2); color: var(--red); border-color: var(--red); }
.badge--info, .badge--card_updated, .badge--refunded { background: var(--blue-2); }
.badge--chargeback, .badge--claim { background: var(--pink-2); }

/* ---------- Varios ---------- */
.empty { text-align: center; padding: 38px 16px; color: var(--muted); }
.empty b { display: block; font-family: var(--font-h); font-size: 22px; text-transform: uppercase; color: var(--ink); margin-bottom: 4px; }
.loading { padding: 30px; text-align: center; color: var(--muted); }
.spin { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--ink); border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2.4s; } }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--muted); font-size: 13px; } .kv dd { margin: 0; font-weight: 500; word-break: break-word; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 3px solid var(--ink); display: flex; flex-direction: column; gap: 12px; }
.timeline li { position: relative; padding-left: 14px; }
.timeline li::before { content: ""; position: absolute; left: -23px; top: 6px; width: 12px; height: 12px; background: var(--lime); border: 2px solid var(--ink); border-radius: 50%; }
/* Pestañas dentro de una página: control segmentado (una pista suave; la activa se levanta) */
.tabs { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 4px; margin-bottom: 16px; background: #ebe7d8; border-radius: 12px; max-width: 100%; }
.tab { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 14px; font-weight: 600; line-height: 1.2; padding: 7px 14px; border: 1.5px solid transparent; border-radius: 9px;
  background: transparent; color: var(--ink-2); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .12s, color .12s; }
.tab:hover { color: var(--ink); background: rgba(255,255,255,.55); }
.tab[aria-selected="true"], .tab[aria-current="true"], .tab[aria-current="page"] { background: #fff; color: var(--ink); font-weight: 800; border-color: var(--ink); box-shadow: 2px 2px 0 0 var(--ink); }
.tab:focus-visible { outline: 3px solid var(--pink); outline-offset: 1px; }
.tab .tab__n { font-size: 11.5px; font-weight: 800; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--line); color: var(--ink); text-align: center; }
.tab .tab__n--hot { background: var(--red); color: #fff; }
pre.code { background: #26330a; color: #ecfca1; padding: 12px; border-radius: 8px; overflow: auto; font-size: 12.5px; max-height: 360px; }
.alertbox { border: 2px solid var(--ink); border-left-width: 8px; border-radius: 8px; padding: 10px 14px; background: var(--card); }
.alertbox--critical { border-color: var(--red); background: var(--red-2); } .alertbox--ok { border-color: var(--ok); background: var(--ok-2); } .alertbox--warning { border-color: var(--amber); background: var(--amber-2); } .alertbox--info { border-color: var(--blue); background: var(--blue-2); }

/* ---------- Modal y toasts ---------- */
.overlay { position: fixed; inset: 0; background: rgba(21, 32, 24, .45); display: grid; place-items: center; padding: 16px; z-index: 50; overflow-y: auto; }
.modal { background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: 6px 8px 0 0 var(--ink); width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; }
.modal--wide { width: min(900px, 100%); }
.modal header { padding: 16px 18px 10px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; position: sticky; top: 0; z-index: 5; background: var(--card); } .modal header h3 { margin: 0; }
.modal-close { flex: none; width: 34px; height: 34px; border: 2px solid var(--ink); border-radius: 50%; background: var(--card); color: var(--ink); font-size: 15px; line-height: 1; cursor: pointer; } .modal-close:hover { background: var(--line); } .modal-close:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; } .modal .body { padding: 6px 18px 14px; } .modal footer { padding: 0 18px 18px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; position: sticky; bottom: 0; z-index: 5; background: var(--card); }
.modal footer:not(:empty) { padding-top: 12px; } .modal footer:empty { display: none; }
/* Botones de formularios dentro del pop-up: fijos abajo al hacer scroll */
.modal .modal-actions { position: sticky; bottom: 0; z-index: 5; background: var(--card); margin: 0 -18px -14px; padding: 12px 18px 16px; border-top: 1px dashed var(--line); box-shadow: 0 16px 0 var(--card); }
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 10px; z-index: 60; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: var(--lime-2); border: 2px solid #000; border-radius: 8px; padding: 10px 14px; box-shadow: 3px 4px 0 0 #000; font-weight: 500; }
.toast--error { background: var(--red); color: #fff; } .toast--ok { background: var(--lime); color: #152018; }

/* ---------- Acceso (login / instalación) ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background:
  radial-gradient(900px 400px at 85% -10%, var(--lime-2), transparent 60%), var(--bg); }
.auth .card { width: min(440px, 100%); }
.auth .brand { padding: 0 0 6px; font-size: 40px; color: var(--ink); } .auth .brand small { color: var(--muted); }

/* ---------- Móvil ---------- */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 40; transform: translateX(-102%); transition: transform .2s; }
  .sidebar.open { transform: none; }
  .topbar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: #fff; color: var(--deep); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
  .topbar .brand { padding: 0; font-size: 24px; } .topbar button { background: transparent; border: 2px solid var(--lime); color: var(--lime); border-radius: 8px; padding: 4px 10px; font: inherit; font-weight: 700; }
  .main { padding: 16px 14px 60px; }
  h1 { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

/* operación */
.row-alert td { background: #fadfe0; }
.row-alert td:first-child { box-shadow: inset 6px 0 0 var(--red); }
.row-alert.click:hover td { background: #f6c9cc !important; }
.flag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 6px; background: var(--red); color: #fff; border: 2px solid #000; white-space: nowrap; }
.flag--soft { background: var(--pink); color: #152018; border-color: var(--ink); }
.kpi--link { text-decoration: none; color: inherit; display: block; }
.kpi--link:hover { transform: translate(1px, 1px); box-shadow: 2px 3px 0 0 var(--ink); }
.kpi--critical { background: var(--red); color: #fff; border-color: #000; box-shadow: 3px 4px 0 0 #000; }
.kpi--critical .l { color: #ffe0df; }
.kpi .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.alert-hero { background: var(--red); color: #fff; border: 2px solid #000; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.alert-hero .big { font-family: var(--font-h); font-size: 44px; line-height: 1; }
.alert-hero .txt { flex: 1; min-width: 200px; }
.alert-hero .txt b { font-family: var(--font-h); font-size: 22px; text-transform: uppercase; font-weight: 400; display: block; }
.alert-hero .btn { color: #152018; background: #fff; border-color: #000; box-shadow: 3px 4px 0 0 #000; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 9px 0; border-bottom: 1px solid var(--line); }
.list-plain li:last-child { border-bottom: 0; }
.statbar { display: flex; height: 16px; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; background: var(--bg); }
.statbar span { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 13px; }
.legend i { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--ink); border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.copybox { display: flex; gap: 8px; align-items: stretch; }
.copybox input { flex: 1; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.sub-link { font-weight: 700; text-decoration: none; border-bottom: 2px solid var(--lime-d); }
.sub-link:hover { background: var(--lime-2); }
.detail-grid > * { min-width: 0; }
.detail-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); align-items: start; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 2px solid var(--ink); border-radius: 8px; padding: 3px 4px 3px 10px; background: var(--lime-2); font-size: 13px; }
details.payload { margin-top: 6px; } details.payload > summary { cursor: pointer; font-weight: 700; font-size: 13px; }
.pick { border: 2px solid var(--ink); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; background: var(--card); }
.pick .var { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 4px 0; border-top: 1px dashed var(--line); box-shadow: 0 16px 0 var(--card); }
.pick .var:first-of-type { border-top: 0; }
.err-text { color: var(--red); font-weight: 600; }
.stat-pill { display: inline-block; font-family: var(--font-h); font-size: 20px; }
@media (max-width: 860px) {
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .table--stack td { min-width: 0; overflow-wrap: anywhere; }
  .alert-hero .big { font-size: 36px; }
  .table--stack thead { display: none; }
  .table--stack, .table--stack tbody, .table--stack tr, .table--stack td { display: block; width: 100%; }
  .table--stack tr { padding: 10px 12px; border-bottom: 2px solid var(--ink); }
  .table--stack tr:last-child { border-bottom: 0; }
  .table--stack td { border: 0; padding: 3px 0; display: flex; gap: 10px; justify-content: space-between; text-align: right; }
  .table--stack td::before { content: attr(data-label); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-align: left; flex: none; padding-top: 2px; }
  .table--stack td.num, .table--stack td.right { text-align: right; }
  .table--stack td[data-label=""]::before { content: none; }
  .row-alert td:first-child { box-shadow: none; }
  .row-alert { box-shadow: inset 6px 0 0 var(--red); }
  .toolbar input[type=search], .toolbar select { width: 100%; }
  .copybox { flex-direction: column; }
}

/* ============================================================
   Módulo administración (settings, golive, users, roles, audit, diagnostics, notifications, profile)
   ============================================================ */
.pager { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.section-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 22px 0 6px; }
.section-title:first-child { margin-top: 0; }
.section-intro { color: var(--muted); margin: 0 0 14px; max-width: 70ch; }
.setting { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.setting:last-child { border-bottom: 0; }
.setting .head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-bottom: 4px; }
.origin { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 1px 7px; border-radius: 999px; border: 1.5px solid var(--line); color: var(--muted); }
.origin--db { border-color: var(--ok); color: var(--ok); }
.origin--env { border-color: var(--blue); color: var(--blue); }
.secret-state { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; font-size: 13.5px; }
.secret-state .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); border: 2px solid var(--ink); flex: none; }
.secret-state .dot--on { background: var(--ok); }
.fact-list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.fact { border: 2px solid var(--ink); border-radius: 8px; padding: 10px 12px; background: var(--card); }
.fact .l { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.fact .v { font-weight: 700; font-size: 17px; word-break: break-word; }
.mode-hero { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.mode-pill { font-family: var(--font-h); font-size: 34px; text-transform: uppercase; padding: 4px 18px; border: 2px solid var(--ink); border-radius: 999px; box-shadow: var(--shadow); line-height: 1.15; }
.mode-pill--test { background: var(--amber-2); } .mode-pill--prod { background: var(--lime); color: #152018; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.steps li { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; }
.steps li::before { content: counter(s); flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--lime); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.master-detail { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 18px; align-items: start; }
.role-list { display: flex; flex-direction: column; gap: 10px; }
.role-item { text-align: left; font: inherit; cursor: pointer; width: 100%; border: 2px solid var(--ink); border-radius: var(--radius); padding: 10px 12px; background: var(--card); color: var(--ink); }
.role-item:hover { background: var(--lime-2); }
.role-item[aria-current="true"] { background: var(--lime); color: #152018; box-shadow: var(--shadow); }
.role-item b { display: block; } .role-item span { font-size: 12.5px; opacity: .8; }
.perm-group { border: 2px solid var(--ink); border-radius: 8px; margin-bottom: 12px; overflow: hidden; background: var(--card); }
.perm-group > header { display: flex; gap: 10px; align-items: center; padding: 8px 12px; background: var(--lime-2); border-bottom: 2px solid var(--ink); font-weight: 700; flex-wrap: wrap; }
.perm-group > .perms { padding: 8px 12px; display: grid; gap: 8px 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.audit-detail { background: var(--bg); padding: 12px 14px !important; }
.diff { width: 100%; border-collapse: collapse; font-size: 13px; }
.diff th, .diff td { text-align: left; padding: 4px 10px 4px 0; vertical-align: top; border-bottom: 1px solid var(--line); word-break: break-word; }
.diff th { color: var(--muted); font-weight: 600; white-space: nowrap; }
.diff .old { color: var(--red); } .diff .new { color: var(--ok); }
.chev { display: inline-block; transition: transform .12s; } [aria-expanded="true"] > .chev { transform: rotate(90deg); }
.linkbtn { font: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; color: inherit; }
.notice-item { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; align-items: start; }
.notice-item--read { opacity: .66; }
.notice-item h3 { font-size: 18px; text-transform: none; font-family: var(--font); font-weight: 700; letter-spacing: 0; margin: 4px 0; }
.qrbox { background: #fff; padding: 6px; border: 2px solid var(--ink); border-radius: 8px; display: inline-block; line-height: 0; }
.qrbox svg { max-width: 100%; height: auto; }
.secret-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 16px; letter-spacing: .08em; background: var(--lime-2); border: 2px dashed var(--ink); padding: 8px 12px; border-radius: 8px; word-break: break-all; display: inline-block; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.mini-table th { text-align: left; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 6px 10px 6px 0; border-bottom: 2px solid var(--ink); white-space: nowrap; }
.mini-table td { padding: 6px 10px 6px 0; border-bottom: 1px solid var(--line); vertical-align: top; word-break: break-word; }
@media (max-width: 860px) { .master-detail { grid-template-columns: 1fr; } .mode-pill { font-size: 28px; } .grid--2 { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .chev { transition: none; } }
[hidden] { display: none !important; }


/* ---------- Menú lateral plegable, marca y secciones de configuración ---------- */
.brand-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.brand-row .brand { min-width: 0; }
.brand-logo { display: block; max-height: 38px; max-width: 150px; width: auto; height: auto; object-fit: contain; margin: 2px 0 4px; }
.brand-name { display: block; }
.nav-toggle { flex: none; border: 2px solid var(--ink); background: #fff; color: var(--ink); border-radius: 8px; width: 28px; height: 28px; padding: 0; display: grid; place-items: center; cursor: pointer; box-shadow: 2px 2px 0 0 var(--ink); }
.nav-toggle .ico svg { width: 16px; height: 16px; }
.nav-toggle:hover { background: var(--lime-2); }
.nav-x, .nav-scrim { display: none; }
.nav .ico { width: 20px; text-align: center; flex: none; }
.nav-parent { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; border: 2px solid transparent; background: none; color: var(--ink-2); font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
.nav-parent:hover { background: var(--bg); }
.nav-parent.is-current { color: var(--deep); font-weight: 800; }
.nav-parent .chev { margin-left: auto; transition: transform .15s; }
.nav-parent[aria-expanded="true"] .chev { transform: rotate(180deg); }
.nav-sub { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 6px 14px; padding-left: 8px; border-left: 2px solid var(--line); }
.nav-sub[hidden] { display: none; }
.nav-sub a { padding: 7px 10px; font-size: 14px; }
.me-link { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.me-link .lbl { line-height: 1.25; }
.me .btn { margin-top: 8px; }
.me .btn-logout { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; background: #fff; color: var(--ink); border: 1.5px solid var(--ink); border-radius: 999px; font-weight: 600; }
.me .btn-logout:hover { background: var(--ink); color: #fff; }
.is-collapsed .me .btn-logout { padding: 8px 0; }

.app.is-collapsed { grid-template-columns: 68px minmax(0, 1fr); }
.is-collapsed .sidebar { padding: 14px 8px; align-items: stretch; }
.is-collapsed .sidebar .lbl, .is-collapsed .sidebar .nav-group, .is-collapsed .sidebar .brand small, .is-collapsed .sidebar .brand-name, .is-collapsed .nav-sub { display: none; }
.is-collapsed .brand-row { flex-direction: column; align-items: center; gap: 8px; }
.is-collapsed .brand-logo { max-width: 44px; max-height: 34px; }
.is-collapsed .nav a, .is-collapsed .nav-parent, .is-collapsed .me-link { justify-content: center; padding: 10px 6px; }
.is-collapsed .nav .count { position: absolute; top: 2px; right: 4px; margin: 0; min-width: 16px; height: 16px; font-size: 10px; }
.is-collapsed .nav a { position: relative; }
.is-collapsed .me { padding-top: 10px; }

/* Pestañas de sección (Suscripciones · Planes · Checkout…): texto con subrayado, sobre una línea */
.cfgbar { display: flex; gap: 4px; overflow-x: auto; margin: 0 0 18px; border-bottom: 2px solid var(--line); scrollbar-width: none; }
.cfgbar::-webkit-scrollbar { display: none; }
.cfgtab { position: relative; flex: none; text-decoration: none; padding: 10px 14px 12px; color: var(--muted); font-weight: 700; font-size: 15px; white-space: nowrap; border-radius: 8px 8px 0 0; margin-bottom: -2px; }
.cfgtab::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 4px; border-radius: 4px 4px 0 0; background: transparent; transition: background .12s; }
.cfgtab:hover { color: var(--ink); }
.cfgtab:hover::after { background: var(--line); }
.cfgtab[aria-current="page"] { color: var(--ink); font-weight: 800; }
.cfgtab[aria-current="page"]::after { background: var(--ink); }
.cfgtab:focus-visible { outline: 3px solid var(--pink); outline-offset: -3px; }

@media (max-width: 860px) {
  .app.is-collapsed { grid-template-columns: 1fr; }
  .nav-toggle { display: none; }
  .nav-toggle.nav-x { display: grid; width: 34px; height: 34px; }
  body.nav-open { overflow: hidden; }
  body.nav-open .nav-scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(21, 32, 24, .4); }
  .is-collapsed .sidebar .lbl { display: inline; }
  .is-collapsed .sidebar .nav-group { display: block; }
  .is-collapsed .sidebar .brand-name { display: block; }
  .is-collapsed .sidebar .brand small { display: block; }
  .is-collapsed .nav-sub { display: flex; }
  .is-collapsed .nav-sub[hidden] { display: none; }
  .is-collapsed .brand-row { flex-direction: row; align-items: flex-start; }
  .is-collapsed .nav a, .is-collapsed .nav-parent, .is-collapsed .me-link { justify-content: flex-start; padding: 9px 10px; }
}

/* ---------- Biblioteca de medios ---------- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-top: 12px; }
.media-card { margin: 0; background: #fff; border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: 3px 4px 0 0 var(--ink); display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.media-thumb { aspect-ratio: 4 / 3; background: repeating-conic-gradient(#ede9da 0% 25%, #f5f3eb 0% 50%) 0 0 / 16px 16px; display: grid; place-items: center; border-bottom: 2px solid var(--ink); }
.media-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.media-card figcaption { padding: 8px 10px 4px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.media-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 10px 10px; margin-top: auto; }
.media-drop { border: 2px dashed var(--ink); border-radius: var(--radius); background: var(--lime-2); padding: 16px; text-align: center; display: flex; flex-direction: column; gap: 2px; font-weight: 700; cursor: pointer; margin-bottom: 8px; }
.media-drop.is-over, .media-drop:hover { background: var(--lime); }

.brand-preview { min-height: 90px; display: grid; place-items: center; padding: 16px; background: repeating-conic-gradient(#ede9da 0% 25%, #f5f3eb 0% 50%) 0 0 / 16px 16px; border: 2px solid var(--ink); border-radius: var(--radius); }
.brand-preview__img { max-width: 260px; max-height: 80px; object-fit: contain; }

.ico svg { width: 20px; height: 20px; display: block; }
.nav .ico.chev { width: 16px; margin-left: auto; }
.nav .ico.chev svg { width: 16px; height: 16px; }

/* ---------- Botones al estilo de la intranet (píldora, borde 2px, sombra dura) ---------- */
.btn { border-radius: 999px; font-weight: 800; box-shadow: 2px 3px 0 0 var(--ink); }
.btn--primary { background: var(--lime); border-color: var(--ink); color: var(--ink); }
.btn--primary:hover { background: var(--lime-d); }
.btn--danger { background: #fff; color: var(--red); border-color: var(--red); box-shadow: 2px 3px 0 0 var(--red); }
.btn--danger:hover { background: var(--red); color: #fff; }
.btn--pink { background: var(--pink); color: var(--ink); }
.btn--ghost { box-shadow: none; border-color: transparent; background: none; }
.btn--ghost:hover { background: var(--bg); }
.btn--sm { box-shadow: 2px 2px 0 0 var(--ink); }
.btn--sm.btn--danger { box-shadow: 2px 2px 0 0 var(--red); }
.btn--ghost.btn--sm { box-shadow: none; }
.alert-hero .btn--danger, .banner--critical .btn--danger { background: #fff; color: var(--red); border-color: #fff; }
.toast--ok { background: var(--deep); color: #fff; border-color: var(--ink); }

/* ---------- Pruebas (solo modo pruebas): debe saltar a la vista ---------- */
.nav a.nav-testing { background: repeating-linear-gradient(-45deg, #ffd23f 0 10px, #152018 10px 20px); color: #152018; border-color: #152018; }
.nav a.nav-testing .lbl { background: #ffd23f; padding: 1px 8px; border-radius: 6px; border: 2px solid #152018; font-weight: 800; }
.nav a.nav-testing .ico { background: #ffd23f; border-radius: 6px; padding: 2px; }
.nav a.nav-testing[aria-current="page"] { box-shadow: 0 0 0 3px #ffd23f; }
.testing-hero { position: relative; border: 3px solid #152018; border-radius: 16px; padding: 22px 22px 18px; margin-bottom: 18px;
  background: #fff3b0; box-shadow: 4px 5px 0 0 #152018; overflow: hidden; }
.testing-hero::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 12px; background: repeating-linear-gradient(-45deg, #ffd23f 0 12px, #152018 12px 24px); }
.testing-hero__tag { display: inline-block; margin-top: 6px; padding: 3px 12px; border: 2px solid #152018; border-radius: 999px; background: #ffd23f; font-weight: 800; letter-spacing: .04em; }
.testing-hero h1 { margin: 10px 0 4px; }
.testing-hero p { margin: 0; }
.testing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.testing-chip { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 10px 12px; border: 2px solid var(--ink); border-radius: 12px; background: var(--card); cursor: pointer; font: inherit; color: var(--ink); }
.testing-chip b { font-size: 17px; }
.testing-chip span { font-size: 13px; color: var(--muted); }
.testing-chip--ok { background: var(--lime-2); }
.testing-chip--wait { background: var(--amber-2); }
.testing-chip:hover { box-shadow: 2px 3px 0 0 var(--ink); }
.testing-chip:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }

/* Submenús de cada sección en el menú lateral */
.nav-tabs { display: none; flex-direction: column; gap: 1px; margin: 2px 0 6px 20px; padding-left: 10px; border-left: 2px solid var(--line); }
.nav-hub.is-open .nav-tabs { display: flex; }
.nav .nav-tab, .nav-fly .nav-tab { display: block; padding: 6px 10px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; border: 0; }
.nav .nav-tab:hover, .nav-fly .nav-tab:hover { background: var(--bg); color: var(--ink); }
.nav .nav-tab[aria-current="page"], .nav-fly .nav-tab[aria-current="page"] { color: var(--deep); font-weight: 800; background: transparent; box-shadow: inset 3px 0 0 var(--lime); }
.is-collapsed .nav-tabs { display: none !important; }
.nav-fly { position: fixed; z-index: 60; min-width: 190px; padding: 8px; background: #fff; border: 2px solid var(--ink); border-radius: 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 1px; animation: navfly .12s ease-out; }
.nav-fly[hidden] { display: none; }
.nav-fly__title { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #94a091; padding: 4px 10px 6px; }
@keyframes navfly { from { opacity: 0; transform: translateX(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .nav-fly { animation: none; } }
@media (max-width: 860px) { .nav-fly { display: none !important; } }

/* Inicio: estadísticas */
.section-title { font-family: var(--font-h); font-weight: 400; font-size: 22px; text-transform: uppercase; margin: 6px 0 12px; }
.section-title span { font-family: var(--font); font-size: 13px; text-transform: none; color: var(--muted); }
.delta { font-weight: 700; }
.delta--up { color: var(--deep); } .delta--down { color: var(--red); } .delta--flat { color: var(--muted); }
.kpi--lime .delta--up { color: #1d3d07; }
.chart h3 { margin-bottom: 2px; }
.chart__total { font-family: var(--font-h); font-size: 28px; line-height: 1.1; }
.chart__total span { font-family: var(--font); font-size: 13px; color: var(--muted); }
.chart__plot { position: relative; margin-top: 12px; padding-top: 30px; }
.chart__svg { display: block; width: 100%; height: 150px; border-bottom: 1.5px solid var(--line); overflow: visible; }
.chart__bar { fill: var(--deep); transition: fill .12s; }
.chart__bar.on { fill: var(--ink); }
.chart__bar--bad { fill: var(--red); }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; }
.chart__tip { position: absolute; top: 2px; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 600; padding: 6px 10px; z-index: 2; border-radius: 8px; white-space: nowrap; pointer-events: none; }
.chart__axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }
.chart__area { position: relative; }
.chart__tip-row { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 8px; }
.chart__tip-row + .chart__tip-row { margin-top: 3px; color: #d9d6c6; }
.chart__tip-row i { width: 10px; height: 10px; border-radius: 3px; border: 1px solid rgba(255,255,255,.55); }
.chart__tip-row .lg-cur { background: var(--deep); } .chart__tip-row .lg-cmp { background: #d9d6c6; }
.chart__tip-row b { text-align: right; font-variant-numeric: tabular-nums; padding-left: 10px; }
.chart__val { position: absolute; transform: translate(-50%, -3px); font-size: 11.5px; font-weight: 700; line-height: 1; white-space: nowrap; pointer-events: none; }
.chart__val--cmp { color: var(--muted); font-weight: 600; transform: translate(-50%, -17px); }   /* encima del número del período, no al lado */
.chart__ticks { display: grid; margin-top: 6px; font-size: 11.5px; line-height: 1.2; text-align: center; }
.chart__ticks span { display: flex; flex-direction: column; align-items: center; min-width: 0; overflow: visible; white-space: nowrap; }
.chart__ticks i { font-style: normal; color: var(--muted); }
.chart__ticks b { font-weight: 700; }
.rank li { display: block; }
.rank__row { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.rank__track { height: 8px; border-radius: 6px; background: var(--line); margin: 5px 0 2px; }
.rank__track i { display: block; height: 100%; border-radius: 6px; background: var(--deep); }
/* Etiqueta «Muy pronto» en el menú */
.nav .soon { margin-left: auto; white-space: nowrap; flex: none; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; background: var(--pink, #f196e4); color: #152018; border: 1.5px solid var(--ink); }
.is-collapsed .nav .soon { display: none; }
.soon-hero { text-align: center; padding: 56px 20px; }
.soon-hero .art { font-size: 56px; line-height: 1; margin-bottom: 14px; }
.soon-hero h2 { font-family: var(--font-h); font-weight: 400; font-size: 32px; text-transform: uppercase; margin: 0 0 8px; }
.soon-hero p { color: var(--muted); max-width: 520px; margin: 0 auto 16px; }
.soon-list { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 620px; margin: 0 auto; }
.soon-list span { padding: 6px 12px; border-radius: 999px; border: 2px dashed var(--line); font-size: 13.5px; font-weight: 600; color: var(--ink-2); }

/* ---------- Estadísticas ---------- */
.an-bar { position: sticky; top: var(--hdr-h); z-index: 6; margin: 4px -4px 16px; padding: 8px 4px; background: var(--bg); }
.an-bar__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.an-bar .an-views { margin: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.an-bar .an-views .tab { white-space: nowrap; }
.an-bar__f { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; min-width: 0; font: inherit; font-size: 13px; color: var(--ink-2); background: #fff; border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 6px 6px 12px; cursor: pointer; }
.an-bar__f:hover, .an-bar__f[aria-expanded="true"] { border-color: var(--ink); }
.an-bar__txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-bar__f b { flex: none; font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--lime-2); color: var(--ink); }
.an-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 12px; margin-top: 8px; box-shadow: var(--shadow); }
@media (max-width: 860px) { .an-bar__f { margin-left: 0; max-width: 100%; } }
.an-f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.an-f select, .an-f input { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--ink); }
.an-toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 16px; }
.an-toc a { font-size: 13px; font-weight: 700; color: var(--ink-2); text-decoration: none; padding: 5px 12px; border-radius: 999px; border: 2px solid var(--line); background: #fff; }
.an-toc a:hover { border-color: var(--ink); }
.an-body { transition: opacity .15s; }
.an-body.is-loading { opacity: .45; pointer-events: none; }
.an-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 0 0 14px; }
.an-head__range { font-family: var(--font-h); font-size: 26px; text-transform: uppercase; line-height: 1.1; }
.an-head__range small { font-family: var(--font); font-size: 13px; text-transform: none; color: var(--muted); }
.an-head__cmp { font-size: 13px; font-weight: 700; color: var(--deep); background: var(--lime-2); padding: 3px 10px; border-radius: 999px; }
.an-section { margin-bottom: 22px; scroll-margin-top: 120px; }
.an-section > .card + .grid, .an-section > .card + .card { margin-top: 16px; }
.an-group { margin-bottom: 14px; }
.an-group__t { font-size: 15px; color: var(--muted); margin: 0 0 8px; }
.an-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.an-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.an-kpi .n { font-size: 32px; }
.an-kpi .sub { display: flex; flex-wrap: wrap; gap: 0 4px; }
.an-prev { color: var(--muted); }
.an-help { color: var(--muted); }
.chart__cmp { fill: #d9d6c6; }
.chart__cmp--over { fill: #cfcbb8; stroke: var(--muted); stroke-dasharray: 3 3; stroke-width: 1; vector-effect: non-scaling-stroke; }
.legend .lg-cur, .legend .lg-cmp { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend .lg-cur { background: var(--deep); } .legend .lg-cmp { background: #d9d6c6; }
.cohort td, .cohort th { padding: 7px 8px; font-size: 13px; }
.cohort td.num { font-variant-numeric: tabular-nums; }
.cohort__na { background: repeating-linear-gradient(45deg, transparent 0 6px, var(--line) 6px 7px); }
.an-notes ul { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: 13.5px; }
@media print { .an-notes[open], .an-notes { display: block; } .an-notes ul { display: block; } }
.print-only { display: none; }

@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff !important; }
  .sidebar, .topbar, .banner, .cfgbar, .no-print, .toast, #toasts, .nav-fly { display: none !important; }
  .app, .app.is-collapsed { display: block !important; }
  .main { padding: 0 !important; max-width: none !important; }
  .print-only { display: block; }
  .card, .kpi { box-shadow: none !important; border-width: 1px !important; break-inside: avoid; }
  .an-section { break-inside: auto; }
  .an-section > h2 { break-after: avoid; }
  .an-grid { grid-template-columns: repeat(4, 1fr) !important; gap: 8px; }
  .an-3 { grid-template-columns: repeat(3, 1fr) !important; gap: 8px; }
  .grid--2 { grid-template-columns: repeat(2, 1fr) !important; gap: 8px; }
  .an-kpi { padding: 8px 10px; }
  .an-kpi .n { font-size: 22px; }
  .an-head { border-bottom: 3px solid #152018; padding-bottom: 8px; display: block; }
  .an-head__brand { font-family: var(--font-h); font-size: 34px; text-transform: uppercase; color: var(--deep); }
  .an-head__gen { font-size: 11px; color: var(--muted); margin-top: 4px; }
  .chart__svg { height: 110px; }
  .chart__tip { display: none !important; }
  .cohort__na { background: #f4f2ea !important; }
  .an-filters, .an-toc { display: none !important; }
  .table-wrap { overflow: visible !important; border-width: 1px !important; }
  .table th { background: #f1f7d6 !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Avisos de Mercado Pago ---------- */
.wh-health { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; padding: 14px 18px; border: 2px solid var(--ink); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.wh-health--ok { background: var(--lime-2); }
.wh-health--warn { background: #fff4d6; }
.wh-health--bad { background: var(--red-2); }
.wh-health__main { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 2px; }
.wh-health__main b { font-family: var(--font-h); font-weight: 400; font-size: 22px; text-transform: uppercase; }
.wh-health__kv { display: flex; gap: 22px; margin: 0; }
.wh-health__kv dt { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.wh-health__kv dd { margin: 0; font-weight: 800; font-size: 18px; }
.wh-item { display: flex; gap: 14px; align-items: flex-start; padding: 12px 16px; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; }
.wh-item--err { border-color: var(--red); background: var(--red-2); }
.wh-item__ico { flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--bg); font-size: 19px; }
.wh-item__body { flex: 1; min-width: 0; }
.wh-item__top { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-bottom: 2px; }
.wh-item__tech { margin-top: 6px; }
.wh-item__tech summary { cursor: pointer; font-size: 12.5px; color: var(--muted); }
.wh-item__tech pre { max-height: 260px; overflow: auto; margin-top: 8px; }

/* ---------- Regalos ---------- */
.rw-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.cards-grid { display: grid; gap: 14px; align-items: start; }
.cards-grid--1 { grid-template-columns: minmax(0, 1fr); }
.cards-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cards-view { display: flex; align-items: center; gap: 8px; }
@media (max-width: 1400px) { .cards-grid--4 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1150px) { .cards-grid--3, .cards-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .cards-grid--2, .cards-grid--3, .cards-grid--4 { grid-template-columns: minmax(0, 1fr); } .cards-view { display: none; } }
.rw-card h3 { margin: 6px 0 4px; }
.rw-card--off { opacity: .6; }
.rw-card__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rw-card__when { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; background: var(--lime-2); border: 1.5px solid var(--ink); border-radius: 999px; padding: 2px 10px; }
.rw-card__gift { margin: 4px 0; font-weight: 700; }
.rw-card__msg { color: var(--ink-2); font-style: italic; margin: 8px 0 0; }
.switch { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.rw-empty { text-align: center; padding: 34px 18px; }
.rw-empty__art { font-size: 48px; }
.rw-empty h2 { margin: 6px 0; }
.rw-howto summary { cursor: pointer; }
.rw-howto ol { margin: 10px 0 0; padding-left: 20px; color: var(--ink-2); font-size: 14px; }
.rw-chosen { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border: 2px solid var(--ink); border-radius: 10px; background: var(--lime-2); }
.rw-results { max-height: 260px; overflow: auto; margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.rw-pick { display: flex; align-items: center; gap: 10px; text-align: left; padding: 7px 10px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; font: inherit; }
.rw-pick:hover { border-color: var(--ink); background: var(--lime-2); }
.rw-pick img, .rw-pick__ph { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; flex: none; display: grid; place-items: center; background: var(--bg); }
/* Estadísticas por vistas */
.an-views { margin: 4px 0 16px; }
.an-pane { display: none; }
.an-pane.is-active { display: block; }
.an-pane > .card + .grid, .an-pane > .grid + .card, .an-pane > .card + .card { margin-top: 16px; }
.an-insights { margin-bottom: 16px; background: var(--lime-2); }
.an-insights h3 { margin-bottom: 8px; }
.an-insights ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px 22px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.an-ins { position: relative; padding-left: 22px; font-size: 15px; line-height: 1.4; }
.an-ins::before { position: absolute; left: 0; top: 0; font-weight: 800; }
.an-ins--up::before { content: "▲"; color: var(--deep); }
.an-ins--down::before { content: "▼"; color: var(--red); }
.an-ins--flat::before { content: "●"; color: var(--ink-2); font-size: 11px; top: 3px; }
@media print {
  .an-pane { display: block !important; }
  .an-pane + .an-pane { break-before: page; }
  .an-pane__title { font-family: var(--font-h); font-weight: 400; font-size: 24px; text-transform: uppercase; margin: 0 0 10px; }
  .an-insights ul { grid-template-columns: 1fr 1fr; }
}

/* Número de suscripción (para soporte) */
.sus-num { display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 800; font-size: 13px; letter-spacing: .03em; color: #fff; background: var(--deep); border-radius: 6px; padding: 2px 8px; vertical-align: 1px; }
.sus-num--sm { font-size: 11px; padding: 1px 6px; margin-left: 6px; }

/* Notas internas */
.notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.note { border: 1.5px solid var(--line); border-radius: 10px; padding: 9px 12px; background: #fff; }
.note--pinned { border-color: var(--ink); background: var(--lime-2); }
.note--why { margin: 10px 0 0; background: var(--bg); line-height: 1.45; display: flex; flex-direction: column; gap: 8px; }
.note--why > p { margin: 0; }
.rec-contacts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.rec-contacts li { display: flex; gap: 8px; align-items: flex-start; }
.rec-contacts li .ico { flex: none; margin-top: 2px; color: var(--muted); }
.rec-contacts li.is-bad, .rec-contacts li.is-bad .ico { color: var(--red); }
.rec-advice { margin: 0; display: flex; gap: 8px; align-items: flex-start; font-weight: 700; padding-top: 8px; border-top: 1px dashed var(--line); }
.rec-advice .ico { flex: none; margin-top: 2px; }
.rec-advice--go { color: #1d6b3a; } .rec-advice--warn { color: #9a4a00; } .rec-advice--muted { color: var(--muted); font-weight: 600; }
.note__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 13.5px; }
.note__acts { margin-left: auto; display: inline-flex; gap: 10px; }
.note__body { white-space: pre-wrap; margin-top: 4px; font-size: 14.5px; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--ink-2); text-decoration: underline; cursor: pointer; }
.linkbtn--danger { color: var(--red); }
.timeline .tl-note { background: var(--lime-2); border-radius: 8px; padding: 6px 10px; }
.setting-pair { border-bottom: 1px dashed var(--line); gap: 0 18px; }
.setting-pair .setting { border-bottom: 0; }
.setting-pair:last-child { border-bottom: 0; }

/* Roles: qué menú abre cada permiso */
.perm-opens { display: block; font-size: 12px; color: var(--ok, #0e6429); margin-top: 2px; }

/* Tareas automáticas */
.cron-tasks { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.cron-tasks li b { display: block; }
.cron-tasks li span { color: var(--muted); font-size: 14px; }

/* Copias de seguridad */
.dest-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 860px) { .dest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dest { border: 2px solid var(--ink); border-radius: 10px; padding: 10px 12px; background: var(--card); }
.dest b { display: block; margin-bottom: 6px; }
.dest--off { border-style: dashed; opacity: .65; }
.guide { margin: 10px 0 0; background: var(--lime-2); border-radius: 8px; padding: 8px 12px; }
.guide summary { cursor: pointer; font-weight: 700; }
.guide ol { margin: 8px 0 4px; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }
.guide .copybox { margin-top: 6px; }
.dest-live { margin-top: 6px; }
.restore-part { padding: 8px 0; border-bottom: 1px dashed var(--line); margin: 0; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; font-weight: 700; }
.progress { height: 14px; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; background: var(--card); }
.progress span { display: block; height: 100%; background: var(--lime, #cdee5a); transition: width .4s ease; }
.progress--bad span { background: var(--red); }
.restore-log { margin: 8px 0 0; padding-left: 18px; }
a.dest { text-decoration: none; color: inherit; display: block; }
a.dest:hover { background: var(--lime-2); }

/* Etiqueta de versión en el pie del menú */
.sidebar .me .ver { display: block; margin-top: 8px; font-size: 11px; color: var(--muted); letter-spacing: .3px; }
.app.is-collapsed .sidebar .me .ver { display: none; }

/* Aviso de versión nueva: hay que recargar para tomar el código nuevo */
.updatebar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 9999;
  max-width: calc(100% - 32px); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: center;
  background: var(--amber-2); color: var(--ink); border: 2px solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 10px 16px; font-size: 14px; }
.updatebar .btn { background: var(--lime); border-color: #000; box-shadow: 3px 4px 0 0 #000; white-space: nowrap; }

/* Login en pasos: cuenta elegida (chip) y casillas del código 2FA */
.auth-id { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; margin: 0 0 14px; padding: 6px 12px 6px 8px; border: 2px solid var(--ink);
  border-radius: 999px; background: var(--lime-2); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: 2px 3px 0 0 var(--ink); }
.auth-id > span:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-id__chg { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; text-decoration: underline; text-underline-offset: 3px; }
.auth-id:hover { transform: translate(1px, 1px); box-shadow: 1px 2px 0 0 var(--ink); }
.otp { display: flex; gap: 8px; justify-content: space-between; }
.otp-box { width: 100%; max-width: 56px; height: 56px; text-align: center; font-size: 24px; font-weight: 700; padding: 0; border: 2px solid var(--ink); border-radius: 12px; background: var(--card); }
.otp-box:focus { outline: none; box-shadow: 0 0 0 3px var(--lime); }
.auth-trust { display: flex; align-items: flex-start; gap: 10px; margin: 14px 0 6px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.auth-trust input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--ink); flex: none; }

/* Íconos de línea dentro de textos y botones (reemplazan los emojis) */
.ico-line { display: inline-flex; align-items: center; gap: 6px; }
.ico-line > .ico svg, .btn .ico svg, .modal-close .ico svg { width: 16px; height: 16px; }
.btn .ico { display: inline-flex; vertical-align: middle; }
.rw-empty__art .ico svg { width: 48px; height: 48px; margin: 0 auto; }
.soon-hero .art .ico svg { width: 56px; height: 56px; margin: 0 auto; }
.wh-item__ico .ico svg, .rw-pick__ph .ico svg { width: 18px; height: 18px; }
.em-blk__ico .ico svg, .em-pick__ico .ico svg, .em-chip__ico .ico svg, .em-blk__grip .ico svg { width: 18px; height: 18px; }
.modal-close { display: grid; place-items: center; padding: 0; }

/* Listas de números (frecuencias, recordatorios) y escalera de descuento */
.numchips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.numchip { display: inline-flex; align-items: center; gap: 6px; }
.numchip__x { display: inline-grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.numchip__x:hover { background: rgba(0, 0, 0, .08); }
.numchip__x .ico svg { width: 14px; height: 14px; }
.ladder { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.ladder__row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border: 2px solid var(--line); border-radius: 10px; background: var(--card); }
.ladder__row--bad { border-color: var(--red); }
.ladder__row--drag { opacity: .5; }
.ladder__row--over { border-color: var(--ink); border-style: dashed; }
.ladder__grip { cursor: grab; color: var(--muted); display: inline-flex; }
.ladder__grip .ico svg { width: 18px; height: 18px; }
.ladder__n { min-width: 150px; }
.ladder__tools { margin-left: auto; display: inline-flex; gap: 4px; }
.ico--inline { display: inline-flex; vertical-align: -3px; } .ico--inline svg { width: 16px; height: 16px; }
a > .ico--inline:first-child { margin-right: 4px; } a > .ico--inline:last-child { margin-left: 4px; }

/* Acciones de la suscripción: por grupos, botones del mismo ancho y alineados */
.actions { display: flex; flex-direction: column; gap: 14px; }
.actions__label { margin: 0 0 6px; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted, #5b6b5d); }
.actions__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.actions__grid .btn { width: 100%; justify-content: flex-start; }
.actions__group--danger { padding-top: 12px; border-top: 1.5px dashed var(--line); }
/* WhatsApp: su color, para reconocerlo de un vistazo */
.btn--wa { background: #25d366; color: #0b2e18; }
.btn--wa:hover { background: #1fbe5b; color: #0b2e18; }

/* Editores con pestañas y vista previa al lado (Widget de la tienda, Checkout) */
.ed-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.ed-preview { position: sticky; top: calc(var(--hdr-h) + 12px); max-height: calc(100vh - var(--hdr-h) - 24px); overflow: auto; background: #fff; }
.ed-what { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; padding: 2px 2px 4px; }
.ed-what p { margin: 0; flex: 1 1 280px; color: var(--muted); font-size: 14px; }
.ed-what .badge { display: inline-flex; align-items: center; gap: 6px; }
.wg-group { padding: 12px 14px; }
.wg-group.is-open { box-shadow: 3px 4px 0 0 var(--ink); }
.wg-ghead { all: unset; cursor: pointer; display: flex; align-items: center; gap: 10px; flex: 1 1 240px; min-width: 0; }
.wg-ghead > span { display: grid; gap: 2px; min-width: 0; }
.wg-ghead:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; border-radius: 6px; }
.wg-gbody { margin-top: 12px; padding-top: 12px; border-top: 2px dashed var(--line); }
.wg-sub { margin: 14px 0 6px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.wg-sub:first-child { margin-top: 0; }
.wg-pics { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.wg-pic { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 6px; border: 2px solid var(--line); border-radius: 12px; background: var(--card); }
.wg-pic img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1.5px solid var(--ink); flex: none; background: var(--line); }
.wg-pic__url { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Barra de guardar (Panel.saveBar): pegada abajo y siempre a la vista en todas las páginas que guardan */
.ed-savebar { position: sticky; bottom: 0; z-index: 20; display: flex; justify-content: flex-end; align-items: center; gap: 10px 12px; flex-wrap: wrap; margin-top: 12px; padding: 12px 0; background: var(--bg); border-top: 2px dashed var(--line); }
.card .ed-savebar { background: var(--card); margin: 16px -18px -18px; padding: 12px 18px; border-radius: 0 0 var(--radius) var(--radius); }
.savebar__note { font-size: 13px; color: var(--muted); }
.ed-savebar.is-dirty .savebar__note { color: var(--ink); font-weight: 800; }
.ed-savebar.is-dirty .savebar__note::before { content: ''; display: inline-block; width: 9px; height: 9px; margin-right: 7px; border-radius: 50%; background: var(--amber); border: 1.5px solid var(--ink); vertical-align: -1px; }
@media (max-width: 560px) { .ed-savebar { justify-content: stretch; } .ed-savebar .savebar__note { flex: 1 0 100%; } .ed-savebar .btn { flex: 1 1 0; justify-content: center; } }
@media (max-width: 1100px) {
  .ed-split { grid-template-columns: minmax(0, 1fr); }
  .ed-preview { position: static; max-height: none; }
}
/* Checkout › Enlaces: nombre arriba, enlace a todo el ancho y botones que no se parten */
.ck-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ck-links li { display: grid; gap: 6px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.ck-links li:last-child { border-bottom: 0; padding-bottom: 0; }
.ck-link { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ck-link input { flex: 1 1 220px; min-width: 0; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.ck-link__btns { display: flex; gap: 6px; flex-wrap: nowrap; }
.ck-link__btns .btn { white-space: nowrap; }

/* Alertas: pestañas por categoría y prioridad, tarjetas con ícono de la categoría */
.tabs--sm { margin-bottom: 0; }
.tabs--sm .tab { padding: 5px 11px; font-size: 13px; }
.nt-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 14px; }
.nt-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; border: 1.5px solid var(--ink); }
.nt-dot--critical { background: var(--red); } .nt-dot--warning { background: var(--amber); } .nt-dot--info { background: var(--blue); }
.nt-card { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px 14px; align-items: start; padding: 14px 16px; }
.nt-card--read { opacity: .68; }
.nt-ico { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--ink); background: #fff; display: grid; place-items: center; box-shadow: 2px 2px 0 0 var(--ink); }
.nt-ico--ok { background: var(--lime); margin: 0 auto 8px; }
.nt-main { min-width: 0; display: grid; gap: 4px; }
.nt-main h3 { font-size: 17px; text-transform: none; font-family: var(--font); font-weight: 800; letter-spacing: 0; margin: 2px 0 0; }
.nt-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.nt-new { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 800; }
.nt-new::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.nt-body { margin: 0; white-space: pre-wrap; font-size: 14.5px; }
.nt-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; align-items: center; }
@media (max-width: 560px) { .nt-card { grid-template-columns: minmax(0, 1fr); } .nt-ico { width: 36px; height: 36px; } }

/* Seguimiento de alertas y Tareas de hoy (Inicio) */
.nt-follow { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.task-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; align-items: start; }
.task-col { padding: 14px 16px; }
.task-col__head { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.task-col__head h3 { margin: 0; flex: 1; font-size: 18px; }
.task-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 10px; }
.task { display: grid; gap: 4px; padding: 10px 0 0; border-top: 1px solid var(--line); }
.task:first-child { border-top: 0; padding-top: 0; }
.task__head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
@media (max-width: 1000px) { .task-board { grid-template-columns: minmax(0, 1fr); } }

/* Envíos: control de 3 opciones (Gratis / Cobra / Sin definir) por ciudad */
.seg { display: inline-flex; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; background: #fff; }
.seg__b { font: inherit; font-size: 12.5px; font-weight: 700; padding: 4px 10px; border: 0; border-left: 1.5px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg__b:first-child { border-left: 0; }
.seg__b[aria-pressed="true"] { color: var(--ink); cursor: default; }
.seg__b--free[aria-pressed="true"] { background: var(--lime); }
.seg__b--charge[aria-pressed="true"] { background: var(--amber-2); }
.seg__b--none[aria-pressed="true"] { background: var(--line); }
.seg__b:disabled { opacity: 1; }
.seg__b:focus-visible { outline: 3px solid var(--pink); outline-offset: -3px; }
/* «Así le sale al cliente»: vista del texto con sus variables reemplazadas */
.see-as { margin: 4px 0 0; padding: 10px 12px; border: 1.5px dashed var(--line); border-radius: 10px; background: #fff; font-size: 13.5px; line-height: 1.45; }

/* Panel en vivo (core.js livePoll): avisos en la esquina y el botón «Hay cambios nuevos» */
.live-toast { position: relative; display: block; padding: 12px 40px 12px 14px; background: #fff; color: var(--ink); text-decoration: none; border: 2px solid var(--ink); border-left-width: 8px; border-radius: 12px; box-shadow: 3px 4px 0 0 var(--ink); animation: liveIn .25s cubic-bezier(.2,.9,.25,1.15); }
.live-toast b { display: block; font-size: 14px; }
.live-toast span { display: block; font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.live-toast:hover { transform: translate(-1px,-1px); box-shadow: 4px 5px 0 0 var(--ink); }
.live-toast--ok { border-left-color: var(--ok); } .live-toast--info { border-left-color: var(--blue); }
.live-toast--warning { border-left-color: var(--amber); } .live-toast--critical { border-left-color: var(--red); background: var(--red-2); }
.live-toast__x { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; display: grid; place-items: center; border: 0; background: transparent; cursor: pointer; color: var(--ink); border-radius: 6px; }
.live-toast__x:hover { background: var(--bg); } .live-toast__x .ico svg { width: 14px; height: 14px; }
.live-pill { position: sticky; top: calc(var(--hdr-h) + 8px); z-index: 30; display: flex; align-items: center; gap: 6px; margin: 0 auto 12px; padding: 8px 16px; border: 2px solid var(--ink); border-radius: 999px; background: var(--lime); color: var(--ink); font: 700 14px var(--font); box-shadow: 2px 3px 0 0 var(--ink); cursor: pointer; }
.live-pill .ico svg { width: 16px; height: 16px; }
@keyframes liveIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .live-toast { animation: none; } }

/* ---------- Encabezado: buscador, alertas y perfil ---------- */
.hdr { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; min-height: var(--hdr-h); padding: 10px 28px; background: #fff; border-bottom: 1px solid var(--line); }
.hdr .hdr-menu, .hdr .hdr-brand { display: none; }
.hdr-search { position: relative; flex: 1 1 auto; max-width: 540px; display: flex; align-items: center; }
.hdr-search > .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); display: grid; color: var(--muted); pointer-events: none; z-index: 1; }
.hdr-search > .ico svg { width: 18px; height: 18px; }
.hdr-search .hdr-search__in { padding-left: 40px; border-color: var(--line); background: var(--bg); border-radius: 999px; }
.hdr-search .hdr-search__in:focus { border-color: var(--ink); background: #fff; outline: none; box-shadow: 0 0 0 3px var(--lime-2); }
.hdr-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.hdr-pop { position: relative; }
.hdr-icon { position: relative; display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 2px solid transparent; border-radius: 10px; background: transparent; color: var(--ink); cursor: pointer; }
.hdr-icon:hover, .hdr-icon[aria-expanded="true"] { border-color: var(--ink); background: var(--lime-2); }
.hdr-icon:focus-visible, .hdr-me:focus-visible { outline: 3px solid var(--lime-d); outline-offset: 2px; }
.hdr-icon .ico, .hdr-icon svg { width: 22px; height: 22px; display: block; }
.hdr-bell__n { position: absolute; top: 1px; right: -2px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; border: 2px solid #fff; }
.hdr-bell__n[hidden] { display: none; }
.hdr-me { display: flex; align-items: center; gap: 10px; padding: 3px 10px 3px 3px; border: 2px solid transparent; border-radius: 999px; background: transparent; font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; }
.hdr-me:hover, .hdr-me[aria-expanded="true"] { border-color: var(--ink); background: var(--lime-2); }
.hdr-av { position: relative; flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--lime); border: 2px solid var(--ink); display: grid; place-items: center; font-weight: 800; font-size: 14px; letter-spacing: .02em; }
.hdr-av::after { content: ""; position: absolute; right: -3px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; background: var(--ok); border: 2px solid #fff; }   /* en línea */
.hdr-me__chev { display: grid; color: var(--muted); transition: transform .12s; } .hdr-me__chev svg { width: 16px; height: 16px; }
.hdr-me[aria-expanded="true"] .hdr-me__chev { transform: rotate(180deg); }
.hdr-drop { position: absolute; right: 0; top: calc(100% + 10px); z-index: 50; width: 380px; max-width: calc(100vw - 24px); background: #fff; border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.hdr-drop[hidden] { display: none; }
.hdr-drop__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.hdr-drop__head--col { flex-direction: column; align-items: flex-start; gap: 2px; }
.hdr-drop__body { max-height: min(60vh, 460px); overflow-y: auto; }
.hdr-drop__body .loading { padding: 18px; }
.hdr-drop__foot { display: flex; justify-content: center; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--bg); }
.hdr-drop__empty { margin: 0; padding: 18px 16px; color: var(--muted); }
.hdr-alert-row { display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.hdr-alert-row:last-child { border-bottom: 0; }
.hdr-alert { flex: 1; min-width: 0; display: flex; gap: 12px; align-items: flex-start; padding: 11px 16px; color: var(--ink); text-decoration: none; }
.hdr-alert__read { flex: none; width: 34px; height: 34px; margin-right: 12px; padding: 0; display: grid; place-items: center; border: 1.5px solid var(--ink); border-radius: 999px; background: #fff; color: var(--ink); cursor: pointer; box-shadow: 1px 2px 0 0 var(--ink); }
.hdr-alert__read:hover, .hdr-alert__read:focus-visible { background: var(--lime); outline: none; }
.hdr-alert__read:active { transform: translate(1px, 1px); box-shadow: none; }
.hdr-alert__read .ico svg { width: 16px; height: 16px; }
.hdr-alert:hover, .hdr-alert:focus-visible { background: var(--lime-2); outline: none; }
.hdr-alert.is-unread .hdr-alert__t { font-weight: 800; }
.hdr-alert__dot { flex: none; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 1.5px var(--ink); }
.hdr-alert__dot--critical { background: var(--red); } .hdr-alert__dot--warning { background: var(--amber); }
.hdr-alert:not(.is-unread) .hdr-alert__dot { opacity: .35; }
.hdr-alert__txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hdr-alert__t { overflow-wrap: anywhere; line-height: 1.3; }
.hdr-me__drop { width: 250px; }
.hdr-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 16px; border: 0; background: none; font: inherit; color: var(--ink); text-decoration: none; text-align: left; cursor: pointer; }
.hdr-item:hover, .hdr-item:focus-visible { background: var(--lime-2); outline: none; }
.hdr-item .ico { display: grid; } .hdr-item svg { width: 18px; height: 18px; }
.hdr-search__list { left: 0; right: auto; width: 100%; min-width: 320px; }
.hdr-res { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.hdr-res:hover, .hdr-res.is-sel { background: var(--lime-2); }
.hdr-res__main { display: flex; flex-direction: column; min-width: 0; }
.hdr-res__main .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hdr-drop__more { display: block; width: 100%; padding: 10px 14px; border: 0; background: var(--bg); font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; }
.hdr-drop__more:hover { background: var(--lime-2); }
@media (max-width: 860px) {
  :root { --hdr-h: 112px; }
  .hdr { flex-wrap: wrap; gap: 8px 10px; padding: 8px 14px; }
  .hdr .hdr-menu { display: grid; } .hdr .hdr-brand { display: block; } .hdr-brand .brand { padding: 0; font-size: 24px; }
  .hdr-me__name, .hdr-me__chev { display: none; } .hdr-me { padding: 2px; }
  .hdr-search { order: 10; flex-basis: 100%; max-width: none; }
  .hdr-drop { position: fixed; left: 12px; right: 12px; top: 60px; width: auto; max-width: none; }
  .hdr-search__list { top: var(--hdr-h); min-width: 0; }
}
@media (prefers-reduced-motion: reduce) { .hdr-me__chev { transition: none; } }
@media print { .hdr { display: none !important; } }
.hdr-group { padding: 8px 14px 4px; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); background: var(--bg); border-bottom: 1px solid var(--line); }
.hdr-res__page { flex-direction: row; align-items: center; gap: 10px; }
.hdr-res__page > .ico { display: grid; color: var(--deep); } .hdr-res__page > .ico svg { width: 18px; height: 18px; }
.hdr-res__page > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.main section.card { scroll-margin-top: calc(var(--hdr-h) + 12px); }
.card.is-found { animation: found 2.4s ease-out; }
@keyframes found { 0%, 40% { box-shadow: 0 0 0 4px var(--lime), var(--shadow); } 100% { box-shadow: var(--shadow); } }
@media (prefers-reduced-motion: reduce) { .card.is-found { animation: none; outline: 3px solid var(--lime); } }
.chip__x { display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--ink); font: inherit; font-size: 17px; line-height: 1; cursor: pointer; }
.chip__x:hover, .chip__x:focus-visible { background: var(--ink); color: #fff; outline: none; }
/* Soporte › Bloqueados */
.blk-items, .blk-hits { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.blk-items li { overflow-wrap: anywhere; }
.blk-items li.is-off { opacity: .55; text-decoration: line-through; }
.blk-hits li { color: var(--muted); overflow-wrap: anywhere; }
.blk-data { border-top: 1px dashed var(--line); padding-top: 8px; }
.blk-data .kv { margin: 6px 0 0; }

/* Detalle de suscripción: «Volver» a la izquierda y anterior/siguiente a la derecha, en la misma línea */
.sub-top { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; margin: 0 0 8px; }
.sub-nav { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.sub-nav__btn { min-width: 36px; padding-left: 8px; padding-right: 8px; justify-content: center; }
.sub-nav__pos { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 640px) {
  .chart--dense .chart__val:not(.chart__val--cmp) { display: none; }   /* en celular, con más de 7 barras los números no caben */
  .chart__ticks { font-size: 10.5px; }
  .chart__val { font-size: 10px; letter-spacing: -.2px; }
}

/* Resumen de una campaña o promoción (#/promos/{id}, #/campaigns/{id}) */
.sum-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin-bottom: 16px; }
.sum-card { margin-bottom: 16px; }
.sum-grid .sum-card { margin-bottom: 0; }
.sum-card h2 { font-size: 20px; margin: 0 0 10px; }
.sum-goal__txt { font-size: 15px; margin-bottom: 8px; }
.sum-bar { height: 14px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; overflow: hidden; }
.sum-bar i { display: block; height: 100%; background: var(--lime-2); border-right: 2px solid var(--ink); min-width: 0; }
.sum-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; counter-reset: st; }
.sum-steps li { position: relative; border: 2px solid var(--ink); border-radius: 14px; padding: 10px 12px; background: #fff; display: flex; flex-direction: column; gap: 2px; }
.sum-steps li b { font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.sum-steps li span { font-weight: 700; font-size: 13.5px; }
.sum-steps li small { font-size: 12px; }
.sum-steps li.is-muted { opacity: .6; }
.sum-mini { display: inline-block; width: 70px; height: 8px; border-radius: 99px; background: #ecebe2; vertical-align: middle; overflow: hidden; }
.sum-mini i { display: block; height: 100%; background: var(--deep); }
@media (max-width: 640px) { .sum-grid { grid-template-columns: 1fr; } .sum-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

