:root { --navy:#14365c; --navy2:#1d4a7a; --amber:#f5a524; --bg:#f2f4f7; --card:#fff; --ink:#1f2933; --muted:#6b7785; --line:#e3e7ec;
  --green:#198754; --red:#d63c3c; --blue:#2f6fde; --grey:#8a94a0; --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { display: flex; flex-direction: column; }
.topbar { background: var(--navy); color: #fff; display: flex; align-items: center; gap: 8px; padding: calc(var(--safe-top) + 12px) 16px 12px; position: sticky; top: 0; z-index: 5; }
.topbar h1 { font-size: 19px; margin: 0; flex: 1; font-weight: 700; letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { background: none; border: 0; color: #fff; font-size: 22px; padding: 0 6px 0 0; }
.pro-badge { background: var(--amber); color: #3b2600; font-weight: 800; font-size: 12px; padding: 3px 8px; border-radius: 20px; }
.view { flex: 1; overflow-y: auto; padding: 14px 14px calc(84px + var(--safe-bottom)); }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); display: flex; padding-bottom: var(--safe-bottom); z-index: 5; }
.tabbar a { flex: 1; text-align: center; color: var(--muted); text-decoration: none; font-size: 11.5px; padding: 7px 0 8px; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.tabbar a .ti { font-size: 21px; line-height: 24px; }
.tabbar a.on { color: var(--navy); font-weight: 700; }
.card { background: var(--card); border-radius: 14px; padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(16,24,40,.06); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.stat { background: var(--card); border-radius: 14px; padding: 13px; box-shadow: 0 1px 2px rgba(16,24,40,.06); }
.stat .lbl { font-size: 12.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.stat .val { font-size: 22px; font-weight: 800; margin-top: 4px; }
.stat .sub { font-size: 12.5px; color: var(--muted); }
.stat.hero { grid-column: 1 / -1; background: linear-gradient(135deg, var(--navy), var(--navy2)); color: #fff; }
.stat.hero .lbl, .stat.hero .sub { color: #c9d6e6; } .stat.hero .val { font-size: 32px; }
.stat.red .val { color: var(--red); } .stat.green .val { color: var(--green); }
h2 { font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin: 18px 4px 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 11px; padding: 12px 16px; font-size: 15.5px; font-weight: 700; background: var(--navy); color: #fff; text-decoration: none; }
.btn.block { width: 100%; } .btn.amber { background: var(--amber); color: #2e1d00; } .btn.ghost { background: #e8edf3; color: var(--navy); }
.btn.green { background: var(--green); } .btn.red { background: #fde8e8; color: var(--red); } .btn.sm { padding: 8px 12px; font-size: 14px; }
.btn:disabled { opacity: .5; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.list { background: var(--card); border-radius: 14px; overflow: hidden; box-shadow: 0 1px 2px rgba(16,24,40,.06); }
.item { display: flex; align-items: center; gap: 10px; padding: 13px 14px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.item:last-child { border-bottom: 0; }
.item .main { flex: 1; min-width: 0; } .item .t1 { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .t2 { font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .amt { font-weight: 800; text-align: right; } .item .amt .badge { margin-top: 4px; }
.badge { display: inline-block; font-size: 11.5px; font-weight: 800; padding: 3px 8px; border-radius: 20px; text-transform: uppercase; letter-spacing: .3px; }
.b-draft { background: #eceff3; color: #5b6673; } .b-sent { background: #e3edfd; color: var(--blue); } .b-paid, .b-accepted { background: #e2f5ea; color: var(--green); } .b-part_paid { background: #fff3d6; color: #9a6400; }
.b-overdue, .b-declined, .b-expired { background: #fde8e8; color: var(--red); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 6px 13px; font-size: 14px; color: var(--muted); white-space: nowrap; }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
label { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin: 10px 0 4px; }
input, select, textarea { width: 100%; font: inherit; padding: 11px 12px; border: 1px solid #cfd6de; border-radius: 10px; background: #fff; color: var(--ink); }
textarea { min-height: 76px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9db8d9; border-color: var(--navy2); }
.line { border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 10px; background: #fbfcfd; }
.line .top { display: flex; gap: 8px; align-items: center; }
.seg { display: inline-flex; background: #e8edf3; border-radius: 9px; padding: 3px; }
.seg button { border: 0; background: none; padding: 6px 10px; border-radius: 7px; font-weight: 700; font-size: 13px; color: var(--muted); }
.seg button.on { background: #fff; color: var(--navy); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.line .grid3 { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 8px; margin-top: 8px; }
.line .grid3 label { margin-top: 0; }
.line .net { text-align: right; font-weight: 700; margin-top: 6px; color: var(--muted); font-size: 14px; }
.del { margin-left: auto; background: none; border: 0; color: var(--red); font-size: 14px; font-weight: 700; }
.totals { font-size: 15px; } .totals div { display: flex; justify-content: space-between; padding: 3px 0; }
.totals .grand { font-size: 20px; font-weight: 800; color: var(--navy); border-top: 2px solid var(--line); margin-top: 6px; padding-top: 8px; }
.muted { color: var(--muted); } .small { font-size: 13.5px; } .center { text-align: center; }
.banner { background: #fff7e6; border: 1px solid #ffe0a3; border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; display: flex; gap: 10px; align-items: center; }
.banner .main { flex: 1; font-size: 14.5px; }
.empty { text-align: center; color: var(--muted); padding: 32px 10px; }
.empty .big { font-size: 44px; }
.modal { position: fixed; inset: 0; background: rgba(10,20,35,.55); z-index: 20; display: flex; align-items: flex-end; }
.sheet { background: #fff; width: 100%; border-radius: 20px 20px 0 0; padding: 20px 18px calc(20px + var(--safe-bottom)); max-height: 92vh; overflow-y: auto; }
.paywall h3 { font-size: 24px; margin: 4px 0 6px; color: var(--navy); } .paywall ul { padding-left: 0; list-style: none; margin: 14px 0; }
.paywall li { padding: 7px 0 7px 30px; position: relative; } .paywall li:before { content: "✓"; position: absolute; left: 4px; color: var(--green); font-weight: 900; }
.price { font-size: 34px; font-weight: 900; color: var(--navy); } .price small { font-size: 15px; color: var(--muted); font-weight: 600; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(90px + var(--safe-bottom)); background: #1f2933; color: #fff; padding: 11px 16px; border-radius: 10px; font-size: 14.5px; z-index: 30; max-width: 90%; }
.kv { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: 15px; } .kv:last-child { border: 0; }
.logo-prev { width: 84px; height: 84px; border-radius: 12px; border: 1px dashed #b8c2cc; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #fff; color: var(--muted); font-size: 12px; }
.logo-prev img { max-width: 100%; max-height: 100%; }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.doc-head .num { font-size: 22px; font-weight: 800; } .doc-total { font-size: 28px; font-weight: 900; color: var(--navy); }
.fab { position: fixed; right: 18px; bottom: calc(80px + var(--safe-bottom)); border-radius: 30px; padding: 14px 20px; box-shadow: 0 6px 16px rgba(20,54,92,.35); z-index: 6; }
pre.msg { white-space: pre-wrap; background: #f6f8fa; border-radius: 10px; padding: 12px; font: 14.5px/1.45 system-ui, sans-serif; margin: 10px 0; }
[hidden] { display: none !important; }

/* bookings (v1.1) */
.tabbar a .ti { position: relative; }
.tab-badge { position: absolute; top: -4px; right: -12px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 800; line-height: 16px; min-width: 16px; padding: 0 4px; border-radius: 9px; font-style: normal; }
.b-pending { background: #fff3d6; color: #9a6400; } .b-completed { background: #e8edf3; color: var(--navy); } .b-cancelled { background: #eceff3; color: #5b6673; }
.linkbox { background: #f4f7fb; border: 1px dashed #b9c7d8; border-radius: 10px; padding: 10px 12px; font-size: 14px; word-break: break-all; color: var(--navy); font-weight: 700; }
.bk-photos { display: flex; gap: 8px; flex-wrap: wrap; } .bk-photos img { width: 92px; height: 92px; object-fit: cover; border-radius: 10px; }
.days { display: flex; flex-wrap: wrap; gap: 6px; } .days label { margin: 0; display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 18px; padding: 6px 10px; font-size: 14px; color: var(--ink); font-weight: 600; background: #fff; }
.days input { width: auto; margin: 0; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; } .switch input { width: 22px; height: 22px; }
.btn.wa { background: #25d366; color: #fff; }

/* v1.2 appointments mode */
.typecard { display: flex; gap: 14px; align-items: center; width: 100%; border: 2px solid var(--line); text-align: left; font: inherit; color: inherit; cursor: pointer; }
.typecard .big { font-size: 38px; } .typecard:active { border-color: var(--navy); }
.item.appt .tm { min-width: 56px; text-align: center; font-size: 15px; border-right: 3px solid var(--amber); padding-right: 8px; }
.daynav { display: flex; align-items: center; justify-content: space-between; gap: 8px; } .daynav .btn { font-size: 22px; padding: 4px 16px; }
.b-no_show { background: #fde8e8; color: var(--red); } .b-held { background: #fff3d6; color: #9a6400; }
.line.svc .top input { flex: 1; } .line.svc .grid3 { grid-template-columns: 1fr 1fr 1fr; }
a.stat { display: block; }

/* v1.3 expenses + export, settings gear, desktop/web layout */
.icon-btn.gear { text-decoration: none; font-size: 23px; padding: 0 2px 0 8px; opacity: .9; } .icon-btn.gear.on { color: var(--amber); opacity: 1; }
h2.mhead { display: flex; justify-content: space-between; }
.rcpt { display: flex; gap: 12px; align-items: flex-start; }
.rcpt-prev { width: 112px; min-height: 140px; border-radius: 12px; border: 1px dashed #b8c2cc; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #fff; color: var(--muted); font-size: 12.5px; text-align: center; flex: none; }
.rcpt-prev img { width: 100%; height: 100%; max-height: 220px; object-fit: contain; }
.rcpt-btns { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.note-box { background: #fff7e6; border: 1px solid #ffe0a3; border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; font-size: 14px; }
.exp-strip { background: #eef6f1; border-color: #cde9d8; }
@media (min-width: 760px) {
  .topbar { padding-left: max(18px, calc(50vw - 410px)); padding-right: max(18px, calc(50vw - 410px)); }
  .view { width: 100%; max-width: 820px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
  body.auth-mode .view { max-width: 460px; padding-top: 24px; }
  .grid2 { grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .tabbar { justify-content: center; } .tabbar a { flex: 0 1 126px; }
  .fab { right: max(18px, calc(50vw - 390px)); }
  .modal { align-items: center; justify-content: center; } .sheet { max-width: 520px; border-radius: 20px; }
  .toast { bottom: 96px; }
}
.install-btn { background: var(--amber); color: #2e1d00; border: 0; border-radius: 16px; font-weight: 800; font-size: 13px; padding: 5px 10px; margin-right: 4px; }

/* v1.4 accounts */
.acct-hero { text-align: left; } .acct-hero .big { font-size: 40px; } .acct-hero ul { padding-left: 18px; margin: 8px 0 4px; color: var(--ink); } .acct-hero li { margin: 3px 0; }
.acct-email { font-size: 19px; font-weight: 800; margin: 2px 0 8px; word-break: break-all; }
input.code-in { font-size: 26px; letter-spacing: 8px; text-align: center; font-weight: 800; }
.acct-banner { background: #eef4fd; border-color: #c9dbf6; }
.acct-row .t1 { color: var(--navy); }
/* v1.4 service style photos */
.sphotos { display: flex; flex-wrap: wrap; gap: 8px; }
.sphotos .sp { position: relative; width: 68px; height: 84px; border-radius: 10px; overflow: hidden; background: #eef2f6; flex: none; }
.sphotos .sp img { width: 100%; height: 100%; object-fit: cover; }
.sphotos .sp-x { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 15px; line-height: 1; padding: 0; }
.sphotos .sp.add { border: 1.5px dashed #9fb0c3; background: #fff; color: var(--navy); font-size: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; font-family: inherit; }
.sphotos .sp.add span { font-size: 11px; font-weight: 700; }
.svc-chosen { display: flex; gap: 12px; align-items: center; }
.svc-chosen img { width: 64px; height: 80px; object-fit: cover; border-radius: 10px; flex: none; }

/* v1.5.1 home upcoming bookings + count badge */
.upcoming-card { padding: 12px 0 0; }
.upcoming-head { display: flex; align-items: center; gap: 8px; padding: 0 14px 10px; }
.upcoming-head b { flex: 1; font-size: 15.5px; color: var(--ink); }
.count-badge { display: inline-block; background: var(--navy); color: #fff; font-size: 10.5px; font-weight: 800; line-height: 16px; min-width: 16px; padding: 0 5px; border-radius: 9px; text-align: center; }
.upcoming-card .list { box-shadow: none; border-radius: 0; }
.upcoming-card .item:last-child { border-bottom: 0; }

/* v1.5.4 Pro plan picker */
.plan { display: flex; align-items: center; gap: 10px; border: 2px solid var(--line, #d9dee5); border-radius: 12px; padding: 10px 12px; margin: 8px 0; cursor: pointer; background: #fff; }
.plan.on { border-color: var(--navy); background: #f3f6fb; } .plan input { width: auto; flex: 0 0 auto; padding: 0; margin: 0; accent-color: var(--navy); }
.plan .pl-main { flex: 1; min-width: 0; } .plan .pl-price { text-align: right; white-space: nowrap; }
.plan .pwPrice { font-size: 22px; font-weight: 900; color: var(--navy); } .plan .pl-price small { color: var(--muted); font-weight: 600; margin-left: 2px; }
.plan.founding { border-style: dashed; } .plan.founding.on { border-style: solid; border-color: var(--amber, #f0a020); background: #fff8ec; }
.pl-tag { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .4px; background: var(--amber, #f0a020); color: #fff; border-radius: 6px; padding: 1px 6px; vertical-align: 2px; }

/* v1.6 sign-in screens, team invites, follow-ups & multi-device layout */
body.auth-mode #tabbar, body.auth-mode #settingsBtn, body.auth-mode #proBadge, body.auth-mode #backBtn { display: none !important; }
body.auth-mode .view { padding-bottom: 24px; }
.auth-brand { display: flex; gap: 12px; align-items: center; margin: 6px 2px 14px; }
.auth-brand b { font-size: 20px; color: var(--navy); }
.auth-logo { width: 48px; height: 48px; border-radius: 14px; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 26px; }
.pw-wrap { position: relative; } .pw-wrap input { padding-right: 64px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--navy); font-weight: 600; font-size: 14px; padding: 8px; }
.salon-ok { background: #eaf7ef; border: 1px solid #bfe5cc; border-radius: 12px; padding: 10px 12px; margin-top: 10px; }
.salon-code { font-size: 30px; font-weight: 800; letter-spacing: 3px; color: var(--navy); margin: 6px 0; font-family: ui-monospace, Menlo, monospace; }

.btn, button, .chip, .plan, .item[href], [data-act] { cursor: pointer; }
.btn.sms { background: #0f766e; color: #fff; }
.btn.mail { background: var(--blue); color: #fff; }
.send-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.fu-banner { background: #eef4fd; border-color: #c9dbf6; }
.fu-item { align-items: flex-start; }
.fu-acts { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; flex: none; }
.small-in { width: 72px; padding: 6px 8px; display: inline-block; margin: 0 4px; }

/* v1.6: busy buttons (no double taps) + offline strip */
.btn.busy { opacity: .7; pointer-events: none; position: relative; }
.btn.busy::after { content: ""; display: inline-block; width: 14px; height: 14px; margin-left: 8px; vertical-align: -2px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: qsspin .7s linear infinite; }
@keyframes qsspin { to { transform: rotate(360deg); } }
.offline-bar { background: #33414f; color: #fff; font-size: 13.5px; text-align: center; padding: 8px 12px; }
.offline-bar[hidden] { display: none; }
