/* El signo $ se dibuja siempre con UNA sola raya (como el peso), con una letra del equipo que ya trae el usuario.
   Solo se aplica al carácter $ (U+0024); el resto del texto sigue con las letras del portal. */
@font-face {
  font-family: "Peso";
  src: local("Helvetica Neue"), local("HelveticaNeue"), local("Arial"), local("Segoe UI"), local("Roboto"), local("Liberation Sans"), local("DejaVu Sans");
  unicode-range: U+0024;
}

/* ==========================================================
   Portal MaciMusic
   Papel frío, tinta azul marino y un latón apagado.
   Tipografía: Newsreader para títulos y cifras grandes,
   Schibsted Grotesk para interfaz y tablas.
   ========================================================== */

:root {
  --ink: #121d33;
  --ink-2: #4b566b;
  --ink-3: #6d778b;
  --paper: #f3f4f6;
  --paper-2: #e8ebf0;
  --white: #ffffff;
  --rule: #d6dae2;
  --rule-strong: #b9bfcb;

  --marino: #1b2f5b;
  --marino-2: #2a3f70;
  --marino-deep: #111f40;
  --brass: #b88a3c;
  --brass-soft: #f3e8d0;
  --teal: #2f7d78;
  --granate: #8c2f3e;
  --acero: #8494b6;
  --verde: #1e6b52;
  --verde-soft: #dcebe4;

  --serif: "Peso", "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: "Peso", "Schibsted Grotesk", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

  --rail: 248px;
  --radius: 4px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  font-feature-settings: "tnum" 1, "lnum" 1;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--marino); text-underline-offset: 3px; }
a:hover { color: var(--marino-2); }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; border-radius: 2px; }

h1, h2, h3 { margin: 0; font-weight: 500; }
p { margin: 0; }

/* ---------- Estructura ---------- */
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }

.rail {
  background: var(--marino-deep);
  color: #d5dbe9;
  padding: 28px 22px 22px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.wordmark { font-family: var(--serif); font-size: 27px; font-weight: 500; letter-spacing: .01em; color: #fff; text-decoration: none; display: block; }
.wordmark small { display: block; font-family: var(--sans); font-size: 13px; font-weight: 400; color: #9fabc6; margin-top: 2px; letter-spacing: 0; }

.rail nav { margin-top: 38px; display: flex; flex-direction: column; gap: 2px; }
.rail nav a {
  color: #c5cde0;
  text-decoration: none;
  padding: 9px 12px;
  border-radius: var(--radius);
  border-left: 2px solid transparent;
  font-weight: 500;
}
.rail nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.rail nav a[aria-current="page"] { background: rgba(255, 255, 255, .09); color: #fff; border-left-color: var(--brass); }

.rail-foot { margin-top: auto; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: 14px; }
.rail-foot .who { color: #fff; font-weight: 600; }
.rail-foot .role { color: #9fabc6; font-size: 13px; }
.rail-foot form { margin: 0; }
.linklike { background: none; border: 0; padding: 0; color: #c5cde0; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linklike:hover { color: #fff; }

.viewas { margin: 26px 0 0; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .12); }
.viewas label { display: block; font-size: 13px; color: #9fabc6; margin-bottom: 6px; }
.viewas select {
  width: 100%; font: inherit; font-size: 14px; color: #fff; background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .22); border-radius: var(--radius); padding: 8px 10px;
}
.viewas select option { color: #121d33; }

.main { padding: 36px 48px 80px; min-width: 0; }
.wrap { max-width: 1120px; }

.topbar { display: none; }

/* ---------- Banner de "ver como" ---------- */
.banner-viewas {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: var(--brass-soft); border: 1px solid #e0cb9d; border-left: 4px solid var(--brass);
  padding: 12px 16px; margin: -8px 0 28px; border-radius: var(--radius); font-size: 14px;
}
.banner-viewas strong { font-weight: 600; }
.banner-viewas form { margin: 0; }

/* ---------- Encabezado de página ---------- */
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 8px; }
.pagehead h1 { font-family: var(--serif); font-size: 38px; line-height: 1.1; letter-spacing: -.005em; }
.pagehead .sub { color: var(--ink-2); margin-top: 6px; }
.crumb { display: inline-block; margin-bottom: 14px; font-size: 14px; color: var(--ink-2); text-decoration: none; }
.crumb:hover { color: var(--marino); text-decoration: underline; }

.periods { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.periods a {
  text-decoration: none; color: var(--ink-2); padding: 7px 13px; border-radius: 999px; font-size: 14px; font-weight: 500;
  border: 1px solid transparent;
}
.periods a:hover { color: var(--ink); border-color: var(--rule-strong); }
.periods a[aria-current="true"] { background: var(--marino); color: #fff; }
details.range { position: relative; }
details.range summary { list-style: none; cursor: pointer; padding: 7px 13px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--ink-2); border: 1px solid transparent; }
details.range summary::-webkit-details-marker { display: none; }
details.range summary:hover { color: var(--ink); border-color: var(--rule-strong); }
details.range[open] summary, details.range.is-active summary { background: var(--marino); color: #fff; }
details.range .range-form { position: absolute; right: 0; top: calc(100% + 8px); z-index: 5; background: var(--white); border: 1px solid var(--rule-strong); border-radius: var(--radius); padding: 12px; box-shadow: 0 10px 30px rgba(18, 29, 51, .14); }
.range-form { display: flex; gap: 6px; align-items: center; }
.range-form input[type="date"] {
  font: inherit; font-size: 14px; color: var(--ink); background: var(--white); border: 1px solid var(--rule-strong);
  border-radius: var(--radius); padding: 6px 8px;
}
.range-form span { color: var(--ink-3); }

/* ---------- Cifra principal ---------- */
.headline { margin: 34px 0 6px; display: grid; grid-template-columns: auto 1fr; gap: 6px 40px; align-items: end; }
.headline .big { font-family: var(--serif); font-weight: 400; font-size: clamp(52px, 7vw, 84px); line-height: .95; letter-spacing: -.02em; color: var(--verde); }
.headline .big-label { font-size: 15px; color: var(--ink-2); margin-bottom: 10px; display: block; }
.headline .facts { display: flex; gap: 34px; flex-wrap: wrap; padding-bottom: 8px; }
.facts div { min-width: 96px; }
.facts dt { font-size: 13px; color: var(--ink-2); }
.facts dd { margin: 2px 0 0; font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; }
.facts { margin: 0; }
.est-note { font-size: 13px; color: var(--ink-2); margin-top: 8px; }

/* ---------- Secciones ---------- */
.section { margin-top: 52px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--rule-strong); padding-top: 14px; margin-bottom: 18px; }
.section-head h2 { font-family: var(--serif); font-size: 24px; }
.section-head p { color: var(--ink-2); font-size: 14px; }

/* ---------- Gráficas ---------- */
.chart-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.chart { display: block; width: 100%; height: auto; min-width: 660px; overflow: visible; }
.chart .axis { stroke: var(--rule-strong); stroke-width: 1; }
.chart .grid { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 2 4; }
.chart .link { stroke: var(--rule-strong); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .ch-plat { fill: var(--marino); }
.chart .ch-tel { fill: var(--brass); }
.chart .ch-efe { fill: var(--teal); }
.chart .bar-total { fill: var(--marino-2); }
.chart .bar-minus { fill: var(--granate); }
.chart .bar-plus { fill: var(--acero); }
.chart .bar-final { fill: var(--verde); }
.chart text { font-family: var(--sans); fill: var(--ink-2); }
.chart .val { font-size: 15px; font-weight: 600; fill: var(--ink); font-variant-numeric: tabular-nums; }
.chart .val-minus { fill: var(--granate); }
.chart .val-final { font-size: 17px; fill: var(--verde); }
.chart .lbl { font-size: 13px; }
.chart .lbl-final { font-weight: 600; fill: var(--ink); }
.chart .legend { font-size: 13px; }
.chart .tick { font-size: 12px; fill: var(--ink-3); }

@keyframes rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.chart-bridge rect { transform-box: fill-box; transform-origin: 50% 100%; animation: rise .65s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i, 0) * 75ms); }

/* ---------- Tablas ---------- */
.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.data th {
  text-align: left; font-weight: 500; color: var(--ink-2); font-size: 13px; padding: 0 14px 10px 0;
  border-bottom: 1px solid var(--rule-strong); white-space: nowrap;
}
table.data td { padding: 14px 14px 14px 0; border-bottom: 1px solid var(--rule); vertical-align: middle; }
table.data tbody tr:hover td { background: rgba(27, 47, 91, .035); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data th.num { text-align: right; }
table.data td:last-child, table.data th:last-child { padding-right: 0; }
table.data .strong { font-weight: 600; }
table.data .muted { color: var(--ink-2); font-size: 13px; }
table.data .free { color: var(--verde); font-weight: 600; }
table.data .neg { color: var(--granate); }
table.data a.rowlink { color: inherit; text-decoration: none; display: block; }
table.data a.rowlink:hover .city { text-decoration: underline; text-underline-offset: 3px; }
.city { font-weight: 600; font-size: 15.5px; }
tfoot td { border-top: 1px solid var(--rule-strong); border-bottom: 0 !important; font-weight: 600; padding-top: 14px; }

.mix { display: flex; width: 120px; height: 8px; border-radius: 2px; overflow: hidden; background: var(--paper-2); }
.mix i { display: block; height: 100%; }
.mix .ch-plat { background: var(--marino); }
.mix .ch-tel { background: var(--brass); }
.mix .ch-efe { background: var(--teal); }

.chip {
  display: inline-block; font-size: 12.5px; font-weight: 500; padding: 2px 9px; border-radius: 999px;
  background: var(--paper-2); color: var(--ink-2); white-space: nowrap;
}
.chip-tel { background: var(--brass-soft); color: #7a5a1d; }
.chip-plat { background: #dfe5f2; color: var(--marino); }
.chip-ok { background: var(--verde-soft); color: var(--verde); }
.chip-off { background: #f2dde0; color: var(--granate); }

.legend-line { display: flex; gap: 20px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); margin-top: 10px; }
.legend-line i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.legend-line .ch-plat { background: var(--marino); }
.legend-line .ch-tel { background: var(--brass); }
.legend-line .ch-efe { background: var(--teal); }

.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; font-size: 14px; color: var(--ink-2); }

.empty { padding: 46px 0; color: var(--ink-2); max-width: 46ch; }
.empty strong { display: block; color: var(--ink); font-family: var(--serif); font-size: 22px; font-weight: 500; margin-bottom: 6px; }

/* ---------- Formularios y botones ---------- */
.btn {
  display: inline-block; font: inherit; font-weight: 600; font-size: 14.5px; color: #fff; background: var(--marino);
  border: 1px solid var(--marino); border-radius: var(--radius); padding: 9px 18px; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--marino-2); color: #fff; }
.btn-quiet { background: transparent; color: var(--marino); border-color: var(--rule-strong); }
.btn-quiet:hover { background: var(--white); color: var(--marino); border-color: var(--marino); }
.btn-small { padding: 6px 12px; font-size: 13.5px; }
.btn-danger { background: transparent; color: var(--granate); border-color: #d9b1b8; }
.btn-danger:hover { background: #f8e8ea; color: var(--granate); border-color: var(--granate); }

.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field .hint { font-size: 13px; color: var(--ink-2); margin-top: 5px; }
input[type="text"], input[type="password"], input[type="date"], select.input {
  width: 100%; font: inherit; color: var(--ink); background: var(--white); border: 1px solid var(--rule-strong);
  border-radius: var(--radius); padding: 10px 12px;
}
input:focus, select:focus { border-color: var(--marino); outline: 2px solid rgba(27, 47, 91, .18); outline-offset: 0; }

.notice { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 24px; font-size: 14.5px; border: 1px solid; }
.notice-ok { background: var(--verde-soft); border-color: #b7d6c8; color: #14513d; }
.notice-error { background: #f7e3e6; border-color: #e0b3bb; color: #7a2432; }
.notice-secret { background: var(--white); border-color: var(--brass); border-left-width: 4px; color: var(--ink); }
.notice-secret code { font-size: 18px; font-weight: 600; letter-spacing: .04em; background: var(--paper-2); padding: 4px 10px; border-radius: 3px; user-select: all; }

.inline-form { display: inline; margin: 0; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

.formgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 14px; align-items: end; }
.formgrid .field { margin: 0; }

.datefix { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.datefix input[type="date"] { width: auto; padding: 6px 8px; font-size: 14px; }

/* ---------- Sincronización ---------- */
.codebox { background: var(--marino-deep); color: #dfe6f5; border-radius: var(--radius); padding: 14px 16px; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 13px; overflow-x: auto; white-space: pre; user-select: all; }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; background: var(--verde); }
.status-dot.bad { background: var(--granate); }

/* ---------- Acceso ---------- */
.login { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; }
.login-art { background: var(--marino-deep); color: #fff; padding: 56px 56px 0; display: flex; flex-direction: column; overflow: hidden; }
.login-art .wordmark { font-size: 32px; }
.login-title { margin-top: clamp(40px, 14vh, 140px); }
.login-art h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 4vw, 54px); line-height: 1.08; letter-spacing: -.012em; }
.login-title p { margin-top: 14px; max-width: 30ch; font-size: 17px; line-height: 1.45; color: #aeb9d3; }
.login-art svg { display: block; width: min(100%, 560px); height: auto; margin-top: auto; align-self: flex-end; padding-top: 32px; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 48px 32px; }
.login-form form { width: 100%; max-width: 360px; }
.login-form h2 { font-family: var(--serif); font-size: 30px; margin-bottom: 6px; }
.login-form .lead { color: var(--ink-2); margin-bottom: 28px; }
.login-form .btn { width: 100%; padding: 12px; }

/* ---------- Errores ---------- */
.errorpage { max-width: 520px; margin: 14vh auto; padding: 0 24px; }
.errorpage h1 { font-family: var(--serif); font-size: 34px; margin-bottom: 10px; }
.errorpage p { color: var(--ink-2); margin-bottom: 22px; }

/* ---------- Pantallas angostas ---------- */
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: fixed; inset: 0 auto 0 0; width: min(82vw, 300px); height: 100vh; transform: translateX(-102%); transition: transform .22s ease; z-index: 30; }
  body.nav-open .rail { transform: none; box-shadow: 0 0 0 100vmax rgba(10, 18, 38, .45); }
  .topbar { display: flex; align-items: center; justify-content: space-between; background: var(--marino-deep); color: #fff; padding: 12px 18px; position: sticky; top: 0; z-index: 20; }
  .topbar .wordmark { font-size: 22px; }
  .topbar button { background: none; border: 1px solid rgba(255, 255, 255, .3); color: #fff; font: inherit; font-size: 14px; border-radius: var(--radius); padding: 6px 12px; cursor: pointer; }
  .main { padding: 26px 20px 64px; }
  .headline { grid-template-columns: 1fr; }
  .pagehead h1 { font-size: 32px; }
  .formgrid { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login-art { padding: 32px 28px 0; }
  .login-art h1 { margin-top: 28px; }
  .login-art svg { width: 78%; max-height: 150px; }
}

@media (prefers-reduced-motion: reduce) {
  .chart-bridge rect { animation: none; }
  .rail { transition: none; }
}

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Ajustes de un concierto ---------- */
details.settings { margin: 22px 0 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
details.settings summary { cursor: pointer; padding: 12px 0; font-weight: 600; color: var(--marino); list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.settings summary::-webkit-details-marker { display: none; }
details.settings summary::after { content: "Mostrar"; font-weight: 500; font-size: 13px; color: var(--ink-2); }
details.settings[open] summary::after { content: "Ocultar"; }
.settings-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 40px; padding: 8px 0 26px; }
.setting label, .setting-label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.setting-row { display: flex; gap: 8px; align-items: center; }
.setting-row input[type="text"], .setting-row select { flex: 1; min-width: 0; }
.setting-row input[type="date"] { width: auto; }
.setting .hint { font-size: 13px; color: var(--ink-2); margin-top: 6px; }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--rule); font-size: 14px; }
@media (max-width: 960px) { .settings-body { grid-template-columns: 1fr; } .setting-row { flex-wrap: wrap; } }

/* ---------- Acciones por pedido y ventas a mano ---------- */
details.rowmenu { position: relative; display: inline-block; text-align: left; }
details.rowmenu summary { list-style: none; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--marino); padding: 4px 10px; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--white); }
details.rowmenu summary::-webkit-details-marker { display: none; }
details.rowmenu[open] summary { background: var(--marino); color: #fff; border-color: var(--marino); }
.rowmenu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 6; width: 250px; background: var(--white); border: 1px solid var(--rule-strong); border-radius: var(--radius); padding: 14px; box-shadow: 0 12px 32px rgba(18, 29, 51, .16); display: grid; gap: 14px; }
.rowmenu-pop label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.rowmenu-pop select { margin-bottom: 8px; }
.rowmenu-pop form + form { border-top: 1px solid var(--rule); padding-top: 12px; }
.cashform { display: grid; grid-template-columns: 150px 100px 150px 160px minmax(0, 1fr) auto; gap: 14px; align-items: end; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--rule); }
.cashform .field { margin: 0; }
input[type="number"] { width: 100%; font: inherit; color: var(--ink); background: var(--white); border: 1px solid var(--rule-strong); border-radius: var(--radius); padding: 10px 12px; }
@media (max-width: 1100px) { .cashform { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cashform .cash-note { grid-column: 1 / -1; } }

.rowmenu-pop form { display: grid; gap: 8px; }
.rowmenu-pop select { margin-bottom: 0; }
.rowmenu-pop .btn { width: 100%; text-align: center; }

/* ---------- Canales ---------- */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 7px; vertical-align: 0; }
.dot.ch-plat { background: var(--marino); }
.dot.ch-tel { background: var(--brass); }
.dot.ch-efe { background: var(--teal); }
table.data th .dot { margin-right: 6px; }
.facts { gap: 18px 30px; }
.channels { margin-top: 14px; }

/* ---------- Encabezados que ordenan ---------- */
a.sortlink { color: inherit; text-decoration: none; cursor: pointer; white-space: nowrap; }
a.sortlink:hover { color: var(--marino); text-decoration: underline; text-underline-offset: 3px; }
a.sortlink.is-active { color: var(--ink); font-weight: 600; }
.sortarrow { font-size: 10px; margin-left: 3px; }

/* ---------- Ventas telefónicas ---------- */
.navbadge { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 8px; border-radius: 999px; background: var(--brass); color: #1a1405; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }
.rail nav a { display: flex; align-items: center; justify-content: space-between; }
.facts dd.subline { font-size: 12.5px; font-weight: 400; color: var(--ink-2); margin-top: 2px; }
.facts dd.small { font-size: 15px; font-weight: 500; }
.facts dd.free { color: var(--verde); }
.phone-facts { margin-top: 26px; display: flex; gap: 18px 48px; flex-wrap: wrap; }
ul.tel-list { list-style: none; margin: 18px 0 0; padding: 0; border-top: 1px solid var(--rule-strong); }
.tel-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 24px; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.tel-title { font-size: 17px; }
.tel-title .strong { margin-right: 6px; }
.tel-meta { margin-top: 3px; color: var(--ink-2); font-size: 14.5px; }
.tel-meta strong { color: var(--ink); font-weight: 600; }
.tel-state { margin-top: 9px; display: flex; gap: 8px 12px; flex-wrap: wrap; align-items: center; font-size: 13.5px; }
.tel-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.tel-actions form { margin: 0; }
.btn-big { min-height: 48px; padding: 12px 22px; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; text-align: center; }
label.btn-big { cursor: pointer; }
.btn.is-disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
@media (max-width: 720px) {
  .tel-item { grid-template-columns: 1fr; }
  .tel-actions { justify-content: stretch; flex-direction: column; align-items: stretch; }
  .tel-actions form, .tel-actions .btn-big { width: 100%; }
  .tel-actions label.btn-big, .tel-actions button.btn-big { width: 100%; }
}

/* ---------- Publicidad ---------- */
.adform { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: end; }
.adform .field { margin: 0; }
.adform input[type="file"] { padding: 8px 0; }
details.howto { margin-top: 16px; font-size: 14px; color: var(--ink-2); }
details.howto summary { cursor: pointer; color: var(--marino); font-weight: 500; }
details.howto ol { margin: 10px 0 0 18px; line-height: 1.6; }
form.adassign { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
form.adassign select { max-width: 230px; }

/* ---------- Pedidos: de lo cobrado a lo que queda ---------- */
.sign { display: inline-block; width: 1.1em; font-weight: 700; text-align: center; }
.sign-plus { color: var(--brass); }
.sign-minus { color: var(--granate); }
.sign-eq { color: var(--marino); }
table.data th.col-sum { color: var(--ink); }
table.data td.col-sum { font-weight: 600; background: rgba(27, 47, 91, .045); }
table.data td.col-sum.free { background: rgba(30, 107, 82, .08); }

table.orders th, table.orders td { padding-left: 9px; padding-right: 9px; }
table.orders th { white-space: normal; vertical-align: bottom; line-height: 1.25; font-size: 12.5px; }
table.orders td { white-space: nowrap; font-size: 13.5px; }
table.orders td:nth-child(2) { font-size: 13px; }
table.orders tfoot td:first-child { white-space: normal; }

table.orders th, table.orders td { padding-left: 7px; padding-right: 7px; }
table.orders th.num { text-align: right; }

/* ---------- Celular: tablas como tarjetas, el puente como lista ---------- */
.table-scroll, .chart-scroll { position: relative; }   /* contiene textos ocultos que antes ensanchaban la página */
.bridge-list { display: none; }

@media (max-width: 720px) {
  .desktop-only, .chart-desktop { display: none; }

  .bridge-list { display: block; list-style: none; margin: 0; padding: 0; }
  .bridge-list li { display: flex; align-items: baseline; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--rule); font-size: 15px; }
  .bridge-list .bl-sign { flex: 0 0 1.3em; text-align: center; font-weight: 700; }
  .bridge-list .bl-label { flex: 1 1 auto; color: var(--ink-2); }
  .bridge-list .bl-amt { flex: 0 0 auto; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
  .bridge-list .bl-plus .bl-sign { color: var(--brass); }
  .bridge-list .bl-minus .bl-sign { color: var(--granate); }
  .bridge-list .bl-minus .bl-amt { color: var(--granate); }
  .bridge-list .bl-total .bl-sign, .bridge-list .bl-total .bl-label { color: var(--marino); font-weight: 600; }
  .bridge-list .bl-start .bl-label, .bridge-list .bl-start .bl-amt { color: var(--ink); font-weight: 600; }
  .bridge-list .bl-final { border-bottom: 0; margin-top: 4px; padding: 14px 12px; background: var(--verde-soft); border-radius: 10px; }
  .bridge-list .bl-final .bl-label { color: var(--verde); font-weight: 600; }
  .bridge-list .bl-final .bl-amt { color: var(--verde); font-size: 20px; font-family: var(--serif); }

  table.cards, table.cards tbody, table.cards tfoot { display: block; width: 100%; }
  table.cards thead { display: none; }
  table.cards tr { display: flex; flex-wrap: wrap; align-items: baseline; background: var(--white); border: 1px solid var(--rule);
                   border-radius: 12px; padding: 14px 16px; margin: 0 0 12px; }
  table.cards tbody tr:hover td { background: transparent; }
  table.cards td { order: 2; flex: 1 0 100%; display: flex; justify-content: space-between; align-items: baseline; gap: 14px;
                   padding: 6px 0 !important; border: 0 !important; text-align: right; white-space: normal !important; font-size: 14.5px !important; background: transparent; }
  table.cards td::before { content: attr(data-label); flex: 0 0 auto; color: var(--ink-2); font-size: 13px; font-weight: 400; text-align: left; }
  table.cards td:empty { display: none; }
  table.cards td.tl { order: 0; display: block; text-align: left; padding: 0 0 8px !important; }
  table.cards td.tl::before, table.cards td.hd::before, table.cards td.act::before { content: none; }
  table.cards td.hd { order: 0; flex: 0 0 auto; display: block; text-align: left; padding: 0 10px 8px 0 !important; }
  table.cards td.free:not(.col-sum) { order: 1; padding: 2px 0 10px !important; font-size: 24px !important; font-family: var(--serif); }
  table.cards td.free:not(.col-sum)::before { font-family: var(--sans); font-size: 13px; align-self: center; }
  table.cards td.col-sum { padding: 8px 10px !important; margin: 2px 0; border-radius: 8px; }
  table.cards td.col-sum, table.cards td.col-sum::before { font-weight: 600; color: var(--ink); }
  table.cards td.col-sum.free, table.cards td.col-sum.free::before { color: var(--verde); }
  table.cards td.act { justify-content: flex-end; padding-top: 10px !important; }
  table.cards tfoot tr { background: var(--paper-2); border-color: var(--rule-strong); }
  table.cards tfoot td { font-weight: 600; border-top: 0 !important; }
  table.cards tfoot td.tl { color: var(--ink); }
}

.notice-warn { background: var(--brass-soft); border-color: #e0cd9f; color: #5a4214; }
.notice-warn a { color: inherit; font-weight: 600; }

/* ---------- Depósitos ---------- */
.facts-row { display: flex; flex-wrap: wrap; gap: 14px 44px; margin: 28px 0 0; }
.facts-row > div { min-width: 150px; }
.facts-row dt { font-size: 13px; color: var(--ink-2); margin: 0 0 4px; }
.facts-row dd { margin: 0; font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; font-family: var(--serif); }
.facts-row dd.free { color: var(--verde); }
@media (max-width: 720px) { .facts-row { gap: 14px 24px; } .facts-row > div { min-width: 40%; } .facts-row dd { font-size: 21px; } }

.facts-row small.muted { display: block; margin-top: 3px; font-size: 12.5px; }

.headline .big .cur { font-family: var(--sans); font-size: .24em; font-weight: 500; letter-spacing: .08em; color: var(--ink-2); margin-left: .5em; vertical-align: baseline; }

/* ---------- Desglose, estados del dinero y nombres ---------- */
.hide-desglose .col-desglose { display: none !important; }
.table-tools { display: flex; justify-content: flex-end; margin: 0 0 10px; }
.states { margin: 12px 0 0; font-size: 14.5px; color: var(--ink-2); line-height: 1.5; }
.states strong { font-weight: 600; }
.states .st-cuenta, .estado-cuenta { color: var(--verde); }
.states .st-camino, .estado-camino { color: #8a6420; }
.states .st-stripe, .estado-stripe { color: var(--ink-2); }
.estado { display: block; margin-top: 2px; font-size: 12px; font-weight: 500; line-height: 1.3; white-space: normal; }
.tel-buyer { margin-top: 6px; font-size: 15px; }
.buyer-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.buyer-form .input { flex: 1 1 200px; min-width: 0; max-width: 320px; }
@media (max-width: 720px) {
  table.cards td.free.col-sum { flex-wrap: wrap; }
  table.cards td .estado { flex: 1 0 100%; text-align: right; margin-top: 4px; }
  .buyer-form .input { max-width: none; }
}

.big-sub { display: block; margin-top: 2px; font-size: 13px; color: var(--ink-2); }

/* La línea de Stripe baja a dos renglones en vez de ensanchar la columna de la cifra grande */
.headline .states { max-width: 430px; }

/* Show realizado y cierre de cuentas */
.chip-done { background: #e6e8ec; color: #4a5568; }
.chip-closed { background: #dfe9e3; color: var(--verde); }
.group-row th { text-align: left; padding: 18px 8px 6px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); font-weight: 600; border-bottom: 1px solid var(--line, #d8dce3); background: transparent; }
.closure { margin: 18px 0; padding: 16px 18px; background: #fff; border: 1px solid var(--line, #d8dce3); border-radius: 10px; }
.closure h2 { margin: 0 0 8px; font-size: 18px; }
.closure p { margin: 6px 0; }
.closure-warn { margin-top: 10px; padding: 12px 14px; background: var(--brass-soft, #f3e8cf); border-left: 4px solid var(--brass, #b38b3f); border-radius: 6px; }
.closure-warn ul { margin: 6px 0 6px 18px; padding: 0; }
@media (max-width: 720px) { .group-row { display: block; } .group-row th { display: block; padding-left: 0; } }

/* Solicitudes */
.reqtypes { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 12px; }
.reqtype { display: block; padding: 16px 18px; background: #fff; border: 1px solid var(--line, #d8dce3); border-radius: 10px; text-decoration: none; color: inherit; }
.reqtype:hover { border-color: var(--marino); }
.reqtype strong { display: block; margin-bottom: 4px; }
.reqtype span { font-size: 14px; color: var(--ink-2); }
.reqform { max-width: 720px; }
.reqform .field { margin-bottom: 16px; }
.reqform label, .reqform .lbl, .reqform legend { display: block; font-weight: 600; margin-bottom: 6px; }
.reqform .check { display: flex; gap: 8px; align-items: center; font-weight: 500; margin: 4px 0; }
.reqform .checks { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.reqform .input { width: 100%; max-width: 560px; }
.reqform .help { margin: 4px 0 0; font-size: 13px; color: var(--ink-2); }
.reqform .req-star { color: var(--granate); }
.reqform .has-error .input { border-color: var(--granate); }
.reqform fieldset.prio { border: 0; padding: 0; margin: 0 0 18px; }
.field-error { margin: 4px 0 0; font-size: 13px; color: var(--granate); font-weight: 600; }
.order-info { margin-top: 6px; font-size: 13px; line-height: 1.4; }
.order-info:empty { display: none; }
.order-ok { color: var(--verde); }
.order-warn { color: #8a6420; }
.orderline { margin: 12px 0; padding: 10px 14px; background: #fff; border: 1px solid var(--line, #d8dce3); border-radius: 8px; font-size: 14px; }
.reqdata { display: grid; gap: 10px; margin: 0; }
.reqdata > div { display: grid; grid-template-columns: 220px 1fr; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line, #e6e8ec); }
.reqdata dt { color: var(--ink-2); font-size: 14px; }
.reqdata dd { margin: 0; }
.files { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.filelink { display: flex; flex-direction: column; gap: 4px; width: 130px; text-decoration: none; color: inherit; font-size: 12px; }
.filelink img { width: 130px; height: 100px; object-fit: cover; border: 1px solid var(--line, #d8dce3); border-radius: 6px; background: #fff; }
.pdfico { display: flex; align-items: center; justify-content: center; width: 130px; height: 100px; border: 1px solid var(--line, #d8dce3); border-radius: 6px; background: #f4f5f7; font-weight: 700; color: var(--ink-2); }
.thread { display: grid; gap: 10px; }
.thread-state { margin: 4px 0; font-size: 13px; color: var(--ink-2); }
.msg { padding: 10px 14px; border-radius: 8px; border: 1px solid var(--line, #d8dce3); background: #fff; max-width: 640px; }
.msg-adm { border-left: 4px solid var(--marino); }
.msg-her { border-left: 4px solid var(--brass, #b38b3f); }
.msg-head { font-size: 13px; color: var(--ink-2); margin-bottom: 4px; }
@media (max-width: 720px) { .reqdata > div { grid-template-columns: 1fr; gap: 2px; } .reqform .input { max-width: none; } }
