/* GM ClubeBarber · app (dono e barbeiro). Mobile primeiro: toques ≥ 44px, barra inferior, folhas de baixo para cima. */
:root {
  --bg: #F7F6F3; --surface: #FFFFFF; --surface-2: #F0EEE8; --line: #DDD9CF;
  --ink: #14233A; --ink-2: #4A5568; --ink-3: #6B7280;
  --blue: #1A365D; --blue-2: #24497A; --blue-soft: #E6EDF6;
  --green: #2D8A4E; --green-ink: #1F6B3B; --green-soft: #E3F1E8;
  --gold: #C4972A; --gold-ink: #7E6017; --gold-soft: #F6ECD3;
  --red: #B23A2C; --red-ink: #9A2E22; --red-soft: #F7E1DE;
  --radius: 14px; --radius-sm: 10px;
  --shadow: 0 6px 24px rgba(20, 35, 58, 0.10);
  --head: "Space Grotesk", "Segoe UI", Arial, sans-serif;
  --body: "Inter", "Segoe UI", Arial, sans-serif;
  --nav-h: 64px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0E1522; --surface: #162132; --surface-2: #1D2A3F; --line: #2B3B54;
  --ink: #EEF1F5; --ink-2: #B6C0CE; --ink-3: #8B97A8;
  --blue: #8FB3E6; --blue-2: #A9C5EE; --blue-soft: #1C2D47;
  --green: #5DBB80; --green-ink: #8FDCAA; --green-soft: #173826;
  --gold: #E1B85A; --gold-ink: #E9C977; --gold-soft: #3A2F12;
  --red: #E07A6C; --red-ink: #F4A69C; --red-soft: #43201C;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.5; -webkit-tap-highlight-color: transparent; }
body.no-scroll { overflow: hidden; }
h1, h2, h3 { font-family: var(--head); line-height: 1.2; margin: 0; }
h1 { font-size: 1.45rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: 0; }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.muted { color: var(--ink-2); } .small { font-size: 0.86rem; } .mono { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Estrutura ---------- */
.shell { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; background: var(--blue); color: #F7F6F3; padding: env(safe-area-inset-top, 0px) max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); }
:root[data-theme="dark"] .topbar { background: #12233D; }
.topbar-in { display: flex; align-items: center; gap: 12px; min-height: 56px; }
.topbar .shop { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.topbar .logo { width: 34px; height: 34px; border-radius: 9px; background: #F7F6F3; color: #1A365D; display: grid; place-items: center; font-family: var(--head); font-weight: 700; font-size: 0.9rem; flex: none; overflow: hidden; }
.topbar .logo img { width: 100%; height: 100%; object-fit: cover; }
.topbar .name { font-family: var(--head); font-weight: 700; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .sub { font-size: 0.78rem; opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .icon-btn { color: #F7F6F3; }
.demo-pill { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,0.08); border: 1px solid rgba(148,163,184,0.28); color: #E2E8F0; font-size: 0.76rem; font-weight: 600; border-radius: 999px; padding: 4px 10px; white-space: nowrap; cursor: pointer; }
.demo-pill:hover { border-color: #38BDF8; color: #FFFFFF; }
.demo-dot { width: 7px; height: 7px; border-radius: 50%; background: #10B981; flex: none; }
.banner { padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 0.92rem; }
.banner .grow { flex: 1; min-width: 180px; }
.banner.b-trial { background: var(--blue-soft); color: var(--ink); }
.banner.b-warn { background: var(--gold-soft); color: var(--ink); }
.banner.b-err { background: var(--red-soft); color: var(--ink); }
.layout { flex: 1; display: flex; }
.side { display: none; }
main.content { flex: 1; min-width: 0; width: 100%; max-width: 1100px; margin: 0 auto; padding: 16px max(16px, env(safe-area-inset-right, 0px)) calc(var(--nav-h) + 32px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Barra inferior */
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--surface); border-top: 1px solid var(--line); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px max(4px, env(safe-area-inset-right, 0px)) calc(4px + env(safe-area-inset-bottom, 0px)) max(4px, env(safe-area-inset-left, 0px)); }
.bottomnav a, .bottomnav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; border: 0; background: none; color: var(--ink-3); text-decoration: none; font-size: 0.7rem; font-weight: 600; border-radius: 12px; cursor: pointer; min-width: 0; }
.bottomnav .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bottomnav .on { color: var(--blue); background: var(--blue-soft); }
@media (max-width: 340px) { .bottomnav .lbl { font-size: 0.62rem; } }
.fab { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom, 0px)); z-index: 35; width: 56px; height: 56px; border-radius: 18px; border: 0; background: var(--green); color: #FBFAF7; box-shadow: var(--shadow); display: grid; place-items: center; cursor: pointer; }
.fab svg { width: 26px; height: 26px; }

@media (min-width: 900px) {
  .side { display: flex; flex-direction: column; gap: 2px; width: 240px; flex: none; padding: 16px 12px; border-right: 1px solid var(--line); background: var(--surface); position: sticky; top: 56px; height: calc(100dvh - 56px); overflow-y: auto; }
  .side a, .side button { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-weight: 600; border: 0; background: none; cursor: pointer; text-align: left; font-size: 0.95rem; }
  .side a:hover, .side button:hover { background: var(--surface-2); color: var(--ink); }
  .side .on { background: var(--blue-soft); color: var(--blue); }
  .side .sep { height: 1px; background: var(--line); margin: 8px 4px; }
  .bottomnav { display: none; }
  .fab { bottom: 24px; }
  main.content { padding-bottom: 48px; }
}

/* ---------- Componentes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card + .card, .card + .section, .section + .card, .section + .section { margin-top: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; min-width: 0; }
.kpi .l { font-size: 0.78rem; color: var(--ink-2); font-weight: 600; }
.kpi .v { font-family: var(--head); font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .s { font-size: 0.78rem; color: var(--ink-3); }
.kpi.k-ok .v { color: var(--green-ink); } .kpi.k-err .v { color: var(--red-ink); } .kpi.k-warn .v { color: var(--gold-ink); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px; border-radius: 12px; border: 1.5px solid transparent; font-weight: 700; font-size: 0.95rem; cursor: pointer; text-decoration: none; white-space: nowrap; background: var(--surface-2); color: var(--ink); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--green); color: #FBFAF7; }
.btn-blue { background: var(--blue); color: #F7F6F3; }
:root[data-theme="dark"] .btn-blue { color: #0E1522; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-danger { background: var(--red); color: #FFF8F6; }
.btn-whats { background: #1E8E4E; color: #F4FFF8; }
.btn-sm { min-height: 44px; padding: 8px 12px; font-size: 0.86rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn.is-busy { position: relative; color: transparent !important; }
.btn.is-busy::after { content: ""; position: absolute; width: 18px; height: 18px; border: 2.5px solid currentColor; border-color: var(--ink-3) transparent var(--ink-3) transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--surface-2); }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; }
.row-actions .btn { flex: 1 1 140px; }

.badge { display: inline-flex; align-items: center; font-size: 0.74rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.b-ok { background: var(--green-soft); color: var(--green-ink); }
.b-warn { background: var(--gold-soft); color: var(--gold-ink); }
.b-err { background: var(--red-soft); color: var(--red-ink); }
.b-neutral { background: var(--surface-2); color: var(--ink-2); }
.b-blue { background: var(--blue-soft); color: var(--blue); }

/* Formulários */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; min-width: 0; }
.field > span, .field > label { font-size: 0.84rem; font-weight: 600; color: var(--ink-2); }
.input, select.input, textarea.input { width: 100%; min-height: 48px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 16px; }
textarea.input { min-height: 90px; resize: vertical; }
.input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px var(--blue-soft); }
.hint { font-size: 0.8rem; color: var(--ink-3); }
.err-text { font-size: 0.84rem; color: var(--red-ink); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0 12px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--green); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button, .chip { min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 600; font-size: 0.9rem; cursor: pointer; color: var(--ink); }
.seg button.on, .chip.on { background: var(--blue); border-color: var(--blue); color: #F7F6F3; }
:root[data-theme="dark"] .seg button.on, :root[data-theme="dark"] .chip.on { color: #0E1522; }
.chip.covered { border-color: var(--green); background: var(--green-soft); color: var(--green-ink); }
.chip.disabled { opacity: 0.45; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 13px; width: 20px; height: 20px; color: var(--ink-3); }
.search .input { padding-left: 42px; }

/* Listas */
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); min-height: 60px; }
.li:last-child { border-bottom: 0; }
.li .main { flex: 1; min-width: 0; }
.li .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .s { font-size: 0.84rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .end { display: flex; align-items: center; gap: 6px; flex: none; }
.li-btn { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; cursor: pointer; }
.li-btn:hover { background: var(--surface-2); }
.avatar { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; font-family: var(--head); background: var(--blue-soft); color: var(--blue); flex: none; }
.empty { text-align: center; padding: 28px 12px; color: var(--ink-2); }
.empty-t { font-weight: 700; color: var(--ink); }
.empty-h { font-size: 0.9rem; margin-top: 4px; }
.empty .btn { margin-top: 12px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 560px; }
.tbl th, .tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-2); background: var(--surface-2); }
.tbl td.n, .tbl th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 2px; scrollbar-width: none; }
.tabs button { flex: none; min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 700; cursor: pointer; color: var(--ink-2); }
.tabs button.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* Agenda em grade */
.daybar { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.daybar .day-label { flex: 1; text-align: center; font-weight: 700; font-family: var(--head); }
.daystrip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 10px; scrollbar-width: none; }
.daystrip button { flex: none; width: 52px; min-height: 58px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 0.72rem; color: var(--ink-2); }
.daystrip button b { font-size: 1.05rem; color: var(--ink); font-family: var(--head); }
.daystrip button.on { background: var(--blue); border-color: var(--blue); color: #F7F6F3; }
.daystrip button.on b { color: #F7F6F3; }
.timeline { display: flex; flex-direction: column; gap: 8px; }
.slot { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px; align-items: stretch; }
.appt .t, .appt .s, .li .t, .li .s { display: block; }
.li .main > button.t { min-height: 44px; display: flex; align-items: center; text-align: left; font: inherit; font-weight: 600; }
.cols > section { min-width: 0; }
.slot .h { font-weight: 700; font-variant-numeric: tabular-nums; padding-top: 12px; font-size: 0.92rem; }
.appt { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--blue); border-radius: 12px; padding: 10px 12px; min-height: 58px; cursor: pointer; text-align: left; width: 100%; color: var(--ink); }
.appt .main { flex: 1; min-width: 0; }
.appt .t { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt .s { font-size: 0.82rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt.st-done { opacity: 0.6; }
.appt.st-requested { border-left-color: var(--gold); background: var(--gold-soft); }
.appt.st-canceled, .appt.st-no_show { opacity: 0.45; text-decoration: line-through; }
.free { display: flex; align-items: center; min-height: 48px; border: 1.5px dashed var(--line); border-radius: 12px; padding: 0 12px; color: var(--ink-3); background: transparent; cursor: pointer; width: 100%; text-align: left; font-size: 0.9rem; }
.free:hover { border-color: var(--green); color: var(--green-ink); }
.cols { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.col-head { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }

/* Comanda */
.paybar { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); z-index: 36; background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -6px 18px rgba(20, 35, 58, 0.08); padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); display: flex; align-items: center; gap: 12px; }
.paybar .tot { flex: 1; min-width: 0; }
.paybar .tot b { display: block; font-family: var(--head); font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.paybar .tot span { font-size: 0.8rem; color: var(--ink-2); }
.paybar .btn { min-width: 140px; }
@media (min-width: 900px) { .paybar { left: 240px; bottom: 0; } }
.has-paybar main.content { padding-bottom: calc(var(--nav-h) + 110px + env(safe-area-inset-bottom, 0px)); }
.cart-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cart-item .main { flex: 1; min-width: 0; }
.cart-item .why { font-size: 0.8rem; }
.qty { display: flex; align-items: center; gap: 4px; }
.qty button { width: 40px; height: 40px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 700; }
.client-box { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); }
.client-box .main { flex: 1; min-width: 0; overflow-wrap: break-word; }
.li { flex-wrap: wrap; }
.li .main { min-width: 140px; }
.li .end { margin-left: auto; }
.client-box .btn { flex: none; }
.notice { border-radius: 12px; padding: 10px 12px; font-size: 0.9rem; }
.notice.n-ok { background: var(--green-soft); color: var(--green-ink); }
.notice.n-warn { background: var(--gold-soft); color: var(--ink); }
.notice.n-err { background: var(--red-soft); color: var(--red-ink); }
.notice.n-info { background: var(--blue-soft); color: var(--ink); }

/* Folha (sheet) */
.sheet-wrap { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(10, 18, 30, 0.45); animation: fade .18s ease-out; }
.sheet { position: relative; width: 100%; max-width: 640px; max-height: 92dvh; background: var(--surface); border-radius: 20px 20px 0 0; box-shadow: var(--shadow); display: flex; flex-direction: column; animation: up .22s ease-out; }
.sheet-wide { max-width: 900px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 12px 8px 20px; border-bottom: 1px solid var(--line); }
.sheet-body { padding: 16px 20px calc(20px + env(safe-area-inset-bottom, 0px)); overflow-y: auto; }
.sheet-wrap.closing .sheet { animation: down .18s ease-in forwards; }
.sheet-wrap.closing .sheet-backdrop { animation: fade .18s reverse forwards; }
@media (min-width: 700px) { .sheet-wrap { align-items: center; } .sheet { border-radius: 20px; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes down { to { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.confirm-msg { color: var(--ink-2); }
.menu-list a, .menu-list button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 0 8px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); text-decoration: none; font-weight: 600; cursor: pointer; text-align: left; font-size: 1rem; }
.menu-list svg { color: var(--ink-2); }

/* Avisos */
#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom, 0px)); z-index: 200; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow); animation: up .2s ease-out; }
.toast.t-err { background: var(--red); color: #FFF8F6; }
.toast.t-warn { background: var(--gold); color: #1F1600; }
.toast.out { opacity: 0; transition: opacity .3s; }

/* Autenticação e assistente */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); background: linear-gradient(160deg, var(--blue) 0 34%, var(--bg) 34%); }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: 20px; padding: 26px 22px; box-shadow: var(--shadow); }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; font-family: var(--head); font-weight: 700; font-size: 1.15rem; }
.auth-brand .logo { width: 38px; height: 38px; border-radius: 10px; background: var(--blue); color: #F7F6F3; display: grid; place-items: center; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 14px; font-size: 0.92rem; }
.auth-links a { min-height: 44px; display: inline-flex; align-items: center; }
.wizard { max-width: 640px; margin: 0 auto; }
.steps { display: flex; gap: 6px; margin: 10px 0 18px; }
.steps span { flex: 1; height: 6px; border-radius: 999px; background: var(--surface-2); }
.steps span.on { background: var(--green); }
.progress { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--green); border-radius: 999px; }
.todo { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.todo .mark { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; flex: none; }
.todo.done .mark { background: var(--green); border-color: var(--green); color: #FBFAF7; }
.todo.done .t { text-decoration: line-through; color: var(--ink-3); }
.todo .t { flex: 1; font-weight: 600; }

/* Tour guiado */
.tour-dim { position: fixed; inset: 0; z-index: 150; background: rgba(10, 18, 30, 0.55); }
.tour-tip { position: fixed; z-index: 151; max-width: min(340px, 92vw); background: var(--surface); color: var(--ink); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); }
.tour-tip p { margin: 4px 0 12px; color: var(--ink-2); font-size: 0.94rem; }
.tour-tip .row-actions { margin-top: 0; }
.tour-hl { position: relative; z-index: 152 !important; box-shadow: 0 0 0 4px var(--gold), 0 0 0 9999px rgba(10, 18, 30, 0.01); border-radius: 12px; }

/* Relatório para imprimir */
.report { background: #fff; color: #14233A; padding: 18px; border-radius: 12px; border: 1px solid var(--line); }
.report h2 { color: #14233A; }
.report .rep-meta { font-size: 0.85rem; color: #4A5568; margin: 4px 0 14px; }
.report table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.report th, .report td { padding: 7px 8px; border-bottom: 1px solid #DDD9CF; text-align: left; }
.report th { background: #F0EEE8; font-size: 0.74rem; text-transform: uppercase; }
.report td.n, .report th.n { text-align: right; white-space: nowrap; }
.report .rep-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 14px; }
.report .rep-kpi { border: 1px solid #DDD9CF; border-radius: 8px; padding: 8px 10px; }
.report .rep-kpi b { display: block; font-size: 1.1rem; }
@media print {
  body * { visibility: hidden; }
  #print-area, #print-area * { visibility: visible; }
  #print-area { position: absolute; left: 0; top: 0; width: 100%; border: 0; }
  .sheet-wrap, .bottomnav, .fab, .topbar { display: none !important; }
}

/* Telas largas */
@media (min-width: 700px) { h1 { font-size: 1.6rem; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ==========================================================================
   GM ClubeBarber · CAMADA DE ACABAMENTO VISUAL (GM Systems & Intelligence)
   --------------------------------------------------------------------------
   COMO APLICAR: no arquivo app/app.css, apague tudo a partir do comentário
   "Identidade Oficial GM Systems" (ou das linhas :root de override no final)
   até o fim do arquivo e cole este bloco inteiro no lugar.

   Nada aqui depende de build, React ou Tailwind. CSS puro.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. PALETA OFICIAL · TEMA CLARO (padrão)
   -------------------------------------------------------------------------- */
:root {
  /* Superfícies */
  --bg: #F4F6FA;
  --surface: #FFFFFF;
  --surface-2: #F8FAFC;
  --surface-3: #EFF3F9;
  --line: #E2E8F0;
  --line-strong: #CBD5E1;

  /* Tinta */
  --ink: #0F172A;
  --ink-2: #334155;
  --ink-3: #64748B;
  --ink-4: #94A3B8;

  /* Marca */
  --navy: #0B132B;
  --navy-deep: #070B14;
  --blue: #0B132B;
  --blue-2: #1D4ED8;
  --blue-3: #1E40AF;
  --blue-soft: rgba(29, 78, 216, 0.10);
  --blue-ink: #1E3A8A;

  /* Dinheiro / sucesso */
  --green: #059669;
  --green-2: #047857;
  --green-ink: #065F46;
  --green-soft: #ECFDF5;

  /* Atenção / tolerância */
  --gold: #D97706;
  --gold-ink: #92400E;
  --gold-soft: #FFFBEB;

  /* Atraso / erro */
  --red: #DC2626;
  --red-ink: #991B1B;
  --red-soft: #FEF2F2;

  /* WhatsApp */
  --whats: #1EA952;
  --whats-ink: #0F6B34;

  /* Tipografia */
  --head: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Elevação */
  --sh-1: 0 1px 2px rgba(11, 19, 43, 0.05);
  --sh-2: 0 1px 3px rgba(11, 19, 43, 0.07), 0 1px 2px rgba(11, 19, 43, 0.04);
  --sh-3: 0 4px 14px rgba(11, 19, 43, 0.09), 0 1px 3px rgba(11, 19, 43, 0.05);
  --sh-4: 0 18px 40px rgba(7, 11, 20, 0.22);

  /* Raio */
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 20px;

  /* Alvo de toque mínimo confortável */
  --touch: 44px;
  --touch-lg: 52px;

  /* Altura da barra inferior */
  --nav-h: 66px;
}

/* --------------------------------------------------------------------------
   2. PALETA OFICIAL · TEMA ESCURO (opcional, pelo seletor Claro/Escuro)
   -------------------------------------------------------------------------- */
:root[data-theme="dark"] {
  --bg: #070B14;
  --surface: #0D1526;
  --surface-2: #111C33;
  --surface-3: #16233D;
  --line: rgba(148, 163, 184, 0.20);
  --line-strong: rgba(148, 163, 184, 0.34);

  --ink: #F8FAFC;
  --ink-2: #CBD5E1;
  --ink-3: #94A3B8;
  --ink-4: #64748B;

  --blue: #3B82F6;
  --blue-2: #2563EB;
  --blue-3: #1D4ED8;
  --blue-soft: rgba(59, 130, 246, 0.16);
  --blue-ink: #93C5FD;

  --green: #10B981;
  --green-2: #059669;
  --green-ink: #6EE7B7;
  --green-soft: rgba(16, 185, 129, 0.14);

  --gold: #F59E0B;
  --gold-ink: #FCD34D;
  --gold-soft: rgba(245, 158, 11, 0.14);

  --red: #F87171;
  --red-ink: #FCA5A5;
  --red-soft: rgba(248, 113, 113, 0.13);

  --whats: #25D366;
  --whats-ink: #6EE7B7;

  --sh-1: 0 1px 2px rgba(0, 0, 0, 0.40);
  --sh-2: 0 1px 3px rgba(0, 0, 0, 0.45);
  --sh-3: 0 4px 16px rgba(0, 0, 0, 0.50);
  --sh-4: 0 18px 44px rgba(0, 0, 0, 0.66);
}

/* --------------------------------------------------------------------------
   3. BASE E TIPOGRAFIA
   -------------------------------------------------------------------------- */
html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--head);
  letter-spacing: -0.015em;
  color: var(--ink);
  line-height: 1.22;
}

h1 { font-size: 1.44rem; font-weight: 700; }
h2 { font-size: 1.18rem; font-weight: 700; }
h3 { font-size: 1rem;    font-weight: 650; }

.small { font-size: 0.82rem; line-height: 1.45; }
.muted { color: var(--ink-3); }
.hint  { font-size: 0.78rem; color: var(--ink-3); line-height: 1.45; }

/* Números tabulares em TODO valor financeiro, horário, data e contador.
   Isto é o que faz colunas de R$ e horas pararem de "dançar". */
.mono, .kpi .v, .kpi .l, .money, .num,
.timeline .h, .paybar .tt, .cart-item .p,
.daystrip b, .bar-val, .plaque-key,
td, th, input[type="date"], input[type="time"],
input[inputmode="decimal"], input[inputmode="numeric"], input[inputmode="tel"] {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.mono { font-family: var(--body); letter-spacing: -0.005em; }

/* Foco sempre visível — teclado e leitor de tela */
:focus-visible {
  outline: 2px solid var(--blue-2);
  outline-offset: 2px;
  border-radius: 6px;
}
.topbar :focus-visible,
.side :focus-visible { outline-color: #7DD3FC; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* --------------------------------------------------------------------------
   4. BARRA SUPERIOR · logo única no mobile
   -------------------------------------------------------------------------- */
.topbar {
  background: var(--navy) !important;
  border-bottom: 1px solid rgba(56, 189, 248, 0.18);
  position: sticky;
  top: 0;
  z-index: 40;
  padding-top: env(safe-area-inset-top);
}

.topbar-in {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px 14px;
  max-width: 1360px;
  margin: 0 auto;
}

.topbar .shop {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.topbar .shop .logo {
  width: 34px; height: 34px;
  flex: 0 0 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.26);
  display: grid; place-items: center;
  font-family: var(--head);
  font-size: 0.78rem; font-weight: 700;
  color: #F8FAFC;
  overflow: hidden;
}
.topbar .shop .logo img { width: 100%; height: 100%; object-fit: cover; }

.topbar .name {
  font-family: var(--head);
  font-size: 0.95rem; font-weight: 650;
  color: #FFFFFF;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar .sub {
  font-size: 0.74rem;
  color: #94A3B8;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Logotipo GM: só no topo no mobile */
.gm-top-logo { height: 20px; width: auto; display: block; margin-right: 4px; flex: 0 0 auto; }

/* Pílula Claro/Escuro */
.gm-theme-pill {
  min-height: 36px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: #F8FAFC;
  border-radius: 999px;
  font-family: var(--body);
  font-size: 0.78rem; font-weight: 600;
  cursor: pointer;
  flex: 0 0 auto;
  transition: background 0.14s, border-color 0.14s;
}
.gm-theme-pill:hover { background: rgba(255, 255, 255, 0.17); border-color: #38BDF8; }

/* Pílula Demo — discreta, nunca uma faixa empurrando conteúdo */
.demo-pill {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px;
  padding: 0 11px;
  border-radius: 999px;
  background: rgba(217, 119, 6, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #FCD34D;
  font-family: var(--body);
  font-size: 0.76rem; font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  flex: 0 0 auto;
  transition: background 0.14s;
}
.demo-pill:hover { background: rgba(217, 119, 6, 0.30); }
.demo-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #F59E0B;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.22);
}

.topbar .icon-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  color: #CBD5E1;
  background: transparent;
  border: 1px solid transparent;
  display: grid; place-items: center;
  flex: 0 0 auto;
}
.topbar .icon-btn:hover { background: rgba(255, 255, 255, 0.10); color: #FFFFFF; }

/* --------------------------------------------------------------------------
   5. AVISO DE SITUAÇÃO DA CONTA — compacto, não empurra o conteúdo
   -------------------------------------------------------------------------- */
.banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  max-width: 1360px;
  margin: 10px auto 0;
  padding: 9px 14px;
  border-radius: var(--r);
  font-size: 0.84rem;
  line-height: 1.4;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--sh-1);
}
.banner .grow { flex: 1; min-width: 190px; }
.banner.b-warn { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-ink); }
.banner.b-err  { background: var(--red-soft);  border-color: var(--red);  color: var(--red-ink); }
.banner.b-info { background: var(--blue-soft); border-color: var(--blue-2); color: var(--blue-ink); }
.banner b { font-weight: 700; }

@media (max-width: 899px) {
  .banner { margin: 10px 12px 0; }
}

/* --------------------------------------------------------------------------
   6. LAYOUT E MENU LATERAL (desktop ≥ 900px)
   -------------------------------------------------------------------------- */
.layout {
  display: block;
  max-width: 1360px;
  margin: 0 auto;
}

.content {
  padding: 16px 14px calc(var(--nav-h) + env(safe-area-inset-bottom) + 24px);
  min-height: 60vh;
}

.side { display: none; }

@media (min-width: 900px) {
  .layout {
    display: grid;
    grid-template-columns: 236px minmax(0, 1fr);
    gap: 0;
    align-items: start;
  }

  .side {
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: sticky;
    top: 58px;
    height: calc(100vh - 58px);
    overflow-y: auto;
    padding: 14px 10px 20px;
    background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%) !important;
    color: #E2E8F0 !important;
    border-right: 1px solid rgba(56, 189, 248, 0.14) !important;
  }

  .side a, .side button {
    display: flex; align-items: center; gap: 10px;
    min-height: var(--touch);
    padding: 0 12px;
    border-radius: 10px;
    font-size: 0.89rem; font-weight: 500;
    color: #CBD5E1 !important;
    background: transparent;
    border: 0;
    text-decoration: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: background 0.14s, color 0.14s;
  }
  .side a svg, .side button svg { flex: 0 0 auto; opacity: 0.9; }
  .side a:hover, .side button:hover {
    background: rgba(255, 255, 255, 0.07) !important;
    color: #FFFFFF !important;
  }
  .side a.on, .side a.active, .side .active {
    background: rgba(56, 189, 248, 0.16) !important;
    color: #7DD3FC !important;
    font-weight: 650;
  }
  .side .sep {
    height: 1px;
    margin: 9px 10px;
    background: rgba(148, 163, 184, 0.18) !important;
  }

  /* Logotipo GM: só na sidebar no desktop */
  .gm-side-brand {
    padding: 2px 12px 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    margin-bottom: 10px;
  }
  .gm-side-brand img { height: 22px; width: auto; display: block; margin-bottom: 6px; }
  .gm-side-brand span { font-size: 0.72rem; color: #94A3B8; display: block; letter-spacing: 0.01em; }

  .gm-top-logo { display: none; }
  .content { padding: 22px 26px 40px; }
  .bottomnav { display: none; }
  .fab { display: none; }
  body.has-paybar .content { padding-bottom: 40px; }
}

/* --------------------------------------------------------------------------
   7. BARRA INFERIOR (mobile)
   -------------------------------------------------------------------------- */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 45;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 12px rgba(11, 19, 43, 0.06);
}
.bottomnav a, .bottomnav button {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  min-height: var(--nav-h);
  background: none; border: 0;
  color: var(--ink-3);
  font-family: var(--body);
  font-size: 0.68rem; font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  position: relative;
}
.bottomnav .lbl { letter-spacing: 0.005em; }
.bottomnav a.on, .bottomnav button.on { color: var(--blue-2); }
.bottomnav a.on::before, .bottomnav button.on::before {
  content: ""; position: absolute; top: 0; left: 50%;
  transform: translateX(-50%);
  width: 26px; height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--blue-2);
}
.bottomnav svg { width: 22px; height: 22px; }

/* Botão flutuante */
.fab {
  position: fixed;
  right: 16px;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 14px);
  z-index: 44;
  width: 56px; height: 56px;
  border-radius: 18px;
  border: 0;
  background: var(--blue-2);
  color: #FFFFFF;
  display: grid; place-items: center;
  box-shadow: 0 10px 24px rgba(29, 78, 216, 0.34);
  cursor: pointer;
  transition: transform 0.14s, box-shadow 0.14s;
}
.fab:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(29, 78, 216, 0.42); }
.fab svg { width: 26px; height: 26px; }
body.has-paybar .fab { display: none; }

/* --------------------------------------------------------------------------
   8. CABEÇALHO DE PÁGINA
   -------------------------------------------------------------------------- */
.page-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.page-head h1 { flex: 1; min-width: 0; margin: 0; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* --------------------------------------------------------------------------
   9. CARTÕES
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--sh-2);
}
.card + .card { margin-top: 14px; }

.card-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: -2px 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.card-head h3 { flex: 1; min-width: 0; margin: 0; }
.card-head > .small, .card-head > a.small, .card-head > span { flex: 0 0 auto; }

.grid { display: grid; gap: 14px; }
.grid.g2 { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.grid.g3 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

/* --------------------------------------------------------------------------
   10. CARTÕES DE NÚMEROS (KPI)
   -------------------------------------------------------------------------- */
.kpis {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(156px, 1fr));
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: var(--r);
  padding: 12px 14px;
  min-height: 92px;
  display: flex; flex-direction: column; justify-content: center; gap: 3px;
  box-shadow: var(--sh-1);
}

.kpi .l {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.015em;
  text-transform: uppercase;
  color: var(--ink-3);
  line-height: 1.3;
}

.kpi .v {
  font-family: var(--head);
  font-size: 1.52rem;
  font-weight: 700;
  letter-spacing: -0.022em;
  color: var(--ink);
  line-height: 1.12;
  /* Impede que R$ 12.345,67 quebre em duas linhas */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi .s {
  font-size: 0.76rem;
  color: var(--ink-3);
  line-height: 1.35;
}
.kpi .s a { color: var(--blue-2); font-weight: 600; text-decoration: none; }
.kpi .s a:hover { text-decoration: underline; }

/* Tonalidades por situação */
.kpi.k-ok   { border-left-color: var(--green); }
.kpi.k-ok   .v { color: var(--green-ink); }
.kpi.k-warn { border-left-color: var(--gold);  }
.kpi.k-warn .v { color: var(--gold-ink); }
.kpi.k-err  { border-left-color: var(--red);   }
.kpi.k-err  .v { color: var(--red-ink); }
.kpi.k-blue { border-left-color: var(--blue-2); }

/* Variante "dinheiro": número maior, para leitura executiva imediata */
.kpi.k-money { min-height: 104px; }
.kpi.k-money .v { font-size: 1.78rem; }

/* Variante compacta: contadores de pessoas */
.kpi.k-tight { min-height: 76px; padding: 10px 12px; }
.kpi.k-tight .v { font-size: 1.3rem; }

@media (max-width: 420px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .v { font-size: 1.32rem; }
  .kpi.k-money .v { font-size: 1.44rem; }
}

/* --------------------------------------------------------------------------
   11. ETIQUETAS DE SITUAÇÃO (Em dia · Tolerância · Atrasado)
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 650;
  letter-spacing: 0.005em;
  line-height: 1.4;
  white-space: nowrap;
  border: 1px solid transparent;
}
/* Ponto colorido: a situação nunca depende só da cor de fundo */
.badge::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}

.badge.ok, .badge.b-ok {
  background: var(--green-soft);
  color: var(--green-ink);
  border-color: color-mix(in srgb, var(--green) 38%, transparent);
}
.badge.warn, .badge.b-warn {
  background: var(--gold-soft);
  color: var(--gold-ink);
  border-color: color-mix(in srgb, var(--gold) 42%, transparent);
}
.badge.err, .badge.b-err {
  background: var(--red-soft);
  color: var(--red-ink);
  border-color: color-mix(in srgb, var(--red) 40%, transparent);
}
.badge.blue, .badge.b-blue {
  background: var(--blue-soft);
  color: var(--blue-ink);
  border-color: color-mix(in srgb, var(--blue-2) 38%, transparent);
}
.badge.neutral, .badge.b-neutral {
  background: var(--surface-3);
  color: var(--ink-2);
  border-color: var(--line-strong);
}

/* No escuro, aumenta o contraste da tinta das etiquetas */
:root[data-theme="dark"] .badge.ok      { color: #6EE7B7; }
:root[data-theme="dark"] .badge.warn    { color: #FCD34D; }
:root[data-theme="dark"] .badge.err     { color: #FCA5A5; }
:root[data-theme="dark"] .badge.blue    { color: #93C5FD; }
:root[data-theme="dark"] .badge.neutral { color: #CBD5E1; }

/* --------------------------------------------------------------------------
   12. BOTÕES — alvo mínimo de 44px em todos
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: var(--touch);
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--body);
  font-size: 0.89rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s, transform 0.08s, box-shadow 0.14s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn svg { width: 17px; height: 17px; flex: 0 0 auto; }

.btn-primary {
  background: var(--blue-2) !important;
  border-color: var(--blue-2) !important;
  color: #FFFFFF !important;
  box-shadow: 0 1px 2px rgba(29, 78, 216, 0.28);
}
.btn-primary:hover { background: var(--blue-3) !important; border-color: var(--blue-3) !important; }

.btn-ok {
  background: var(--green) !important;
  border-color: var(--green) !important;
  color: #FFFFFF !important;
}
.btn-ok:hover { background: var(--green-2) !important; border-color: var(--green-2) !important; }

.btn-blue {
  background: var(--blue-soft);
  border-color: color-mix(in srgb, var(--blue-2) 40%, transparent);
  color: var(--blue-ink);
}
.btn-blue:hover { background: color-mix(in srgb, var(--blue-2) 18%, transparent); }

.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-3); border-color: var(--ink-4); color: var(--ink); }

.btn-danger { background: var(--red-soft); border-color: var(--red); color: var(--red-ink); }
.btn-danger:hover { background: color-mix(in srgb, var(--red) 16%, transparent); }

.btn-whats { background: var(--whats); border-color: var(--whats); color: #FFFFFF; }
.btn-whats:hover { background: #17913F; border-color: #17913F; }

/* Pequeno continua clicável: 38px é o mínimo só em barras densas */
.btn-sm { min-height: 38px; padding: 0 12px; font-size: 0.82rem; border-radius: 9px; }
.btn-sm svg { width: 15px; height: 15px; }

.btn-lg { min-height: var(--touch-lg); padding: 0 20px; font-size: 0.95rem; border-radius: 12px; }
.btn-block { width: 100%; }

.icon-btn {
  display: grid; place-items: center;
  width: var(--touch); height: var(--touch);
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  flex: 0 0 auto;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }

.row-actions {
  display: flex; gap: 9px; flex-wrap: wrap;
  margin-top: 12px;
}

/* --------------------------------------------------------------------------
   13. AÇÕES RÁPIDAS DE BALCÃO (Hoje) — registrar em segundos
   -------------------------------------------------------------------------- */
.quick {
  display: grid;
  gap: 9px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-bottom: 16px;
}

.quick-btn {
  display: flex; align-items: center; gap: 10px;
  min-height: 58px;
  padding: 10px 13px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  text-align: left;
  box-shadow: var(--sh-1);
  transition: border-color 0.14s, box-shadow 0.14s, transform 0.08s;
  font-family: var(--body);
}
.quick-btn:hover { border-color: var(--blue-2); box-shadow: var(--sh-3); }
.quick-btn:active { transform: translateY(1px); }

.quick-btn .ic {
  width: 38px; height: 38px;
  flex: 0 0 38px;
  border-radius: 11px;
  display: grid; place-items: center;
  background: var(--blue-soft);
  color: var(--blue-2);
}
.quick-btn .ic svg { width: 19px; height: 19px; }
.quick-btn.q-green .ic { background: var(--green-soft); color: var(--green); }
.quick-btn.q-gold  .ic { background: var(--gold-soft);  color: var(--gold); }

.quick-btn .tx { min-width: 0; }
.quick-btn .tx b {
  display: block;
  font-size: 0.88rem; font-weight: 650;
  line-height: 1.25;
}
.quick-btn .tx span {
  display: block;
  font-size: 0.74rem;
  color: var(--ink-3);
  line-height: 1.3;
}

/* --------------------------------------------------------------------------
   14. FORMULÁRIOS
   -------------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span:first-child {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: 0.005em;
}

.input, select.input, textarea.input {
  width: 100%;
  min-height: var(--touch);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--body);
  font-size: 0.92rem;
  line-height: 1.35;
  transition: border-color 0.14s, box-shadow 0.14s;
  appearance: none;
  -webkit-appearance: none;
}
.input::placeholder { color: var(--ink-4); }
.input:focus {
  outline: none;
  border-color: var(--blue-2);
  box-shadow: 0 0 0 3px var(--blue-soft);
}
textarea.input { min-height: 86px; resize: vertical; }

select.input {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%),
                    linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

.form-row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  margin-bottom: 12px;
}

.checkline {
  display: flex; align-items: center; gap: 9px;
  min-height: var(--touch);
  cursor: pointer;
  font-size: 0.88rem;
}
.checkline input[type="checkbox"], .checkline input[type="radio"] {
  width: 20px; height: 20px; flex: 0 0 20px; accent-color: var(--blue-2); cursor: pointer;
}

/* --------------------------------------------------------------------------
   15. ABAS E SEGMENTOS — roláveis no celular, 44px de altura
   -------------------------------------------------------------------------- */
.tabs, .seg {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  padding: 4px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}
.tabs::-webkit-scrollbar, .seg::-webkit-scrollbar { display: none; }

.tabs a, .tabs button, .seg button {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: var(--ink-3);
  font-family: var(--body);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  scroll-snap-align: start;
  transition: background 0.14s, color 0.14s;
}
.tabs a:hover, .tabs button:hover, .seg button:hover { color: var(--ink); }
.tabs a.on, .tabs button.on, .seg button.on {
  background: var(--surface);
  color: var(--blue-2);
  box-shadow: var(--sh-2);
}

/* Fileira de filtros em "pílulas" */
.chips { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 12px; }
.chips button {
  min-height: 38px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
  font-family: var(--body);
  font-size: 0.82rem; font-weight: 600;
  cursor: pointer;
}
.chips button.on { background: var(--blue-2); border-color: var(--blue-2); color: #FFFFFF; }

/* --------------------------------------------------------------------------
   16. LISTAS
   -------------------------------------------------------------------------- */
.list { display: flex; flex-direction: column; }
.li {
  display: flex; align-items: center; gap: 12px;
  min-height: 56px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
}
.li:last-child { border-bottom: 0; }
.li .main { flex: 1; min-width: 0; }
.li .t {
  font-size: 0.9rem; font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  display: block;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.li .s {
  font-size: 0.78rem;
  color: var(--ink-3);
  line-height: 1.35;
  margin-top: 1px;
}
.li .end { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; }

/* Botão-texto dentro de lista (abrir ficha do cliente) */
.li .t[data-member], .li button.t {
  background: none; border: 0; padding: 0;
  font: inherit; color: var(--blue-2);
  cursor: pointer; text-align: left;
  width: 100%;
}
.li .t[data-member]:hover, .li button.t:hover { text-decoration: underline; }

.avatar {
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 11px;
  background: var(--blue-soft);
  color: var(--blue-ink);
  display: grid; place-items: center;
  font-family: var(--head);
  font-size: 0.82rem; font-weight: 700;
  text-transform: uppercase;
  overflow: hidden;
}

.dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 9px; display: inline-block; }

/* --------------------------------------------------------------------------
   17. TABELAS → CARTÕES NO CELULAR
   -------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -2px; }

table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}
td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  vertical-align: middle;
}
td.num, th.num { text-align: right; }
tbody tr:last-child td { border-bottom: 0; }

/* No celular cada linha vira um cartão legível, sem rolagem lateral quebrada.
   Requisito: cada <td> traz data-label="Nome da coluna". */
@media (max-width: 719px) {
  table.stack, table.stack thead, table.stack tbody,
  table.stack tr, table.stack th, table.stack td { display: block; width: 100%; }
  table.stack thead { display: none; }
  table.stack tr {
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--surface);
    padding: 10px 12px;
    margin-bottom: 9px;
    box-shadow: var(--sh-1);
  }
  table.stack td {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 6px 0;
    border-bottom: 1px dashed var(--line);
    text-align: right;
  }
  table.stack td:last-child { border-bottom: 0; }
  table.stack td::before {
    content: attr(data-label);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--ink-3);
    text-align: left;
    flex: 0 0 auto;
  }
}

/* --------------------------------------------------------------------------
   18. AGENDA: faixa de dias, linha do tempo e horários
   -------------------------------------------------------------------------- */
.daystrip {
  display: flex; gap: 7px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  margin-bottom: 10px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
}
.daystrip::-webkit-scrollbar { display: none; }
.daystrip button {
  flex: 0 0 auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px;
  min-width: 54px;
  min-height: var(--touch-lg);
  padding: 7px 9px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-3);
  font-family: var(--body);
  font-size: 0.69rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  scroll-snap-align: center;
  transition: border-color 0.14s, background 0.14s;
}
.daystrip button b {
  font-family: var(--head);
  font-size: 1.04rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.daystrip button:hover { border-color: var(--blue-2); }
.daystrip button.on {
  background: var(--blue-2);
  border-color: var(--blue-2);
  color: rgba(255, 255, 255, 0.82);
}
.daystrip button.on b { color: #FFFFFF; }

.daybar {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.day-label {
  flex: 1; min-width: 150px;
  font-family: var(--head);
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--ink-2);
}

.cols {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}
.cols > section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 13px 14px 15px;
  box-shadow: var(--sh-2);
}
.col-head {
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 9px;
  margin-bottom: 7px;
  border-bottom: 1px solid var(--line);
  font-family: var(--head);
  font-size: 0.92rem;
  font-weight: 650;
}

.timeline { display: flex; flex-direction: column; }
.slot { display: flex; align-items: stretch; gap: 10px; padding: 3px 0; }
.slot .h {
  flex: 0 0 46px;
  padding-top: 13px;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--ink-3);
}

.appt {
  flex: 1;
  display: flex; align-items: center; gap: 10px;
  min-height: var(--touch);
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue-2);
  background: var(--surface-2);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  font-family: var(--body);
  transition: border-color 0.14s, box-shadow 0.14s, transform 0.08s;
}
.appt:hover { box-shadow: var(--sh-3); border-color: var(--line-strong); }
.appt:active { transform: translateY(1px); }
.appt .main { flex: 1; min-width: 0; }
.appt .t {
  display: block;
  font-size: 0.88rem; font-weight: 650;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.appt .s {
  display: block;
  font-size: 0.75rem;
  color: var(--ink-3);
  margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.appt.st-done     { background: var(--green-soft); border-left-color: var(--green); }
.appt.st-canceled { opacity: 0.56; text-decoration: line-through; }
.appt.st-no_show  { background: var(--red-soft); border-left-color: var(--red); }
.appt.st-requested{ background: var(--gold-soft); border-left-color: var(--gold); }

/* Espaço livre: convite claro ao toque */
.free {
  flex: 1;
  display: flex; align-items: center;
  min-height: var(--touch);
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px dashed var(--line-strong);
  background: transparent;
  color: var(--ink-3);
  font-family: var(--body);
  font-size: 0.8rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s, color 0.14s;
}
.free:hover {
  border-color: var(--blue-2);
  border-style: solid;
  background: var(--blue-soft);
  color: var(--blue-ink);
}

/* --------------------------------------------------------------------------
   19. ATENDER (comanda) — rodapé de pagamento fixo
   -------------------------------------------------------------------------- */
.client-box {
  display: flex; align-items: center; gap: 10px;
  min-height: var(--touch-lg);
  padding: 8px 11px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
}
.client-box .main { flex: 1; min-width: 0; font-size: 0.88rem; }

.cart-item {
  display: flex; align-items: center; gap: 10px;
  min-height: 52px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--line);
}
.cart-item:last-of-type { border-bottom: 0; }
.cart-item .main { flex: 1; min-width: 0; }
.cart-item .p {
  font-family: var(--head);
  font-size: 0.95rem;
  font-weight: 650;
  flex: 0 0 auto;
}
.cart-item .p.free-item { color: var(--green-ink); }

.paybar {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  z-index: 46;
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px rgba(11, 19, 43, 0.12);
}
/* Markup atual do atender.js: <div class="tot"><b>total</b><span>apoio</span></div> */
.paybar .tot { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.paybar .tot > b {
  font-family: var(--head);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
}
.paybar .tot > span {
  font-size: 0.74rem;
  color: var(--ink-3);
  line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.paybar .tt { flex: 1; min-width: 0; }
.paybar .tt .l {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.paybar .tt .v {
  display: block;
  font-family: var(--head);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
  line-height: 1.1;
}
.paybar .btn { min-height: var(--touch-lg); padding: 0 22px; font-size: 0.95rem; flex: 0 0 auto; }

body.has-paybar .content {
  padding-bottom: calc(var(--nav-h) + 92px + env(safe-area-inset-bottom));
}

@media (min-width: 900px) {
  .paybar {
    bottom: 0;
    left: 236px;
    padding: 12px 26px;
  }
  body.has-paybar .content { padding-bottom: 104px; }
}

/* --------------------------------------------------------------------------
   20. PLAQUINHA PIX — material de balcão
   -------------------------------------------------------------------------- */
.plaque-wrap {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  align-items: start;
  margin-top: 14px;
}
@media (max-width: 719px) {
  .plaque-wrap { grid-template-columns: minmax(0, 1fr); }
}

/* A plaquinha em si: fundo branco sempre, inclusive no tema escuro,
   porque é uma pré-visualização de impressão. */
.plaque {
  background: #FFFFFF;
  color: #0F172A;
  border: 1px solid #E2E8F0;
  border-radius: var(--r-lg);
  padding: 20px 18px 18px;
  text-align: center;
  box-shadow: var(--sh-3);
  max-width: 300px;
  margin: 0 auto;
}
.plaque-top {
  border-bottom: 2px solid #0B132B;
  padding-bottom: 11px;
  margin-bottom: 14px;
}
.plaque-shop {
  font-family: var(--head);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #0B132B;
  line-height: 1.2;
  word-break: break-word;
}
.plaque-kicker {
  display: block;
  margin-top: 3px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #64748B;
}
.plaque-qr {
  width: 182px; height: 182px;
  margin: 0 auto 13px;
  display: grid; place-items: center;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 7px;
}
.plaque-qr svg, .plaque-qr img { width: 100%; height: 100%; display: block; }
.plaque-amount {
  font-family: var(--head);
  font-size: 1.3rem;
  font-weight: 700;
  color: #059669;
  font-variant-numeric: tabular-nums;
  margin-bottom: 7px;
}
.plaque-amount.livre { font-size: 0.86rem; font-weight: 600; color: #64748B; }
.plaque-label {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94A3B8;
  margin-bottom: 2px;
}
.plaque-key {
  font-size: 0.86rem;
  font-weight: 650;
  color: #0F172A;
  word-break: break-all;
  line-height: 1.35;
}
.plaque-name {
  font-size: 0.76rem;
  color: #475569;
  margin-top: 7px;
  line-height: 1.35;
}
.plaque-foot {
  margin-top: 13px;
  padding-top: 10px;
  border-top: 1px solid #E2E8F0;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94A3B8;
}

/* --------------------------------------------------------------------------
   21. GRÁFICO DE BARRAS (indicadores do clube)
   -------------------------------------------------------------------------- */
.bars { display: flex; flex-direction: column; gap: 2px; }

.bar-row {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 102px;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 2px 0;
}
.bar-mes {
  font-size: 0.76rem;
  font-weight: 650;
  color: var(--ink-2);
  text-transform: capitalize;
  white-space: nowrap;
}
.bar-track {
  height: 22px;
  border-radius: 5px;
  background: var(--surface-3);
  overflow: hidden;
  position: relative;
}
/* Barra única, matiz único (verde dinheiro), ponta arredondada de 4px
   ancorada na base — sem gradiente, sem arco-íris. */
.bar-fill {
  display: block;
  height: 100%;
  border-radius: 0 5px 5px 0;
  background: var(--green);
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  min-width: 3px;
}
.bar-row.is-now .bar-fill { background: var(--green-2); }
.bar-row.is-zero .bar-fill { background: var(--line-strong); }
.bar-val {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
  text-align: right;
  white-space: nowrap;
}
.bar-row.is-zero .bar-val { color: var(--ink-4); font-weight: 600; }

@media (max-width: 460px) {
  .bar-row { grid-template-columns: 50px minmax(0, 1fr) 88px; gap: 8px; }
  .bar-mes { font-size: 0.72rem; }
  .bar-val { font-size: 0.78rem; }
}

/* Barra de progresso simples (primeiros passos, planos) */
.progress {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.progress > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--blue-2);
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Linha de plano nos indicadores */
.planline { padding: 9px 0; border-bottom: 1px solid var(--line); }
.planline:last-child { border-bottom: 0; }
.planline .top {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-bottom: 5px;
  font-size: 0.85rem;
}
.planline .top b { font-weight: 650; }
.planline .top .v { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   22. PRIMEIROS PASSOS
   -------------------------------------------------------------------------- */
.todo {
  display: flex; align-items: center; gap: 11px;
  min-height: var(--touch);
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}
.todo:last-child { border-bottom: 0; }
.todo .mark {
  width: 24px; height: 24px; flex: 0 0 24px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  display: grid; place-items: center;
  color: #FFFFFF;
}
.todo .mark svg { width: 13px; height: 13px; }
.todo.done .mark { background: var(--green); border-color: var(--green); }
.todo .t { font-size: 0.88rem; font-weight: 500; }
.todo.done .t { color: var(--ink-3); text-decoration: line-through; }

/* --------------------------------------------------------------------------
   23. BOTTOM SHEETS / MODAIS
   -------------------------------------------------------------------------- */
.sheet-back {
  position: fixed; inset: 0;
  z-index: 60;
  background: rgba(7, 11, 20, 0.52);
  backdrop-filter: blur(2px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: sheet-fade 0.16s ease-out;
}
@keyframes sheet-fade { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--sh-4);
  animation: sheet-up 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  padding-bottom: env(safe-area-inset-bottom);
}
.sheet.wide { max-width: 820px; }
@keyframes sheet-up { from { transform: translateY(18px); opacity: 0.6; } to { transform: translateY(0); opacity: 1; } }

/* Alça de arraste — sinaliza que dá para fechar deslizando */
.sheet::before {
  content: "";
  width: 38px; height: 4px;
  border-radius: 999px;
  background: var(--line-strong);
  margin: 9px auto 0;
  flex: 0 0 auto;
}

.sheet-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px 11px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.sheet-head h3 { flex: 1; min-width: 0; margin: 0; font-size: 1.04rem; }

.sheet-body {
  padding: 16px 18px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
}

@media (min-width: 720px) {
  .sheet-back { align-items: center; }
  .sheet { border-radius: var(--r-xl); max-height: 86vh; }
  .sheet::before { display: none; }
}

/* --------------------------------------------------------------------------
   24. ESTADOS VAZIOS
   -------------------------------------------------------------------------- */
.empty {
  text-align: center;
  padding: 34px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--surface-2);
}
.empty .ic {
  width: 46px; height: 46px;
  margin: 0 auto 12px;
  border-radius: 14px;
  background: var(--surface-3);
  color: var(--ink-4);
  display: grid; place-items: center;
}
.empty .ic svg { width: 22px; height: 22px; }
.empty h4, .empty .t, .empty .empty-t {
  font-family: var(--head);
  font-size: 1rem;
  font-weight: 650;
  color: var(--ink);
  margin-bottom: 5px;
}
.empty p, .empty .s, .empty .empty-h {
  font-size: 0.84rem;
  color: var(--ink-3);
  max-width: 380px;
  margin: 0 auto;
  line-height: 1.5;
}
.empty .btn, .empty .act { margin-top: 15px; }

/* --------------------------------------------------------------------------
   25. AVISOS EM LINHA E RECADOS
   -------------------------------------------------------------------------- */
.notice {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 11px 13px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--ink-2);
}
.notice a { color: var(--blue-2); font-weight: 600; }
.notice.n-info { background: var(--blue-soft); border-color: color-mix(in srgb, var(--blue-2) 32%, transparent); color: var(--blue-ink); }
.notice.n-ok   { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 34%, transparent); color: var(--green-ink); }
.notice.n-warn { background: var(--gold-soft); border-color: color-mix(in srgb, var(--gold) 36%, transparent); color: var(--gold-ink); }
.notice.n-err  { background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 34%, transparent); color: var(--red-ink); }

/* --------------------------------------------------------------------------
   26. AVISOS FLUTUANTES (toast)
   -------------------------------------------------------------------------- */
.toasts {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 18px);
  z-index: 80;
  display: flex; flex-direction: column; gap: 8px;
  width: min(420px, calc(100vw - 28px));
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 15px;
  border-radius: var(--r);
  background: var(--navy);
  color: #F8FAFC;
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: var(--sh-4);
  animation: toast-in 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: auto;
}
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.toast.t-ok  { background: var(--green-2); }
.toast.t-err { background: #B91C1C; }
.toast.t-warn{ background: #B45309; }

@media (min-width: 900px) {
  .toasts { bottom: 24px; left: auto; right: 24px; transform: none; }
}

/* --------------------------------------------------------------------------
   27. PASSEIO GUIADO
   -------------------------------------------------------------------------- */
.tour-dim { position: fixed; inset: 0; z-index: 70; background: rgba(7, 11, 20, 0.62); }
.tour-tip {
  position: fixed;
  z-index: 71;
  width: min(330px, calc(100vw - 28px));
  padding: 15px 17px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-4);
}
.tour-tip h4 { font-size: 0.98rem; margin-bottom: 6px; }
.tour-tip p { font-size: 0.85rem; color: var(--ink-2); line-height: 1.5; }
.tour-tip .row-actions { margin-top: 13px; }

/* --------------------------------------------------------------------------
   28. IMPRESSÃO — só a plaquinha sai no papel
   -------------------------------------------------------------------------- */
@media print {
  .topbar, .side, .bottomnav, .fab, .paybar, .banner,
  .tabs, .seg, .chips, .row-actions, .toasts, .sheet-back { display: none !important; }
  body { background: #FFFFFF; color: #000000; }
  .card { border: 1px solid #CCCCCC; box-shadow: none; }
  .content { padding: 0; }
  .plaque {
    box-shadow: none;
    border: 2px solid #0B132B;
    max-width: 320px;
    margin: 0 auto;
    page-break-inside: avoid;
  }
  .plaque-wrap { display: block; }
  .plaque-side { display: none !important; }
}

/* --------------------------------------------------------------------------
   29. UTILITÁRIOS
   -------------------------------------------------------------------------- */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.stack-sm > * + * { margin-top: 8px; }
.stack    > * + * { margin-top: 14px; }
.nowrap { white-space: nowrap; }
.right  { text-align: right; }

/* ---------- Correção Definitiva: Navegação Única por Plataforma & Full-Bleed ---------- */
.topbar-in { width: 100% !important; max-width: none !important; margin: 0 !important; padding: 8px 20px !important; }
.layout { width: 100% !important; max-width: none !important; margin: 0 !important; }
main.content, .content { width: 100%; max-width: 1280px; margin: 0 auto; }

@media (max-width: 899px) {
  .side { display: none !important; }
  .bottomnav { display: grid !important; }
  .gm-top-logo { display: block !important; }
}

@media (min-width: 900px) {
  .layout { display: grid !important; grid-template-columns: 236px minmax(0, 1fr) !important; align-items: stretch !important; }
  .side { display: flex !important; min-height: calc(100vh - 58px); }
  .bottomnav, .fab { display: none !important; }
  .gm-top-logo { display: none !important; }
  main.content, .content { padding: 24px 28px 48px !important; }
  .sheet-wrap { align-items: center; padding: 24px; }
  .sheet { border-radius: 16px; max-height: 86vh; }
}

/* ---------- Blindagem Anti-Sobreposição (Mobile & Desktop) ---------- */
.kpi, .cols > section, .appt, .quick-btn, .quick-btn .tx, .li .main, .card { min-width: 0; }
.appt { overflow: hidden; }
.kpi .v { font-size: clamp(1.12rem, 2.5vw, 1.52rem); }
.kpi.k-money .v { font-size: clamp(1.22rem, 3vw, 1.78rem); }
body.has-paybar .fab { display: none !important; }
@media (max-width: 899px) {
  body.has-paybar main.content, body.has-paybar .content { padding-bottom: calc(var(--nav-h) + 116px + env(safe-area-inset-bottom, 0px)) !important; }
}
@media (min-width: 900px) {
  body.has-paybar main.content, body.has-paybar .content { padding-bottom: 110px !important; }
}


/* ---------- GM Motos · Botões Rápidos, Donuts e DRE ---------- */
.quick-4 { display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 14px; }
@media (max-width: 600px) { .quick-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tap-val {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 64px; padding: 10px; border-radius: 14px;
  background: var(--surface); border: 1.5px solid var(--line-strong);
  color: var(--ink); font-family: var(--head); font-weight: 700; font-size: 1.2rem;
  cursor: pointer; box-shadow: var(--sh-1); transition: transform .08s, border-color .14s;
}
.tap-val:hover { border-color: var(--green); }
.tap-val:active { transform: scale(0.97); }
.tap-val span { font-family: var(--body); font-size: 0.72rem; font-weight: 600; color: var(--green-ink); margin-top: 2px; }
.ir-track { width: 100%; height: 10px; background: var(--surface-3); border-radius: 999px; overflow: hidden; margin: 8px 0 4px; }
.ir-fill { height: 100%; background: var(--blue-2); border-radius: 999px; transition: width .25s; }
.comp-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 12px; margin-top: 12px; }
.comp-item { display: flex; align-items: center; gap: 10px; min-width: 0; }
.comp-item .t { font-size: 0.78rem; font-weight: 700; color: var(--ink); }
.comp-item .v { font-size: 0.76rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
tr.total-row td { border-top: 2px solid var(--gold); border-bottom: 2px solid var(--ink); font-weight: 700; background: var(--surface-2); }


/* ==========================================================================
   SPACING SYSTEM OFICIAL GM (Escala 4pt / 8pt · Mobile & Desktop)
   ========================================================================== */
:root {
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
}

/* Padronização de imagens, logos e ícones */
.gm-top-logo { height: 22px !important; width: auto !important; object-fit: contain; }
.gm-side-brand { padding: var(--sp-2) var(--sp-3) var(--sp-4) !important; margin-bottom: var(--sp-3) !important; }
.gm-side-brand img { height: 24px !important; width: auto !important; margin-bottom: var(--sp-2) !important; object-fit: contain; }
.btn svg, .side svg, .bottomnav svg { width: 20px; height: 20px; flex: 0 0 20px; }
.btn-sm svg { width: 17px; height: 17px; flex: 0 0 17px; }

/* Ritmo vertical uniforme entre seções */
.page-head { gap: var(--sp-3) !important; margin-bottom: var(--sp-4) !important; }
.page-head .actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.tabs { gap: var(--sp-2) !important; margin-bottom: var(--sp-4) !important; }
.quick-4 { gap: var(--sp-3) !important; margin-bottom: var(--sp-4) !important; }
.kpis { gap: var(--sp-3) !important; margin-bottom: var(--sp-4) !important; }
.grid { gap: var(--sp-4) !important; align-items: start; }
.stack { display: flex; flex-direction: column; gap: var(--sp-4) !important; }

/* Cartões e containers sem margem dupla */
.card { padding: var(--sp-4) !important; margin-bottom: 0 !important; border-radius: var(--r-lg) !important; }
.card + .card { margin-top: var(--sp-4) !important; }
.grid .card + .card, .stack .card + .card { margin-top: 0 !important; }
.card-head { gap: var(--sp-2) !important; padding-bottom: var(--sp-3) !important; margin-bottom: var(--sp-3) !important; }

/* Botões de 1 toque e KPIs simétricos */
.tap-val { min-height: 68px !important; padding: var(--sp-3) var(--sp-4) !important; gap: var(--sp-1); }
.kpi { padding: var(--sp-3) var(--sp-4) !important; gap: var(--sp-1) !important; min-height: 88px !important; }
.kpi.k-money { min-height: 96px !important; }

/* Listas, formulários e tabelas */
.li { gap: var(--sp-3) !important; padding: var(--sp-3) 0 !important; min-height: 56px !important; }
.form-row { gap: var(--sp-3) !important; margin-bottom: var(--sp-3) !important; }
.field { gap: var(--sp-1) !important; margin-bottom: 0 !important; }
.row-actions { gap: var(--sp-2) !important; margin-top: var(--sp-4) !important; }
table th, table td { padding: 10px 12px 10px 0 !important; }

/* Respiro de tela Mobile vs Desktop */
main.content, .content {
  padding: var(--sp-4) var(--sp-4) calc(var(--nav-h) + var(--sp-8) + env(safe-area-inset-bottom, 0px)) !important;
}
@media (min-width: 900px) {
  main.content, .content { padding: var(--sp-6) var(--sp-6) var(--sp-8) !important; }
  .card { padding: var(--sp-5) !important; }
  .kpis { gap: var(--sp-4) !important; margin-bottom: var(--sp-5) !important; }
  .quick-4 { gap: var(--sp-3) !important; margin-bottom: var(--sp-5) !important; }
  .grid { gap: var(--sp-5) !important; }
  .stack { gap: var(--sp-5) !important; }
}

/* ---------- Ajuste Proporcional Desktop vs Mobile (.quick-4 / .tap-val) ---------- */
@media (max-width: 639px) {
  .quick-4 { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .tap-val { min-height: 60px !important; width: 100%; }
}
@media (min-width: 640px) {
  .quick-4 { display: flex !important; flex-wrap: wrap !important; align-items: stretch !important; }
  .tap-val { flex: 0 1 auto !important; min-width: 142px !important; max-width: 210px !important; min-height: 54px !important; padding: 8px 18px !important; font-size: 1.06rem !important; }
}
