/* Comparador de turnos · estilo premium: neutros, un acento azul profundo, tinta para lo importante. */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --line: #e6e9ef;
  --line-2: #eef0f4;
  --text: #0b1220;
  --text-2: #344054;
  --muted: #667085;
  --faint: #98a2b3;
  --a: #2f5bea;
  --a-ink: #1d3fb8;
  --a-soft: #eef2fe;
  --b: #7a5af8;
  --b-ink: #5925dc;
  --b-soft: #f3f0ff;
  --cross: #d92d20;
  --cross-soft: #fef3f2;
  --ok: #067647;
  --ok-dot: #12b76a;
  --ok-soft: #ecfdf3;
  --hol: #b54708;
  --hol-dot: #f79009;
  --hol-soft: #fffaeb;
  --ink: #0b1220;
  --ink-text: #ffffff;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px -12px rgba(16, 24, 40, .1);
  --shadow-lg: 0 18px 40px -20px rgba(11, 18, 32, .5);
  --radius: 18px;
  --display: "Inter Tight", Inter, system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0f1a; --surface: #111827; --surface-2: #0f1623; --line: #1f2a3d; --line-2: #1a2435; --text: #e9edf5; --text-2: #c7ced9;
    --muted: #98a2b3; --faint: #667085; --a: #6e8ef7; --a-ink: #a9bcfb; --a-soft: #18234a; --b: #a48afb; --b-ink: #c9b8ff; --b-soft: #241b47;
    --cross: #f97066; --cross-soft: #3a1513; --ok: #47cd89; --ok-dot: #47cd89; --ok-soft: #0d2e20; --hol: #fdb022; --hol-dot: #fdb022; --hol-soft: #33240a;
    --ink: #1b2436; --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 18px 40px -20px rgba(0, 0, 0, .7); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0f1a; --surface: #111827; --surface-2: #0f1623; --line: #1f2a3d; --line-2: #1a2435; --text: #e9edf5; --text-2: #c7ced9;
  --muted: #98a2b3; --faint: #667085; --a: #6e8ef7; --a-ink: #a9bcfb; --a-soft: #18234a; --b: #a48afb; --b-ink: #c9b8ff; --b-soft: #241b47;
  --cross: #f97066; --cross-soft: #3a1513; --ok: #47cd89; --ok-dot: #47cd89; --ok-soft: #0d2e20; --hol: #fdb022; --hol-dot: #fdb022; --hol-soft: #33240a;
  --ink: #1b2436; --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 18px 40px -20px rgba(0, 0, 0, .7); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "tnum" 1, "cv11" 1; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
h1, h2, h3 { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.grow { flex: 1; }
[hidden] { display: none !important; }

/* Colores por lugar */
.p-a { --c: var(--a); --c-soft: var(--a-soft); --c-ink: var(--a-ink); }
.p-b { --c: var(--b); --c-soft: var(--b-soft); --c-ink: var(--b-ink); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--muted)); margin-right: 7px; vertical-align: 1px; flex: none; }
.dot.cross { background: var(--cross); }
.dot.swapd { background: var(--ok-dot); }
.dot.holi { background: var(--hol-dot); }

/* Botones */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; font-size: .9rem; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--line), var(--text) 15%); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--a); border-color: var(--a); color: #fff; }
.btn.primary:hover { background: color-mix(in srgb, var(--a), #000 12%); }
.btn.primary.dark { background: var(--ink); border-color: var(--ink); color: var(--ink-text); }
.btn.primary.dark:hover { background: color-mix(in srgb, var(--ink), #fff 12%); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--line); }
.btn.danger { color: var(--cross); }
.btn.small { height: 32px; padding: 0 12px; font-size: .84rem; border-radius: 10px; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; border: 0; background: transparent; cursor: pointer; color: var(--muted); transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--line-2); color: var(--text); }
:focus-visible { outline: 2px solid var(--a); outline-offset: 2px; }

/* Encabezado */
.top { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; height: 64px; padding: 0 28px;
  background: color-mix(in srgb, var(--surface), transparent 14%); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--a); color: #fff; flex: none; }
.brand-mark svg { stroke-width: 2.4; }
.brand strong { font-family: var(--display); font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; white-space: nowrap; }
.month-nav { display: flex; align-items: center; gap: 2px; background: var(--line-2); border-radius: 999px; padding: 4px; }
.month-nav .icon-btn { width: 32px; height: 32px; border-radius: 999px; }
.month-nav .icon-btn:hover { background: var(--surface); }
.month-nav h1 { font-size: .95rem; font-weight: 600; min-width: 148px; text-align: center; }
.today-btn { height: 32px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--surface); box-shadow: 0 1px 2px rgba(16, 24, 40, .08); font-weight: 600; font-size: .82rem; cursor: pointer; }
.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.acct { position: relative; margin-left: 6px; }
.acct-btn { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 10px 0 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; font-weight: 500; font-size: .9rem; max-width: 260px; }
.acct-btn:hover { border-color: color-mix(in srgb, var(--line), var(--text) 18%); }
.acct-btn svg { width: 14px; height: 14px; color: var(--muted); }
.acct-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 32px; height: 32px; border-radius: 999px; background: var(--a-soft); color: var(--a-ink); display: grid; place-items: center; font-weight: 700; font-size: .78rem; flex: none; letter-spacing: .02em; }
.acct-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 40px -16px rgba(16, 24, 40, .25); padding: 6px; z-index: 30; animation: menu-in .16s ease-out; }
.acct-menu-name { margin: 0; padding: 8px 10px 10px; font-size: .82rem; color: var(--muted); border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }
.acct-menu button { display: flex; align-items: center; gap: 10px; width: 100%; height: 40px; padding: 0 10px; border: 0; border-radius: 9px; background: transparent; cursor: pointer; font-weight: 500; text-align: left; }
.acct-menu button:hover { background: var(--surface-2); }
.acct-menu button svg { color: var(--muted); }
.acct-menu .danger, .menu-list .danger { color: var(--cross); }
.acct-menu .danger svg, .menu-list .danger svg { color: var(--cross); }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* Distribución */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; max-width: 1400px; margin: 0 auto; padding: 28px 28px 56px; align-items: start; }
.content { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 88px; }
.panel, .board, .stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel { padding: 18px; }
.panel h2 { font-size: .95rem; font-weight: 600; margin-bottom: 12px; }
.mobile-only { display: none; }
.hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hello p { margin: 0 0 4px; font-size: .9rem; color: var(--muted); }
.hello h2 { font-family: var(--display); font-size: 2rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.setup-slot { display: flex; flex-direction: column; gap: 16px; }
.setup-slot:empty { display: none; }

/* Próximo turno */
.next-card { background: var(--ink); color: var(--ink-text); border-radius: 20px; padding: 22px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow-lg); }
.next-card:empty { display: none; }
.nc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.nc-label { font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #98a2b3; }
.nc-when { font-size: .75rem; font-weight: 600; background: rgba(255, 255, 255, .12); border-radius: 999px; padding: 4px 10px; }
.nc-title { font-family: var(--display); font-size: 1.55rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.15; }
.nc-sub { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: .9rem; color: #d0d5dd; }
.nc-sub .dot.p-a { background: #8fa8f7; } .nc-sub .dot.p-b { background: #bba6fc; }
.nc-note { font-size: .82rem; color: #fde68a; }
.nc-foot { display: flex; align-items: center; gap: 10px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .84rem; color: #d0d5dd; }
.nc-foot .ok-ic { width: 26px; height: 26px; border-radius: 999px; background: #12b76a; display: grid; place-items: center; flex: none; }
.nc-foot .ok-ic svg { width: 14px; height: 14px; stroke: #fff; stroke-width: 2.6; }
.nc-foot button { margin-left: auto; border: 0; background: rgba(255, 255, 255, .12); color: #fff; border-radius: 999px; height: 30px; padding: 0 12px; font-weight: 600; font-size: .8rem; cursor: pointer; }
.nc-empty { color: #d0d5dd; font-size: .92rem; }

/* Próximos 7 días y agenda */
.week-row, .ag-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 0; border: 0; border-top: 1px solid var(--line-2); background: none; text-align: left; cursor: pointer; }
.week-row:first-child { border-top: 0; padding-top: 2px; }
.day-badge { width: 44px; text-align: center; flex: none; }
.day-badge small { display: block; font-size: .68rem; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
.day-badge b { display: block; font-family: var(--display); font-size: 1.25rem; font-weight: 700; line-height: 1.1; }
.row-bar { width: 4px; align-self: stretch; min-height: 32px; border-radius: 999px; background: var(--c, var(--line)); flex: none; }
.row-main { flex: 1; min-width: 0; }
.row-main b { display: block; font-size: .92rem; font-weight: 600; }
.row-main span { display: block; font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.place-tag { font-size: .72rem; font-weight: 600; border-radius: 999px; padding: 4px 9px; white-space: nowrap; background: var(--c-soft); color: var(--c-ink); max-width: 46%; overflow: hidden; text-overflow: ellipsis; }
.week-row.given .row-main b, .ag-row.given .row-main b { text-decoration: line-through; color: var(--faint); }
.week-row.given .row-bar, .ag-row.given .row-bar { background: var(--ok-dot); }
.week-row.cover .row-bar, .ag-row.cover .row-bar { background: var(--hol-dot); }
.week-empty { margin: 0; color: var(--muted); font-size: .88rem; }
.agenda { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px 18px; }
.ag-day { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-2); }
.ag-day:first-child { border-top: 0; }
.ag-day.past { opacity: .5; }
.ag-day.today .day-badge b { color: var(--a); }
.ag-day.holiday .day-badge small { color: var(--hol); }
.ag-shifts { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ag-row { border-top: 0; padding: 4px 0; }
.ag-hol { font-size: .72rem; font-weight: 600; color: var(--hol); }
.ag-empty { padding: 28px 8px; text-align: center; color: var(--muted); }

/* Estado (cuadros y WhatsApp) en el panel lateral */
.status-card { padding: 4px 18px; display: flex; flex-direction: column; }
.status-card > section, .status-card > section.compact, .status-card > section.on { border: 0; border-radius: 0; box-shadow: none; background: none; padding: 14px 0; animation: none; }
.status-card .wa-head, .status-card .uploads-head { flex-wrap: nowrap; align-items: center; gap: 12px; }
.status-card .up-titles, .status-card .wa-titles { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.status-card .wa-titles h2, .status-card .up-titles h2 { font-size: .92rem; color: var(--text); }
.status-card .wa-titles p, .status-card #uploadsHint { margin: 0; font-size: .8rem; color: var(--muted); }
.status-card #uploadsHint { flex-direction: column; gap: 1px; }
.ag-more { display: block; width: 100%; margin: 4px 0; padding: 10px; border: 1px dashed var(--line); border-radius: 12px; background: none; color: var(--muted); font-weight: 500; font-size: .84rem; cursor: pointer; }
.status-card > section + section { border-top: 1px solid var(--line-2); }
.status-card .upload-tiles, .status-card .wa-body { grid-template-columns: 1fr; }

/* Avisos de cruces */
.reminders:empty { display: none; }
.reminders ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.reminders button { width: 100%; text-align: left; border: 1px solid; border-radius: 14px; padding: 12px 16px 12px 46px; cursor: pointer; position: relative; }
.reminders button::before { position: absolute; left: 14px; top: 11px; width: 22px; height: 22px; border-radius: 999px; display: grid; place-items: center; font-weight: 800; font-size: .8rem; }
.reminders .warn button { background: var(--cross-soft); border-color: color-mix(in srgb, var(--cross), transparent 70%); }
.reminders .warn button::before { content: "!"; color: #fff; background: var(--cross); }

/* Resumen del mes: una franja con cuatro cifras */
.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.metric { padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; border-right: 1px solid var(--line-2); min-width: 0; }
.metric:last-child { border-right: 0; }
.metric h3 { font-size: .8rem; font-weight: 500; color: var(--muted); }
.metric .big { margin: 0; font-family: var(--display); font-size: 2.2rem; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.metric .big small { font-size: 1rem; color: var(--muted); font-weight: 600; margin-left: 3px; }
.metric .foot { margin: 0; font-size: .78rem; color: var(--text-2); }
.metric .foot.ok { color: var(--ok); font-weight: 600; }
.metric.alert .big, .metric.alert .foot b { color: var(--cross); }
.metric.ok .big { color: var(--ok); }
.split { display: flex; flex-direction: column; gap: 3px; font-size: .78rem; color: var(--text-2); }
.split span { display: flex; align-items: center; min-width: 0; }
.split em { font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.split b { margin-left: auto; padding-left: 8px; font-weight: 600; color: var(--text); }
.bar { display: flex; gap: 2px; height: 6px; border-radius: 99px; overflow: hidden; background: var(--line-2); }
.bar span { background: var(--c); border-radius: 99px; }
/* Tarjetas de cifras sueltas (panel de administración) */
.stat { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.stat h3 { font-size: .8rem; font-weight: 500; color: var(--muted); }
.stat .big { margin: 0; font-family: var(--display); font-size: 2rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.stat .big small { font-size: 1rem; color: var(--muted); font-weight: 500; }
.stat .foot { margin: auto 0 0; font-size: .8rem; color: var(--muted); }
.stat.alert { border-color: color-mix(in srgb, var(--cross), transparent 55%); background: linear-gradient(var(--cross-soft), var(--surface) 70%); }
.stat.alert .big, .stat.alert .foot b { color: var(--cross); }
.stat.ok .big { color: var(--ok); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }

/* Barra para marcar */
.board { padding: 18px 20px 20px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-bottom: 14px; }
.brush-label { font-size: .8rem; font-weight: 500; color: var(--muted); }
.seg { display: inline-flex; padding: 4px; border-radius: 12px; background: var(--line-2); gap: 2px; }
.seg button { border: 0; background: transparent; height: 32px; padding: 0 14px; border-radius: 9px; cursor: pointer; font-weight: 500; font-size: .86rem; color: var(--muted); display: inline-flex; align-items: center; }
.seg button.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(16, 24, 40, .1); }
.types { display: flex; flex-wrap: wrap; gap: 6px; }
.type-btn { display: inline-flex; align-items: baseline; gap: 6px; height: 34px; padding: 0 12px; align-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: .86rem; }
.type-btn b { color: var(--text); }
.type-btn span { color: var(--text-2); }
.type-btn small { color: var(--muted); font-variant-numeric: tabular-nums; }
.type-btn.on { background: var(--ink); border-color: var(--ink); color: var(--ink-text); }
.type-btn.on b, .type-btn.on span, .type-btn.on small { color: var(--ink-text); }
.type-btn.on small { opacity: .7; }
.hint { flex-basis: 100%; margin: 0; font-size: .8rem; color: var(--muted); }
.view-seg button { height: 34px; padding: 0 18px; }

/* Calendario: líneas finas, hoy en círculo, festivos en ámbar */
.cal-head, .calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head span { font-size: .72rem; font-weight: 600; color: var(--faint); letter-spacing: .05em; text-transform: uppercase; padding: 0 10px 8px; }
.calendar { gap: 1px; background: var(--line-2); border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden; }
.day { min-height: 112px; padding: 8px 8px 10px; background: var(--surface); cursor: pointer; display: flex; flex-direction: column; gap: 5px; transition: background .12s; min-width: 0; }
.day:hover { background: var(--surface-2); }
.day.out { background: var(--surface-2); cursor: default; }
.day.sunday .num, .day.holiday .num { color: var(--hol); }
.day.holiday { background: color-mix(in srgb, var(--hol-soft), var(--surface) 45%); }
.day.has-cross { box-shadow: inset 0 0 0 2px var(--cross); }
.day-head { display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 24px; }
.num { font-weight: 600; font-size: .84rem; padding-left: 4px; color: var(--text-2); }
.day.today .num { background: var(--a); color: #fff; border-radius: 99px; width: 26px; height: 26px; display: inline-grid; place-items: center; padding: 0; }
.hol { font-size: .68rem; color: var(--hol); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chips { display: flex; flex-direction: column; gap: 4px; }
.chip { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; width: 100%; text-align: left; border: 0; border-radius: 8px; background: var(--c-soft); padding: 5px 8px; cursor: pointer; font-size: .76rem; line-height: 1.25; transition: filter .12s; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 99px; background: var(--c); flex: none; }
.chip b { color: var(--c-ink); font-weight: 700; }
.chip .time { color: var(--text-2); }
.chip .with { flex-basis: 100%; color: var(--ok); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .72rem; }
.chip.cross { background: var(--cross-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cross), transparent 55%); }
.chip.cross::before { background: var(--cross); }
.chip.cross b { color: var(--cross); }
.chip.given { background: var(--ok-soft); }
.chip.given::before { background: var(--ok-dot); }
.chip.given b, .chip.given .time { text-decoration: line-through; color: var(--faint); }
.chip:hover { filter: brightness(.97); }
.chip.cover { background: var(--hol-soft); }
.chip.cover::before { background: var(--hol-dot); }
.chip .with.cover { color: var(--hol); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: .78rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; }

/* Devolución dentro del detalle del turno */
.swap-row .payback-note { color: var(--hol); font-weight: 500; }
.payback { border: 1px solid color-mix(in srgb, var(--hol-dot), transparent 60%); border-radius: 14px; padding: 12px 14px; background: var(--hol-soft); display: flex; flex-direction: column; gap: 12px; }
.pb-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 600; font-size: .9rem; color: var(--hol); cursor: pointer; }
.pb-toggle input { appearance: none; -webkit-appearance: none; width: 48px; height: 28px; border-radius: 999px; border: 0; padding: 0; margin: 0; background: color-mix(in srgb, var(--muted), transparent 55%); position: relative; cursor: pointer; transition: background .2s; flex: none; }
.pb-toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 999px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s; }
.pb-toggle input:checked { background: var(--hol-dot); }
.pb-toggle input:checked::after { transform: translateX(20px); }
.pb-toggle input:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--hol-dot), transparent 70%); }
.pb-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pb-fields .field { margin: 0; }
.pb-fields input, .pb-fields select { background: var(--surface); }
.pb-fields:not(.one-place) .field:nth-child(3) { grid-column: 1 / -1; }
.pb-preview { grid-column: 1 / -1; margin: 0; font-size: .84rem; color: var(--text-2); }
.pb-preview b { color: var(--text); }
@media (max-width: 520px) { .pb-fields, .pb-fields.one-place { grid-template-columns: 1fr; } }
.callout.cover { background: var(--hol-soft); border-color: transparent; }
.type-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.type-pick button { min-height: 52px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 6px; font-weight: 600; font-size: .86rem; }
.type-pick button small { font-weight: 500; font-size: .72rem; color: var(--faint); }
.type-pick button[aria-checked="true"] { border: 1.5px solid var(--c, var(--a)); background: var(--c-soft, var(--a-soft)); color: var(--c-ink, var(--a-ink)); }
.type-pick button[aria-checked="true"] small { color: var(--c-ink, var(--a-ink)); opacity: .8; }
.people-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -6px; }
.people-chips:empty { display: none; }
.people-chips button { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); font-size: .8rem; font-weight: 500; cursor: pointer; }
.people-chips button:hover { border-color: var(--ok-dot); color: var(--ok); }

/* Listas laterales */
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.list > li { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.list > li.pending { border-color: color-mix(in srgb, var(--cross), transparent 55%); }
.list p { margin: 6px 0 0; }
.li-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.tag { font-size: .74rem; font-weight: 600; padding: 3px 9px; border-radius: 99px; max-width: 60%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--surface-2); color: var(--muted); }
.tag.bad { background: var(--cross-soft); color: var(--cross); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.muted-tag { background: transparent; border: 1px dashed var(--line); }
.pair { display: grid; gap: 4px; }
.pair button, .swap-row { display: flex; align-items: center; flex-wrap: wrap; width: 100%; text-align: left; border: 0; background: var(--surface-2); border-radius: 10px; padding: 7px 9px; cursor: pointer; font-size: .85rem; }
.pair button:hover, .swap-row:hover { background: color-mix(in srgb, var(--surface-2), var(--text) 5%); }
.pair small { flex-basis: 100%; padding-left: 15px; color: var(--muted); }
.list > li:has(.swap-row) { padding: 0; border: 0; }
.swap-row { justify-content: flex-start; gap: 12px; flex-wrap: nowrap; padding: 10px 12px; border: 1px solid var(--line-2); background: var(--surface); }
.swap-row .avatar { background: var(--ok-soft); color: var(--ok); width: 36px; height: 36px; }
.swap-row > span:not(.avatar) { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.swap-row small { color: var(--muted); }
.swap-row .note { font-style: italic; }
.empty { margin: 0; color: var(--muted); font-size: .88rem; }
.menu-list { display: flex; flex-direction: column; }
.menu-list button { display: flex; align-items: center; gap: 12px; height: 52px; border: 0; border-top: 1px solid var(--line-2); background: none; text-align: left; font-weight: 500; cursor: pointer; padding: 0 2px; }
.menu-list button:first-child { border-top: 0; }
.menu-list button svg { color: var(--muted); }
.menu-list .chev { margin-left: auto; width: 16px; height: 16px; color: var(--faint); }

/* Barra inferior y botón flotante (solo celular) */
.tabbar, .fab { display: none; }

/* Diálogos */
.dialog { width: min(500px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 22px; padding: 0; background: var(--surface); color: var(--text); box-shadow: 0 32px 80px -24px rgba(11, 18, 32, .45); }
.dialog.wide { width: min(780px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(11, 18, 32, .5); backdrop-filter: blur(3px); }
.dialog form { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dialog-head h2 { font-family: var(--display); font-size: 1.3rem; font-weight: 700; letter-spacing: -.01em; display: inline; }
.dialog-head p { margin: 4px 0 0; color: var(--muted); font-size: .88rem; }
.dialog-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 6px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: .86rem; font-weight: 600; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--surface-2); transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--a); box-shadow: 0 0 0 3px color-mix(in srgb, var(--a), transparent 80%); }
textarea { resize: vertical; }
.callout { border-radius: 12px; padding: 11px 13px; font-size: .88rem; }
.callout.bad { background: var(--cross-soft); color: color-mix(in srgb, var(--cross), var(--text) 30%); }
.callout.ok { background: var(--ok-soft); }
.place-card { border: 1px solid var(--line); border-top: 3px solid var(--c); border-radius: 12px; padding: 12px; margin: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.place-card legend { font-weight: 600; font-size: .85rem; padding: 0 4px; display: flex; align-items: center; }
.types-table { display: grid; gap: 6px; }
.tt-head, .tt-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) 86px 86px 30px; gap: 5px; align-items: center; }
.tt-head span { font-size: .72rem; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.tt-row input { padding: 6px 7px; font-size: .85rem; }
.tt-row .icon-btn { width: 30px; height: 30px; }
.tt-row input[type="time"] { padding: 6px 4px; }
.backup summary { cursor: pointer; font-weight: 500; }
/* ---------- Uno o dos lugares ---------- */
.mode-chooser { background: var(--surface); border: 1px solid color-mix(in srgb, var(--a), transparent 55%); border-radius: var(--radius); box-shadow: 0 0 0 3px color-mix(in srgb, var(--a), transparent 88%), var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.mode-chooser[hidden] { display: none; }
.mode-chooser h2 { font-size: 1.1rem; }
.mode-chooser p { margin: 4px 0 0; }
.mode-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-pick button { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; border: 1.5px solid var(--line); background: var(--surface); border-radius: 14px; padding: 14px; cursor: pointer; transition: border-color .15s, background .15s, transform .1s; }
.mode-pick button:hover { border-color: var(--a); background: var(--a-soft); }
.mode-pick button:active { transform: scale(.98); }
.mode-pick button.on { border-color: var(--a); background: var(--a-soft); box-shadow: inset 0 0 0 1px var(--a); }
.mode-pick b { font-size: 1rem; }
.mode-pick small { color: var(--muted); font-size: .82rem; }
.mode-ico { display: flex; gap: 4px; margin-bottom: 4px; }
.mode-ico i { width: 26px; height: 30px; border-radius: 6px; background: var(--a); }
.mode-ico.two i:last-child { background: var(--b); }
.upload-tiles.single { grid-template-columns: minmax(0, 560px); }
#placeSeg[hidden], .panel[hidden] { display: none; }
@media (max-width: 520px) { .mode-pick { grid-template-columns: 1fr; } }

/* ---------- Aviso por WhatsApp ---------- */
.wa-panel { --wa: #16a34a; --wa-soft: #e8f8ee; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; transition: border-color .2s, box-shadow .2s; }
.wa-panel[hidden] { display: none; }
.wa-panel.on { border-color: color-mix(in srgb, var(--wa), transparent 55%); box-shadow: 0 0 0 3px color-mix(in srgb, var(--wa), transparent 88%), var(--shadow); }
.wa-head { display: flex; align-items: center; gap: 12px; }
.wa-logo { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--wa-soft); color: var(--wa); flex: none; transition: background .2s, color .2s; }
.wa-panel.on .wa-logo { background: var(--wa); color: #fff; }
.wa-logo svg { width: 24px; height: 24px; }
.wa-logo .fill { fill: currentColor; stroke: none; }
.wa-titles { flex: 1; min-width: 0; }
.wa-titles h2 { font-size: 1rem; }
.wa-titles p { margin: 2px 0 0; color: var(--muted); }
.wa-panel.on .wa-titles p b { color: var(--wa); }
.switch { position: relative; width: 56px; height: 32px; border-radius: 99px; border: 0; background: color-mix(in srgb, var(--muted), transparent 55%); cursor: pointer; flex: none; transition: background .2s; padding: 0; }
.switch .knob { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .22s cubic-bezier(.3, 1.4, .6, 1); }
.switch[aria-checked="true"] { background: var(--wa); }
.switch[aria-checked="true"] .knob { transform: translateX(24px); }
.wa-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.wa-form { display: flex; flex-direction: column; gap: 12px; }
.wa-form p { margin: 0; }
.phone-wrap { position: relative; display: block; }
.phone-wrap input { padding-right: 38px; font-size: 1rem; letter-spacing: .02em; }
.ok-mark { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; border-radius: 50%; background: var(--wa); color: #fff; font-size: .75rem; font-weight: 700; display: grid; place-items: center; animation: pop .25s ease-out; }
.ok-mark[hidden] { display: none; }
@keyframes pop { from { transform: translateY(-50%) scale(.4); } to { transform: translateY(-50%) scale(1); } }
.hour-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hour-chip { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 7px 13px; cursor: pointer; font-weight: 500; font-size: .88rem; transition: background .15s, border-color .15s, color .15s; }
.hour-chip:hover { border-color: var(--wa); }
.hour-chip.on { background: var(--wa); border-color: var(--wa); color: #fff; }
.wa-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.wa-actions .btn svg { width: 16px; height: 16px; }
.btn.sending svg { animation: fly .8s ease-in-out infinite; }
@keyframes fly { 50% { transform: translate(3px, -3px); } }
#waStatus { color: var(--muted); }
.wa-preview { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.wa-preview p { margin: 0; color: var(--muted); }
.wa-preview p b { color: var(--text); }
.wa-chat { flex: 1; border-radius: 14px; padding: 14px 12px; background: #efeae2 radial-gradient(#e3dccf 1.2px, transparent 1.3px) 0 0 / 18px 18px; }
.wa-bubble { position: relative; background: #fff; color: #111; border-radius: 4px 14px 14px 14px; padding: 10px 12px 22px; font-size: .86rem; line-height: 1.45; max-width: 100%; box-shadow: 0 1px 1px rgba(0, 0, 0, .12); animation: bubble .3s ease-out; }
.wa-bubble::before { content: ""; position: absolute; left: -7px; top: 0; border: 8px solid transparent; border-top-color: #fff; border-right-color: #fff; border-width: 0 8px 10px 0; }
.wa-foot { display: block; margin-top: 8px; color: #8a8a8a; font-size: .76rem; }
.wa-time { position: absolute; right: 10px; bottom: 6px; color: #8a8a8a; font-size: .7rem; }
@keyframes bubble { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.wa-panel.shake { animation: shake .4s; }
.wa-edit, .wa-done { flex: none; }
.wa-edit[hidden], .wa-done[hidden] { display: none; }
/* Activo con número: solo una franja que confirma que está activo */
.wa-panel.compact { padding: 10px 12px 10px 10px; border-color: color-mix(in srgb, var(--wa), transparent 60%);
  background: linear-gradient(100deg, var(--wa-soft), var(--surface) 70%); box-shadow: var(--shadow); animation: wa-in .35s ease-out; }
.wa-panel.compact .wa-body, .wa-panel.compact .switch { display: none; }
.wa-panel.compact .wa-logo { width: 36px; height: 36px; border-radius: 50%; position: relative; }
.wa-panel.compact .wa-logo svg { width: 20px; height: 20px; }
.wa-panel.compact .wa-logo::after { content: "✓"; position: absolute; right: -3px; bottom: -3px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface); color: var(--wa); font-size: 11px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--wa-soft); }
.wa-panel.compact .wa-titles h2 { font-size: .95rem; color: color-mix(in srgb, var(--wa), var(--text) 35%); }
.wa-panel.compact .wa-titles p { font-variant-numeric: tabular-nums; }
.wa-panel.compact .wa-edit { color: color-mix(in srgb, var(--wa), var(--text) 30%); border-color: color-mix(in srgb, var(--wa), transparent 70%); background: var(--surface); }
@keyframes wa-in { from { opacity: .4; transform: translateY(-4px) scale(.99); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .wa-panel.compact { animation: none; } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@media (max-width: 900px) { .wa-body { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .wa-bubble, .ok-mark, .wa-panel.shake, .btn.sending svg { animation: none; } }

/* ---------- Ajustes: lugares en pestañas ---------- */
.places-editor { display: flex; flex-direction: column; gap: 12px; }
.place-tabs { align-self: flex-start; }
.place-tabs button { display: inline-flex; align-items: center; }
.types-list { display: grid; gap: 6px; }
.tl-head, .tl-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) 128px 128px 96px 34px; gap: 8px; align-items: center; }
.tl-head span { font-size: .72rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.tl-row input { padding: 8px 10px; }
.tl-code { text-align: center; font-weight: 700; text-transform: uppercase; }
.place-card > .btn { align-self: flex-start; }
.tl-badge { font-size: .85rem; font-weight: 600; color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tl-badge .night { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 99px; background: var(--b-soft); color: var(--b); font-size: .72rem; }
@media (max-width: 720px) {
  .tl-head { display: none; }
  .tl-row { grid-template-columns: 56px minmax(0, 1fr) minmax(0, 1fr) 34px; grid-template-areas: "code name name del" "start start end end" "badge badge badge badge";
    border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
  .tl-code { grid-area: code; } .tl-name { grid-area: name; } .tl-del { grid-area: del; }
  .tl-start { grid-area: start; } .tl-end { grid-area: end; } .tl-badge { grid-area: badge; }
  .tl-row input[type="time"] { padding: 8px 4px 8px 8px; font-size: .9rem; }
}
.backup .row { display: flex; flex-wrap: wrap; gap: 8px; }
.file-btn input { display: none; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: .9rem; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }


/* ---------- Subir cuadros ---------- */
.uploads { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.uploads-head { display: flex; align-items: center; gap: 4px 12px; margin-bottom: 12px; }
.up-titles { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.uploads-head h2 { font-size: .95rem; }
.uploads-head p { margin: 0; }
.up-logo { display: none; }
.up-edit, #upDone { flex: none; }
/* Cuadros del mes ya cargados: solo una franja con el resumen */
.uploads.compact { padding: 10px 12px 10px 10px; border-color: color-mix(in srgb, var(--a), transparent 65%);
  background: linear-gradient(100deg, var(--a-soft), var(--surface) 70%); animation: wa-in .35s ease-out; }
.uploads.compact .uploads-head { margin: 0; }
.uploads.compact .upload-tiles { display: none; }
.uploads.compact .up-logo { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--a); color: #fff; flex: none; position: relative; }
.uploads.compact .up-logo svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.uploads.compact .up-logo::after { content: "✓"; position: absolute; right: -3px; bottom: -3px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface); color: var(--a); font-size: 11px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--a-soft); }
.uploads.compact .up-titles { flex-direction: column; align-items: flex-start; gap: 3px; }
.uploads.compact h2 { color: color-mix(in srgb, var(--a), var(--text) 35%); }
.uploads.compact #uploadsHint { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.up-chip { display: inline-flex; align-items: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.uploads.compact .up-edit { color: color-mix(in srgb, var(--a), var(--text) 30%); border-color: color-mix(in srgb, var(--a), transparent 70%); background: var(--surface); }
@media (prefers-reduced-motion: reduce) { .uploads.compact { animation: none; } }
.upload-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { border: 1px solid var(--line); border-top: 3px solid var(--c); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; background: linear-gradient(var(--c-soft), var(--surface) 55%); }
.tile-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.tile-head > span:first-child { display: inline-flex; align-items: center; }
.tile .field input { background: var(--surface); }
.upload-btn { justify-content: center; position: relative; overflow: hidden; background: var(--c); border-color: var(--c); }
.upload-btn:hover { background: color-mix(in srgb, var(--c), #000 12%); }
.upload-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.upload-btn:focus-within { outline: 2px solid var(--c); outline-offset: 2px; }

.loading { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(15, 23, 42, .45); backdrop-filter: blur(2px); }
.loading[hidden] { display: none; }
.loading-card { display: flex; align-items: center; gap: 14px; background: var(--surface); border-radius: 16px; padding: 18px 22px; box-shadow: 0 24px 60px rgba(0, 0, 0, .25); margin: 16px; }
.loading-card p { margin: 0; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--a-soft); border-top-color: var(--a); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.5s; } }

/* ---------- Revisión de lo leído ---------- */
.im-h { font-size: .9rem; margin: 4px 0 8px; }
.codes { display: grid; gap: 6px; }
.code-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) minmax(0, 1.3fr); gap: 6px 10px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 10px; }
.code-row.skip { opacity: .65; }
.code-row select { padding: 7px 9px; }
.code-pill { display: inline-grid; place-items: center; min-width: 40px; height: 30px; padding: 0 6px; border-radius: 8px; background: var(--a-soft); color: var(--a); font-weight: 700; }
.code-desc { font-size: .85rem; min-width: 0; }
.new-type { grid-column: 2 / -1; display: grid; grid-template-columns: minmax(0, 1fr) 100px 100px; gap: 6px; }
.new-type input { padding: 6px 8px; }
.code-note { grid-column: 1 / -1; }
.cal-head.mini span { padding-bottom: 4px; font-size: .7rem; text-align: center; }
.im-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.im-day { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: 8px; padding: 4px; min-width: 0; cursor: text; }
.im-day span { font-size: .72rem; font-weight: 600; color: var(--muted); }
.im-day.red span { color: var(--hol); }
.im-day input { border: 0; background: transparent; padding: 2px 0; font-weight: 600; font-size: .9rem; text-transform: uppercase; min-width: 0; }
.im-day input:focus { box-shadow: none; }
.im-day:focus-within { border-color: var(--a); box-shadow: 0 0 0 2px color-mix(in srgb, var(--a), transparent 80%); }
.im-day.doubt { background: var(--hol-soft); border-color: var(--hol); }
.im-day.out { border-style: dashed; border-color: color-mix(in srgb, var(--line), transparent 40%); }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: .88rem; cursor: pointer; }
.check[hidden] { display: none; }
.check input { width: auto; margin-top: 3px; accent-color: var(--a); }
.callout { background: var(--surface-2); border: 1px solid var(--line); }
.callout + .callout { margin-top: 6px; }
.callout.bad { border-color: transparent; }
.callout.ok { border-color: transparent; }
.callout.warn { background: var(--hol-soft); border-color: transparent; }
.cands { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.form-error { margin: 0; color: var(--cross); font-size: .88rem; min-height: 1px; }
.form-error:empty { display: none; }

/* ---------- Entrada con PIN y administración ---------- */
.auth-page { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 28px 24px; display: flex; flex-direction: column; gap: 12px; text-align: center; }
.auth-card[hidden], .admin[hidden] { display: none; }
.link-btn { border: 0; background: none; padding: 0; color: var(--a); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.req-form { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.req-form[hidden], .req-done[hidden] { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.req-done { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.req-done p { margin: 0; }
.ok-big { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); margin-bottom: 6px; }
.ok-big svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.requests-panel { border-color: color-mix(in srgb, var(--hol), transparent 50%); background: linear-gradient(var(--hol-soft), var(--surface) 80px); }
.requests-panel[hidden] { display: none; }
.req-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.req-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.req-list li:first-child { border-top: 0; }
.req-list .who { flex: 1 1 220px; display: flex; flex-direction: column; }
.req-list .who small { color: var(--muted); }
.req-list .acts { display: flex; gap: 8px; }
.count-badge { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; background: var(--hol); color: #fff; font-size: .8rem; font-weight: 700; margin-left: 6px; vertical-align: 2px; }
.pin-reveal .wa-send { background: #25d366; border-color: #25d366; color: #fff; }
.auth-card h1 { font-size: 1.35rem; letter-spacing: -.01em; }
.auth-card p { margin: 0; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; text-align: left; }
.brand-mark.big { width: 52px; height: 52px; border-radius: 15px; margin: 0 auto 4px; }
.brand-mark.big svg { width: 26px; height: 26px; }
.brand-mark.dark { background: var(--text); color: var(--bg); }
.pin-boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.pin-boxes input { text-align: center; font-size: 1.5rem; font-weight: 700; padding: 10px 0; border-radius: 12px; font-variant-numeric: tabular-nums; }
.btn.block { width: 100%; justify-content: center; height: 44px; }
.btn:disabled { opacity: .6; cursor: default; }

.admin { width: min(980px, 100%); align-self: start; display: flex; flex-direction: column; gap: 16px; padding-top: 8px; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.admin-head h1 { font-size: 1.35rem; }
.admin-head p { margin: 2px 0 0; }
.add-user { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.add-user .field { flex: 1 1 260px; }
.add-user .btn { height: 41px; }
.pin-reveal { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; border-color: color-mix(in srgb, var(--ok), transparent 50%); background: var(--ok-soft); }
.pin-reveal[hidden] { display: none; }
.pin-reveal p { margin: 0; }
.pin-big { font-size: 2.2rem; font-weight: 700; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.users-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.users-table th { text-align: left; font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 0 8px 8px; }
.users-table td { padding: 10px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
.users-table tr.off td { color: var(--muted); }
.users-table .acts { text-align: right; min-width: 250px; }
.users-table .acts .btn { margin: 2px 0; }
.users-table .tag { max-width: none; }
.users-table .sub { display: block; font-size: .78rem; color: var(--muted); }
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: 10px; }
.sec-head h2 { font-size: 1.05rem; margin: 0; }
.sec-head p { margin: 0; }
.wa-stats { display: flex; flex-direction: column; gap: 12px; }
.wa-stats .sec-head { margin-bottom: -2px; }
.admin-stats .stat .big { font-size: 1.75rem; }
.admin-stats .delta { display: block; font-size: .8rem; font-weight: 600; margin-top: 2px; }
.admin-stats .delta.up { color: var(--cross); }
.admin-stats .delta.down { color: var(--ok); }
.chart-panel { padding: 14px 16px 10px; }
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.chart-head h3 { margin: 0; font-size: .8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.chart-legend { font-size: .78rem; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 8px; }
.lg.ok { background: var(--a); } .lg.bad { background: var(--cross); }
.chart { display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); align-items: end; gap: 3px; height: 120px; border-bottom: 1px solid var(--line); }
.chart .col { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; border-radius: 4px 4px 0 0; cursor: default; }
.chart .col:hover { background: var(--surface-2); }
.chart .col i { display: block; border-radius: 3px 3px 0 0; min-height: 0; }
.chart .col i.ok { background: var(--a); }
.chart .col i.bad { background: var(--cross); }
.chart .col.today i.ok { background: color-mix(in srgb, var(--a), #000 15%); }
.chart .col .tip { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); background: var(--text); color: var(--surface); font-size: .74rem; padding: 4px 7px; border-radius: 6px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; z-index: 2; }
.chart .col:hover .tip, .chart .col:focus .tip { opacity: 1; }
.chart .col:first-child .tip { left: 0; transform: none; }
.chart .col:last-child .tip { left: auto; right: 0; transform: none; }
.chart-axis { display: flex; justify-content: space-between; font-size: .74rem; color: var(--muted); padding-top: 6px; }
.chart-empty { grid-column: 1 / -1; align-self: center; text-align: center; color: var(--muted); font-size: .88rem; }
.recent { padding: 0; }
.recent summary { padding: 12px 16px; cursor: pointer; font-weight: 600; font-size: .92rem; }
.recent-list { list-style: none; margin: 0; padding: 0 16px 10px; }
.recent-list li { display: flex; align-items: baseline; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: .88rem; }
.recent-list li .when { margin-left: auto; color: var(--muted); font-size: .8rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.recent-list li .why { display: block; color: var(--cross); font-size: .8rem; }
@media (max-width: 720px) {
  .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart { gap: 2px; height: 96px; }
}

/* Pantallas medianas */
@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .next-card { grid-column: 1 / -1; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Celular: secciones en pestañas, barra inferior, hojas que suben desde abajo */
@media (max-width: 720px) {
  body { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .top { grid-template-columns: auto 1fr auto; height: 58px; padding: 0 14px; gap: 10px; }
  .brand strong, #printBtn, #settingsBtn, .acct-name, .acct-btn > svg { display: none; }
  .month-nav { justify-self: center; }
  .month-nav h1 { min-width: 116px; font-size: .9rem; }
  .today-btn { padding: 0 10px; }
  .acct { margin: 0; }
  .acct-btn { padding: 0; border: 0; height: 40px; background: none; }
  .avatar { width: 38px; height: 38px; font-size: .82rem; }
  .layout { display: flex; flex-direction: column; align-items: stretch; padding: 16px 16px 24px; gap: 14px; }
  .content, .side { display: contents; }
  .hello { order: -3; }
  .next-card { order: -2; }
  .hello h2 { font-size: 1.6rem; }
  .view-seg { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .mobile-only { display: block; }
  body[data-tab="cuadro"] [data-tabs]:not([data-tabs~="cuadro"]),
  body[data-tab="resumen"] [data-tabs]:not([data-tabs~="resumen"]),
  body[data-tab="cambios"] [data-tabs]:not([data-tabs~="cambios"]),
  body[data-tab="ajustes"] [data-tabs]:not([data-tabs~="ajustes"]) { display: none !important; }
  .tabbar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface), transparent 6%);
    backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-top: 1px solid var(--line); }
  .tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 52px; justify-content: center; border: 0; background: none; color: var(--muted); font-size: .7rem; font-weight: 500; cursor: pointer; }
  .tabbar button svg { width: 23px; height: 23px; }
  .tabbar button.on { color: var(--a); font-weight: 600; }
  .tab-badge { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--cross); color: #fff; font-size: .66rem; font-weight: 700; display: grid; place-items: center; }
  .fab { display: grid; place-items: center; position: fixed; right: 18px; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 24; width: 56px; height: 56px; border-radius: 18px; border: 0; background: var(--a); color: #fff; box-shadow: 0 14px 28px -10px color-mix(in srgb, var(--a), transparent 25%); cursor: pointer; }
  .fab svg { width: 24px; height: 24px; stroke-width: 2.4; }
  body:not([data-tab="cuadro"]) .fab { display: none; }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { padding: 16px; }
  .metric:nth-child(2n) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line-2); }
  .metric .big { font-size: 1.9rem; }
  .board { padding: 12px; }
  .toolbar { gap: 8px; }
  .cal-head span { padding: 0 0 6px; font-size: .64rem; text-align: center; }
  .calendar { border-radius: 12px; }
  .day { min-height: 66px; padding: 5px 3px; gap: 3px; }
  .hol, .chip .time, .chip .with { display: none; }
  .chip { justify-content: center; padding: 3px 0; font-size: .72rem; border-radius: 6px; }
  .chip::before { display: none; }
  .day.today .num { width: 22px; height: 22px; }
  .num { font-size: .76rem; padding: 0; text-align: center; }
  .day-head { justify-content: center; min-height: 22px; }
  .agenda { padding: 4px 14px; }
  .status-card { padding: 4px 16px; }
  .stat .big { font-size: 1.6rem; }
  .dialog, .dialog.wide { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 26px 26px 0 0; border: 0; max-height: 94dvh; animation: sheet-up .28s cubic-bezier(.2, .9, .3, 1); }
  .dialog form { padding: 10px 18px calc(18px + env(safe-area-inset-bottom)); }
  .dialog form::before { content: ""; width: 40px; height: 5px; border-radius: 99px; background: var(--line); align-self: center; margin-bottom: 4px; }
  .dialog-foot .btn { height: 50px; border-radius: 14px; }
  .dialog-foot .btn.primary { flex: 1; justify-content: center; }
  .toast { bottom: calc(92px + env(safe-area-inset-bottom)); }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .dialog { animation: none !important; } }
@media (max-width: 400px) {
  .stats { gap: 8px; }
  .stat { padding: 12px; }
}

@media (max-width: 720px) {
  .upload-tiles { grid-template-columns: 1fr; }
  .code-row { grid-template-columns: 46px minmax(0, 1fr); }
  .code-row select { grid-column: 1 / -1; }
  .new-type { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
  .new-type input:first-child { grid-column: 1 / -1; }
  .im-day input { font-size: .8rem; }
  .users-table thead { display: none; }
  .users-table tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 10px 0; border-top: 1px solid var(--line); }
  .users-table td { border: 0; padding: 0; }
  .users-table td[data-l="Plan"] { grid-column: 1 / -1; padding: 6px 0 4px; }
  .users-table td[data-l="Plan"] .plan-cell { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; }
  .users-table td[data-l="Último ingreso"], .users-table td[data-l="Este mes"] { grid-column: 1 / -1; font-size: .8rem; color: var(--muted); }
  .users-table td[data-l="Este mes"] .sub { display: inline; }
  .users-table td[data-l="Este mes"] .sub::before { content: " · "; }
  .users-table td[data-l="Último ingreso"]::before { content: "Último ingreso: "; }
  .users-table td[data-l="Este mes"]::before { content: "Este mes: "; }
  .users-table td[data-l="WhatsApp"] { grid-column: 1 / -1; }
  .users-table .acts { grid-column: 1 / -1; text-align: left; white-space: normal; padding-top: 6px; }
}

/* Impresión: el cuadro final en una hoja horizontal */
@media print {
  @page { size: landscape; margin: 10mm; }
  :root { --bg: #fff; --surface: #fff; --surface-2: #fff; --shadow: none; color-scheme: light; }
  body { font-size: 11px; padding: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .top { position: static; display: flex; height: auto; border: 0; padding: 0 0 8px; backdrop-filter: none; background: none; }
  .top-actions, .month-nav button, .toolbar, .reminders, .setup-slot, .hello, .mode-chooser, .agenda, .next-card, #weekCard, .status-card,
  .mobile-only, #crossPanel, .tabbar, .fab, .toast { display: none !important; }
  .month-nav { background: none; }
  #board[hidden] { display: block !important; }
  .layout { display: block; padding: 0; }
  .content, .side { display: block; position: static; }
  .summary { margin-bottom: 8px; box-shadow: none; }
  .metric { padding: 8px 12px; }
  .metric .big { font-size: 1.4rem; }
  .board { border: 0; padding: 0; box-shadow: none; }
  .day { min-height: 70px; break-inside: avoid; }
  .side { margin-top: 10px; }
  .panel { border: 0; padding: 0; box-shadow: none; }
}
a.btn { text-decoration: none; }
.nw { white-space: nowrap; }
.nc-body { display: block; width: 100%; border: 0; padding: 0; margin: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.nc-body:focus-visible { outline-color: #8fa8f7; }

/* ---------- Entrada: fondo tinta, mensaje arriba y el PIN en una hoja blanca ---------- */
.auth-page.entrar { --ink-bg: #0b1220; background: var(--ink-bg); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 40px 16px; }
.entrar .auth-hero { width: min(420px, 100%); display: flex; flex-direction: column; gap: 10px; }
.entrar .auth-hero .brand-mark.big { margin: 0 0 10px; width: 56px; height: 56px; border-radius: 16px; box-shadow: 0 14px 30px -12px rgba(47, 91, 234, .8); }
.entrar .auth-hero .brand-mark.big svg { width: 28px; height: 28px; stroke-width: 2.4; }
.hero-kicker { margin: 0; font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #98a2b3; }
.hero-title { margin: 0; font-family: var(--display); font-size: 2.2rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.08; }
.hero-sub { margin: 4px 0 0; font-size: .95rem; line-height: 1.5; color: #98a2b3; }
.entrar .auth-card { width: min(420px, 100%); text-align: left; border: 0; border-radius: 24px; padding: 26px 24px 28px; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .6); color: var(--text); gap: 10px; }
.entrar .auth-card h1 { font-family: var(--display); font-size: 1.3rem; font-weight: 700; }
.entrar .auth-card > .muted.small { text-align: center; margin-top: 4px; }
.entrar .pin-boxes { gap: 8px; }
.entrar .pin-boxes input { height: 58px; border-radius: 14px; font-size: 1.5rem; }
.entrar .pin-boxes input:focus { border: 2px solid var(--a); background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--a), transparent 82%); }
.entrar .btn.block { height: 52px; border-radius: 16px; font-size: 1rem; }
.entrar .req-done { text-align: center; }
@media (max-width: 720px) {
  .auth-page.entrar { justify-content: flex-start; padding: 0; gap: 0; min-height: 100dvh; }
  .entrar .auth-hero { padding: calc(64px + env(safe-area-inset-top)) 28px 32px; }
  .entrar .auth-card { margin-top: auto; width: 100%; border-radius: 28px 28px 0 0; padding: 28px 22px calc(32px + env(safe-area-inset-bottom)); }
  .hero-title { font-size: 2.1rem; }
}
/* Panel de administración: los botones de cada fila conservan su borde */
.admin .btn.ghost { border-color: var(--line); background: var(--surface); }
.admin .btn.ghost:hover { background: var(--surface-2); }

/* ---------- Cuenta congelada (mensualidad vencida) ---------- */
.acct-menu-plan { margin: -4px 0 4px; padding: 0 10px 10px; font-size: .78rem; color: var(--muted); border-bottom: 1px solid var(--line-2); }
.acct-menu-name:has(+ .acct-menu-plan:not([hidden])) { border-bottom: 0; padding-bottom: 6px; }
body.is-frozen { overflow: hidden; }
body.is-frozen > :not(.frozen):not(.toast) { filter: blur(6px); pointer-events: none; user-select: none; }
.frozen { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px 16px; background: color-mix(in srgb, var(--ink), transparent 30%); overflow-y: auto; }
.frozen[hidden] { display: none; }
.frozen-card { width: min(420px, 100%); background: var(--surface); color: var(--text); border-radius: 24px; padding: 28px 24px 20px; box-shadow: 0 30px 60px -20px rgba(11, 18, 32, .5); display: flex; flex-direction: column; gap: 12px; text-align: center; }
.frozen-icon { width: 56px; height: 56px; margin: 0 auto 4px; border-radius: 16px; display: grid; place-items: center; background: var(--hol-soft); color: var(--hol); }
.frozen-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.frozen-card h1 { margin: 0; font-family: var(--display); font-size: 1.5rem; letter-spacing: -.02em; }
.frozen-card p { margin: 0; line-height: 1.5; }
.frozen-price { display: flex; align-items: baseline; justify-content: center; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); margin-top: 4px; }
.frozen-price span { font-weight: 600; color: var(--muted); font-size: .9rem; }
.frozen-price b { font-family: var(--display); font-size: 1.6rem; letter-spacing: -.02em; }
.frozen-price small { color: var(--muted); }
.frozen-safe { display: flex; gap: 8px; align-items: flex-start; text-align: left; font-size: .86rem; color: var(--ok); background: var(--ok-soft); border-radius: 12px; padding: 10px 12px; }
.frozen-safe svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-top: 1px; }
.frozen .btn.block { width: 100%; justify-content: center; height: 50px; }
.frozen-out { border: 0; background: none; color: var(--muted); font: inherit; font-size: .9rem; cursor: pointer; padding: 8px; }
.frozen-out:hover { color: var(--text); }
@media (max-width: 720px) {
  .frozen { place-items: end center; padding: 0; }
  .frozen-card { border-radius: 28px 28px 0 0; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
}

/* ---------- Panel: mensualidades ---------- */
.plan-cell { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.plan-select { min-width: 160px; height: 32px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text); font: inherit; font-size: .85rem; padding: 0 8px; }
.tag.warn { background: var(--hol-soft); color: var(--hol); }
.users-table .sub.cargo { display: block; }
.toast.show:has(.toast-undo) { pointer-events: auto; }
.toast-undo { margin-left: 10px; border: 0; background: none; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; padding: 0; }

/* ---------- Panel: avisos push ---------- */
.head-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.btn.bell { display: inline-flex; align-items: center; gap: 6px; }
.btn.bell svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn.bell.on { color: var(--ok); border-color: color-mix(in srgb, var(--ok), transparent 60%); background: var(--ok-soft); }
.push-hint { margin: -8px 0 16px; padding: 10px 14px; border-radius: 12px; background: var(--a-soft); color: var(--a-ink); font-size: .86rem; line-height: 1.45; }

/* =====================================================================
   Panel de administración (rediseño premium)
   ===================================================================== */
.adm-page { background: var(--bg); }
.adm[hidden] { display: none; }
.adm { min-height: 100vh; min-height: 100dvh; display: flex; align-items: stretch; }

/* Menú lateral oscuro */
.adm-nav { position: sticky; top: 0; align-self: flex-start; height: 100vh; height: 100dvh; width: 248px; flex: none; box-sizing: border-box; padding: 22px 14px; background: #0b1220; color: #fff; display: flex; flex-direction: column; gap: 4px; }
.adm-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 22px; }
.adm-brand .brand-mark { width: 36px; height: 36px; border-radius: 11px; }
.adm-brand b { display: block; font-size: .95rem; }
.adm-brand small { display: block; font-size: .75rem; color: #98a2b3; }
.adm-link { display: flex; align-items: center; gap: 12px; width: 100%; height: 44px; padding: 0 12px; border: 0; border-radius: 12px; background: transparent; color: #d0d5dd; font: inherit; font-size: .9rem; font-weight: 500; cursor: pointer; text-align: left; }
.adm-link svg { width: 19px; height: 19px; stroke-width: 2; }
.adm-link span { flex: 1; }
.adm-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.adm-link.on { background: rgba(255, 255, 255, .1); color: #fff; font-weight: 600; }
.adm-link:focus-visible, .push-toggle:focus-visible { outline: 2px solid #8fa8f7; outline-offset: 2px; }
.adm-badge { min-width: 20px; height: 20px; padding: 0 6px; box-sizing: border-box; border-radius: 999px; background: #f04438; color: #fff; font-size: .72rem; font-weight: 700; font-style: normal; display: inline-grid; place-items: center; }
.adm-badge[hidden] { display: none; }
.adm-nav-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 20px; }
.push-toggle { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 14px; background: transparent; color: #d0d5dd; font: inherit; font-size: .84rem; font-weight: 600; cursor: pointer; text-align: left; }
.push-toggle[hidden] { display: none; }
.push-toggle.on { border-color: transparent; background: rgba(18, 183, 106, .14); color: #75e0a7; }
.push-toggle.round { display: none; }

/* Contenido */
.adm-main { flex: 1; min-width: 0; box-sizing: border-box; padding: 32px 40px 56px; display: flex; flex-direction: column; gap: 22px; max-width: 1240px; }
.adm-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.adm-date { margin: 0; font-size: .9rem; color: var(--muted); }
.adm-head h1 { margin: 4px 0 0; font-family: var(--display); font-size: 2rem; font-weight: 700; letter-spacing: -.02em; }
.adm-head-acts { display: flex; align-items: center; gap: 10px; }
.add-btn { height: 44px; padding: 0 18px; }
.add-btn svg, .add-inline svg { stroke-width: 2.4; }
.push-hint { margin: -6px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--a-soft); color: var(--a-ink); font-size: .86rem; line-height: 1.45; }

/* Cifras de arriba */
.adm-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi-dark { grid-column: span 2; background: #0b1220; color: #fff; border-radius: 22px; padding: 22px 24px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 20px 40px -24px rgba(11, 18, 32, .7); }
.kpi-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.kpi-dark h2 { margin: 0; font-size: .76rem; font-weight: 600; color: #98a2b3; letter-spacing: .06em; text-transform: uppercase; }
.kpi-chip { font-size: .74rem; font-weight: 600; color: #fec84b; background: rgba(247, 144, 9, .14); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.kpi-money { margin: 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.kpi-money b { font-family: var(--display); font-size: 2.6rem; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.kpi-money span { font-size: .92rem; color: #98a2b3; }
.kpi-bar { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.kpi-bar i { display: block; height: 100%; border-radius: 999px; background: #2f5bea; }
.kpi-dark .kpi-foot { color: #d0d5dd; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 20px 22px; display: flex; flex-direction: column; gap: 6px; }
.kpi h2 { margin: 0; font-size: .82rem; font-weight: 600; color: var(--muted); }
.kpi-num { margin: 0; font-family: var(--display); font-size: 2.3rem; font-weight: 700; line-height: 1.1; }
.kpi-foot { margin: auto 0 0; font-size: .82rem; color: var(--muted); }
.kpi-foot.bad { color: var(--cross); font-weight: 600; }
.kpi-spark { display: flex; align-items: flex-end; gap: 3px; height: 28px; margin-top: auto; }
.kpi-spark i { flex: 1; border-radius: 3px; background: var(--a); }
.kpi-spark i.zero { background: var(--line); }

/* Columnas y tarjetas */
.adm-cols { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; }
.adm-col-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.adm-col-side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.adm-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 6px 22px 12px; scroll-margin-top: 24px; }
.adm-section { display: flex; flex-direction: column; gap: 14px; scroll-margin-top: 24px; }
.adm-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 0 8px; }
.adm-card-head h2 { margin: 0; font-size: 1.05rem; font-weight: 700; }

/* Requiere tu atención */
.att-list, .staff-list { list-style: none; margin: 0; padding: 0; }
.att { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.att-ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none; font-weight: 700; font-size: .85rem; }
.att-ico svg { width: 20px; height: 20px; stroke-width: 2; }
.att-ico.req { background: var(--a-soft); color: var(--a-ink); }
.att-ico.warn { background: var(--hol-soft); color: var(--hol); }
.att-ico.bad { background: var(--cross-soft); color: var(--cross); }
.att-txt { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.att-txt b { font-size: .95rem; }
.att-txt small { font-size: .82rem; color: var(--muted); }
.att-acts { display: flex; gap: 8px; }
.att-acts .btn { height: 40px; }
.danger-txt { color: var(--cross); }
.att-empty { display: flex; align-items: center; gap: 14px; padding: 18px 0 12px; border-top: 1px solid var(--line-2); }
.att-empty div { display: flex; flex-direction: column; gap: 2px; }
.att-empty small { color: var(--muted); font-size: .84rem; }
.ok-icon { width: 56px; height: 56px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; flex: none; }
.ok-icon svg { width: 28px; height: 28px; stroke-width: 2.4; }
.ok-icon.small { width: 44px; height: 44px; }
.ok-icon.small svg { width: 22px; height: 22px; }

/* Personal */
.adm-seg { display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 3px; }
.adm-seg button { height: 32px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; font: inherit; font-size: .8rem; font-weight: 500; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.adm-seg button span { color: var(--muted); margin-left: 2px; }
.adm-seg button[aria-selected="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(16, 24, 40, .1); }
.staff-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 13px 8px; margin: 0 -8px; box-sizing: content-box; border: 0; border-top: 1px solid var(--line-2); border-radius: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background .15s; }
.staff-list li:first-child .staff-row { border-top-color: transparent; }
.staff-row:hover { background: var(--surface-2); border-radius: 12px; }
.staff-row.off { opacity: .65; }
.av { width: 40px; height: 40px; border-radius: 999px; display: grid; place-items: center; flex: none; font-weight: 700; font-size: .82rem; background: var(--a-soft); color: var(--a-ink); }
.av[data-tone="1"] { background: var(--b-soft); color: var(--b-ink); }
.av[data-tone="2"] { background: var(--ok-soft); color: var(--ok); }
.av[data-tone="3"] { background: var(--hol-soft); color: var(--hol); }
.av.big { width: 56px; height: 56px; font-family: var(--display); font-size: 1.2rem; }
.staff-row .who { flex: 1 1 180px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.staff-row .who b { font-size: .95rem; }
.staff-row .who small { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.staff-row .plan { flex: 0 0 150px; font-size: .84rem; color: var(--text-2); }
.staff-row .state { flex: 0 0 170px; }
.staff-row .wa { flex: 0 0 116px; display: flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); }
.staff-row .more { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 11px; display: grid; place-items: center; color: var(--muted); flex: none; }
.staff-row .more circle { fill: currentColor; }
.dot-s { width: 8px; height: 8px; border-radius: 999px; background: var(--line); flex: none; }
.dot-s.on { background: #12b76a; }
.pill { display: inline-block; font-style: normal; font-size: .74rem; font-weight: 600; border-radius: 999px; padding: 4px 10px; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--hol-soft); color: var(--hol); }
.pill.bad { background: var(--cross-soft); color: var(--cross); }
.add-inline { display: none; }

/* Mensualidades (columna lateral) */
.pay-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pay-grid div { border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.pay-grid small { font-size: .76rem; color: var(--muted); }
.pay-grid b { font-family: var(--display); font-size: 1.35rem; font-weight: 700; }
.pay-grid span { font-size: .74rem; color: var(--muted); }
.pay-grid .bad { border-color: color-mix(in srgb, var(--cross), transparent 60%); background: var(--cross-soft); }
.pay-grid .bad b { color: var(--cross); }
.pay-grid .warn b { color: var(--hol); }
#payStats > .muted { margin: 12px 0 6px; line-height: 1.45; }
.plan-list { margin: 0; padding-bottom: 6px; display: flex; flex-direction: column; }
.plan-list div { display: flex; justify-content: space-between; padding: 9px 0; font-size: .9rem; }
.plan-list dt { color: var(--text-2); }
.plan-list dd { margin: 0; font-weight: 700; }
.plan-list .sep { border-top: 1px solid var(--line-2); margin-top: 4px; padding-top: 13px; }
.adm-card .recent-list { padding: 0 0 6px; }
.adm-card .recent-list li:first-child { border-top: 0; }
.pay-empty { display: block !important; border: 1px dashed var(--line) !important; border-radius: 16px; padding: 18px 14px !important; text-align: center; color: var(--muted); line-height: 1.5; margin: 4px 0 8px; }

/* Hojas: ficha de la persona, acceso listo, dar acceso */
.sheet-body { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.pd-head { display: flex; align-items: center; gap: 14px; }
.pd-head > div { flex: 1; min-width: 0; }
.pd-head h2 { margin: 0; font-family: var(--display); font-size: 1.35rem; font-weight: 700; }
.pd-head p { margin: 2px 0 0; font-size: .88rem; color: var(--muted); }
.icon-close { width: 44px; height: 44px; border-radius: 999px; border: 0; background: var(--surface-2); color: var(--text-2); display: grid; place-items: center; cursor: pointer; flex: none; }
.pd-money { border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.pd-money.warn { background: var(--hol-soft); border-color: color-mix(in srgb, var(--hol), transparent 60%); }
.pd-money.bad { background: var(--cross-soft); border-color: color-mix(in srgb, var(--cross), transparent 60%); }
.pd-money.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok), transparent 70%); }
.pd-row { display: flex; justify-content: space-between; gap: 10px; font-size: .82rem; font-weight: 600; color: var(--text-2); }
.pd-money.warn .pd-row { color: var(--hol); }
.pd-money.bad .pd-row { color: var(--cross); }
.pd-money.ok .pd-row { color: var(--ok); }
.pd-price { margin: 0; font-family: var(--display); font-size: 2rem; font-weight: 700; letter-spacing: -.01em; }
.pd-price small { font-family: Inter, sans-serif; font-size: .88rem; font-weight: 500; color: var(--muted); }
.pd-note { margin: 0; font-size: .8rem; text-align: center; color: var(--text-2); }
.btn.big { height: 52px; border-radius: 14px; font-size: 1rem; }
.btn.big svg { stroke-width: 2.4; }
.pd-block { display: flex; flex-direction: column; gap: 8px; }
.pd-label { font-size: .88rem; font-weight: 600; }
.plan-pick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 14px; padding: 4px; }
.plan-pick button { min-height: 48px; border: 0; border-radius: 10px; background: transparent; font: inherit; font-size: .8rem; font-weight: 500; color: var(--text-2); display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; }
.plan-pick small { font-size: .72rem; color: var(--muted); }
.plan-pick button[aria-checked="true"] { background: var(--surface); color: var(--text); font-weight: 700; box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }
.plan-pick button[aria-checked="true"] small { color: var(--a); font-weight: 600; }
.pd-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pd-tiles div { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pd-tiles small { font-size: .72rem; color: var(--muted); }
.pd-tiles b { font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-tiles b.ok { color: var(--ok); }
.pd-actions { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.pd-actions button { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 0 14px; border: 0; border-top: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: inherit; font-size: .92rem; font-weight: 500; cursor: pointer; text-align: left; }
.pd-actions button:first-child { border-top: 0; }
.pd-actions button:hover { background: var(--surface-2); }
.pd-actions button svg { color: var(--muted); }
.pd-actions .danger, .pd-actions .danger svg { color: var(--cross); }
.ok-head { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.ok-head h2 { margin: 0; font-family: var(--display); font-size: 1.45rem; font-weight: 700; }
.ok-head p { margin: 0; font-size: .88rem; }
.pin-box { border-radius: 18px; background: var(--surface-2); padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pin-box span { font-size: .72rem; font-weight: 600; letter-spacing: .08em; color: var(--muted); }
.pin-box b { font-family: var(--display); font-size: 2.4rem; font-weight: 700; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.pin-box small { font-size: .76rem; color: var(--muted); }
.wa-preview { display: flex; flex-direction: column; gap: 6px; }
.wa-bubble-msg { margin: 0; max-height: 150px; overflow-y: auto; background: #e7f8ee; color: #0b1220; border-radius: 16px 16px 16px 4px; padding: 12px 14px; font-size: .82rem; line-height: 1.5; white-space: pre-line; }
.pin-actions { display: flex; flex-direction: column; gap: 10px; }
.pin-actions .two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pin-actions .btn.block { height: 48px; border-radius: 14px; justify-content: center; }
.btn.wa-send { background: #25d366; border-color: #25d366; color: #0b1220; font-weight: 700; }
.btn.wa-send:hover { background: #1fbf5b; }
.btn.wa-send[hidden] { display: none; }
.btn.soft { background: var(--surface-2); }
#personDialog, #pinDialog { width: min(460px, calc(100vw - 32px)); }

/* Entrada del administrador (usa el estilo oscuro de la entrada de usuarios) */
.brand-mark.glass { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); box-shadow: none !important; }
.entrar .auth-hero[hidden], .entrar .auth-card[hidden] { display: none; }
.pass-wrap { display: flex; align-items: center; position: relative; }
.pass-wrap input { padding-right: 52px; height: 52px; border-radius: 14px; font-size: 1rem; }
.pass-wrap input:focus { border: 2px solid var(--a); background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--a), transparent 82%); outline: 0; }
.pass-eye { position: absolute; right: 6px; width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.pass-eye[aria-pressed="true"] { color: var(--a); }

/* Barra inferior del panel (celular) */
.adm-tabbar { display: none; }

@media (max-width: 1100px) {
  .adm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .staff-row .wa { display: none; }
}
@media (max-width: 900px) {
  .staff-row .plan { display: none; }
}
@media (max-width: 720px) {
  .adm-nav { display: none; }
  .adm-main { padding: calc(20px + env(safe-area-inset-top)) 16px calc(110px + env(safe-area-inset-bottom)); gap: 16px; }
  .adm-head { align-items: center; flex-wrap: nowrap; }
  .adm-head h1 { font-size: 1.6rem; }
  .adm-date { font-size: .82rem; }
  .add-btn { width: 44px; padding: 0; justify-content: center; border-radius: 999px; }
  .add-btn span { display: none; }
  .push-toggle.round:not([hidden]) { display: grid; place-items: center; width: 44px; height: 44px; min-height: 0; padding: 0; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); }
  .push-toggle.round.on { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
  .push-toggle.round .push-label { display: none; }
  .push-toggle.round svg { width: 20px; height: 20px; stroke-width: 2; }
  .adm-kpis { gap: 10px; }
  .kpi-dark { padding: 18px 20px; border-radius: 20px; }
  .kpi-money b { font-size: 2.2rem; }
  .kpi { padding: 14px 16px; border-radius: 18px; }
  .kpi-num { font-size: 1.8rem; }
  .adm-card { padding: 4px 16px 10px; border-radius: 20px; }
  .adm-cols, .adm-col-main, .adm-col-side { gap: 16px; }
  .att-acts { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .att-acts .btn { height: 44px; justify-content: center; }
  .att-acts .btn:only-child { grid-column: 1 / -1; }
  .staff-row .state { flex: none; }
  .staff-row .who { flex: 1 1 0; }
  .staff-row .state .pill { font-size: .7rem; padding: 4px 8px; }
  .staff-row .more { display: none; }
  .add-inline { display: flex; margin: 10px 0 6px; height: 48px; border-radius: 14px; justify-content: center; }
  .adm-tabbar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface), transparent 6%); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-top: 1px solid var(--line); }
  .adm-tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 48px; border: 0; background: none; color: var(--muted); font: inherit; font-size: .7rem; font-weight: 500; cursor: pointer; }
  .adm-tabbar button svg { width: 23px; height: 23px; }
  .adm-tabbar button.on { color: var(--a); font-weight: 600; }
  .adm-tabbar .adm-badge { position: absolute; top: -2px; left: calc(50% + 6px); }
  body.adm-page[data-tab="inicio"] [data-tabs]:not([data-tabs~="inicio"]),
  body.adm-page[data-tab="personal"] [data-tabs]:not([data-tabs~="personal"]),
  body.adm-page[data-tab="cobros"] [data-tabs]:not([data-tabs~="cobros"]),
  body.adm-page[data-tab="avisos"] [data-tabs]:not([data-tabs~="avisos"]) { display: none !important; }
  body.adm-page:not([data-tab="inicio"]) .push-hint { display: none; }
  .sheet-body { padding: 10px 18px calc(22px + env(safe-area-inset-bottom)); }
  .sheet-body::before { content: ""; width: 40px; height: 5px; border-radius: 99px; background: var(--line); align-self: center; }
  #personDialog, #pinDialog { width: 100%; }
  .plan-pick button { font-size: .74rem; }
}
.pay-grid { gap: 8px; }
.pay-grid div { padding: 10px 12px; }
.pay-grid b { font-size: 1.2rem; }
.pay-grid small, .pay-grid span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
