:root {
  --bg: #f4f5f9;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --border: #e3e5ee;
  --text: #171a29;
  --muted: #646a82;
  --accent: #4f46e5;
  --accent-ink: #ffffff;
  --accent-soft: #eceafe;
  --ok: #0f8a5f;
  --ok-soft: #e3f6ee;
  --warn: #a15c00;
  --warn-soft: #fff3dd;
  --err: #c0262d;
  --err-soft: #fde8e8;
  --info-soft: #e7f0ff;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 22, 40, .06), 0 2px 8px rgba(20, 22, 40, .04);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1018;
    --surface: #181a25;
    --surface-2: #1e2130;
    --border: #2b2f42;
    --text: #eceef6;
    --muted: #9aa0b8;
    --accent: #8b84ff;
    --accent-ink: #11121a;
    --accent-soft: #26244a;
    --ok: #4fd1a1;
    --ok-soft: #12302a;
    --warn: #f3b453;
    --warn-soft: #33270f;
    --err: #ff7b80;
    --err-soft: #3a1719;
    --info-soft: #172440;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); -webkit-text-size-adjust: 100%; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: 1rem; }
p { margin: .25rem 0 .75rem; }
.boot { padding: 2rem; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: .75rem; padding: .55rem 1rem; padding-top: max(.55rem, env(safe-area-inset-top));
}
.brand { font-weight: 700; display: flex; align-items: center; gap: .5rem; white-space: nowrap; text-decoration: none; color: var(--text); }
.brand .logo { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; color: var(--accent-ink); font-size: 16px; }
.nav { display: flex; gap: .15rem; overflow-x: auto; flex: 1; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { padding: .45rem .7rem; border-radius: 8px; text-decoration: none; color: var(--muted); white-space: nowrap; font-weight: 500; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.user { display: flex; align-items: center; gap: .5rem; white-space: nowrap; }
.user .name { color: var(--muted); font-size: .85rem; }
main { max-width: 1180px; margin: 0 auto; padding: 1.1rem 1rem 4rem; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.page-head p { margin: 0; }
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; }
  .nav { order: 3; flex-basis: 100%; }
  .user .name { display: none; }
  main { padding: .9rem .75rem 5rem; }
}

/* ---------- componentes ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; margin-bottom: 1rem; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .75rem; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 1rem; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem .9rem; box-shadow: var(--shadow); }
.kpi .label { color: var(--muted); font-size: .8rem; }
.kpi .value { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: .15rem; }
.kpi .sub { color: var(--muted); font-size: .78rem; }
.kpi.good .value { color: var(--ok); }
.kpi.bad .value { color: var(--err); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); padding: .5rem .85rem; border-radius: 9px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--err); }
.btn.small { padding: .3rem .6rem; font-size: .85rem; }
.btn.ghost { border-color: transparent; background: transparent; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

label.field { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; color: var(--muted); font-weight: 500; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: .5rem .6rem; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
input[type="number"] { font-variant-numeric: tabular-nums; }
.form-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; margin-bottom: .75rem; }
.form-row > .field { flex: 1 1 140px; }
.form-row > .field.grow { flex: 3 1 220px; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -1rem; padding: 0 1rem; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: .5rem .55rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .02em; background: var(--surface); position: sticky; top: 0; }
tbody tr:hover { background: var(--surface-2); }
tfoot td { font-weight: 700; border-top: 2px solid var(--border); border-bottom: none; }
td input { width: 100%; padding: .35rem .45rem; }
td input.qty { max-width: 92px; text-align: right; }
td input.money { max-width: 130px; text-align: right; }

.badge { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.err { background: var(--err-soft); color: var(--err); border-color: transparent; }
.badge.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pos { color: var(--ok); }
.neg { color: var(--err); }

.alert { border-radius: 10px; padding: .6rem .8rem; margin-bottom: .5rem; font-size: .9rem; background: var(--info-soft); }
.alert.warn { background: var(--warn-soft); }
.alert.error { background: var(--err-soft); }
.alert.ok { background: var(--ok-soft); }

.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { background: none; border: none; border-bottom: 2px solid transparent; padding: .55rem .8rem; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.tabs .count { margin-left: .3rem; }

.empty { text-align: center; color: var(--muted); padding: 1.5rem 1rem; }
.list-links { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.tile { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .85rem 1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); text-decoration: none; color: var(--text); box-shadow: var(--shadow); }
.tile:hover { border-color: var(--accent); }
.tile strong { display: block; }

/* barras horizontales simples */
.bars-chart { display: grid; gap: .45rem; }
.bars-chart .row { display: grid; grid-template-columns: minmax(90px, 160px) 1fr auto; gap: .6rem; align-items: center; font-size: .88rem; }
.bars-chart .track, .bars-chart .fill { display: block; }
.bars-chart .track { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.bars-chart .fill { height: 100%; background: var(--accent); border-radius: 999px; }

/* conteo (celular) */
.count-toolbar { position: sticky; top: 52px; z-index: 10; background: var(--bg); padding: .5rem 0; display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.count-toolbar input[type="search"] { flex: 1 1 200px; }
.count-list { display: grid; gap: .5rem; }
.count-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .65rem .75rem; }
.count-item.neg { border-color: var(--err); background: var(--err-soft); }
.count-item.done { border-left: 4px solid var(--ok); }
.count-item .title { display: flex; justify-content: space-between; gap: .5rem; font-weight: 600; margin-bottom: .45rem; }
.count-item .fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; }
.count-item .fields label { font-size: .72rem; color: var(--muted); display: flex; flex-direction: column; gap: .15rem; }
.count-item .fields input { width: 100%; padding: .55rem .4rem; text-align: center; font-size: 1rem; }
.count-item .fields input.closing { border-color: var(--accent); font-weight: 700; }
.count-item .meta { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); margin-top: .35rem; }
.savebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--border); padding: .6rem 1rem; padding-bottom: max(.6rem, env(safe-area-inset-bottom)); display: flex; gap: .75rem; align-items: center; justify-content: space-between; }
.savebar .status { color: var(--muted); font-size: .85rem; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login .card { width: min(380px, 100%); padding: 1.5rem; }
.login .brand { margin-bottom: 1rem; font-size: 1.15rem; }

/* toasts y modal */
#toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 100; display: grid; gap: .5rem; max-width: min(380px, calc(100vw - 2rem)); }
.toast { background: var(--text); color: var(--bg); padding: .65rem .9rem; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.2); font-size: .9rem; }
.toast.error { background: var(--err); color: #fff; }
dialog { border: 1px solid var(--border); border-radius: 14px; padding: 0; background: var(--surface); color: var(--text); width: min(560px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); }
dialog::backdrop { background: rgba(10, 12, 25, .45); }
dialog .dlg-body { padding: 1.1rem 1.2rem; overflow-y: auto; max-height: calc(100vh - 9rem); }
dialog .dlg-foot { padding: .8rem 1.2rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: .5rem; }

@media print {
  .topbar, .savebar, .actions, .tabs, #toasts { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* ---------- vista tipo planilla ---------- */
:root { --sheet-band: #111827; --sheet-band-ink: #fff; --sheet-head: #3b82f6; --sheet-head-ink: #fff; --sheet-calc: #f1f3f8; --sheet-line: #d5d9e4; }
@media (prefers-color-scheme: dark) { :root { --sheet-band: #000; --sheet-head: #1d4ed8; --sheet-calc: #202436; --sheet-line: #343a52; } }
.sheet-title { margin: 1.2rem 0 .5rem; letter-spacing: .03em; }
.sheet-wrap { overflow: auto; max-height: 75vh; border: 1px solid var(--sheet-line); border-radius: 8px; background: var(--surface); margin-bottom: 1rem; }
table.sheet { border-collapse: separate; border-spacing: 0; font-size: .82rem; width: max-content; min-width: 100%; }
table.sheet th, table.sheet td { border-right: 1px solid var(--sheet-line); border-bottom: 1px solid var(--sheet-line); padding: .3rem .45rem; white-space: nowrap; }
table.sheet thead th { position: sticky; top: 0; z-index: 2; background: var(--sheet-head); color: var(--sheet-head-ink); text-align: center; font-size: .72rem; text-transform: none; letter-spacing: 0; }
table.sheet thead tr:first-child th { top: 0; }
table.sheet thead tr:nth-child(2) th { top: 27px; }
table.sheet th.band { background: var(--sheet-band); color: var(--sheet-band-ink); font-size: .8rem; letter-spacing: .04em; }
table.sheet th.corner { background: var(--sheet-band); color: var(--sheet-band-ink); left: 0; z-index: 4; min-width: 210px; text-align: left; }
table.sheet th.calc { background: #64748b; }
table.sheet th.prod { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; font-weight: 600; min-width: 210px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
table.sheet td.in { padding: 0; }
table.sheet input.cell { width: 64px; border: none; border-radius: 0; background: transparent; text-align: right; padding: .3rem .4rem; font-size: .85rem; }
table.sheet input.cell:focus { outline: 2px solid var(--accent); background: var(--accent-soft); }
table.sheet input.cell.bad { background: var(--err-soft); outline: 2px solid var(--err); }
table.sheet td.calc { background: var(--sheet-calc); }
table.sheet td.total, table.sheet th.total { font-weight: 700; }
table.sheet td.neg-cell { background: var(--err-soft); color: var(--err); font-weight: 700; }
table.sheet tbody tr:hover th.prod, table.sheet tbody tr:hover td { background-color: var(--accent-soft); }
table.sheet tfoot td, table.sheet tfoot th { font-weight: 700; background: var(--surface-2); position: sticky; bottom: 0; border-top: 2px solid var(--sheet-line); }
table.sheet tfoot th.prod { z-index: 3; }
.mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
table.sheet.mini { width: 100%; min-width: 0; border: 1px solid var(--sheet-line); border-radius: 8px; overflow: hidden; background: var(--surface); }
table.sheet.mini thead th { position: static; }
table.sheet.mini td { text-align: center; font-size: .95rem; font-weight: 600; }
table.sheet.mini td.small { font-weight: 400; font-size: .75rem; }
.ledger-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: .9rem; align-items: start; }
.ledger-grid table.sheet { width: 100%; min-width: 0; }
.ledger-grid table.sheet thead th { position: static; }
.ledger-grid .sheet-wrap { max-height: none; margin: 0; }
.ledger-grid input { width: 100%; padding: .25rem .35rem; font-size: .82rem; }
.report-week { border: 1px solid var(--sheet-line); border-radius: 10px; background: var(--surface); padding: .8rem; margin-bottom: 1rem; }
.report-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .6rem; margin-top: .6rem; }
.report-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 1rem; align-items: start; }
@media (max-width: 760px) { .report-layout { grid-template-columns: 1fr; } }

/* ---------- pantalla Noche (simple) ---------- */
.noche-head { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin-bottom: .8rem; }
.field-inline { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.05rem; }
.field-inline input, .field-inline select { font-size: 1rem; font-weight: 600; padding: .55rem .7rem; }
.bar-pills { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .3rem; margin-bottom: .9rem; scrollbar-width: none; }
.bar-pills::-webkit-scrollbar { display: none; }
.bar-pills button { flex: 0 0 auto; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 12px; padding: .65rem 1.1rem; font: inherit; font-weight: 700; cursor: pointer; display: flex; flex-direction: column; align-items: center; min-width: 96px; }
.bar-pills button small { font-weight: 500; color: var(--muted); font-size: .75rem; }
.bar-pills button.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.bar-pills button.active small { color: var(--accent-ink); opacity: .85; }
.live { margin-bottom: 1rem; }
.live-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .6rem; }
.live-status { margin-top: .5rem; font-size: .85rem; color: var(--muted); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: .3rem; vertical-align: middle; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.off { background: var(--err); }
.plist { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.prow { display: grid; grid-template-columns: minmax(180px, 2fr) repeat(3, minmax(90px, 1fr)) minmax(70px, .7fr); gap: .5rem; align-items: center; padding: .45rem .8rem; border-bottom: 1px solid var(--border); }
.plist.admin .prow { grid-template-columns: minmax(180px, 2fr) repeat(3, minmax(90px, 1fr)) minmax(70px, .7fr) minmax(80px, .8fr) minmax(90px, .9fr); }
.prow.phead { background: var(--surface-2); font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.prow.done { box-shadow: inset 4px 0 0 var(--ok); }
.prow.neg { background: var(--err-soft); box-shadow: inset 4px 0 0 var(--err); }
.pname { font-weight: 600; }
.pname small { display: block; font-weight: 500; font-size: .75rem; }
.pin span, .pcalc span:first-child { display: none; }
.pin input { width: 100%; text-align: center; font-size: 1rem; padding: .5rem .3rem; }
.pin input.bad { border-color: var(--err); background: var(--err-soft); }
.pin:nth-of-type(3) input { border-color: var(--accent); font-weight: 700; }
.pcalc { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  .prow, .plist.admin .prow { grid-template-columns: repeat(3, 1fr); padding: .65rem .75rem; }
  .prow.phead { display: none; }
  .pname { grid-column: 1 / -1; }
  .pin { display: flex; flex-direction: column; gap: .15rem; }
  .pin span, .pcalc span:first-child { display: block; font-size: .72rem; color: var(--muted); }
  .pcalc { text-align: left; display: flex; flex-direction: column; }
}
@media (max-width: 760px) {
  .live-cards { grid-template-columns: repeat(2, 1fr); gap: .4rem; }
  .live-cards .kpi { padding: .5rem .6rem; }
  .live-cards .kpi .value { font-size: 1.05rem; }
  .live-cards .kpi .sub { display: none; }
  .live-cards .kpi:last-child { grid-column: 1 / -1; }
  .count-toolbar .muted { display: none; }
  .noche-head .btn { font-size: .8rem; }
}
/* Contraseña en campo de texto con puntos: el navegador no lo trata como formulario de acceso */
input.secreto { -webkit-text-security: disc; text-security: disc; font-family: inherit; letter-spacing: .12em; }

/* Instalación de propinas: tablas por máquina y caja */
.tips-table .grp-row td { background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .82rem; letter-spacing: .02em; text-transform: uppercase; }
.tips-table .sub-row td { font-weight: 600; color: var(--muted); border-top: 1px dashed var(--border); }
.tips-table .total-row td { font-weight: 800; border-top: 2px solid var(--text, #11121a); }
.tips-table td.deposit { font-weight: 700; color: var(--accent); }
.tips-table td small { font-weight: 400; }
.tips-table.periodo th, .tips-table.periodo td { white-space: nowrap; }
.tips-table.periodo td:first-child, .tips-table.periodo th:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; }
label.field.inline { flex-direction: row; align-items: center; gap: .4rem; }

/* Reparto de la propina del día */
.reparto-card .card-head { gap: .6rem; flex-wrap: wrap; }
.reparto-table .sub-detail td { font-size: .85rem; padding-top: .3rem; padding-bottom: .3rem; }
.reparto-table .sub-detail td:first-child { padding-left: 1.4rem; color: var(--muted); }
.reparto-table td.deposit { font-weight: 700; color: var(--accent); }
.reparto-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .7rem; margin-bottom: .9rem; }
.reparto-row { display: grid; grid-template-columns: minmax(140px, 2fr) 90px minmax(170px, 2fr) 100px auto; gap: .6rem; align-items: end; padding: .6rem 0; border-top: 1px solid var(--border); }
.reparto-row label.field.pct input { text-align: right; }
.reparto-foot { display: flex; align-items: center; gap: .8rem; justify-content: space-between; margin: .6rem 0; flex-wrap: wrap; }
@media (max-width: 640px) { .reparto-row { grid-template-columns: 1fr 1fr; } .reparto-row .quitar { justify-self: start; } }
.month-nav input[type="date"] { min-width: 150px; }

/* Control de propinas: lista seleccionable */
.filtros { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; margin-bottom: .7rem; }
.sel-acciones { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .7rem; }
.tips-list { max-height: 520px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.tips-list thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.tips-list tfoot td { position: sticky; bottom: 0; background: var(--surface); }
.tips-list th.chk, .tips-list td.chk { width: 2.2rem; text-align: center; }
.tips-list input[type="checkbox"] { width: 1.05rem; height: 1.05rem; accent-color: var(--accent); cursor: pointer; }
.tips-list tr.off td { opacity: .45; }
.tips-list tr.off td.chk { opacity: 1; }
.dep-totales { margin: .2rem 0 .7rem; color: var(--muted); }
.dep-totales strong { color: var(--accent); }

/* Control de propinas: descontar efectivo */
.control-pasos { align-items: start; }
.calc { margin-top: .8rem; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.calc > div { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem .8rem; border-top: 1px solid var(--border); }
.calc > div:first-child { border-top: 0; }
.calc .calc-total { background: var(--accent-soft); color: var(--accent); font-size: 1.1rem; }
.linklike { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; }

/* Control de propinas del día (Club Alemán) */
.deposit-big { color: var(--accent); font-size: 1.2rem; }
.reparto-table tr.off td { opacity: .5; }
.reparto-total { color: var(--muted); font-size: .9rem; }
.area-head { display: flex; justify-content: space-between; align-items: baseline; margin: .9rem 0 .3rem; font-size: .95rem; text-transform: uppercase; letter-spacing: .03em; color: var(--accent); }
.por-persona { margin-top: .8rem; }
.dia-kpis .value.accent { color: var(--accent); }
.vp-table td.pct-col, .detalle-table td.pct-col { color: var(--accent); font-weight: 700; }
.vp-table th, .vp-table td, .detalle-table th, .detalle-table td { white-space: nowrap; }
.detalle-table td.muted { color: var(--muted); }
.detalle-wrap { max-height: 70vh; overflow: auto; }
.detalle-table thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .8rem; }
.chip { border: 1px solid var(--border); background: var(--surface); color: inherit; border-radius: 999px; padding: .35rem .8rem; font: inherit; font-size: .88rem; cursor: pointer; }
.chip span { color: var(--muted); margin-left: .25rem; font-variant-numeric: tabular-nums; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.on span { color: rgba(255, 255, 255, .8); }
.check { display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; }

/* Conciliación (Club Alemán) */
.file-btn { cursor: pointer; }
.alert-card { border-left: 4px solid var(--warn, #d97706); }
.revisar { list-style: none; margin: .25rem 0 0; padding: 0; display: grid; gap: .35rem; }
.revisar li { padding: .45rem .7rem; border-radius: 8px; background: var(--warn-soft); }
.revisar li.grave { background: var(--err-soft); }
.revisar a { color: inherit; text-decoration: none; }
.revisar a:hover { text-decoration: underline; }
.conc-table .cash-in { width: 7.5rem; text-align: right; font: inherit; font-variant-numeric: tabular-nums; padding: .25rem .4rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: inherit; }
.conc-table td small { white-space: nowrap; }

/* Estado del conector de Toteat */
.conector-ok { color: var(--muted); margin: -.25rem 0 .75rem; display: flex; align-items: center; gap: .45rem; }
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: vxPulse 2s infinite; }
@keyframes vxPulse { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .5); } 70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }

/* Análisis (instalación de propinas) */
.c-tar { background: #3D86FF; } .c-ef { background: #22C55E; } .c-tr { background: #A78BFA; }
.an-hero .an-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 1.1rem; }
.an-kpis small { display: block; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.an-kpis strong { font-size: clamp(1.35rem, 1rem + 1.2vw, 2rem); font-variant-numeric: tabular-nums; }
.an-h3 { font-size: .95rem; margin: .2rem 0 .5rem; }
.an-stack { display: flex; height: 18px; border-radius: 999px; overflow: hidden; background: var(--border); }
.an-seg { height: 100%; }
.an-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin-top: .55rem; font-size: .9rem; }
.an-legend i, .an-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.an-top { margin: 0 0 1rem; }
.an-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.an-flow h2 { margin-bottom: .2rem; }
.an-row { display: grid; grid-template-columns: 1.4rem 1fr auto; align-items: baseline; gap: .5rem; padding: .5rem 0; border-bottom: 1px dashed var(--border); }
.an-row.tot { border-bottom: 1px solid var(--border); font-weight: 700; }
.an-row.tot .an-val { font-size: 1.12rem; }
.an-sig { color: var(--muted); font-weight: 700; text-align: center; }
.an-lab small { display: block; color: var(--muted); font-size: .78rem; font-weight: 400; }
.an-val { font-variant-numeric: tabular-nums; text-align: right; }
.an-row.neg .an-val { color: var(--err); } .an-row.pos .an-val { color: var(--ok); }
.an-pct input { width: 3.4rem; padding: .1rem .3rem; font: inherit; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: inherit; text-align: right; }
.an-nota { font-size: .86rem; color: var(--muted); margin: .7rem 0 0; line-height: 1.45; }
.an-days, .an-sect { display: grid; gap: .45rem; }
.an-day, .an-sec { display: grid; grid-template-columns: 8.2rem 1fr 7.5rem 10rem; align-items: center; gap: .7rem; }
.an-sec { grid-template-columns: 8.2rem 1fr 7.5rem auto; }
.an-date { font-weight: 600; font-size: .9rem; }
.an-bar { display: flex; height: 14px; border-radius: 6px; overflow: hidden; background: color-mix(in srgb, var(--border) 60%, transparent); }
.an-bar > span { height: 100%; }
.an-num { font-variant-numeric: tabular-nums; text-align: right; font-size: .9rem; }
.an-chip { font-size: .75rem; padding: .2rem .55rem; border-radius: 999px; text-align: center; white-space: nowrap; }
.an-chip.ok { background: var(--ok-soft); color: var(--ok); } .an-chip.warn { background: var(--warn-soft); }
.an-chip.bad { background: var(--err-soft); color: var(--err); font-weight: 700; } .an-chip.nd { color: var(--muted); border: 1px dashed var(--border); }
.an-alerts { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .5rem; }
.an-al { border-left: 4px solid var(--border); background: var(--surface); border-radius: 8px; padding: .6rem .8rem; }
.an-al.alta { border-left-color: var(--err); background: var(--err-soft); } .an-al.media { border-left-color: #F59E0B; background: var(--warn-soft); }
.an-al-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; }
.an-al-m { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 700; }
.an-al p { margin: .25rem 0 0; font-size: .88rem; }
.an-tag { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; padding: .1rem .45rem; border-radius: 4px; background: rgba(0, 0, 0, .18); }
@media (max-width: 640px) {
  .an-day { grid-template-columns: 5.6rem 1fr auto; } .an-day .an-chip { grid-column: 2 / 4; justify-self: start; }
  .an-sec { grid-template-columns: 5.6rem 1fr auto; } .an-sec > .small { grid-column: 1 / 4; }
}
/* Análisis: turnos AM y PM */
.an-turnos { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; margin: .4rem 0 1.2rem; }
.an-turno { border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.1rem; }
.an-turno.is-bad { border-color: rgba(248, 113, 113, .45); box-shadow: inset 3px 0 0 var(--err); }
.an-turno h3 { margin: 0 0 .6rem; font-size: 1.05rem; }
.an-tk { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: .3rem; }
.an-tk small { display: block; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.an-tk strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
table.an-tt th.an-tt-g { text-align: center; border-bottom: 1px solid var(--border); }
table.an-tt td, table.an-tt th { white-space: nowrap; }
table.an-tt tfoot th { border-top: 1px solid var(--border); }
.an-tk-ef strong { font-size: 1.6rem; }
.an-tk-ef span { display: block; font-variant-numeric: tabular-nums; color: var(--muted); margin-top: .35rem; }
.an-h4 { margin: .9rem 0 .1rem; font-size: .92rem; }
.an-turno-sel { margin-right: .6rem; }
.an-turno-tag { font-size: .55em; vertical-align: middle; padding: .2em .6em; border-radius: 999px; background: rgba(0, 102, 255, .16); color: var(--blue-soft, #3d85ff); letter-spacing: 0; }
.an-turno-nota { margin-bottom: 1rem; }
/* Análisis: zonas (filtro y AM/PM) */
.an-sec-btn { width: 100%; text-align: left; background: none; border: 0; color: inherit; font: inherit; cursor: pointer; border-radius: 8px; padding: .35rem .3rem; }
.an-sec-btn:hover { background: rgba(0, 102, 255, .08); }
.c-am { background: #f5b942; } .c-pm { background: #6d5cff; }
.an-dot.c-am, .an-dot.c-pm { display: inline-block; }
.c-redelcom { background: #2bd4a4; } .an-dot.c-redelcom { display: inline-block; }
.chips-lab { align-self: center; margin-right: .3rem; min-width: 7.5rem; }

/* Bar + Terraza + Salón: el día que se está viendo */
.vp-table tr.fila-actual td { background: color-mix(in srgb, var(--accent) 12%, transparent); }
