/* Gestión — estilo nativo de Apple */
:root {
  --bg: #000; --bg2: #1c1c1e; --card: #1c1c1e; --card-solid: #1c1c1e; --raise: rgba(118,118,128,.24);
  --line: rgba(84,84,88,.45); --line2: rgba(84,84,88,.8);
  --text: #fff; --muted: #98989f; --faint: #636366;
  --accent: #0a84ff; --accent2: #0a84ff; --accent-ink: #fff;
  --ok: #30d158; --warn: #ff9f0a; --bad: #ff453a;
  --glow1: transparent; --glow2: transparent;
  --shadow: none;
  --av-l: 70%; --av-a: .2;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  --serif: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --ease: cubic-bezier(.2,.8,.2,1);
  --sab: env(safe-area-inset-bottom, 0px); --sat: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f2f2f7; --bg2: #e5e5ea; --card: #fff; --card-solid: #fff; --raise: rgba(118,118,128,.12);
  --line: rgba(60,60,67,.13); --line2: rgba(60,60,67,.26);
  --text: #000; --muted: #6c6c70; --faint: #aeaeb2;
  --accent: #007aff; --accent2: #007aff; --accent-ink: #fff;
  --ok: #1f9d48; --warn: #c27500; --bad: #e0352b;
  --shadow: 0 1px 2px rgba(0,0,0,.04);
  --av-l: 42%; --av-a: .13;
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font: 16px/1.4 var(--sans); color: var(--text); background: var(--bg);
  min-height: 100dvh; -webkit-font-smoothing: antialiased; overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(60vmax 50vmax at 0% 0%, var(--glow1), transparent 60%),
              radial-gradient(50vmax 50vmax at 100% 100%, var(--glow2), transparent 60%);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.num { font-variant-numeric: tabular-nums; }

/* ── Splash ── */
.splash { min-height: 100dvh; display: grid; place-items: center; }
.splash-mark { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--line2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Acceso ── */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 380px; animation: rise .6s var(--ease) both; }
.auth-logo { width: 56px; height: 56px; border-radius: 16px; margin-bottom: 28px; box-shadow: 0 0 0 1px var(--line2), 0 12px 40px -8px var(--glow1); }
.auth h1 { font: 700 34px/1.1 var(--sans); letter-spacing: -.01em; }
.auth p.lead { color: var(--muted); margin: 10px 0 28px; }
.auth .err { color: var(--bad); font-size: 13.5px; min-height: 20px; margin-top: 4px; }

/* ── Estructura ── */
.shell { min-height: 100dvh; }
.view { padding: calc(18px + var(--sat)) 16px calc(104px + var(--sab)); max-width: 1180px; margin: 0 auto; }
.view.enter > * { animation: rise .5s var(--ease) both; }
.view.enter > *:nth-child(2) { animation-delay: .05s; }
.view.enter > *:nth-child(3) { animation-delay: .1s; }
.view.enter > *:nth-child(4) { animation-delay: .15s; }
.view.enter > *:nth-child(n+5) { animation-delay: .2s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

.nav {
  position: fixed; left: 12px; right: 12px; bottom: calc(10px + var(--sab)); z-index: 20;
  display: flex; justify-content: space-around; padding: 6px;
  background: color-mix(in srgb, var(--card-solid) 82%, transparent); backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 16px 40px -12px rgba(0,0,0,.5);
}
.nav-brand, .nav-new, .nav-sp, .nav a.only-wide { display: none; }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px 6px; border-radius: 16px; color: var(--faint); font-size: 10.5px; font-weight: 500; transition: color .2s, background .2s; }
.nav a.on { color: var(--accent); background: var(--raise); }
.nav a:active { transform: scale(.94); }

.fab {
  position: fixed; right: 18px; bottom: calc(88px + var(--sab)); z-index: 21; width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center; color: var(--accent-ink);
  background: linear-gradient(140deg, var(--accent), var(--accent2)); box-shadow: 0 8px 24px -8px var(--accent2);
  transition: transform .2s var(--ease);
}
.fab:active { transform: scale(.92); }
.fab svg.i { width: 24px; height: 24px; stroke-width: 2; }

/* ── Cabecera de vista ── */
.vh { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.eyebrow { color: var(--muted); font-size: 13px; }
.vh h1 { font: 700 34px/1.1 var(--sans); letter-spacing: -.02em; }
.vh-r { display: flex; align-items: center; gap: 8px; }
.mp { display: flex; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.mp button { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.mp button:hover { background: var(--raise); color: var(--text); }
.mp span { display: inline-block; min-width: 124px; text-align: center; font-weight: 500; font-size: 14px; }
.mp span::first-letter { text-transform: uppercase; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--card); border: 1px solid var(--line); color: var(--muted); }
.icon-btn:hover { color: var(--text); }

/* ── Tarjetas ── */
.card { background: var(--card); border: 0; border-radius: 20px; padding: 20px; box-shadow: var(--shadow); }
.card-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.card-h h2 { font-size: 15px; font-weight: 600; }
.card-h a, .link { color: var(--accent); font-size: 13.5px; font-weight: 500; }
.label { color: var(--muted); font-size: 12.5px; letter-spacing: .02em; }
.stack { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }

.dash { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.dash > *, .kpis > *, .summary > *, .grid > * { min-width: 0; }
.hero { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px;
  background: var(--card); }
.hero-amt { font: 700 clamp(40px, 11vw, 56px)/1 var(--serif); letter-spacing: -.02em; margin: 6px 0 10px; }
.hero-sub { color: var(--muted); font-size: 14px; }
.hero-sub b { color: var(--text); font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 500; background: var(--raise); color: var(--muted); white-space: nowrap; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.ok { color: var(--ok); } .chip.warn { color: var(--warn); } .chip.bad { color: var(--bad); }
.ring { width: 104px; height: 104px; flex: none; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; stroke-linecap: round; }
.ring .bg { stroke: var(--raise); }
.ring .fg { stroke: var(--accent); stroke-dasharray: 289; stroke-dashoffset: 289; transition: stroke-dashoffset 1.1s var(--ease); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 600; font-size: 19px; }

.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kpi { padding: 16px; border-radius: 20px; }
.kpi .v { font: 700 24px/1.1 var(--serif); margin-top: 6px; }
.kpi .v.pos { color: var(--ok); } .kpi .v.neg { color: var(--bad); }
.kpi small { color: var(--faint); font-size: 12px; }

.chart { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; height: 170px; align-items: end; }
.chart button { display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; border-radius: 12px; padding: 6px 2px; transition: background .2s; }
.chart button:hover, .chart button.on { background: var(--raise); }
.chart .bars { display: flex; align-items: flex-end; gap: 4px; flex: 1; width: 100%; justify-content: center; }
.chart .bar { width: min(16px, 34%); border-radius: 5px 5px 2px 2px; min-height: 3px; height: 0; transition: height .9s var(--ease); position: relative; }
.chart .bar.inc { background: color-mix(in srgb, var(--accent) 22%, transparent); overflow: hidden; }
.chart .bar.inc i { position: absolute; left: 0; right: 0; bottom: 0; background: var(--accent); border-radius: inherit; }
.chart .bar[data-h="0%"] { visibility: hidden; }
.chart .bar.exp { background: color-mix(in srgb, var(--bad) 65%, transparent); }
.chart span { font-size: 11.5px; color: var(--muted); text-transform: capitalize; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 3px; margin-right: 5px; }

/* ── Filas ── */
.list { display: grid; grid-template-columns: minmax(0, 1fr); }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-top: 1px solid var(--line); cursor: pointer; text-align: left; width: 100%; animation: rise .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 30ms); }
.list > .row:first-child { border-top: 0; }
.row:hover .row-t { color: var(--accent); }
.av { width: 40px; height: 40px; border-radius: 13px; flex: none; display: grid; place-items: center; font-weight: 600; font-size: 15px;
  background: hsl(var(--h, 40) 60% 50% / var(--av-a)); color: hsl(var(--h, 40) 65% var(--av-l)); }
.row-main { flex: 1; min-width: 0; }
.row-t { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .2s; }
.row .chk, .row .row-amt, .row .av { flex: none; }
.row-s { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-s.bad { color: var(--bad); } .row-s.ok { color: var(--ok); }
.row-amt { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-amt.neg { color: var(--text); }
.tag { display: inline-block; font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 2px 6px; border-radius: 6px; background: var(--raise); color: var(--muted); vertical-align: 1px; margin-left: 4px; }
.tag.warn { color: var(--warn); } .tag.bad { color: var(--bad); } .tag.ok { color: var(--ok); }
.chk { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; border: 1.5px solid var(--line2); color: transparent; transition: all .25s var(--ease); }
.chk:hover { border-color: var(--ok); color: var(--ok); }
.chk.on { background: var(--ok); border-color: var(--ok); color: #fff; animation: pop .35s var(--ease); }
.chk svg.i { width: 16px; height: 16px; stroke-width: 2.6; }
@keyframes pop { 50% { transform: scale(1.2); } }
.empty { text-align: center; color: var(--muted); padding: 32px 12px; font-size: 14px; }
.empty b { display: block; font: 600 18px var(--sans); color: var(--text); margin-bottom: 4px; }

.seg { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { padding: 7px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 500; color: var(--muted); transition: all .2s; }
.seg button.on { background: var(--accent); color: #fff; }
.toolbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
.summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.summary .kpi .v { font-size: 20px; }

/* ── Servicios ── */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.svc { cursor: pointer; transition: transform .25s var(--ease), border-color .25s; animation: rise .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms); }
.svc:hover { transform: translateY(-2px); border-color: var(--line2); }
.svc.off { opacity: .55; }
.svc-top { display: flex; gap: 12px; align-items: center; }
.svc-amt { font: 700 30px/1 var(--serif); margin: 18px 0 2px; }
.svc-amt small { font: 400 13px var(--sans); color: var(--muted); }
.dots { display: flex; gap: 5px; margin-top: 16px; align-items: center; }
.dots i { flex: 1; height: 5px; border-radius: 3px; background: var(--raise); }
.dots i.paid { background: var(--ok); } .dots i.pending { background: var(--warn); } .dots i.overdue { background: var(--bad); }
.svc-foot { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12.5px; color: var(--muted); }

/* ── IPTV ── */
.search { flex: 1; min-width: 180px; }
.iptv { animation: rise .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms); }
.iptv-top { display: flex; gap: 12px; align-items: center; }
.badge { margin-left: auto; padding: 5px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: color-mix(in srgb, currentColor 14%, transparent); }
.st-ok .badge { color: var(--ok); } .st-soon .badge { color: var(--warn); } .st-expired .badge { color: var(--bad); } .st-none .badge { color: var(--muted); }
.life { height: 4px; border-radius: 2px; background: var(--raise); margin: 16px 0 8px; overflow: hidden; }
.life i { display: block; height: 100%; border-radius: 2px; background: var(--ok); }
.st-soon .life i { background: var(--warn); } .st-expired .life i { background: var(--bad); }
.creds { display: grid; gap: 1px; margin: 14px 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.cred { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--raise); }
.cred .label { width: 62px; flex: none; }
.cred code { flex: 1; font: 13.5px ui-monospace, "SF Mono", Menlo, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cred button { color: var(--muted); padding: 4px; }
.cred button:hover { color: var(--accent); }
.cred svg.i { width: 17px; height: 17px; }
.acts { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Botones y formularios ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 18px; border-radius: 14px; font-weight: 600; font-size: 15px; transition: transform .15s var(--ease), filter .2s, background .2s; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(140deg, var(--accent), var(--accent2)); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: var(--raise); }
.btn.ghost:hover { background: var(--line2); }
.btn.danger { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.btn.sm { height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 11px; font-weight: 500; }
.btn.sm svg.i { width: 16px; height: 16px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .6; pointer-events: none; }

.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
.field { grid-column: 1 / -1; display: grid; gap: 6px; }
.field.half { grid-column: auto; }
.field > span { font-size: 13px; color: var(--muted); font-weight: 500; }
.input { width: 100%; height: 48px; padding: 0 14px; border-radius: 13px; background: var(--raise); border: 1px solid var(--line); font-size: 16px; outline: 0; transition: border-color .2s, box-shadow .2s; appearance: none; -webkit-appearance: none; min-width: 0; }
textarea.input { height: 84px; padding: 12px 14px; resize: vertical; }
select.input { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 13px; background: var(--raise); border: 1px solid var(--line); cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch i { width: 44px; height: 26px; border-radius: 13px; background: var(--line2); position: relative; transition: background .25s; flex: none; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .25s var(--ease); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Hoja / modal ── */
.backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; align-items: flex-end; justify-content: center; animation: fade .25s both; }
.backdrop.out { animation: fade .2s reverse both; }
.sheet { width: 100%; max-width: 540px; max-height: 92dvh; overflow-y: auto; background: var(--card-solid); border: 1px solid var(--line); border-bottom: 0; border-radius: 26px 26px 0 0; padding: 10px 20px calc(22px + var(--sab)); animation: up .4s var(--ease) both; overscroll-behavior: contain; }
.backdrop.out .sheet { animation: up .2s reverse both; }
.sheet::before { content: ""; display: block; width: 38px; height: 4px; border-radius: 2px; background: var(--line2); margin: 0 auto 14px; }
.sheet-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.sheet-h h2 { font: 700 22px/1.2 var(--sans); letter-spacing: -.01em; }
.sheet-h p { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.sheet-f { display: flex; gap: 10px; margin-top: 20px; }
.sheet-f .btn.primary { flex: 1; }
.menu { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
.menu button { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 16px; background: var(--raise); text-align: left; transition: background .2s; }
.menu button:hover { background: var(--line2); }
.menu b { display: block; font-weight: 600; } .menu small { color: var(--muted); font-size: 13px; }
.menu .av { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(100%); } }

/* ── Avisos ── */
#toast-root { position: fixed; left: 0; right: 0; bottom: calc(96px + var(--sab)); z-index: 60; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 14px; background: #2c2c2e; color: #fff; font-weight: 500; font-size: 14px; box-shadow: 0 12px 32px -8px rgba(0,0,0,.5); animation: rise .35s var(--ease) both; }
.toast.bad { background: var(--bad); color: #fff; }
.toast button { color: inherit; font-weight: 700; text-decoration: underline; }

.settings { max-width: 560px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.set-row:first-of-type { border-top: 0; }
.set-row small { display: block; color: var(--muted); font-size: 13px; }

.catbar { display: grid; grid-template-columns: 96px 1fr auto; gap: 12px; align-items: center; padding: 7px 0; font-size: 14px; }
.catbar .track { height: 8px; border-radius: 4px; background: var(--raise); overflow: hidden; }
.catbar .track i { display: block; height: 100%; border-radius: 4px; background: hsl(var(--h) 60% 60%); }

/* ── Tablet ── */
@media (min-width: 768px) {
  .shell { display: grid; grid-template-columns: 88px 1fr; }
  .nav { position: sticky; top: 0; left: auto; right: auto; bottom: auto; height: 100dvh; flex-direction: column; justify-content: flex-start; gap: 6px; padding: 18px 10px; border-radius: 0; border: 0; border-right: 1px solid var(--line); box-shadow: none; background: color-mix(in srgb, var(--card-solid) 55%, transparent); }
  .nav a { flex: none; width: 100%; padding: 10px 2px 8px; }
  .nav-brand { display: grid; place-items: center; margin-bottom: 10px; }
  .nav-brand img { width: 40px; height: 40px; border-radius: 12px; box-shadow: 0 0 0 1px var(--line2); }
  .nav-brand span { display: none; }
  .nav-new { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 15px; color: var(--accent-ink); background: linear-gradient(140deg, var(--accent), var(--accent2)); }
  .nav-new span { display: none; }
  .nav-sp { display: block; flex: 1; }
  .nav a.only-wide { display: flex; }
  .fab, .only-mobile { display: none !important; }
  .view { padding: 36px 32px 48px; width: 100%; }
  .vh h1 { font-size: 38px; }
  .backdrop { align-items: center; padding: 24px; }
  .sheet { border-radius: 26px; border-bottom: 1px solid var(--line); padding: 26px; animation-name: zoom; }
  .sheet::before { display: none; }
  #toast-root { bottom: 28px; }
  .dash { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
  .dash .wide { grid-column: 1 / -1; }
  .hero { padding: 30px; }
  .ring { width: 128px; height: 128px; }
  .chart { height: 210px; }
  @keyframes zoom { from { opacity: 0; transform: scale(.96) translateY(8px); } }
}

/* ── Escritorio ── */
@media (min-width: 1100px) {
  .shell { grid-template-columns: 248px 1fr; }
  .nav { padding: 24px 16px; align-items: stretch; }
  .nav-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; margin-bottom: 20px; }
  .nav-brand span { display: block; font: 700 22px var(--sans); letter-spacing: -.02em; }
  .nav-new { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; margin-bottom: 18px; }
  .nav-new span { display: inline; }
  .nav a { flex-direction: row; gap: 12px; padding: 11px 12px; font-size: 14.5px; border-radius: 13px; }
  .view { padding: 44px 48px 64px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}

/* ── Clientes ── */
.mini { display: grid; gap: 6px; margin: 14px 0 2px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
.mini div { display: flex; justify-content: space-between; gap: 10px; }
.mini span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini b { color: var(--text); font-weight: 600; } .mini b.due { color: var(--warn); }
.svc .chips { margin-top: 10px; } .svc .acts { margin-top: 14px; }
@media (max-width: 767px) { .nav a { font-size: 10px; } }

/* ── Agenda y ajustes ── */
.av.day { flex-direction: column; display: flex; align-items: center; justify-content: center; line-height: 1; gap: 1px; }
.av.day b { font-size: 15px; } .av.day small { font-size: 9.5px; font-weight: 600; text-transform: uppercase; }
.set-row > div:first-child { min-width: 0; }
.set-row.sub { padding-left: 14px; border-top-style: dashed; }
.set-row .acts { flex-wrap: nowrap; }
.set-row { flex-wrap: wrap; }
.set-row > div:first-child { flex: 1 1 210px; }

/* Nada puede ensanchar la página: ni textos largos ni tamaños de letra grandes del sistema. */
html { overflow-x: hidden; }
.view { overflow-x: clip; }
.card { min-width: 0; max-width: 100%; }
.row-t.rt { display: flex; align-items: center; }
.row-t.rt .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.row-t.rt .tag { flex: none; }
.mini { grid-template-columns: minmax(0, 1fr); }
.mini span { min-width: 0; }
.card-h { flex-wrap: wrap; gap: 6px 12px; }
.hero > div:first-child { min-width: 0; }
.mini div { min-width: 0; } .mini b { flex: none; }
.summary .kpi { padding: 14px 12px; } .summary .kpi .v { font-size: clamp(15px, 4.6vw, 20px); white-space: nowrap; }
.kpi .v { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cred code.wrap { white-space: normal; overflow-wrap: anywhere; }

/* ── Selector de periodo ── */
.vh-r { flex-wrap: wrap; }
.seg.sm button { padding: 6px 12px; font-size: 13px; }
.mp.dates { padding: 3px 10px; gap: 6px; }
.mp.dates span { min-width: 0; color: var(--muted); }
.mp.dates input { border: 0; background: none; height: 32px; font-size: 14px; font-weight: 500; outline: 0; min-width: 0; color: inherit; }
.chart.dense { gap: 2px; }
.chart.dense .bars { gap: 2px; }
.chart.dense .bar { width: 42%; border-radius: 3px 3px 1px 1px; }
.chart.dense span { font-size: 10.5px; }
textarea.input.msg { height: 300px; font: 14px/1.5 ui-monospace, "SF Mono", Menlo, monospace; white-space: pre-wrap; }

/* Calendario */
.cal .card-h { align-items: center; }
.cal .mp span { min-width: 128px; text-align: center; font-size: 13.5px; font-weight: 500; }
.cal .mp span::first-letter { text-transform: uppercase; }
.cal-w, .cal-g { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; text-align: center; }
.cal-w span { font-size: 11px; font-weight: 600; color: var(--faint); padding-bottom: 6px; }
.cal-d { aspect-ratio: 1 / .9; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--text); min-width: 0; }
.cal-d b { font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; }
.cal-d:hover { background: var(--line); }
.cal-d.today b { background: var(--bad); color: #fff; font-weight: 600; }
.cal-d.on { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.cal-dots { display: flex; gap: 3px; height: 6px; }
.cal-dots i, .cal-l i { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.cal-l { margin: 12px 0 4px; flex-wrap: wrap; }
.cal-l i { margin-right: 5px; }
i.cobro { background: var(--accent); } i.paid { background: var(--ok); } i.iptv { background: var(--warn); }
.cal-h { margin: 14px 0 6px; } .cal-h::first-letter { text-transform: uppercase; }
.cal-h .link { font-size: 12.5px; }
.av.day.cobro { --h: 212; } .av.day.paid { --h: 145; } .av.day.iptv { --h: 30; }
@media (max-width: 420px) { .cal .mp span { min-width: 104px; font-size: 13px; } .cal-d b { font-size: 14px; width: 26px; height: 26px; } }
