:root {
  --cocoa: #7a4033;
  --cocoa-2: #5e2f26;
  --rose: #c9917f;
  --rose-soft: #f7e8e3;
  --gold: linear-gradient(135deg, #e3b7a6, #bf8571);
  --sage: #7f9a76;
  --bg: #f6ebe7;
  --card: rgba(255, 251, 249, .82);
  --card-solid: #fffaf8;
  --ink: #3a2a26;
  --muted: #8d7770;
  --line: rgba(122, 64, 51, .12);
  --ok: #4c7a46;
  --ok-soft: #e6f0e1;
  --warn: #9a6a1d;
  --warn-soft: #fbefd9;
  --bad: #b3402f;
  --bad-soft: #fae3de;
  --info: #7a4033;
  --info-soft: #f3e1da;
  --radius: 20px;
  --side: 232px;
  --shadow: 0 6px 24px rgba(122, 64, 51, .08);
  --serif: "Lora", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 14.5px/1.4 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(520px 420px at 95% -5%, #f3d6cb 0%, transparent 70%),
    radial-gradient(480px 420px at -10% 40%, #f1dccf 0%, transparent 70%),
    radial-gradient(500px 400px at 100% 100%, #efd2c6 0%, transparent 70%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
}
a { color: var(--cocoa); }
h1, h2, h3 { margin: 0; line-height: 1.25; font-family: var(--serif); font-weight: 600; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Shell ---------- */
.side {
  position: fixed; inset: 12px auto 12px 12px; width: var(--side);
  background: rgba(255, 250, 248, .72); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, .8); border-radius: 26px; box-shadow: var(--shadow);
  color: var(--ink); display: flex; flex-direction: column; z-index: 30;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 18px 16px 12px; }
.brand strong { display: block; font: 600 16px var(--serif); color: var(--cocoa); }
.brand small { font-size: 11px; color: var(--muted); letter-spacing: .6px; text-transform: uppercase; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gold); color: #fff; font: 600 13px var(--serif); letter-spacing: .5px;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.4);
}
.side nav { flex: 1; overflow-y: auto; padding: 6px 10px; }
.side nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin-bottom: 2px;
  border-radius: 999px; color: #6b5750; text-decoration: none; font-size: 14px;
}
.side nav a:hover { background: rgba(122, 64, 51, .07); }
.side nav a.on { background: var(--cocoa); color: #fff; font-weight: 600; box-shadow: 0 6px 14px rgba(122,64,51,.28); }
.side-foot { padding: 12px 18px 16px; border-top: 1px solid var(--line); font-size: 13px; display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--muted); }
.side-foot a { color: var(--cocoa); display: flex; align-items: center; gap: 6px; text-decoration: none; }
.side-foot .ic { width: 16px; height: 16px; }

.main { margin-left: calc(var(--side) + 36px); padding: 0 28px 40px 8px; max-width: calc(1180px + var(--side)); }
.main-bare { margin: 0 auto; max-width: 420px; padding: 40px 16px; }
.top { display: flex; align-items: center; gap: 12px; padding: 22px 0 14px; }
.top h1 { font-size: 26px; flex: 1; color: var(--cocoa-2); }
.top-date { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .8px; }
.only-mobile { display: none !important; }
.scrim { display: none; }

/* ---------- Building blocks (frosted glass) ---------- */
.card {
  background: var(--card); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, .85); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat {
  background: var(--card); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, .85); border-radius: 18px; box-shadow: var(--shadow); padding: 12px 14px;
}
.stat small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .7px; }
.stat b { display: block; font: 600 22px var(--serif); margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }
.stat.accent { background: linear-gradient(145deg, var(--cocoa) 0%, var(--cocoa-2) 100%); color: #fff; border-color: transparent; }
.stat.accent small, .stat.accent span { color: rgba(255,255,255,.78); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.empty { text-align: center; color: var(--muted); padding: 18px 8px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }

/* Service chips: two rows, swipe sideways */
.chips, .svc-pick {
  display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, auto); grid-auto-columns: max-content;
  gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 -2px 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar, .svc-pick::-webkit-scrollbar { display: none; }
.svc-chip {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; position: relative;
  padding: 8px 14px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255,255,255,.85);
  color: var(--ink); font-family: inherit; font-weight: 600; font-size: 13px; line-height: 1.25; cursor: pointer; white-space: nowrap; margin: 0;
}
.svc-chip small { color: var(--muted); font-weight: 500; font-size: 12px; }
.svc-chip input { position: absolute; opacity: 0; pointer-events: none; }
.svc-chip.on, .svc-chip:has(input:checked) { background: var(--cocoa); border-color: var(--cocoa); color: #fff; box-shadow: 0 6px 14px rgba(122,64,51,.25); }
.svc-chip.on small, .svc-chip:has(input:checked) small { color: rgba(255,255,255,.8); }

.back-btn { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.85); border: 1px solid var(--line); color: var(--cocoa); text-decoration: none; font-size: 22px; line-height: 1; align-items: center; justify-content: center; margin-right: -2px; }

/* Category tabs above service chips */
.cat-tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 -2px 8px; padding: 2px; scrollbar-width: none; }
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tabs button {
  flex: none; padding: 5px 13px; border-radius: 999px; border: 1px solid var(--line); background: transparent;
  color: var(--muted); font-family: inherit; font-weight: 600; font-size: 12.5px; cursor: pointer; white-space: nowrap;
}
.cat-tabs button.on { background: var(--cocoa); border-color: var(--cocoa); color: #fff; }
.bk-money { display: inline-block; margin-top: 6px; padding: 3px 10px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: 12px; font-weight: 600; }

/* Dashboard stat tiles, quick buttons, timeline */
.s-link { position: relative; text-decoration: none; color: inherit; display: block; }
.stats3 { margin-bottom: 12px; }
.stat .s-ic { display: inline-block; vertical-align: -3px; margin-right: 4px; color: var(--cocoa); font-style: normal; }
.stat .s-ic .ic { width: 15px; height: 15px; }
.s-hot { background: linear-gradient(160deg, #fff, #f7e1d9); }
.s-hot b { color: var(--cocoa); }
.s-warn { background: linear-gradient(160deg, #fff7e8, #fdeccb); }
.s-warn .s-ic { color: var(--warn); }
.stat em { font-style: normal; font-weight: 600; }
.stat em.pos { color: var(--ok); } .stat em.neg { color: var(--bad); }
.quick a .q-ic { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--rose-soft); color: var(--cocoa); font-style: normal; }
.quick a .q-ic .ic { width: 21px; height: 21px; }
.quick a.main-q .q-ic { background: rgba(255,255,255,.18); color: #fff; }
.prog { height: 6px; margin: 0 0 10px; }
.tl { display: flex; flex-direction: column; }
.tl-row { display: grid; grid-template-columns: 42px 14px minmax(0, 1fr); gap: 6px; }
.tl-time { text-align: right; padding-top: 10px; line-height: 1.1; }
.tl-time b { font: 600 15px var(--serif); color: var(--cocoa-2); display: block; }
.tl-time small { font-size: 10px; font-weight: 600; color: var(--muted); letter-spacing: .4px; }
.tl-line { position: relative; }
.tl-line::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--line); }
.tl-row:first-child .tl-line::before { top: 18px; }
.tl-row:last-child .tl-line::before { bottom: calc(100% - 18px); }
.tl-line i { position: absolute; left: 50%; top: 13px; width: 11px; height: 11px; margin-left: -5.5px; border-radius: 50%; background: var(--rose); box-shadow: 0 0 0 3px var(--card-solid); }
.tl-row.is-done .tl-line i { background: var(--sage); }
.tl-card { padding: 8px 0 12px; min-width: 0; }
.tl-row.is-done .bk-name { color: var(--muted); }
.tl-top { display: flex; align-items: center; gap: 5px; }
.tl-top .bk-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tl-card .bk-tags { margin: 5px 0 0; }

/* Clients */
.search { position: relative; }
.search .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; }
.search input[type=search] { padding: 8px 14px 8px 44px; border-radius: 999px; min-height: 46px; background: rgba(255,255,255,.9); -webkit-appearance: none; appearance: none; }
.seg.seg-scroll { display: flex; overflow-x: auto; flex-wrap: nowrap; max-width: 100%; scrollbar-width: none; }
.seg-scroll::-webkit-scrollbar { display: none; }
.seg.seg-scroll a { white-space: nowrap; flex: none; }
.cl { display: flex; align-items: center; gap: 6px; padding: 10px 10px 10px 12px; margin-bottom: 8px; border-radius: 20px; background: var(--card); border: 1px solid rgba(255,255,255,.85); box-shadow: var(--shadow); animation: rise .3s ease both; }
.cl-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.cl-info { flex: 1; min-width: 0; }
.cl-name { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cl-info .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-spent { font: 600 14px var(--serif); color: var(--cocoa); }
.cl-act { display: flex; gap: 5px; flex: none; }
.prof { display: flex; align-items: center; gap: 14px; margin: 2px 2px 12px; }
.prof h2 { font-size: 22px; }
.avatar-lg { width: 64px; height: 64px; font-size: 26px; }
.acts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.acts a { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 11px 4px; border-radius: 18px; background: var(--card); border: 1px solid rgba(255,255,255,.85); box-shadow: var(--shadow); color: var(--cocoa); text-decoration: none; font-size: 12px; font-weight: 600; }
.acts a .ic { width: 22px; height: 22px; }
.acts form { display: contents; }
.acts button { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 11px 4px; border-radius: 18px; background: var(--card); border: 1px solid rgba(255,255,255,.85); box-shadow: var(--shadow); color: var(--cocoa); font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer; width: 100%; }
.acts button .ic { width: 22px; height: 22px; }
.enq { align-items: flex-start; }
.enq .avatar { margin-top: 2px; }
.tag-date { background: var(--info-soft); display: inline-flex; align-items: center; gap: 4px; }
.tag-date .ic { width: 13px; height: 13px; }
.ico-line { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; }
.ico-line .ic { width: 14px; height: 14px; }
.lg { display: inline-block; width: 9px; height: 9px; border-radius: 3px; vertical-align: baseline; margin: 0 2px 0 4px; }
.icon-btn .ic { width: 18px; height: 18px; }
.wk-nav .ic, .back-btn .ic { width: 20px; height: 20px; }
.wk-nav { display: grid; place-items: center; }
.btn .ic + .sp { margin-left: 2px; }
.acts a.main-q { background: linear-gradient(145deg, var(--cocoa), var(--cocoa-2)); color: #fff; border-color: transparent; }
.sum-h { cursor: pointer; font: 600 16px var(--serif); }
.next-bk { background: var(--ok-soft); border-color: transparent; }
.next-bk small { text-transform: uppercase; letter-spacing: .6px; font-size: 11px; }

/* Bookings: week strip + cards */
.week { display: flex; align-items: center; gap: 5px; margin-bottom: 12px; }
.wk-nav { width: 26px; text-align: center; color: var(--cocoa); text-decoration: none; font-size: 22px; line-height: 1; flex: none; }
.wd {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 0 6px;
  border-radius: 18px; text-decoration: none; color: var(--ink); background: rgba(255,255,255,.6); border: 1px solid transparent;
}
.wd small { font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.wd b { font: 600 17px var(--serif); }
.wd .dots { display: flex; gap: 2px; height: 5px; margin-top: 2px; }
.wd .dots u { width: 5px; height: 5px; border-radius: 50%; background: var(--rose); }
.wd.is-today { border-color: var(--rose); }
.wd.on { background: var(--cocoa); color: #fff; box-shadow: 0 8px 16px rgba(122,64,51,.28); }
.wd.on small { color: rgba(255,255,255,.75); }
.wd.on .dots u { background: #fff; }
.day-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; margin: 4px 2px 10px; }
.day-head h2 { font-size: 21px; display: inline; margin-right: 6px; }
.day-sep { margin: 14px 2px 8px; font: 600 15px var(--serif); color: var(--cocoa-2); }
.bk {
  display: flex; gap: 12px; padding: 12px; margin-bottom: 10px; border-radius: 20px; background: var(--card);
  border: 1px solid rgba(255,255,255,.85); box-shadow: var(--shadow); animation: rise .35s ease both;
}
.bk-off { opacity: .55; }
.bk-time { width: 50px; flex: none; text-align: center; padding: 6px 0; border-radius: 14px; background: var(--rose-soft); color: var(--cocoa); align-self: flex-start; }
.bk-time b { display: block; font: 600 17px/1.1 var(--serif); }
.bk-time small { font-size: 10.5px; font-weight: 600; letter-spacing: .5px; }
.bk-body { flex: 1; min-width: 0; }
.bk-name { font-weight: 700; font-size: 15.5px; color: var(--ink); text-decoration: none; }
.bk-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0 2px; }
.tag { padding: 3px 10px; border-radius: 999px; background: #f6e3dc; color: var(--cocoa); font-size: 12px; font-weight: 600; }
.tag-empty { background: #eee6e2; color: var(--muted); font-weight: 500; }
.bk-meta { margin-top: 2px; }
.bk-actions { display: flex; align-items: center; gap: 5px; margin-top: 10px; }
.bk-actions .btn.sm { padding: 4px 11px; }
.bk-actions .btn.sm:has(> .ic:only-child) { padding: 4px 10px; }

/* Dashboard hero with parlour props */
.hero {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 14px 8px 12px 18px; border-radius: 26px; margin-bottom: 12px; color: var(--cocoa-2);
  background: radial-gradient(260px 160px at 85% 10%, rgba(255,255,255,.7), transparent 70%), linear-gradient(135deg, #fae6df 0%, #f2d0c4 100%);
  border: 1px solid rgba(255,255,255,.85); box-shadow: var(--shadow); animation: rise .35s ease both;
}
.hero-text { display: flex; flex-direction: column; min-width: 0; }
.hero-text small { font-size: 13px; color: #9a6a5d; white-space: nowrap; }
.hero-text b { font: 600 30px/1.15 var(--serif); margin-top: 2px; }
.hero-text span { font-size: 12.5px; color: #8d5c4f; }
.hero-text .hero-sub { margin-top: 4px; font-weight: 600; color: var(--cocoa); font-size: 12px; white-space: nowrap; }
.hero-art { width: 44%; max-width: 230px; flex: none; }
/* props stay still, no looping animation */
@media (min-width: 861px) { .hero { padding-left: 28px; } .hero-art { width: 320px; } .hero-text b { font-size: 38px; } }

/* Middle + button and quick-add sheet */
.fab {
  flex: none; width: 54px; height: 54px; border-radius: 50%; border: 4px solid var(--bg); margin: -16px 6px 0; padding: 0;
  background: linear-gradient(145deg, var(--cocoa), var(--cocoa-2)); color: #fff; cursor: pointer;
  display: grid; place-items: center; box-shadow: 0 8px 18px rgba(94, 47, 38, .4); transition: transform .2s ease;
}
.fab .ic { width: 24px; height: 24px; stroke-width: 2.2; transition: transform .25s ease; }
body.qs-open .fab .ic { transform: rotate(45deg); }
.fab:active { transform: scale(.93); }
.qs-scrim { display: none; position: fixed; inset: 0; z-index: 35; background: rgba(58, 42, 38, .38); opacity: 0; transition: opacity .25s ease; }
.qs {
  position: fixed; left: 14px; right: 14px; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 40; padding: 8px 10px 10px;
  background: #fffaf8; border-radius: 26px; box-shadow: 0 14px 40px rgba(94, 47, 38, .25);
  transform: translateY(40px) scale(.96); opacity: 0; transition: transform .28s cubic-bezier(.2, .9, .3, 1), opacity .2s ease; visibility: hidden;
}
body.qs-open .tabs { z-index: 45; }
.qs-handle { width: 40px; height: 4px; border-radius: 4px; background: rgba(122, 64, 51, .22); margin: 2px auto 8px; }
.qs-item { display: flex; align-items: center; gap: 12px; padding: 9px 6px; border-radius: 16px; text-decoration: none; color: var(--ink); }
.qs-item:active { background: var(--rose-soft); }
.qs-item .tile-ic { width: 40px; height: 40px; border-radius: 13px; }
.qs-item b { display: block; font-size: 15px; }
.qs-item small { display: block; color: var(--muted); font-size: 12px; }
body.qs-open .qs { transform: none; opacity: 1; visibility: visible; }
body.qs-open .qs-scrim { display: block; opacity: 1; }
@media (min-width: 861px) { .qs, .qs-scrim, .fab { display: none !important; } }

/* Manage hub */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile {
  display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 20px; text-decoration: none; color: var(--ink);
  background: var(--card); border: 1px solid rgba(255,255,255,.85); box-shadow: var(--shadow); animation: rise .35s ease both;
}
.tile b { font: 600 15px var(--serif); margin-top: 8px; }
.tile small { color: var(--muted); font-size: 12px; }
.tile-ic { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--rose-soft); color: var(--cocoa); }
.tile:active { transform: scale(.97); }
@media (min-width: 861px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Initial avatar */
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--gold); color: #fff; font: 600 16px var(--serif); box-shadow: inset 0 0 0 2px rgba(255,255,255,.45);
}

/* Soft motion */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.card, .stat, .quick a, .flash { animation: rise .35s ease both; }
.btn, .quick a, .svc-chip, .tabs a { transition: transform .12s ease, background .2s ease, box-shadow .2s ease; }
.btn:active, .quick a:active, .svc-chip:active { transform: scale(.96); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Home quick actions */
.quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.quick a {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 18px;
  background: var(--card); border: 1px solid rgba(255,255,255,.85); box-shadow: var(--shadow);
  color: var(--cocoa); text-decoration: none; font-size: 12.5px; font-weight: 600;
}
.quick a .ic { width: 24px; height: 24px; }
.quick a.main-q { background: linear-gradient(145deg, var(--cocoa), var(--cocoa-2)); color: #fff; border-color: transparent; }

/* Buttons: rounded pills */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 8px 18px; border-radius: 999px; border: 1px solid var(--cocoa);
  background: var(--cocoa); color: #fff; font: inherit; font-weight: 600; font-size: 14px;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  box-shadow: 0 6px 14px rgba(122, 64, 51, .22);
}
.btn:hover { background: var(--cocoa-2); }
.btn.ghost { background: rgba(255,255,255,.8); color: var(--cocoa); border-color: var(--line); box-shadow: none; }
.btn.ghost:hover { border-color: var(--rose); }
.btn.sm { min-height: 32px; padding: 4px 13px; font-size: 13px; }
.btn.danger { background: transparent; color: var(--bad); border-color: rgba(179, 64, 47, .25); box-shadow: none; }
.btn.wa { background: var(--sage); border-color: var(--sage); box-shadow: 0 6px 14px rgba(127,154,118,.3); }
.btn .ic { width: 16px; height: 16px; }
.icon-btn { background: none; border: 0; padding: 6px; color: inherit; cursor: pointer; display: inline-flex; }
.link-btn { background: none; border: 0; padding: 0; color: var(--cocoa); font: inherit; cursor: pointer; text-decoration: underline; }

/* Forms */
label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 4px; color: #6b5750; }
.field { margin-bottom: 10px; }
input[type=text], input[type=tel], input[type=number], input[type=date], input[type=time], input[type=month],
input[type=password], input[type=search], select, textarea {
  width: 100%; min-height: 42px; padding: 8px 14px; border: 1px solid rgba(122, 64, 51, .16); border-radius: 14px;
  font: inherit; color: inherit; background: rgba(255,255,255,.85);
}
textarea { min-height: 64px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--rose); outline-offset: -1px; border-color: transparent; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 14px; cursor: pointer; color: var(--ink); }
.check input { width: 18px; height: 18px; accent-color: var(--cocoa); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid.fg4 { grid-template-columns: 2fr 1.5fr 1fr 1fr; }
.inline-form { display: inline; }
details.add { padding: 10px; }
details.add > summary { list-style: none; cursor: pointer; width: 100%; }
details.add > summary::-webkit-details-marker { display: none; }
details.add[open] > summary { margin-bottom: 12px; }
details.add:not([open]) { background: transparent; border: 0; box-shadow: none; padding: 0; backdrop-filter: none; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tfoot td { font-weight: 700; border-top: 2px solid var(--line); }

/* Rows */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; }
.list .sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.time-pill { min-width: 62px; text-align: center; background: var(--rose-soft); color: var(--cocoa); border-radius: 14px; padding: 6px 4px; font-weight: 700; font-size: 12.5px; line-height: 1.25; }

/* Badges */
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: #eee6e2; color: #6b5750; white-space: nowrap; }
.b-new, .b-scheduled { background: var(--info-soft); color: var(--info); }
.b-contacted, .b-due { background: var(--warn-soft); color: var(--warn); }
.b-converted, .b-done, .b-paid { background: var(--ok-soft); color: var(--ok); }
.b-closed, .b-cancelled, .b-no-show { background: #eee6e2; color: #8d7770; }

.flash { padding: 10px 16px; border-radius: 16px; margin-bottom: 12px; font-size: 14px; }
.flash-ok { background: var(--ok-soft); color: var(--ok); }
.flash-err { background: var(--bad-soft); color: var(--bad); }

/* Filters */
.seg { display: inline-flex; background: rgba(122, 64, 51, .08); border-radius: 999px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg a { padding: 6px 14px; border-radius: 999px; text-decoration: none; color: var(--muted); font-size: 13px; font-weight: 600; }
.seg a.on { background: #fff; color: var(--cocoa); box-shadow: 0 2px 6px rgba(122,64,51,.12); }

/* Bill items */
.items .item { display: grid; grid-template-columns: 2fr 110px 70px 100px 36px; gap: 8px; align-items: center; margin-bottom: 8px; }
input.as-title { border: 0; background: transparent; padding-left: 2px; font-weight: 600; min-height: 30px; }
.items .item-head { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .7px; }
.items .amount { text-align: right; font-weight: 600; }
.totals { margin-left: auto; max-width: 360px; }
.totals .t { display: flex; justify-content: space-between; padding: 5px 0; gap: 10px; align-items: center; }
.totals .t input { max-width: 130px; text-align: right; }
.totals .grand { font: 600 20px var(--serif); border-top: 1px solid var(--line); margin-top: 4px; padding-top: 10px; }

.invoice { max-width: 720px; }
.inv-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.inv-head h2 { font-size: 22px; color: var(--cocoa); }

/* Login */
.login-card { background: var(--card); backdrop-filter: blur(14px); border: 1px solid rgba(255,255,255,.9); border-radius: 28px; box-shadow: var(--shadow); padding: 30px 24px; }
.login-card .brand-mark { width: 52px; height: 52px; font-size: 17px; margin-bottom: 14px; }
.brand-logo { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; flex: none; background: #000; box-shadow: 0 4px 12px rgba(58, 42, 38, .3); }
.login-logo-wrap { background: #000; border-radius: 20px; overflow: hidden; margin: -10px -6px 18px; box-shadow: 0 10px 24px rgba(58, 42, 38, .25); }
.login-logo { display: block; width: 100%; height: auto; }
.login-card h1 { font-size: 26px; margin-bottom: 4px; color: var(--cocoa-2); }
.login-card p { margin: 0 0 20px; color: var(--muted); }

.bar { height: 8px; background: var(--rose-soft); border-radius: 99px; overflow: hidden; margin-top: 4px; }
.bar i { display: block; height: 100%; background: var(--gold); border-radius: 99px; }

/* ---------- Phones: compact, floating pill nav ---------- */
@media (max-width: 860px) {
  body { font-size: 14px; }
  .only-mobile { display: inline-flex !important; }
  .side { inset: 0 auto 0 0; border-radius: 0 26px 26px 0; transform: translateX(-105%); transition: transform .22s ease; width: 270px; background: rgba(255,250,248,.96); }
  body.menu-open .side { transform: none; }
  body.menu-open .scrim { display: block; position: fixed; inset: 0; background: rgba(58,42,38,.35); z-index: 25; }
  .main { margin-left: 0; padding: 0 12px 92px; }
  .main-bare { padding: 28px 14px; }
  .top { padding: 8px 0 6px; gap: 8px; }
  .top h1 { font-size: 21px; }
  .top-date { font-size: 11px; }

  .grid { gap: 10px; }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .grid > * { min-width: 0; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat { padding: 9px 12px; border-radius: 16px; }
  .stat b { font-size: 18px; }
  .stat small { font-size: 10.5px; }
  .stat span { font-size: 11px; display: block; line-height: 1.3; }
  .g3.keep3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  .card { padding: 12px; border-radius: 18px; margin-bottom: 10px; }
  .card-head { margin-bottom: 6px; }
  h2 { font-size: 16px; }
  .list > li { padding: 8px 0; gap: 8px; }
  .time-pill { min-width: 54px; padding: 5px 3px; font-size: 12px; border-radius: 12px; }
  hr { margin: 8px 0; }
  .empty { padding: 10px 6px; }

  .form-grid, .form-grid.fg4 { grid-template-columns: 1fr 1fr; gap: 0 8px; }
  .form-grid .full { grid-column: 1 / -1; }
  .field { margin-bottom: 8px; }
  input[type=text], input[type=tel], input[type=number], input[type=date], input[type=time], input[type=month],
  input[type=password], input[type=search], select { min-height: 38px; padding: 6px 12px; border-radius: 12px; }
  label { margin-bottom: 2px; font-size: 12px; }
  .btn { min-height: 38px; }
  .btn.sm { min-height: 30px; }

  .items .item-head { display: none; }
  .items .item { grid-template-columns: 1fr 58px 1fr 26px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 14px; gap: 6px; margin-bottom: 6px; background: rgba(255,255,255,.55); }
  .items .item .svc { grid-column: 1 / -1; }
  .items .item .amount { text-align: right; }
  .items .item .remove { justify-self: end; padding: 2px; }
  .items .item input[type=number] { min-height: 34px; padding: 4px 8px; }
  .totals { max-width: none; }
  .totals .t { padding: 3px 0; }
  .hide-mobile { display: none !important; }

  /* Floating pill bar like the reference */
  .main { padding-bottom: 84px; }
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: rgba(255, 249, 246, .88); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid rgba(122, 64, 51, .1); border-radius: 22px 22px 0 0;
    display: flex !important; align-items: stretch; padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }
  .tabs a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    padding: 6px 0; font-size: 10.5px; line-height: 1; color: #a8928a; text-decoration: none; position: relative;
  }
  .tabs a .ic { width: 22px; height: 22px; stroke-width: 1.7; }
  .tabs a.on { color: var(--cocoa); font-weight: 700; }
  .tabs a.on::before {
    content: ""; position: absolute; top: -7px; left: 50%; width: 26px; height: 3px; margin-left: -13px;
    border-radius: 0 0 4px 4px; background: var(--gold);
  }
}

/* Collapsible sections: SVG chevron instead of the browser's triangle */
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary:not(.btn) { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
details > summary:not(.btn)::after {
  content: ""; flex: none; width: 18px; height: 18px; transition: transform .2s ease;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a4033' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
}
details[open] > summary:not(.btn)::after { transform: rotate(180deg); }

@media print {
  .side, .top, .tabs, .no-print, .flash { display: none !important; }
  .main { margin: 0; padding: 0; }
  body { background: #fff; }
  .card { border: 0; padding: 0; box-shadow: none; background: none; }
}
