@import url('https://fonts.googleapis.com/css2?family=Audiowide&family=Bebas+Neue&family=Inter:wght@400;500;600;700&family=Outfit:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Space+Mono:wght@400;700&display=swap');

@keyframes spin { to { transform: rotate(360deg); } }

:root {
  --bg: #0b0b0b;
  --card: #141414;
  --card2: #1a1a1a;
  --border: #252525;
  --border2: #333;
  --text: #efefef;
  --muted: #888;
  --dim: #444;
  --accent: #7cf237;
  --red: #ff5252;
  --green: #4ade80;
  --blue: #60a5fa;
  --yellow: #fbbf24;
  --purple: #a78bfa;

  /* ── Size system (M = default) ── */
  --sz-base:     13px;   /* general body/table text */
  --sz-sm:       10px;   /* muted small labels */
  --sz-md:       12px;   /* buttons, pills, tabs */
  --sz-card-num: 28px;   /* big stat card numbers */
  --sz-cell:     26px;   /* session tick cell */
  --sz-bal:      20px;   /* pack balance / count-num */
  --sz-count:    22px;   /* session count */
  --sz-cname:    13px;   /* client name in grid */
  --sz-tab:      12px;   /* nav tab labels */
  --sz-row-p:    8px;    /* table row vertical padding */
  --sz-card-p:   14px;   /* card padding */
  --sz-input:    13px;   /* input/select font */
}

/* ── App-wide text-size scaling ──
   The --sz-* vars above only cover the weekly table / cards / tabs, so adjusting
   them alone left most of the app (which uses hardcoded px) unscaled. `zoom`
   reflows the ENTIRE rendered UI, so S / M / L / XL now scale every view
   consistently. M is the default (no class) = zoom 1. */
body.sz-s  { zoom: 0.85; }
body.sz-l  { zoom: 1.15; }
body.sz-xl { zoom: 1.30; }

body.light-mode {
  --bg:     #f2f4f8;
  --card:   #ffffff;
  --card2:  #e8ecf4;
  --border: #cdd1de;
  --border2:#b8bccb;
  --text:   #1a1c23;
  --muted:  #5c6070;
  --dim:    #a0a4b0;
  --accent: #2da820;
  --red:    #c0392b;
  --green:  #157a3a;
  --blue:   #1a60b0;
  --yellow: #9a6400;
  --purple: #5e3fa8;
}
body.light-mode { background: var(--bg); color: var(--text); }
body.light-mode html { background: var(--bg); }
body.light-mode .nav { background: #fff; border-bottom: 1px solid var(--border); box-shadow: 0 1px 6px rgba(0,0,0,.07); }
body.light-mode .week-bar { background: #f2f4f8; box-shadow: 0 3px 10px rgba(0,0,0,.12); }
body.light-mode .tab { color: var(--muted); }
body.light-mode .tab.active { background: var(--accent); color: #fff; }
body.light-mode .tab:hover:not(.active) { background: var(--card2); color: var(--text); }
body.light-mode .card { background: #fff; border-color: var(--border); box-shadow: 0 1px 4px rgba(0,0,0,.05); }
body.light-mode .c-name,
body.light-mode .cl-row-name,
body.light-mode .exp-row-desc,
body.light-mode .rec-row-desc { color: var(--text) !important; }
body.light-mode table.main tr { background: var(--card); }
body.light-mode table.main tr.client-row td { background: #fff; color: var(--text); }
body.light-mode table.main tr.client-row:hover td { background: #f5f7ff; }
body.light-mode table.main tr.adhoc-row td { background: #fff; color: var(--text); }
body.light-mode table.main tr.adhoc-row:hover td { background: #f5f7ff; }
body.light-mode .chk { border-color: var(--border); background: #eaecf4; }
body.light-mode .chk.on { background: var(--accent); border-color: var(--accent); color: #fff; }
body.light-mode .wbtn { background: var(--card2); color: var(--text); border-color: var(--border); }
body.light-mode .modal { background: var(--card); border-color: var(--border); box-shadow: 0 8px 32px rgba(0,0,0,.12); }
body.light-mode .modal-title { color: var(--accent); }
body.light-mode .mbtn-save { background: var(--accent); color: #fff; border-color: var(--accent); }
body.light-mode .add-form, body.light-mode .pkg-form { background: #fff; border-color: var(--border); }
body.light-mode input[type=text], body.light-mode input[type=number], body.light-mode input[type=email],
body.light-mode input[type=password], body.light-mode input[type=date], body.light-mode input[type=tel], body.light-mode select, body.light-mode textarea {
  background: #fff !important; border-color: var(--border) !important; color: var(--text) !important; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: #0b0b0b; width: 100%; max-width: 100%; overflow-x: clip; }
body { font-family: 'Outfit', sans-serif; background: #0b0b0b; color: #efefef; min-height: 100vh; width: 100%; max-width: 100%; overflow-x: clip; }

table.main tr { background: #141414; }
table.main tr.client-row td { background: var(--card); color: var(--text); }
table.main tr.client-row:hover td { background: #1e1e1e; }
/* Ad-hoc / walk-in summary row — matches client-row backgrounds in both themes */
table.main tr.adhoc-row td { background: var(--card); color: var(--text); }
table.main tr.adhoc-row:hover td { background: #1e1e1e; }

/* ── NAV ── */
.nav {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px 0; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: #080808; z-index: 200;
  flex-wrap: wrap; max-width: 100vw; box-sizing: border-box;
}
/* tabs fill a dedicated second row */
.tabs-wrap {
  flex: 1 1 100%; order: 10;
  position: relative; overflow: hidden;
  margin: 0 -12px;
}
.tabs-wrap::after {
  content: ''; pointer-events: none;
  position: absolute; right: 0; top: 0; bottom: 0; width: 36px;
  background: linear-gradient(to right, transparent, #080808);
  z-index: 2;
}
body.light-mode .tabs-wrap::after { background: linear-gradient(to right, transparent, #fff); }
.tabs {
  display: flex; gap: 2px; padding: 4px 0;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scroll-behavior: smooth;
  border-top: 1px solid var(--border);
  padding-left: 12px; padding-right: 36px;
}
.tabs::-webkit-scrollbar { display: none; }
.nav-controls {
  display: flex; align-items: center; gap: 5px;
  margin-left: auto; flex-shrink: 0; flex-wrap: nowrap;
}
.logo-img {
  height: 40px; width: auto; flex-shrink: 0;
  filter: none;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  transition: opacity .15s;
}
.logo-img:hover { opacity: .75; }
.tab { padding: 5px 13px; border-radius: 7px; font-size: var(--sz-tab,12px); font-weight: 600; cursor: pointer; border: none; background: transparent; color: var(--muted); transition: all .2s; white-space: nowrap; flex-shrink: 0; }
.tab.active { background: var(--accent); color: #0b0b0b; }

/* Money sub-nav pills (Invoicing / Expenses / Tax) */
.msub { padding: 4px 12px; border-radius: 20px; font-family: 'Outfit', sans-serif; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; border: 1px solid var(--border); background: transparent; color: var(--muted); flex-shrink: 0; transition: all .15s; }
.msub:hover { border-color: var(--accent); color: var(--accent); }
.msub.active { background: rgba(124,242,55,.12); border-color: var(--accent); color: var(--accent); }

@media (max-width: 640px) {
  .nav { padding: 6px 10px; gap: 6px; }
  .logo-img { height: 30px; }
  /* allow the control cluster to wrap onto a 2nd row so nothing clips off the right edge on phones.
     flex-shrink/min-width override is required: the base rule is flex:0 0 (nowrap), so without these
     it just grows past the viewport instead of wrapping. */
  .nav-controls { flex-wrap: wrap; justify-content: flex-end; row-gap: 5px; flex-shrink: 1; min-width: 0; }
  .tab { padding: 4px 9px; font-size: 11px; }
  #last-sync-badge { font-size: 9px; }
  #signout-btn { font-size: 10px; padding: 3px 7px; }
}

/* Landscape: logo + tabs each take full width, tabs wrap freely */
@media (orientation: landscape) and (max-height: 500px) {
  .nav { padding: 6px 14px; gap: 4px; }
  .logo-img { height: 26px; }
  .tabs {
    flex: 1 1 100%;
    margin-left: 0;
    flex-wrap: wrap;
    border-radius: 8px;
    max-width: 100%;
    overflow: visible;
  }
  .tab { padding: 4px 10px; font-size: 11px; }
}

/* ── VIEWS ── */
.view { display: none; max-width: 100vw; overflow-x: clip; box-sizing: border-box; }
.view.active { display: block; }

/* ── WEEK TOOLBAR — compact rounded card inside .nav: week changer + goals strip ── */
.week-bar { display: flex; flex: 1 1 100%; order: 20; padding: 4px 0 6px; min-width: 0; }
.wk-toolbar {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px;
  background: var(--card2); border: 1px solid var(--border); border-radius: 16px; padding: 7px 9px;
}
body.light-mode .wk-toolbar { background: #eef1f7; border-color: var(--border); }
/* ── Top split: week changer (left) + At-a-glance carousel (right) — 50/50 on every screen ── */
.wk-split { display: flex; gap: 8px; align-items: stretch; }
.wk-split > * { flex: 1 1 0; min-width: 0; box-sizing: border-box; }

/* LEFT — week changer card (date-led; tap the date to open that month in the Calendar) */
.wk-changer { display: flex; align-items: center; gap: 4px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 6px; }
body.light-mode .wk-changer { background: #fff; }
.wk-arrow { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; background: var(--card2); border: 1px solid var(--border); color: var(--muted); font-size: 19px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: color .15s, background .15s, border-color .15s; }
body.light-mode .wk-arrow { background: #f2f4f8; }
.wk-arrow:hover { color: var(--accent); border-color: rgba(124,242,55,.4); }
.wk-arrow:active { transform: scale(.92); }
.wk-center { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; padding: 2px; border-radius: 10px; border: 1px solid transparent; transition: background .15s, border-color .15s; overflow: hidden; }
.wk-center:hover, .wk-center:focus-visible { background: rgba(124,242,55,.06); border-color: rgba(124,242,55,.2); outline: none; }
.wk-date { font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 21px; letter-spacing: .2px; color: var(--text); line-height: 1.05; white-space: nowrap; text-transform: none; }
.wk-meta { display: flex; align-items: baseline; justify-content: center; font-size: 12px; line-height: 1.2; white-space: nowrap; max-width: 100%; }
.wk-sub { color: var(--muted); font-weight: 600; }
.wk-rev { color: var(--green); font-weight: 800; }
.wk-rev::before { content: "·"; color: var(--muted); font-weight: 600; margin: 0 5px; }

/* RIGHT — At a glance: one KPI card per view, swipeable + auto-rotating every 5s */
.wk-glance { display: flex; flex-direction: column; gap: 5px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 6px 6px 5px; overflow: hidden; }
body.light-mode .wk-glance { background: #fff; }
.wk-glance #week-cards { display: flex; flex: 1; gap: 6px; overflow-x: auto; scroll-snap-type: x proximity; overflow-anchor: none; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 0; margin: 0; }
.wk-glance #week-cards::-webkit-scrollbar { display: none; }
.wk-glance #week-cards > .card { flex: 0 0 100%; min-width: 100%; scroll-snap-align: start; box-sizing: border-box; }
.wk-glance .cards-dots { display: flex; justify-content: center; align-items: center; gap: 5px; padding: 1px 0 0; }
.wk-glance .cards-dots .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--border); transition: width .2s ease, background .2s ease; flex-shrink: 0; }
.wk-glance .cards-dots .dot.active { width: 16px; border-radius: 3px; background: var(--accent); }

/* Swipe-to-change-week: the session sheet slides in from the swipe direction */
@keyframes mtWkInNext { from { transform: translateX(34px); opacity: .5; } to { transform: none; opacity: 1; } }
@keyframes mtWkInPrev { from { transform: translateX(-34px); opacity: .5; } to { transform: none; opacity: 1; } }
.mt-wk-in-next { animation: mtWkInNext .26s cubic-bezier(.22,.61,.36,1); }
.mt-wk-in-prev { animation: mtWkInPrev .26s cubic-bezier(.22,.61,.36,1); }

/* Compact goals strip (3 mini progress bars) inside the week toolbar */
.wk-goals-row { display: flex; align-items: center; gap: 10px; padding: 1px 2px 0; }
.wk-goal { display: flex; align-items: center; gap: 5px; flex: 1; min-width: 0; }
.wk-goal-lbl { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); flex-shrink: 0; }
.wk-goal-track { flex: 1; height: 5px; min-width: 16px; background: var(--border); border-radius: 3px; overflow: hidden; }
.wk-goal-fill { display: block; height: 100%; border-radius: 3px; transition: width .5s; }
.wk-goal-val { font-size: 10px; font-weight: 700; color: var(--text); white-space: nowrap; flex-shrink: 0; display: inline-flex; align-items: center; }
.wk-goal-input { width: 38px; background: transparent; border: none; border-bottom: 1px dashed var(--border); color: var(--muted); font-family: 'Outfit', sans-serif; font-size: 10px; font-weight: 700; text-align: center; padding: 0 1px; outline: none; -moz-appearance: textfield; }
.wk-goal-input::-webkit-outer-spin-button, .wk-goal-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.wk-goal-input:focus { border-bottom-color: var(--accent); color: var(--text); }

/* ── SUMMARY CARDS ── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding: 16px 8px 14px; }
.cards-dots { display: none; }   /* carousel indicator — shown only on mobile, where #week-cards scrolls */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: var(--sz-card-p,14px) 16px; }
.card-label { font-size: var(--sz-sm,10px); font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 5px; }
.card-val { font-family: 'Bebas Neue', sans-serif; font-size: var(--sz-card-num,28px); letter-spacing: 1px; line-height: 1; }
.cv-accent { color: var(--accent); }
.cv-green { color: var(--green); }
.cv-red { color: var(--red); }
.cv-blue { color: var(--blue); }

/* ── TABLE ── */
.tbl-wrap { padding: 0 18px 18px; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100vw; box-sizing: border-box; }

/* Mobile: shrink table to fit phone screen */
@media (max-width: 640px) {
  .tbl-wrap { padding: 0 4px 14px; }
  table.main { min-width: 480px; }
  table.main th { font-size: 8px; padding: 5px 2px; letter-spacing: 0; }
  .td-name { min-width: 80px; padding: 7px 3px; }
  .c-name { font-size: 10px; max-width: 80px; }
  .c-meta { font-size: 9px; gap: 3px; }
  .mode-badge { font-size: 8px; padding: 1px 4px; }
  .td-bal { min-width: 28px; padding: 6px 2px; }
  .bal-num { font-size: 15px; }
  .td-day { padding: 5px 1px; min-width: 24px; }
  .chk { width: 20px; height: 20px; border-radius: 5px; font-size: 9px; border-width: 1px; }
  .td-count { min-width: 24px; padding: 5px 2px; }
  .count-num { font-size: 15px; }
  .td-rev { min-width: 50px; font-size: 10px; padding: 5px 3px; }
  .td-pay { padding: 5px 2px; }
  .pbtn { padding: 2px 4px; font-size: 9px; border-radius: 4px; }
  .td-after { min-width: 28px; padding: 6px 2px; }
}
.sec-title { font-family: 'Bebas Neue', sans-serif; font-size: 16px; letter-spacing: 2px; color: var(--dim); margin-bottom: 10px; margin-top: 4px; }

table.main { width: 100%; border-collapse: collapse; min-width: 680px; }
table.main th {
  padding: 8px 8px; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--muted); border-bottom: 1px solid var(--border);
  text-align: center; white-space: nowrap;
}
table.main th.tl { text-align: left; }
table.main td { border-bottom: 1px solid #1a1a1a; }

tr.client-row:hover td { background: rgba(255,255,255,.015); }

.td-name { padding: var(--sz-row-p,8px) 8px; min-width: 130px; background: transparent; }
.c-name { font-weight: 700; font-size: var(--sz-cname,13px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; color: var(--text); }
.c-meta { font-size: var(--sz-sm,10px); color: var(--muted); margin-top: 1px; display: flex; gap: 6px; align-items: center; }

/* Rate privacy mask */
.rate-hidden { 
  filter: blur(4px); 
  transition: filter .2s;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.rate-hidden:hover, .rate-hidden:active { filter: blur(0); }

/* Payment mode badge */
.mode-badge {
  font-size: 9px; font-weight: 700; padding: 1px 6px;
  border-radius: 4px; text-transform: uppercase; letter-spacing: .05em;
}
.mode-prepaid { background: rgba(167,139,250,.15); color: var(--purple); }
.mode-weekly { background: rgba(251,191,36,.15); color: var(--yellow); }
.mode-hybrid { background: rgba(96,165,250,.15); color: var(--blue); }
.mode-online { background: rgba(52,211,153,.15); color: var(--green); }

/* Balance cell */
.td-bal { padding: 8px 6px; text-align: center; min-width: 52px; }
.bal-num { font-family: 'Bebas Neue', sans-serif; font-size: var(--sz-bal,20px); line-height: 1; }
.bal-pos { color: var(--green); }
.bal-neg { color: var(--red); }
.bal-zero { color: var(--dim); }

/* Day checkbox */
.td-day { padding: 8px 4px; text-align: center; min-width: 36px; }
.chk {
  width: var(--sz-cell,26px); height: var(--sz-cell,26px); border-radius: 7px; border: 2px solid var(--border);
  background: var(--card); cursor: pointer; display: flex; align-items: center;
  justify-content: center; margin: 0 auto; transition: all .15s; font-size: calc(var(--sz-cell,26px) * .5); font-weight: 700;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}
/* PROG "P" toggle — sized + aligned like a day checkbox so it sits at the same
   level as the tick boxes. Colours (blue when delivered/charged) set inline. */
.prog-chk {
  width: var(--sz-cell,26px); height: var(--sz-cell,26px); border-radius: 7px; border: 2px solid var(--border);
  background: var(--card); cursor: pointer; display: flex; align-items: center; justify-content: center;
  margin: 0 auto; padding: 0; line-height: 1; font-family: 'Outfit', sans-serif; font-weight: 800;
  font-size: calc(var(--sz-cell,26px) * .5); transition: all .15s;
}
body.compact .prog-chk { width: 18px; height: 18px; border-radius: 4px; border-width: 1px; font-size: 10px; }
.pack-badge-dot {
  position: absolute; top: 1px; right: 1px;
  background: #185FA5; color: #E6F1FB;
  font-size: 8px; font-weight: 700;
  min-width: 14px; height: 14px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  line-height: 1; padding: 0 2px; pointer-events: none;
  z-index: 2;
}
/* Paid pack credit — gold (blue default = pending, credited when the invoice is marked paid). */
.pack-badge-dot.paid { background: #C8912B; color: #1c1400; }
.chk:hover:not(.on) { border-color: var(--accent); background: rgba(124,242,55,.06); }
.chk.on { background: var(--accent); border-color: var(--accent); color: #0b0b0b; }
.chk.on.sub-trainer { background: var(--purple); border-color: var(--purple); color: #fff; }

/* Finalised (locked) week — sheet is read-only; show it can't be edited and
   suppress the empty-cell hover affordance so the lock reads clearly. */
#session-sheet.week-locked .chk,
#session-sheet.week-locked .prog-chk { cursor: not-allowed; }
#session-sheet.week-locked .chk:hover:not(.on) { border-color: var(--border); background: var(--card); }

/* Coach/owner "on holiday" week — a soft green wash over the weekly view so it
   reads at a glance as a deliberately-quiet week. Overlay is non-interactive. */
#view-week.coach-away { position: relative; }
#view-week.coach-away::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 4;
  background: rgba(124, 242, 55, .09);
}

/* First-run coach: pulse the empty session boxes so new trainers notice them.
   Only active while the "tick a session" step is showing (class on #view-week). */
.wk-coach-tap td.td-day .chk:not(.on) {
  border-color: rgba(124,242,55,.6);
  animation: chkCoachPulse 1.7s ease-in-out infinite;
}
.wk-coach-tap td.td-today .chk:not(.on) { border-color: rgba(124,242,55,.8); }
@keyframes chkCoachPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124,242,55,0); }
  50%      { box-shadow: 0 0 0 3px rgba(124,242,55,.18); }
}
@media (prefers-reduced-motion: reduce) {
  .wk-coach-tap td.td-day .chk:not(.on) { animation: none; }
}

/* ── Today column highlight ──
   Borders kept at a uniform 1px so the today column reads at the same line
   thickness as the rest of the table grid (the green colour carries the
   emphasis, not a heavier stroke). */
th.th-today {
  background: rgba(124,242,55,.13);
  color: var(--accent);
  border-left: 1px solid rgba(124,242,55,.40);
  border-right: 1px solid rgba(124,242,55,.40);
  border-top: 1px solid rgba(124,242,55,.50);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .5px;
  position: relative;
}
th.th-today::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 1px;
  background: rgba(124,242,55,.40);
}
td.td-today {
  background: rgba(124,242,55,.055);
  border-left: 1px solid rgba(124,242,55,.18);
  border-right: 1px solid rgba(124,242,55,.18);
}
td.td-today .chk {
  width: 34px; height: 34px; border-radius: 9px;
  border-color: rgba(124,242,55,.40);
  box-shadow: 0 2px 8px rgba(0,0,0,.35), 0 0 0 1px rgba(124,242,55,.15);
}
td.td-today .chk:hover:not(.on) {
  border-color: var(--accent);
  background: rgba(124,242,55,.12);
  box-shadow: 0 3px 12px rgba(0,0,0,.40), 0 0 0 1px rgba(124,242,55,.30);
}
body.compact td.td-today .chk { width: 24px; height: 24px; }

/* ── Compact mode ── */
body.compact .chk { width: 18px; height: 18px; border-radius: 4px; font-size: 9px; border-width: 1px; }
body.compact .td-day { padding: 3px 2px; min-width: 24px; }
body.compact .td-name { padding: 4px 4px; }
body.compact .td-bal { padding: 3px 3px; min-width: 32px; }
body.compact .td-count { padding: 3px 3px; }
body.compact .td-rev { padding: 3px 4px; font-size: 11px; min-width: 56px; }
body.compact .td-pay { padding: 3px 3px; }
body.compact .pbtn { padding: 2px 5px; font-size: 9px; }
body.compact .count-num { font-size: 15px; }
body.compact .c-name { font-size: 10px; }
body.compact .c-meta { font-size: 8px; }
body.compact tr.client-row td { padding-top: 1px; padding-bottom: 1px; }
body.compact .bal-num { font-size: 12px; }
body.compact .note-btn { font-size: 9px; padding: 1px 4px; }

/* Count & revenue */
.td-count { padding: 8px 6px; text-align: center; min-width: 36px; }
.count-num { font-family: 'Bebas Neue', sans-serif; font-size: var(--sz-count,22px); color: var(--accent); }
.td-rev { padding: 8px 8px; text-align: right; min-width: 78px; font-weight: 700; font-size: 13px; color: var(--green); white-space: nowrap; }

/* PAY badges (Bank / Cash / Stripe) — circular, colour-coded. Used above the
   notes icon in each client row (tap to cycle). .pay-cell = compact in-table size. */
.pay-badge { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font: 700 13px/1 'Outfit', sans-serif; border: 1.5px solid; box-sizing: border-box; padding: 0; cursor: pointer; background: transparent; transition: filter .15s, transform .1s; }
.pay-badge:active { transform: scale(.9); }
.pay-badge.pay-cell { width: 22px; height: 22px; font-size: 11px; }
.pay-b { color: #2a6fdb; border-color: #2a6fdb; background: rgba(42,111,219,.12); }
.pay-c { color: #c9890a; border-color: #eaa61c; background: rgba(234,166,28,.16); }
.pay-s { color: #635bff; border-color: #635bff; background: rgba(99,91,255,.12); }
.pay-none { color: var(--muted); border-color: var(--border); background: transparent; }

/* Compact the client quick-panel so the whole profile (incl. the Last-8-weeks
   chart) fits with minimal scrolling — tighter body padding, section gaps,
   section-heading spacing and control heights. Overrides the inline margins. */
#cp-body { padding: 6px 14px 12px !important; }
#cp-body > div { margin-bottom: 5px !important; }
#cp-body > div > div:first-child { margin-bottom: 3px !important; } /* uppercase section labels */
#cp-body input, #cp-body select, #cp-body textarea { padding-top: 6px !important; padding-bottom: 6px !important; }
#cp-body #cp-week-summary > div { padding: 8px 6px !important; } /* the 3 stat tiles */

/* Payment toggle B/C */
.td-pay { padding: 8px 6px; text-align: center; }
.pay-row { display: flex; gap: 3px; justify-content: center; }
.pbtn { padding: 3px 8px; border-radius: 5px; border: 1px solid var(--border); background: transparent; font-size: 10px; font-weight: 700; cursor: pointer; color: var(--muted); transition: all .15s; }
.pbtn.pb { border-color: var(--blue); color: var(--blue); background: rgba(96,165,250,.15); }
.pbtn.pc { border-color: var(--yellow); color: var(--yellow); background: rgba(251,191,36,.15); }

/* After balance */
.td-after { padding: 8px 6px; text-align: center; min-width: 52px; }

/* Totals row */
tr.tot-row td { background: #101010; border-top: 2px solid var(--border2); padding: 9px 8px; font-weight: 700; font-size: 11px; color: var(--muted); text-align: center; }

/* ── CLIENTS VIEW ── */
.clients-wrap { padding: 16px 18px; max-width: 960px; margin: 0 auto; }
.client-list-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cl-roster-inner { min-width: 640px; }

.client-list { background: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; margin-bottom: 20px; }
.cl-header { padding: 12px 16px; background: var(--card2); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.cl-title { font-family: 'Bebas Neue', sans-serif; font-size: 17px; letter-spacing: 1px; color: var(--accent); }

.cl-head, .cl-row { display: grid; grid-template-columns: minmax(0,1fr) 100px 136px; align-items: center; gap: 10px; }
.cl-head { padding: 8px 16px; border-top: 1px solid var(--border); }
.cl-row { padding: 11px 16px; border-top: 1px solid #1c1c1c; }
.cl-row:hover { background: rgba(255,255,255,.015); }
.cl-row-info { flex: 1; min-width: 0; }
.cl-row-name { font-weight: 600; font-size: var(--sz-cname,13px); color: var(--text); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.cl-row-rate { font-size: 13px; color: var(--muted); text-align: center; }
.cl-credit-pill { display: inline-flex; align-items: center; gap: 3px; border-radius: 20px; padding: 2px 3px; border: 1px solid; font-size: 11px; flex-shrink: 0; }
.cl-credit-pill .cc-adj { width: 18px; height: 18px; border-radius: 5px; border: none; background: rgba(255,255,255,.08); color: inherit; font-size: 13px; cursor: pointer; display: flex; align-items: center; justify-content: center; line-height: 1; padding: 0; flex-shrink: 0; }
.cl-credit-pill .cc-adj:hover { background: rgba(255,255,255,.18); }
.cl-credit-num { font-weight: 700; min-width: 22px; text-align: center; }

/* Mode toggle switch */
.mode-switch { display: flex; background: #111; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.ms-btn { flex: 1; padding: 4px 6px; font-size: 10px; font-weight: 700; cursor: pointer; border: none; background: transparent; color: var(--muted); transition: all .15s; text-align: center; }
.ms-btn.ms-prepaid.act { background: rgba(167,139,250,.2); color: var(--purple); }
.ms-btn.ms-weekly.act { background: rgba(251,191,36,.2); color: var(--yellow); }

/* Credits control */
.credit-ctrl { display: flex; align-items: center; gap: 6px; justify-content: center; }
.cc-btn { width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--border); background: var(--card); color: var(--text); font-size: 15px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .15s; }
.cc-btn:hover { border-color: var(--accent); color: var(--accent); }
.cc-val { font-family: 'Bebas Neue', sans-serif; font-size: 20px; color: var(--accent); min-width: 28px; text-align: center; }

.cl-row-bal { text-align: center; font-family: 'Bebas Neue', sans-serif; font-size: 18px; } /* legacy */

.icon-btn { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--border); background: transparent; color: var(--muted); font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .15s; }
.icon-btn:hover { border-color: var(--red); color: var(--red); }
.icon-btn.edit:hover { border-color: var(--blue); color: var(--blue); }

/* Add client form */
.add-form { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.form-title { font-family: 'Bebas Neue', sans-serif; font-size: 17px; letter-spacing: 1px; color: var(--accent); margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 100px 120px 120px auto; gap: 10px; align-items: end; }
.fg label { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 5px; }
.fg input, .fg select { width: 100%; background: var(--card2); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-family: 'Outfit', sans-serif; font-size: 13px; padding: 9px 11px; outline: none; transition: border-color .2s; }
.fg input:focus, .fg select:focus { border-color: var(--accent); }
.fg input::placeholder { color: var(--dim); }
.btn-add { padding: 9px 18px; background: var(--accent); color: #0b0b0b; border: none; border-radius: 8px; font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap; }
.btn-add:hover { opacity: .85; }

/* ── PACKAGES ── */
.pkg-wrap { padding: 16px 18px; max-width: 900px; margin: 0 auto; }
.pkg-form-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 20px; margin-bottom: 20px; }
.pkg-form-title { font-family: 'Bebas Neue', sans-serif; font-size: 17px; letter-spacing: 1px; color: var(--accent); margin-bottom: 14px; }
.pkg-form-grid { display: grid; grid-template-columns: 1fr 1fr 80px 120px 100px 120px; gap: 10px; align-items: end; }

.pkg-history-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.pkg-hist-header { padding: 12px 16px; background: var(--card2); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.pkg-hist-title { font-family: 'Bebas Neue', sans-serif; font-size: 17px; letter-spacing: 1px; color: var(--accent); }

.pkg-row { display: grid; grid-template-columns: 1fr 110px 80px 90px 90px 100px 36px; gap: 8px; align-items: center; padding: 12px 16px; border-top: 1px solid #1c1c1c; font-size: 13px; }
.pkg-row:hover { background: rgba(255,255,255,.015); }
.pkg-row-client { font-weight: 600; }
.pkg-row-date { font-size: 12px; color: var(--muted); }
.pkg-row-sessions { font-family: 'Bebas Neue', sans-serif; font-size: 20px; color: var(--accent); text-align: center; }
.pkg-row-amount { font-weight: 700; color: var(--green); text-align: right; }
.pkg-row-notes { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pkg-empty { padding: 32px; text-align: center; color: var(--muted); font-size: 13px; }

/* col headers for pkg */
.pkg-col-heads { display: grid; grid-template-columns: 1fr 110px 80px 90px 90px 100px 36px; gap: 8px; padding: 8px 16px; border-top: 1px solid var(--border); }
.pkg-col-heads span { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }

@media (max-width: 640px) {
  .pkg-form-grid { grid-template-columns: 1fr 1fr; }
  .pkg-row { grid-template-columns: 1fr 70px 80px 80px; }
  .pkg-row > :nth-child(5), .pkg-row > :nth-child(6), .pkg-row > :nth-child(7) { display: none; }
  .pkg-col-heads > :nth-child(5), .pkg-col-heads > :nth-child(6), .pkg-col-heads > :nth-child(7) { display: none; }
  .pkg-col-heads { grid-template-columns: 1fr 70px 80px 80px; }
}


.report-wrap { padding: 16px 18px; max-width: 960px; margin: 0 auto; }
.rpt-controls { display: flex; gap: 8px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.rpt-sel { background: var(--card2); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-family: 'Outfit', sans-serif; font-size: 12px; padding: 7px 12px; outline: none; cursor: pointer; }
.rpt-sel:focus { border-color: var(--accent); }

.rpt-section { background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 16px; }
.rpt-head { padding: 11px 16px; background: var(--card2); border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px; }
.rpt-head-title { font-family: 'Bebas Neue', sans-serif; font-size: 16px; letter-spacing: 1px; color: var(--accent); }
.rpt-row { display: flex; align-items: center; padding: 10px 16px; border-top: 1px solid #1c1c1c; font-size: 13px; gap: 10px; }
.rr-name { flex: 1; font-weight: 600; color: #f0f0f0; }
.rr-meta { font-size: 11px; color: var(--muted); }
.rr-val { font-weight: 700; color: var(--green); min-width: 80px; text-align: right; }
.chip { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 700; }
.chip-b { background: rgba(96,165,250,.15); color: var(--blue); }
.chip-c { background: rgba(251,191,36,.15); color: var(--yellow); }
.chip-s { background: rgba(99,91,255,.15); color: #635bff; }
.pbtn.ps { border-color: #635bff; color: #635bff; background: rgba(99,91,255,.15); }
.chip-n { background: rgba(68,68,68,.3); color: var(--dim); }
.cmp-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.cmp-up { background: rgba(74,222,128,.15); color: var(--green); }
.cmp-down { background: rgba(255,82,82,.15); color: var(--red); }
.cmp-flat { background: rgba(136,136,136,.15); color: var(--muted); }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.chart-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.chart-card.full { grid-column: 1 / -1; }
.chart-title { font-family: 'Bebas Neue', sans-serif; font-size: 15px; letter-spacing: 1px; color: var(--accent); margin-bottom: 14px; }
.chart-wrap { position: relative; height: 200px; }
.chart-wrap.tall { height: 240px; }
.period-pills { display: flex; gap: 4px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.period-pills::-webkit-scrollbar { display: none; }
.period-pill { padding: 4px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; cursor: pointer; border: 1px solid var(--border); background: transparent; color: var(--muted); transition: all .15s; white-space: nowrap; }
.period-pill.active { background: var(--accent); color: #0b0b0b; border-color: var(--accent); }
@media (max-width: 640px) {
  .chart-grid { grid-template-columns: 1fr; }
  .chart-card.full { grid-column: 1; }
}

/* ── CALENDAR ── */
.cal-wrap { padding: 14px 18px; max-width: 1100px; margin: 0 auto; }
.cal-year-nav { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.cal-year-label { font-family: 'Bebas Neue', sans-serif; font-size: 28px; letter-spacing: 2px; color: var(--accent); }
.cal-months-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
.cal-month { background: var(--card); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; transition: box-shadow .3s, border-color .3s; scroll-margin-top: 90px; }
/* Brief flash when jumped-to from the week bar's date tap */
.cal-month.cal-month-flash { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(124,242,55,.35); }
@media (prefers-reduced-motion: reduce){ .cal-month { transition: none; } }
.cal-month-head { padding: 16px 18px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.cal-month-name { font-family: 'Bebas Neue', sans-serif; font-size: 24px; letter-spacing: 1px; color: var(--text); }
.cal-month-stats { display: flex; gap: 22px; }
.cal-stat { text-align: right; }
.cal-stat-label { font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.cal-stat-val { font-family: 'Bebas Neue', sans-serif; font-size: 20px; letter-spacing: .5px; line-height: 1; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr) 1.15fr; gap: 8px; padding: 12px; }
.cal-day-head { padding: 2px 4px; text-align: center; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.cal-day { min-height: 92px; padding: 10px 11px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); position: relative; cursor: pointer; display: flex; flex-direction: column; transition: box-shadow .12s, border-color .12s; }
.cal-day:hover { border-color: var(--muted); }
.cal-day.other-month { cursor: default; }
.cal-day.other-month .cal-day-num { display: none; }
.cal-grid > .cal-day:nth-child(8n+6), .cal-grid > .cal-day:nth-child(8n+7) { background: var(--card2); }
.cal-day.today { border-color: var(--accent); }
.cal-day.cal-day-selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); background: rgba(124,242,55,.06); }
.cal-day.today .cal-day-num { color: var(--accent); font-weight: 700; }
.cal-day-num { font-size: 17px; color: var(--text); line-height: 1; font-weight: 500; }
.cal-day-cx { position: absolute; top: 8px; right: 10px; font-size: 11px; font-weight: 700; color: var(--red); line-height: 1; }
.cal-day-dots { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 7px; }
.cal-day-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex-shrink: 0; }
.cal-day-dot.dot-b { background: var(--blue); }
.cal-day-dot.dot-c { background: var(--yellow); }
.cal-day-foot { margin-top: auto; padding-top: 6px; }
/* iOS date inputs have a wide intrinsic min-width — keep them inside their grid column */
#cp-dob, #away-from, #away-to { min-width: 0; max-width: 100%; box-sizing: border-box; }
.cal-day-rev { font-size: 14px; font-weight: 700; color: var(--green); line-height: 1.25; }
.cal-day-exp { font-size: 13px; font-weight: 700; color: var(--red); line-height: 1.25; }
.cal-week-total-head { color: var(--accent); text-align: right; padding-right: 6px; }
.cal-week-total { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; text-align: right; gap: 3px; padding: 10px 14px; border-radius: 14px; background: rgba(124,242,55,.06); border: 1px solid rgba(124,242,55,.18); }
.cal-wk-rev { font-family: 'Bebas Neue', sans-serif; font-size: 22px; font-weight: 800; color: var(--green); line-height: 1; letter-spacing: .5px; }
.cal-wk-delta { font-size: 12px; font-weight: 700; }
.cal-wk-delta.up { color: var(--green); }
.cal-wk-delta.down { color: var(--red); }
.cal-wk-exp { font-size: 12px; font-weight: 700; color: var(--red); }
@media (max-width: 640px){
  .cal-months-grid { gap: 12px; }
  .cal-month-head { padding: 12px; }
  .cal-month-name { font-size: 19px; }
  .cal-month-stats { gap: 12px; }
  .cal-stat-val { font-size: 15px; }
  .cal-grid { gap: 4px; padding: 6px; }
  .cal-day-head { font-size: 8.5px; padding: 2px 1px; }
  .cal-day { min-height: 58px; padding: 5px 6px; border-radius: 9px; }
  .cal-day-num { font-size: 12px; }
  .cal-day-cx { top: 4px; right: 5px; font-size: 9px; }
  .cal-day-dots { gap: 2px; margin-top: 4px; }
  .cal-day-dot { width: 5px; height: 5px; }
  .cal-day-foot { padding-top: 3px; }
  .cal-day-rev { font-size: 10px; }
  .cal-day-exp { font-size: 9px; }
  .cal-week-total { padding: 4px 7px; border-radius: 9px; gap: 1px; }
  .cal-wk-rev { font-size: 14px; }
  .cal-wk-delta, .cal-wk-exp { font-size: 9px; }
}
.cal-week-row { display: flex; padding: 5px 10px; border-top: 1px solid var(--border); background: #111; justify-content: space-between; align-items: center; }
.cal-week-label { font-size: 10px; color: var(--muted); }
.cal-week-val { font-family: 'Bebas Neue', sans-serif; font-size: 14px; color: var(--accent); }

/* Day detail popup */
.day-sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 299; }
body.light-mode .day-sheet-backdrop { background: rgba(20,30,60,.28); }
.day-sheet { position: fixed; z-index: 300; top: 50%; right: 22px; transform: translateY(-50%); width: 320px; max-height: 82vh; overflow-y: auto; background: var(--card); border: 1px solid var(--border2); border-radius: 16px; padding: 18px; box-shadow: 0 12px 40px rgba(0,0,0,.55); }
.day-sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 4px; }
.day-sheet-eyebrow { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.day-sheet-title { font-family: 'Bebas Neue', sans-serif; font-size: 22px; color: var(--text); line-height: 1.1; }
.day-popup-close { background: none; border: none; color: var(--muted); font-size: 20px; cursor: pointer; line-height: 1; padding: 0 2px; }
.day-sheet-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); }
.day-sheet-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--card2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--text); flex-shrink: 0; }
.day-sheet-avatar.neg { background: rgba(255,82,82,.12); border-color: rgba(255,82,82,.35); color: var(--red); }
.day-sheet-rowmain { flex: 1; min-width: 0; }
.day-sheet-rowname { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-sheet-rowsub { font-size: 11px; color: var(--muted); }
.day-sheet-amt { font-size: 13px; font-weight: 700; flex-shrink: 0; }
.day-sheet-amt.pos { color: var(--green); }
.day-sheet-amt.neg { color: var(--red); }
.day-sheet-foot { border-top: 2px solid var(--border); margin-top: 8px; padding-top: 10px; }
.day-sheet-footrow { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); padding: 3px 0; }
.day-sheet-footrow span:last-child { font-weight: 700; color: var(--text); }
.day-sheet-footrow.total { font-size: 14px; color: var(--text); font-weight: 700; margin-top: 3px; }
.day-sheet-footrow .pos { color: var(--green); }
.day-sheet-footrow .neg { color: var(--red); }
.day-sheet-empty { padding: 22px 4px; text-align: center; color: var(--muted); font-size: 13px; }
.cal-day-selected { box-shadow: inset 0 0 0 2px var(--accent); }
@media (max-width: 640px){
  .day-sheet { top: auto; right: 0; left: 0; bottom: 0; transform: none; width: auto; max-height: 78vh; border-radius: 18px 18px 0 0; padding: 16px 16px calc(18px + env(safe-area-inset-bottom)); animation: daySheetUp .22s ease; }
}
@keyframes daySheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* ── SUMMARY LIST ── */
.summ-wrap { padding: 14px 18px; max-width: 860px; margin: 0 auto; }
.summ-year-nav { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.summ-year-label { font-family: 'Bebas Neue', sans-serif; font-size: 28px; letter-spacing: 2px; color: var(--accent); }

.summ-monthly { background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 14px; }
.summ-month-head { padding: 10px 16px; background: var(--card2); border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; cursor: pointer; user-select: none; }
.summ-month-title { font-family: 'Bebas Neue', sans-serif; font-size: 16px; letter-spacing: 1px; color: var(--text); }
.summ-month-total { font-family: 'Bebas Neue', sans-serif; font-size: 18px; color: var(--accent); }
.summ-week-row { display: flex; align-items: center; padding: 10px 16px; border-top: 1px solid #1c1c1c; gap: 10px; font-size: 13px; }
.summ-week-row:hover { background: rgba(255,255,255,.015); cursor: pointer; }
.swr-date { min-width: 110px; color: var(--text); font-weight: 600; }
.swr-sess { min-width: 60px; color: var(--blue); font-family: 'Bebas Neue',sans-serif; font-size: 18px; }
.swr-rev { color: var(--green); font-weight: 700; min-width: 80px; text-align: right; }
.swr-bar { flex: 1; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.swr-bar-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s; }
.swr-goal { font-size: 11px; color: var(--muted); min-width: 60px; text-align: right; }

.summ-year-summary { background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 14px; }
.sys-head { padding: 10px 16px; background: var(--card2); border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; }
.sys-title { font-family: 'Bebas Neue', sans-serif; font-size: 16px; letter-spacing: 1px; color: var(--accent); }
.sys-row { display: flex; align-items: center; padding: 9px 16px; border-top: 1px solid #1c1c1c; font-size: 13px; gap: 10px; }
.sys-month { flex: 0 0 90px; color: var(--text); font-weight: 600; }
.sys-rev { font-weight: 700; color: var(--green); min-width: 80px; text-align: right; }
.sys-bar { flex: 1; height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.sys-bar-stack { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.sys-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--green)); border-radius: 3px; }

@media (max-width: 640px) {
  .cal-months-grid { grid-template-columns: 1fr; }
}

/* ── AI ── */
.ai-wrap { padding: 16px 18px; max-width: 860px; margin: 0 auto; }
.ai-panel { background: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.ai-head { padding: 15px 16px; background: var(--card2); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.ai-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }
.ai-title { font-family: 'Bebas Neue', sans-serif; font-size: 17px; letter-spacing: 1px; color: var(--accent); }
.ai-sub { font-size: 11px; color: var(--muted); }
.ai-msgs { padding: 18px 16px 14px; display: flex; flex-direction: column; gap: 14px; }
.tax-block { background:var(--card);border:1px solid var(--border);border-radius:14px;overflow:hidden;margin-bottom:12px; }
.tax-block-header { width:100%;display:flex;justify-content:space-between;align-items:center;padding:13px 16px;background:none;border:none;cursor:pointer;text-align:left;gap:8px;flex-wrap:nowrap; }
.tax-block-header:hover { background:rgba(255,255,255,.03); }
.tax-block-body { padding:0 16px 16px; }
.tax-block-arrow { font-size:11px;color:var(--muted);transition:transform .2s;flex-shrink:0; }
.tax-block-arrow.open { transform:rotate(180deg); }
.tax-pill { padding:4px 12px;border-radius:20px;font-family:'Outfit',sans-serif;font-size:11px;font-weight:600;cursor:pointer;transition:all .15s;border:1px solid var(--border);background:transparent;color:var(--muted); }
.tax-pill.on { border-color:var(--accent);background:rgba(124,242,55,.1);color:var(--accent); }
.dash-pill { padding:4px 9px;border-radius:20px;font-family:'Outfit',sans-serif;font-size:11px;font-weight:600;cursor:pointer;border:1px solid var(--border);background:transparent;color:var(--muted);transition:all .15s;white-space:nowrap; }
.dash-pill.active { border-color:var(--accent);background:rgba(124,242,55,.12);color:var(--accent); }

/* ── Dashboard scoreboard redesign ── */
.dash-wrap { padding: 12px 12px 44px; max-width: 520px; margin: 0 auto; }
.dash-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 13px 14px; }
.dash-sec { font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 22px 6px 9px; display: flex; align-items: center; gap: 8px; }
.dash-sec::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.dash-g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.dash-lbl { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.dash-sub { font-size: 11px; color: var(--muted); font-weight: 500; }
.dash-num { font-family: 'Bebas Neue', sans-serif; line-height: .86; letter-spacing: .5px; color: var(--text); }
.dash-mc .dash-num { font-size: 31px; margin-top: 5px; }
.dash-mc .dash-num.sm { font-size: 25px; }
.dash-hero { position: relative; overflow: hidden; padding: 16px 16px 14px; margin-top: 14px; background: radial-gradient(130% 150% at 0% 0%, rgba(124,242,55,.14), transparent 58%), var(--card); }
.dash-hero-num { font-family: 'Bebas Neue', sans-serif; font-size: 56px; line-height: .84; color: var(--accent); }
.dash-hero-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--border); }
.dash-hero-stats .dash-num { font-size: 23px; }
.dash-chip { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.dash-chip.g { background: rgba(124,242,55,.16); color: var(--green); }
.dash-chip.a { background: rgba(251,191,36,.18); color: var(--yellow); }
.dash-track { height: 7px; border-radius: 5px; background: var(--card2); overflow: hidden; }
.dash-fill { height: 100%; border-radius: 5px; }
.dash-seg { height: 11px; border-radius: 6px; overflow: hidden; display: flex; }
.dash-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dash-legend { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 9px; }
.dash-legend span { font-size: 11px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.dash-dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; flex-shrink: 0; }
.dash-delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 700; }
.dash-kpi { background:var(--card2);border:1px solid var(--border);border-radius:10px;padding:12px 14px; }
.dash-g3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 9px; }

/* ── Reports redesign (mirrors the dashboard; two parts: business review + accountant) ── */
.report-wrap { max-width: 560px; margin: 0 auto; padding: 12px 12px 44px; }
.rpt-part { display: flex; align-items: baseline; gap: 10px; margin: 26px 2px 2px; }
.rpt-part span { font-family: 'Bebas Neue', sans-serif; font-size: 22px; letter-spacing: 1px; color: var(--text); }
.rpt-part i { font-style: normal; font-size: 11px; color: var(--muted); font-weight: 500; }
.rpt-pnl-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.rpt-pnl-row:last-child { border-bottom: none; }
.rpt-pnl-row .l { font-size: 13px; color: var(--text); }
.rpt-pnl-row .l .s { display: block; font-size: 10.5px; color: var(--muted); font-weight: 500; margin-top: 1px; }
.rpt-pnl-row .r { font-family: 'Bebas Neue', sans-serif; font-size: 21px; letter-spacing: .4px; color: var(--text); white-space: nowrap; }
.rpt-pnl-row.total { border-top: 2px solid var(--border); border-bottom: none; margin-top: 2px; padding-top: 11px; }
.rpt-pnl-row.total .l { font-weight: 800; text-transform: uppercase; letter-spacing: .05em; font-size: 12px; }
.rpt-pnl-row.total .r { font-size: 29px; }
.rpt-wf { display: flex; align-items: flex-end; gap: 4px; height: 56px; margin: 14px 0 2px; }
.rpt-wf > div { flex: 1; border-radius: 4px 4px 0 0; min-height: 3px; }
.rpt-tbl { width: 100%; border-collapse: collapse; }
.rpt-tbl th { font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-align: right; padding: 0 0 8px; border-bottom: 1px solid var(--border); }
.rpt-tbl th:first-child { text-align: left; }
.rpt-tbl td { font-size: 12.5px; padding: 9px 0; border-bottom: 1px solid var(--border); text-align: right; color: var(--text); }
.rpt-tbl td:first-child { text-align: left; font-weight: 600; }
.rpt-tbl tr:last-child td { border-bottom: none; }
.rpt-chip { font-size: 9px; font-weight: 700; padding: 2px 7px; border-radius: 6px; display: inline-block; }
.rpt-chip.g { background: rgba(124,242,55,.16); color: var(--green); }
.rpt-chip.a { background: rgba(251,191,36,.18); color: var(--yellow); }
.rpt-chip.r { background: rgba(255,82,82,.16); color: var(--red); }
.rpt-pct { width: 42px; background: transparent; border: none; border-bottom: 1px dashed var(--border); color: var(--accent); font-family: 'Outfit', sans-serif; font-size: 14px; font-weight: 700; text-align: center; padding: 0 2px; outline: none; -moz-appearance: textfield; }
.rpt-pct::-webkit-outer-spin-button, .rpt-pct::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.rpt-pct:focus { border-bottom-color: var(--accent); color: var(--text); }
.rpt-kbtn { background: var(--card2); border: 1px solid var(--border); color: var(--text); border-radius: 10px; font-family: 'Outfit', sans-serif; font-size: 12px; font-weight: 600; padding: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; }
.rpt-kbtn:hover { border-color: var(--accent); }
.dash-kpi-label { font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);margin-bottom:4px; }
.dash-kpi-val { font-size:22px;font-weight:700;line-height:1; }
.dash-kpi-sub { font-size:10px;margin-top:4px; }
.dash-bar-row { display:flex;align-items:center;gap:8px;padding:5px 0;border-bottom:1px solid var(--border); }
.dash-bar-label { font-size:11px;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:80px;max-width:100px; }
.dash-bar-track { flex:1;height:8px;background:var(--border);border-radius:4px;overflow:hidden; }
.dash-bar-fill { height:100%;border-radius:4px;transition:width .4s; }
.dash-bar-val { font-size:11px;font-weight:700;white-space:nowrap;min-width:48px;text-align:right; }
.dash-table-row { display:flex;justify-content:space-between;padding:6px 0;border-bottom:1px solid var(--border);font-size:12px; }
.dash-table-total { display:flex;justify-content:space-between;padding:8px 0 2px;font-size:13px;font-weight:700;border-top:2px solid var(--border); }
.msg { display: flex; gap: 10px; max-width: 88%; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg-av { width: 28px; height: 28px; border-radius: 7px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.msg.user .msg-av { background: var(--accent); color: #0b0b0b; }
.msg.ai .msg-av { background: var(--card2); color: var(--accent); border: 1px solid var(--border); }
.msg-bub { padding: 11px 14px; border-radius: 10px; font-size: 13px; line-height: 1.65; color: var(--text); }
.msg.user .msg-bub { background: var(--accent); color: #0b0b0b; font-weight: 500; border-radius: 10px 10px 2px 10px; }
.msg.ai .msg-bub { background: var(--card2); border: 1px solid var(--border); color: var(--text); border-radius: 10px 10px 10px 2px; }
.typing-indicator { display: flex; gap: 4px; align-items: center; padding: 2px 0; }
.td { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: td 1.2s infinite; }
.td:nth-child(2){animation-delay:.2s} .td:nth-child(3){animation-delay:.4s}
@keyframes td { 0%,60%,100%{transform:translateY(0);opacity:.4} 30%{transform:translateY(-4px);opacity:1} }
.qps { padding: 10px 16px 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.qp { padding: 6px 13px; background: transparent; border: 1px solid var(--border); border-radius: 20px; color: var(--muted); font-family: 'Outfit',sans-serif; font-size: 11px; cursor: pointer; transition: all .15s; }
.qp:hover { border-color: var(--accent); color: var(--accent); }
.ai-inp-row { padding: 14px 16px; border-top: 1px solid var(--border); display: flex; gap: 10px; }
.ai-inp { flex: 1; background: var(--card2); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-family: 'Outfit',sans-serif; font-size: 13px; padding: 10px 13px; outline: none; }
.ai-inp:focus { border-color: var(--accent); }
.ai-inp::placeholder { color: var(--muted); }
.ai-send { padding: 8px 16px; background: var(--accent); color: #0b0b0b; border: none; border-radius: 8px; font-family: 'Outfit',sans-serif; font-weight: 700; font-size: 13px; cursor: pointer; }
.ai-send:disabled { opacity: .4; cursor: not-allowed; }

/* ── EXPENSES ── */
.exp-wrap { padding: 14px 18px; max-width: 960px; margin: 0 auto; }

.exp-form-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 20px; margin-bottom: 16px; }
.exp-form-title { font-family: 'Bebas Neue', sans-serif; font-size: 17px; letter-spacing: 1px; color: var(--red); margin-bottom: 14px; }
.exp-form-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto; gap: 10px; align-items: end; }

.exp-summary { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 16px; }

.exp-list-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; margin-bottom: 16px; }
.exp-list-head { padding: 12px 16px; background: var(--card2); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.exp-list-title { font-family: 'Bebas Neue', sans-serif; font-size: 17px; letter-spacing: 1px; color: var(--red); }

.exp-col-heads { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 44px 1fr 34px; gap: 8px; padding: 7px 16px; border-bottom: 1px solid var(--border); }
.exp-col-heads span { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }

.exp-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 44px 1fr 34px; gap: 8px; align-items: center; padding: 11px 16px; border-top: 1px solid #1c1c1c; font-size: 13px; transition: background .12s; }
.exp-row:hover { background: rgba(255,255,255,.015); }
.exp-row-desc { font-weight: 600; color: var(--text); }
.exp-row-cat { font-size: 11px; }
.exp-row-date { font-size: 12px; color: var(--muted); }
.exp-row-amount { font-weight: 700; color: var(--red); text-align: right; }
.exp-row-pay { text-align: center; }
.exp-empty { padding: 32px; text-align: center; color: var(--muted); font-size: 13px; }

/* Category chip colours */
.cat-chip { display: inline-block; padding: 2px 8px; border-radius: 5px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }

/* P&L panel */
.stab { padding:6px 14px;border-radius:20px;font-family:'Outfit',sans-serif;font-size:12px;font-weight:600;cursor:pointer;white-space:nowrap;border:1px solid var(--border);background:transparent;color:var(--muted);transition:all .15s; }
.active-stab { background:rgba(124,242,55,.12);border-color:rgba(124,242,55,.35);color:var(--accent); }
.pnl-head { padding: 12px 16px; background: var(--card2); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.pnl-title { font-family: 'Bebas Neue', sans-serif; font-size: 17px; letter-spacing: 1px; color: var(--accent); }
.pnl-row { display: flex; align-items: center; padding: 11px 16px; border-top: 1px solid #1c1c1c; font-size: 13px; gap: 12px; }
.pnl-label { flex: 1; color: var(--muted); }
.pnl-label.pnl-bold { color: #fff; font-weight: 700; }
.pnl-val { font-weight: 700; min-width: 100px; text-align: right; font-family: 'Bebas Neue', sans-serif; font-size: 20px; letter-spacing: .5px; }
.pnl-sub { font-size: 11px; color: var(--muted); min-width: 160px; text-align: right; }
.pnl-divider { border-top: 1px solid var(--border2); margin: 0; }

@media (max-width:640px) {
  .exp-form-grid { grid-template-columns: 1fr 1fr; }
  .exp-summary { grid-template-columns: 1fr 1fr; }
  /* ── Expense rows become two-line cards ──────────────────────────────────
     These columns used to be hidden outright — `.exp-row > :nth-child(3), :nth-child(5),
     :nth-child(6) { display:none }` dropped Amount, GST and Date, i.e. the phone asked you
     to categorise a row while hiding the facts you'd categorise it with. The same seven
     grid children are re-laid out as a card instead of being thrown away:

        ☐ DIGIDIRECT SYDNEY [GST][CAPITAL]           $1,578.16
          [EQUIPMENT ▾]          [BANK]     26 July 26
          [GST] $143.47  [100% biz ▾]                    ×
     Three lines, not two: squeezing category and GST onto one line truncated the category
     to "ACCOUNTIN" — and the category is the field you're there to set. A review pass wants
     to read the row, so give it the height.                                              */
  .exp-col-heads { display: none; }          /* a card carries its own labels */
  .exp-row {
    grid-template-columns: minmax(0,1fr) auto auto;
    grid-template-areas:
      "desc desc amount"
      "cat  pay  date"
      "gst  gst  del";
    gap: 8px 6px;
    align-items: center;
    padding: 12px 14px;
  }
  .exp-row > :nth-child(1) { grid-area: desc;   min-width: 0; }
  /* NOTE: no justify-self here. `justify-self:start` sizes the cell to its content, and a
     <select> has a large min-content width — so the category box grew past its column and
     painted straight over the GST chip. Stretching the cell and clamping the select keeps
     a long label (e.g. "Accounting & Fees") inside its lane. */
  .exp-row > :nth-child(2) { grid-area: cat;    min-width: 0; justify-self: stretch; }
  .exp-row-cat select { max-width: 100%; }   /* clamp, don't stretch: keeps the chip chip-sized */
  .exp-row > :nth-child(3) { grid-area: amount; align-self: start; justify-self: end; font-size: 15px; white-space: nowrap; }
  .exp-row > :nth-child(4) { grid-area: pay;    justify-self: center; }
  .exp-row > :nth-child(6) { grid-area: date;   justify-self: end; white-space: nowrap; }
  .exp-row > :nth-child(7) { grid-area: del;    justify-self: end; }
  /* The GST cell stacks (button / credit / business-%) on desktop — inline on a card, where
     it has a full line to itself. */
  .exp-row > :nth-child(5) {
    grid-area: gst; min-width: 0;
    display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; text-align: left !important;
  }
  .exp-row > :nth-child(5) > div { margin-top: 0 !important; }
  .exp-row > :nth-child(5) select { margin-top: 0 !important; }
  /* Comfortable thumb targets on the controls a review pass actually taps — including the
     inline answer buttons (PT questions, GST checks, suggestions), which are the whole
     point of reviewing on a phone. */
  .exp-row select, .exp-row .icon-btn, .exp-row > :nth-child(5) button { min-height: 32px; }
  .exp-row > :nth-child(1) button { min-height: 32px; padding-left: 12px; padding-right: 12px; }
  .exp-row .exp-cb { width: 18px; height: 18px; }
}

.rec-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr 34px; gap: 8px; align-items: center; padding: 11px 16px; border-top: 1px solid #1c1c1c; font-size: 13px; transition: background .12s; }
.rec-row:hover { background: rgba(255,255,255,.015); }
.rec-row-desc { font-weight: 600; color: var(--text); }
.rec-freq-chip { display: inline-block; padding: 2px 8px; border-radius: 5px; font-size: 10px; font-weight: 700; text-transform: uppercase; background: rgba(167,139,250,.15); color: var(--purple); }
.rec-due { font-size: 12px; }
.rec-due.due-soon { color: var(--yellow); font-weight: 700; }
.rec-due.overdue { color: var(--red); font-weight: 700; }
.rec-due.ok { color: var(--muted); }

/* ── MODAL ── */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.75); z-index: 1000; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-bg.open { display: flex; }
.modal { background: var(--card); border: 1px solid var(--border2); border-radius: 16px; padding: 24px; width: 100%; max-width: 420px; }
.modal-title { font-family: 'Bebas Neue', sans-serif; font-size: 20px; letter-spacing: 1px; color: var(--accent); margin-bottom: 18px; }
.mfg { margin-bottom: 14px; }
.mfg label { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 5px; }
.mfg input, .mfg select { width: 100%; background: #1c1c1c; border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-family: 'Outfit',sans-serif; font-size: 13px; padding: 9px 11px; outline: none; }
.mfg input:focus, .mfg select:focus { border-color: var(--accent); }
.modal-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.mbtn { padding: 8px 18px; border-radius: 8px; font-family: 'Outfit',sans-serif; font-size: 13px; font-weight: 600; cursor: pointer; border: none; }
.mbtn-cancel { background: var(--card2); border: 1px solid var(--border); color: var(--muted); }
.mbtn-save { background: var(--accent); color: #0b0b0b; }

::-webkit-scrollbar { width: 3px; } ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

@media (max-width:640px) {
  /* week-bar is now inside nav — no separate mobile override needed */
  /* Compact "At a glance" tiles on mobile (~half the height) */
  .cards { grid-template-columns: 1fr 1fr; gap: 7px; padding: 8px 8px 6px; }
  /* Top split stays 50/50 on phones — shrink the week changer so the date fits a half-width column */
  .wk-split { gap: 6px; }
  .wk-changer { padding: 5px 3px; gap: 2px; border-radius: 11px; }
  .wk-arrow { width: 26px; height: 26px; font-size: 16px; }
  .wk-date { font-size: 14px; letter-spacing: 0; }
  .wk-meta { font-size: 9px; }
  .wk-rev::before { margin: 0 3px; }
  .wk-glance { padding: 5px 4px 4px; border-radius: 11px; }
  .wk-glance .cards-dots .dot.active { width: 13px; }
  .card { padding: 6px 9px; border-radius: 10px; }
  .card-label { font-size: 8px; margin-bottom: 1px; letter-spacing: .04em; }
  .card-val { font-size: 17px; }
  .card > div:not(.card-label):not(.card-val) { font-size: 8.5px !important; margin-top: 1px !important; line-height: 1.25 !important; }
  .card table { margin-top: 1px !important; }
  .card table td { font-size: 8.5px !important; padding: 0 !important; }
  .card table td[style*="20px"] { font-size: 13px !important; padding: 0 4px 0 0 !important; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  /* Dashboard panels: collapse to one column — the inline 1fr 1fr left the 2nd column clipped off-screen */
  #dash-panels-grid { grid-template-columns: 1fr !important; }
  .cl-head, .cl-row { grid-template-columns: minmax(0,1fr) 84px 96px; gap: 8px; }
  .cl-row { padding: 10px 12px; }
  .cl-row-name { font-size: 12px; }
  .cl-credit-pill { font-size: 10px; padding: 2px 4px 2px 2px; }
  .cl-credit-pill .cc-adj { width: 16px; height: 16px; font-size: 12px; }
  .icon-btn { width: 26px; height: 26px; font-size: 13px; }
  .cl-archive-btn { display: none; } /* show archive via Edit on mobile */

  /* Session table mobile — fit Client + all 7 day columns on a phone; analytics columns scroll.
     KEY: override the desktop `table.main{min-width:680px}` (defined after the old block, so it
     used to win and inflate every column). min-width:0 lets the table size to its content. */
  .week-wrap { padding: 0 0 14px; }
  .week-wrap > div { padding-left: 10px; padding-right: 10px; }
  .tbl-scroll-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.main { min-width: 0; font-size: 11px; }
  .td-name { min-width: 70px; max-width: 86px; padding: 7px 3px; overflow: hidden; }
  .td-name .drag-handle { display: none; }   /* reorder is a desktop affordance; avoids touch-scroll conflict + frees width */
  .td-name .row-caret { display: none; }      /* decorative "tap for more" hint — the whole name area is already tappable */
  .td-name .note-btn { flex-shrink: 0; }      /* keep the ✎ edit button from being squeezed/clipped */
  .c-name { font-size: 11px; max-width: 54px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .c-meta { font-size: 9px; gap: 3px; }
  .c-meta .rate-hidden { display: none; }     /* hide the blurred per-client rate on mobile to fit; still shown on desktop + in edit */
  .mode-badge { font-size: 8px; padding: 0 4px; }
  .td-bal { min-width: 22px; padding: 6px 1px; font-size: 11px; }
  .bal-num { font-size: 13px; }
  .td-day { min-width: 28px; padding: 5px 1px; }
  .chk { width: 22px; height: 22px; font-size: 10px; border-radius: 6px; }
  td.td-today .chk { width: 24px; height: 24px; border-radius: 6px; }
  .td-count { min-width: 22px; padding: 5px 1px; }
  .count-num { font-size: 14px; }
  .td-rev { min-width: 46px; padding: 5px 3px; font-size: 11px; }
  .td-pay { padding: 5px 2px; }
  .pbtn { padding: 3px 5px; font-size: 9px; }
  .td-after { min-width: 28px; padding: 6px 1px; font-size: 11px; }
  table.main th { font-size: 9px; padding: 6px 1px; }

  /* Nav wraps on mobile */
  .nav { flex-wrap: wrap; gap: 4px; padding: 8px 8px; }
  .tabs { gap: 2px; }
  .tab { padding: 5px 8px; font-size: 11px; }

  /* Goals bar */
  #goals-bar-wrap { padding: 0 8px 10px; }
}

/* ── APPLY-TO-SIMILAR TOAST — stacks above the undo toast ── */
#similar-toast {
  position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%) translateY(140px);
  background: #f5f5f5; border: 1px solid #fbbf24; border-radius: 12px;
  padding: 10px 16px; display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: #111; z-index: 9999; max-width: min(92vw, 480px);
  box-shadow: 0 8px 32px rgba(0,0,0,.4); transition: transform .25s cubic-bezier(.34,1.56,.64,1);
}
#similar-toast.show { transform: translateX(-50%) translateY(0); }
#similar-toast-text { flex: 1; min-width: 0; }
#similar-toast-msg { display: block; }
#similar-toast-scope { display: block; font-size: 11px; color: #666; margin-top: 2px; }
#similar-toast-apply { background: #111; color: #fbbf24; border: none; border-radius: 7px; padding: 4px 12px; font-family: 'Outfit',sans-serif; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
#similar-toast-dismiss { background: none; color: #666; border: none; font-size: 16px; cursor: pointer; padding: 0 2px; line-height: 1; }

/* ── UNDO TOAST ── */
#undo-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: #f5f5f5; border: 1px solid #ddd; border-radius: 12px;
  padding: 10px 16px; display: flex; align-items: center; gap: 12px;
  font-size: 13px; color: #111; z-index: 9999; white-space: nowrap;
  box-shadow: 0 8px 32px rgba(0,0,0,.4); transition: transform .25s cubic-bezier(.34,1.56,.64,1);
}
#undo-toast.show { transform: translateX(-50%) translateY(0); }
#undo-toast-btn { background: #111; color: #7cf237; border: none; border-radius: 7px; padding: 4px 12px; font-family: 'Outfit',sans-serif; font-size: 12px; font-weight: 700; cursor: pointer; }

/* ── QUICK-ADD FAB — auto-hide on scroll so it never covers toolbar buttons (e.g. "Clear All") on mobile ── */
#fab-split { transition: transform .25s ease, opacity .25s ease; }
#fab-split.fab-hidden { transform: translateY(120px); opacity: 0; pointer-events: none; }

/* Split-circle quick-add FAB — grey halves, green + / red −, tinted hover.
   Compact (58px) and drag-to-reposition (cursor:grab + touch-action:none so a
   touch drag repositions instead of scrolling; the drag logic lives in app.html). */
.fab-split { display: flex; width: 58px; height: 58px; border-radius: 50%; overflow: hidden;
  box-shadow: 0 8px 20px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.05);
  cursor: grab; touch-action: none; }
.fab-half { flex: 1 1 50%; height: 100%; padding: 0; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; background: #2b2b2b;
  transition: background .16s ease; -webkit-tap-highlight-color: transparent; }
.fab-half svg { transition: transform .12s ease; }
.fab-half:active svg { transform: scale(.8); }
.fab-half-add { color: var(--accent); border-right: 1px solid rgba(255,255,255,.10); }
.fab-half-exp { color: var(--red); }
.fab-half-add:hover { background: #37431f; }   /* green + grey mix */
.fab-half-exp:hover { background: #45272a; }   /* red + grey mix */
body.light-mode .fab-split { box-shadow: 0 8px 20px rgba(20,30,60,.18), 0 0 0 1px rgba(0,0,0,.06); }
body.light-mode .fab-half { background: #e7eaf2; }
body.light-mode .fab-half-add { border-right-color: rgba(0,0,0,.08); }
body.light-mode .fab-half-add:hover { background: #cfe7b3; } /* green + grey mix */
body.light-mode .fab-half-exp:hover { background: #f1cccc; } /* red + grey mix */

/* ── INVOICE MODAL ── */
#invoice-preview { background: #fff; color: #111; border-radius: 8px; padding: 32px; font-family: 'Outfit',sans-serif; font-size: 13px; line-height: 1.6; }
#invoice-preview h1 { font-size: 28px; font-weight: 700; margin-bottom: 4px; }
#invoice-preview table { width: 100%; border-collapse: collapse; margin-top: 16px; }
#invoice-preview th { background: #f0f0f0; padding: 8px 10px; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
#invoice-preview td { padding: 8px 10px; border-bottom: 1px solid #eee; }
#invoice-preview .inv-total { font-size: 18px; font-weight: 700; }

@media print {
  nav, .period-pills, #compare-pills, #rpt-controls button, .chart-grid,
  #rpt-top5, #rpt-eofy, .rpt-controls > div:last-child { display:none !important; }
  body { background:#fff !important; color:#000 !important; }
  .view { display:block !important; }
  .view:not(#view-report) { display:none !important; }
  .report-wrap { max-width:100% !important; padding:0 !important; }
  .card { border:1px solid #ccc !important; background:#f9f9f9 !important; }
  .card-val, .card-label { color:#000 !important; }
  .pnl-card, .rpt-section { border:1px solid #ccc !important; background:#fff !important; }
  .pnl-label, .pnl-val, .pnl-sub, .rr-name, .rr-val { color:#000 !important; }
  .pnl-head { background:#f0f0f0 !important; }
  .pnl-title { color:#000 !important; }
  .rpt-head { background:#f0f0f0 !important; }
  .rpt-head-title { color:#000 !important; }
}

/* ===================================================
   ▼▼▼  MOMENTUM LOGIN SPLASH — COPY TO app.html  ▼▼▼
   =================================================== */

.mt-splash {
  position: fixed;
  inset: 0;
  background: #050505;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: mtSplashOut 0.6s ease 5.3s forwards;
}

@keyframes mtSplashOut {
  to { opacity: 0; visibility: hidden; pointer-events: none; }
}

/* Radial green glow */
.mt-splash::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at center,
    rgba(124,242,55,0.10) 0%,
    rgba(124,242,55,0.04) 35%,
    transparent 65%);
  opacity: 0;
  animation: mtOrbIn 0.8s ease 0.1s forwards;
}

@keyframes mtOrbIn { to { opacity: 1; } }

.mt-splash-stack {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* === Icon (animated draw-on then real Icon.png) === */
.mt-splash-icon-wrap {
  position: relative;
  width: 130px;
  height: 130px;
  margin-bottom: 26px;
}

.mt-splash-outline-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.mt-splash-outline {
  fill: none;
  stroke: #7cf237;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
}
.mt-splash-outline-circle {
  animation:
    mtDrawOn 2.0s cubic-bezier(0.65, 0, 0.35, 1) 0.3s forwards,
    mtFadeOut 0.5s ease 2.7s forwards;
}
.mt-splash-outline-m {
  animation:
    mtDrawOn 1.9s cubic-bezier(0.65, 0, 0.35, 1) 0.5s forwards,
    mtFadeOut 0.5s ease 2.7s forwards;
}

@keyframes mtDrawOn  { to { stroke-dashoffset: 0; } }
@keyframes mtFadeOut { to { opacity: 0; } }

/* Real Icon.png (transparent) fades in once outline is drawn — with soft white edge glow */
.mt-splash-icon-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: scale(0.88);
  transform-origin: center;
  filter:
    drop-shadow(0 0 6px rgba(255,255,255,0.55))
    drop-shadow(0 0 16px rgba(124,242,55,0.35));
  animation: mtFillIn 0.55s cubic-bezier(0.34, 1.4, 0.64, 1) 2.65s forwards;
}

@keyframes mtFillIn {
  to { opacity: 1; transform: scale(1); }
}

/* === Full Momentum Tracking wordmark === */
.mt-splash-wordmark {
  width: 260px;
  max-width: 72vw;
  opacity: 0;
  transform: translateY(8px);
  animation: mtTextIn 0.55s ease 3.3s forwards;
}

@keyframes mtTextIn {
  to { opacity: 1; transform: translateY(0); }
}

/* ===================================================
   ▲▲▲  END SPLASH STYLES  ▲▲▲
   =================================================== */

/* Toolbar diet: power-user items hidden on phones (all have homes in Settings/Help) */
@media (max-width: 720px){ .mt-desktop-only{ display:none !important; } }

/* KPI tile hide control — a − notch on the tile's top edge (window-control style).
   Hover-revealed on desktop; faintly visible on touch. Restore via ⚙ Panels → Toggle Tiles. */
.dash-kpi{overflow:visible}
.dash-kpi .kpi-hide{
  position:absolute; top:-8px; left:50%; transform:translateX(-50%);
  width:24px; height:16px; display:flex; align-items:center; justify-content:center;
  background:var(--card2); border:1px solid var(--border); border-radius:8px;
  color:var(--muted); font-size:13px; line-height:1; font-weight:700;
  cursor:pointer; opacity:0; transition:opacity .15s, color .15s, border-color .15s;
  padding:0;
}
.dash-kpi:hover .kpi-hide{opacity:1}
.dash-kpi .kpi-hide:hover{color:var(--red); border-color:var(--red)}
@media (hover:none){ .dash-kpi .kpi-hide{opacity:.4} }
