/* Marca Creativa Nails Spa: #C38A77 · #E9B6A5 · #D7A96E · #F7E6D4 — DM Serif Display + Josefin Sans */
:root {
  --brand: #C38A77;
  --rose: #E9B6A5;
  --gold: #D7A96E;
  --cream: #F7E6D4;
  --bg: #FBF6F1;
  --surface: #ffffff;
  --surface-2: #F7E6D4;
  --line: #EEDCCF;
  --ink: #3A2621;
  --ink-2: #7A5A50;
  --ink-3: #A88C82;
  --accent: #A3634F;
  --accent-ink: #ffffff;
  --accent-soft: #F9E4DB;
  --bar: #C38A77;
  --good: #3E7A55;
  --good-soft: #E3F1E6;
  --bad: #B23A2E;
  --bad-soft: #FBE3DF;
  --warn-soft: #F8EAD3;
  --shadow: 0 1px 2px rgba(120, 70, 50, .06), 0 6px 18px rgba(120, 70, 50, .07);
  --radius: 16px;
  --serif: "DM Serif Display", Georgia, serif;
  --sans: "Josefin Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1C1513;
    --surface: #271D1A;
    --surface-2: #33261F;
    --line: #45342D;
    --ink: #F7E6D4;
    --ink-2: #D9BFB2;
    --ink-3: #A88C82;
    --accent: #E9B6A5;
    --accent-ink: #2A1A15;
    --accent-soft: #4A3028;
    --bar: #E9B6A5;
    --good: #8FCFA3;
    --good-soft: #20352A;
    --bad: #FF9B8E;
    --bad-soft: #452420;
    --warn-soft: #3D3020;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.4 var(--sans);
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, .stat .v, .totalbar.grand { font-family: var(--serif); font-weight: 400; letter-spacing: .01em; }
.splash { display: grid; place-items: center; height: 100vh; }
.splash img { width: 220px; }
/* Estructura */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.top h1 { font-size: 22px; margin: 0; flex: 1; color: var(--ink); }
.top .mark { width: 30px; height: 30px; }
.top .who { font-size: 13px; color: var(--ink-2); text-align: right; line-height: 1.2; }
main { max-width: 860px; margin: 0 auto; padding: 14px 16px calc(96px + env(safe-area-inset-bottom)); }
nav.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: flex; background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
nav.tabs a {
  flex: 1; text-align: center; padding: 8px 2px 9px; text-decoration: none;
  color: var(--ink-3); font-size: 12px; font-weight: 600;
}
nav.tabs a .ic { display: block; height: 24px; margin-bottom: 2px; }
nav.tabs a .ic svg { width: 23px; height: 23px; }
nav.tabs a.on { color: var(--accent); }
@media (min-width: 900px) {
  nav.tabs { top: 0; bottom: 0; right: auto; width: 96px; flex-direction: column; border-top: 0; border-right: 1px solid var(--line); padding-top: 70px; }
  nav.tabs a { flex: 0; padding: 12px 4px; }
  body { padding-left: 96px; }
}

/* Componentes */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow); }
.card h2 { font-size: 16px; margin: 0 0 10px; }
.card h3 { font-size: 14px; margin: 14px 0 6px; color: var(--ink-2); }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.right { text-align: right; }
.num { font-variant-numeric: tabular-nums; }
.stack > * + * { margin-top: 10px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); border-radius: 10px;
  padding: 9px 14px; font-weight: 600; cursor: pointer; min-height: 42px; text-decoration: none;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.big { width: 100%; min-height: 54px; font-size: 18px; border-radius: 14px; }
.btn.danger { color: var(--bad); }
a.btn { color: inherit; }
.btn.primary.danger-fill { background: var(--bad); border-color: var(--bad); color: #fff; }
input[type=checkbox] { width: 22px; min-height: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.btn.small { min-height: 34px; padding: 5px 10px; font-size: 14px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

label.field { display: block; font-size: 13px; color: var(--ink-2); font-weight: 600; }
label.field > input, label.field > select, label.field > textarea { margin-top: 4px; }
input, select, textarea {
  width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface); font-size: 16px;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible, .chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 7px 13px; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 12px; }
.seg button { border: 0; background: transparent; border-radius: 9px; padding: 10px 4px; font-weight: 600; cursor: pointer; font-size: 14px; }
.seg button.on { background: var(--surface); box-shadow: var(--shadow); color: var(--accent); }

.services { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.svc {
  text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 12px;
  padding: 10px 11px; cursor: pointer; min-height: 70px; position: relative;
}
.svc b { display: block; font-size: 14px; font-weight: 600; line-height: 1.25; }
.svc span { color: var(--ink-2); font-size: 14px; }
.svc .qty { position: absolute; top: 6px; right: 6px; background: var(--accent); color: var(--accent-ink); border-radius: 999px; min-width: 24px; height: 24px; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.svc.in { border-color: var(--accent); background: var(--accent-soft); }

.line { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: 0; }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); font-size: 18px; cursor: pointer; }
.stepper span { min-width: 22px; text-align: center; font-weight: 700; }

select.tsel { min-height: 32px; padding: 3px 8px; font-size: 14px; width: auto; max-width: 100%; margin-top: 4px; border-radius: 8px; color: var(--accent); font-weight: 600; }
.payrow { border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.payrow input[inputmode] { min-height: 40px; }

.receipt { background: #fff; color: #3A2621; border-radius: 12px; padding: 18px 16px; border: 1px solid var(--line); }
.receipt hr { border-top: 1px dashed #EEDCCF; }
.receipt .muted { color: #A88C82; }
.rc-logo { display: block; width: 190px; margin: 4px auto 8px; }
.rc-sub { text-align: center; font-size: 13px; color: #7A5A50; }
.rc-client { text-align: center; font-weight: 600; margin-top: 6px; }
.rc-item { display: flex; gap: 8px; padding: 4px 0; font-size: 15px; }

.totalbar { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; padding: 3px 0; }
.totalbar.grand { font-size: 22px; font-weight: 800; padding-top: 8px; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.stat .k { font-size: 12px; color: var(--ink-2); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.stat .v { font-size: 22px; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .s { font-size: 12px; color: var(--ink-3); }
.stat.hero { grid-column: 1 / -1; background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.stat.hero .k, .stat.hero .s { color: inherit; opacity: .85; }
.stat.hero .v { font-size: 34px; }

.bars .b { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 8px; align-items: center; padding: 5px 0; font-size: 14px; }
.bars .b .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .track { height: 14px; border-radius: 0 4px 4px 0; }
.bars .fill { height: 100%; background: var(--bar); border-radius: 0 4px 4px 0; min-width: 2px; }
.bars .val { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }

.daychart { display: flex; align-items: flex-end; gap: 2px; height: 130px; padding-top: 6px; border-bottom: 1px solid var(--line); position: relative; }
.daychart .col { flex: 1; height: 100%; display: flex; align-items: flex-end; cursor: default; }
.daychart .col i { display: block; width: 100%; background: var(--bar); border-radius: 4px 4px 0 0; min-height: 2px; }
.daychart .col:hover i, .daychart .col.on i { opacity: .7; }
.daylabels { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-3); margin-top: 4px; }
.tip { min-height: 20px; font-size: 13px; color: var(--ink-2); margin-top: 6px; }

table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; color: var(--ink-2); font-weight: 600; padding: 6px 4px; border-bottom: 1px solid var(--line); }
table.t td { padding: 8px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t .r { text-align: right; font-variant-numeric: tabular-nums; }
.scroll-x { overflow-x: auto; }

.sale { padding: 10px 0; border-bottom: 1px solid var(--line); }
.sale:last-child { border-bottom: 0; }
.sale .head { display: flex; justify-content: space-between; gap: 8px; }
.sale .items { font-size: 14px; color: var(--ink-2); }
.sale.void { opacity: .55; }
.sale.void .amt { text-decoration: line-through; }

.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); vertical-align: middle; }
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--warn-soft); color: var(--ink); }

.empty { text-align: center; color: var(--ink-3); padding: 24px 8px; }
.err { background: var(--bad-soft); color: var(--bad); padding: 10px 12px; border-radius: 10px; font-size: 14px; }

/* Login */
.login { max-width: 380px; margin: 0 auto; padding: 12vh 20px 40px; }
.login .logo { width: 260px; max-width: 80%; display: block; margin: 0 auto 26px; }
.login h1 { text-align: center; margin: 0 0 4px; color: var(--accent); font-size: 30px; }
.login p { text-align: center; margin: 0 0 22px; }

/* Ventana modal */
.modal-bg { position: fixed; inset: 0; background: rgba(20, 8, 14, .45); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: var(--surface); width: 100%; max-width: 480px; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); max-height: 92vh; overflow: auto; }
@media (min-width: 600px) { .modal-bg { align-items: center; } .modal { border-radius: 18px; } }
.modal h2 { margin: 0 0 12px; font-size: 18px; }

#toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 12px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: .2s; z-index: 30; max-width: calc(100% - 32px);
}
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.bad { background: var(--bad); color: #fff; }

.menu a { display: flex; align-items: center; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; font-weight: 600; }
.menu a:last-child { border-bottom: 0; }
.menu a .ic { width: 26px; text-align: center; font-size: 20px; }

/* Avisos */
.banner { display: flex; align-items: center; gap: 8px; background: var(--accent-soft); color: var(--ink); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; font-weight: 600; }

/* Agenda */
.ag-day { display: flex; align-items: center; gap: 8px; }
.ag-day > .btn { width: 48px; font-size: 22px; padding: 0; }
.ag-date { flex: 1; position: relative; text-align: center; line-height: 1.15; cursor: pointer; }
.ag-date-main { display: block; font-family: var(--serif); font-size: 26px; text-transform: capitalize; }
.ag-date-sub { display: block; color: var(--ink-2); font-size: 14px; }
.ag-date input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.free-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 6px; }
.free { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 6px 4px; cursor: pointer; text-align: center; }
.free b { display: block; font-size: 19px; color: var(--accent); font-family: var(--serif); font-weight: 400; }
.free span { display: block; font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.free:active { background: var(--accent-soft); }
.ag-card { padding: 0; overflow: hidden; }
.ag-scroll { overflow: auto; max-height: 72vh; overscroll-behavior: contain; }
.ag-inner { position: relative; }
.ag-head, .ag-body { display: grid; }
.ag-head { position: sticky; top: 0; z-index: 4; background: var(--surface); border-bottom: 1px solid var(--line); }
.ag-corner { position: sticky; left: 0; background: var(--surface); z-index: 5; }
.ag-name { padding: 10px 6px; text-align: center; font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 1px solid var(--line); }
.ag-body { position: relative; }
.ag-times { position: sticky; left: 0; z-index: 3; background: var(--surface); border-right: 1px solid var(--line); }
.ag-times span { position: absolute; right: 6px; transform: translateY(-50%); font-size: 12px; color: var(--ink-2); font-weight: 600; }
.ag-times span:first-child { transform: none; }
.ag-col {
  position: relative; border-left: 1px solid var(--line); cursor: copy;
  background-image:
    repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(to bottom, transparent 0 36px, color-mix(in srgb, var(--line) 55%, transparent) 36px 37px, transparent 37px 72px);
}
.ag-appt {
  position: absolute; left: 3px; right: 3px; overflow: hidden; text-align: left; cursor: pointer;
  border: 0; border-left: 4px solid var(--brand); border-radius: 8px; padding: 3px 6px;
  background: var(--accent-soft); color: var(--ink); font-size: 12px; line-height: 1.2;
}
.ag-appt b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-appt span { display: block; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-appt.st-atendida { border-left-color: var(--good); background: var(--good-soft); }
.ag-appt.st-no_vino { border-left-color: var(--ink-3); background: var(--surface-2); opacity: .7; }
.ag-now { position: absolute; left: 56px; right: 0; height: 2px; background: var(--bad); z-index: 2; pointer-events: none; }
.ag-now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--bad); }
.svc-pick { display: flex; flex-wrap: wrap; gap: 6px; max-height: 172px; overflow: auto; padding: 2px; }
.svc-pick .chip { font-size: 13px; padding: 6px 10px; }
.chip[disabled], .seg button[disabled] { opacity: .6; }input.search { margin-bottom: 10px; background: var(--surface-2); border-color: transparent; }
.roster-chips { display: flex; flex-wrap: wrap; gap: 6px; }