/* Due Back by Jefi Studio. Jefi family type and warmth, its own deep green accent. */
:root {
  color-scheme: light;
  --bg: #f6f5f2; --panel: #ffffff; --tile: #eeece6; --line: #e2dfd7; --line-2: #d4d0c6;
  --fg: #141413; --soft: #5b5852; --faint: #8b877e;
  --acc: #0f6b5a; --acc-press: #0b5547; --acc-tint: #e3efe9; --on-acc: #ffffff;
  --orange: #ff5b1f;
  --late: #b4381c; --late-tint: #fbe9e2;
  --soon: #8a6a00; --soon-tint: #f8f0d4;
  --quiet: #5b5852; --quiet-tint: #ecebe6;
  --ok: #1c7c4b; --ok-tint: #e2f2e8;
  --display: "Stack Sans Headline", "Helvetica Neue", Arial, sans-serif;
  --text: "Stack Sans Text", "Helvetica Neue", Arial, sans-serif;
  --r: 16px; --r-sm: 10px;
  --shadow: 0 1px 2px rgba(20,20,19,.04), 0 8px 24px rgba(20,20,19,.06);
  --ease: cubic-bezier(.2,.7,.2,1);
  --side: 232px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121212; --panel: #1b1a19; --tile: #232220; --line: #2c2a28; --line-2: #3a3835;
  --fg: #f4f3ef; --soft: #b6b2aa; --faint: #8a867e;
  --acc: #49b597; --acc-press: #5fc4a7; --acc-tint: #17302a; --on-acc: #0c1512;
  --late: #ff8a6b; --late-tint: #3a1f17; --soon: #e3bf4f; --soon-tint: #33290f;
  --quiet: #b6b2aa; --quiet-tint: #262523; --ok: #5ccf8f; --ok-tint: #15291e;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.3);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121212; --panel: #1b1a19; --tile: #232220; --line: #2c2a28; --line-2: #3a3835;
    --fg: #f4f3ef; --soft: #b6b2aa; --faint: #8a867e;
    --acc: #49b597; --acc-press: #5fc4a7; --acc-tint: #17302a; --on-acc: #0c1512;
    --late: #ff8a6b; --late-tint: #3a1f17; --soon: #e3bf4f; --soon-tint: #33290f;
    --quiet: #b6b2aa; --quiet-tint: #262523; --ok: #5ccf8f; --ok-tint: #15291e;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.3);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 15px/1.5 var(--text); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: .2em; }
h1, h2, h3 { margin: 0; font-weight: 400; }
h1 { font-family: var(--display); font-weight: 300; font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -.02em; line-height: 1.08; }
h2 { font-family: var(--display); font-weight: 300; font-size: 24px; letter-spacing: -.015em; line-height: 1.15; }
h3 { font-size: 16px; font-weight: 500; letter-spacing: -.005em; }
p { margin: 0 0 .8em; }
.soft { color: var(--soft); } .faint { color: var(--faint); } .small { font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: 6px; }

.boot { min-height: 100vh; display: grid; place-items: center; }
.logo-mark { width: 40px; height: 40px; border-radius: 12px; background: var(--acc); animation: pulse 1.2s var(--ease) infinite alternate; }
@keyframes pulse { to { transform: scale(.88); opacity: .6; } }

/* Shell */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; padding: 20px 14px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; background: var(--bg); }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; text-decoration: none; }
.brand-icon { width: 30px; height: 30px; border-radius: 9px; background: var(--acc); display: grid; place-items: center; color: var(--on-acc); flex: none; overflow: hidden; }
.brand-icon img { width: 100%; height: 100%; object-fit: cover; }
.brand b { font-family: var(--display); font-weight: 300; font-size: 21px; letter-spacing: -.02em; }
.brand small { display: block; font-size: 11px; color: var(--faint); margin-top: -2px; }
.nav { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; text-decoration: none; color: var(--soft); font-weight: 500; font-size: 14px; }
.nav svg { width: 18px; height: 18px; flex: none; }
.nav:hover { background: var(--tile); color: var(--fg); }
.nav[aria-current="page"] { background: var(--panel); color: var(--fg); box-shadow: var(--shadow); }
.nav .count { margin-left: auto; font-size: 12px; background: var(--late-tint); color: var(--late); padding: 1px 8px; border-radius: 99px; }
.nav .lock { margin-left: auto; width: 14px; height: 14px; opacity: .5; }
.nav-sep { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 16px 10px 6px; }
.side-foot { margin-top: auto; padding: 10px; font-size: 12px; color: var(--faint); }
.side-foot a { color: var(--soft); }

.main { min-width: 0; padding: 22px clamp(16px, 3vw, 40px) 120px; }
.top { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; }
.top .search { flex: 1; max-width: 420px; position: relative; }
.top .search input { width: 100%; padding: 10px 12px 10px 38px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); }
.top .search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--faint); }
.top .spacer { flex: 1; }
.results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; z-index: 30; max-height: 320px; overflow: auto; }
.results button { display: flex; width: 100%; gap: 10px; align-items: center; text-align: left; padding: 8px 10px; border: 0; background: none; border-radius: 9px; cursor: pointer; }
.results button:hover, .results button:focus-visible { background: var(--tile); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 99px; border: 1px solid transparent; background: var(--acc); color: var(--on-acc); font-weight: 500; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, transform .1s; }
.btn:hover { background: var(--acc-press); }
.btn:active { transform: scale(.98); }
.btn svg { width: 16px; height: 16px; }
.btn.ghost { background: var(--panel); color: var(--fg); border-color: var(--line); }
.btn.ghost:hover { background: var(--tile); }
.btn.plain { background: none; color: var(--soft); padding-left: 10px; padding-right: 10px; }
.btn.plain:hover { color: var(--fg); background: var(--tile); }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.danger { background: none; color: var(--late); border-color: var(--line); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn { width: 38px; height: 38px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); display: grid; place-items: center; cursor: pointer; color: var(--soft); }
.icon-btn:hover { color: var(--fg); }
.icon-btn svg { width: 18px; height: 18px; }

/* Cards and stats */
.head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.head p { margin: 6px 0 0; color: var(--soft); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 22px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; text-align: left; cursor: pointer; transition: border-color .15s, transform .15s var(--ease); }
.stat:hover { transform: translateY(-2px); }
.stat[aria-pressed="true"] { border-color: var(--fg); }
.stat .lbl { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--soft); }
.stat .num { font-family: var(--display); font-weight: 300; font-size: 40px; line-height: 1; margin-top: 10px; letter-spacing: -.03em; }
.stat .sub { font-size: 12px; color: var(--faint); margin-top: 6px; }
.dot { width: 8px; height: 8px; border-radius: 99px; flex: none; }
.dot.late { background: var(--late); } .dot.soon { background: var(--soon); } .dot.quiet { background: var(--faint); } .dot.booked { background: var(--ok); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.card-pad { padding: 18px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

/* Client list */
.list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 1.4fr 1.2fr 1fr auto; gap: 14px; align-items: center; padding: 13px 18px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s; }
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--tile); }
.row .who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.avatar { width: 34px; height: 34px; border-radius: 99px; background: var(--tile); display: grid; place-items: center; font-size: 13px; font-weight: 500; color: var(--soft); flex: none; }
.row .name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta { font-size: 13px; color: var(--faint); }
.row .acts { display: flex; gap: 6px; }
.row.dim { opacity: .55; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.pill.late { background: var(--late-tint); color: var(--late); }
.pill.soon { background: var(--soon-tint); color: var(--soon); }
.pill.quiet { background: var(--quiet-tint); color: var(--quiet); }
.pill.booked { background: var(--ok-tint); color: var(--ok); }
.pill.ok { background: var(--tile); color: var(--soft); }
.pill.acc { background: var(--acc-tint); color: var(--acc); }
.empty { padding: 48px 20px; text-align: center; color: var(--soft); }
.empty h3 { margin-bottom: 6px; color: var(--fg); }
.group-title { padding: 12px 18px 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); background: var(--bg); border-bottom: 1px solid var(--line); }

/* Chips and segmented */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 6px 13px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); font-size: 13px; cursor: pointer; color: var(--soft); }
.chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.seg { display: inline-flex; background: var(--tile); border-radius: 99px; padding: 3px; }
.seg button { border: 0; background: none; padding: 6px 13px; border-radius: 99px; font-size: 13px; cursor: pointer; color: var(--soft); }
.seg button[aria-pressed="true"] { background: var(--panel); color: var(--fg); box-shadow: var(--shadow); }

/* Messages */
.msgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.msg { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.msg-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.msg-body { white-space: pre-wrap; font-size: 14px; line-height: 1.55; background: var(--bg); border-radius: 12px; padding: 12px 14px; flex: 1; }
.msg-subj { font-size: 13px; color: var(--soft); }
.tok { background: var(--acc-tint); color: var(--acc); border-radius: 5px; padding: 0 3px; }
.msg-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.note { font-size: 12px; color: var(--faint); }
.locked { position: relative; }
.locked .msg-body { filter: blur(4px); user-select: none; }

/* Drawer and modal */
.scrim { position: fixed; inset: 0; background: rgba(10,10,10,.32); z-index: 40; animation: fade .2s ease both; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--panel); z-index: 41; box-shadow: -10px 0 40px rgba(0,0,0,.12); display: flex; flex-direction: column; animation: slide .3s var(--ease) both; }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.drawer-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer-body { padding: 20px; overflow: auto; flex: 1; display: grid; gap: 20px; align-content: start; }
.modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); overflow: auto; background: var(--panel); border-radius: 22px; z-index: 41; box-shadow: var(--shadow); animation: pop .25s var(--ease) both; }
.modal.wide { width: min(820px, calc(100vw - 24px)); }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -46%); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 8px; }
.modal-body { padding: 10px 22px 22px; display: grid; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 22px 22px; flex-wrap: wrap; }

/* Forms */
label.f { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--soft); }
.in, select.in, textarea.in { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel); font-size: 15px; color: var(--fg); }
textarea.in { min-height: 120px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.in:focus { outline: 2px solid var(--acc); outline-offset: -1px; border-color: transparent; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--fg); font-weight: 400; }
.check input { margin-top: 3px; accent-color: var(--acc); width: 16px; height: 16px; }
.frow { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.frow3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.hint { font-size: 12px; color: var(--faint); font-weight: 400; }

/* Timeline */
.timeline { display: grid; gap: 0; }
.tl { display: grid; grid-template-columns: 14px 1fr auto; gap: 12px; padding: 8px 0; position: relative; font-size: 14px; }
.tl::before { content: ""; position: absolute; left: 6px; top: 22px; bottom: -8px; width: 2px; background: var(--line); }
.tl:last-child::before { display: none; }
.tl i { width: 14px; height: 14px; border-radius: 99px; border: 2px solid var(--acc); background: var(--panel); margin-top: 3px; }
.tl.contact i { border-color: var(--faint); }
.tl.won i { border-color: var(--ok); background: var(--ok); }

/* Banners and toast */
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; background: var(--acc-tint); color: var(--fg); margin-bottom: 18px; font-size: 14px; flex-wrap: wrap; }
.banner b { font-weight: 500; }
.banner > svg { width: 18px; height: 18px; flex: none; color: var(--acc); }
.empty svg, .msg-acts svg, .row svg { width: 16px; height: 16px; }
.banner .btn { margin-left: auto; }
.banner.warn { background: var(--soon-tint); }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 11px 18px; border-radius: 99px; font-size: 14px; z-index: 60; box-shadow: var(--shadow); animation: up .3s var(--ease) both; display: flex; gap: 10px; align-items: center; }
@keyframes up { from { opacity: 0; transform: translate(-50%, 10px); } }
.toast svg { width: 18px; height: 18px; flex: none; }
.toast.won { background: var(--ok); color: #fff; }

/* Tour */
.tour-hole { position: fixed; z-index: 70; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(10,10,10,.5); transition: all .35s var(--ease); pointer-events: none; }
.tour-tip { position: fixed; z-index: 71; width: min(340px, calc(100vw - 24px)); background: var(--panel); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); transition: top .35s var(--ease), left .35s var(--ease); }
.tour-tip h3 { margin-bottom: 6px; }
.tour-tip .soft { font-size: 14px; }
.tour-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.tour-foot .steps { font-size: 12px; color: var(--faint); margin-right: auto; }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 500; font-size: 12px; color: var(--faint); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table input.in, .table select.in { padding: 6px 8px; font-size: 14px; }
.scroll-x { overflow-x: auto; }

/* Numbers (Pro) */
.big { font-family: var(--display); font-weight: 300; font-size: 44px; letter-spacing: -.03em; line-height: 1; }
.bars { display: flex; align-items: end; gap: 6px; height: 120px; margin-top: 14px; }
.bars div { flex: 1; background: var(--acc); border-radius: 6px 6px 2px 2px; min-height: 3px; position: relative; opacity: .85; }
.bars div:last-child { opacity: 1; }
.bars-lbl { display: flex; gap: 6px; margin-top: 6px; } .bars-lbl span { flex: 1; text-align: center; font-size: 11px; color: var(--faint); }
.month { padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); display: grid; gap: 6px; align-content: start; }
.month.now { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc); }
.upsell { text-align: center; padding: 40px 24px; }
.upsell .lockbig { width: 48px; height: 48px; border-radius: 14px; background: var(--acc-tint); color: var(--acc); display: grid; place-items: center; margin: 0 auto 14px; }

/* Unlock / welcome */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate .card { max-width: 460px; width: 100%; padding: 28px; }

/* Mobile */
.tabbar { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .main { padding: 14px 16px 110px; }
  .top { margin-bottom: 18px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat .num { font-size: 32px; }
  .row { grid-template-columns: 1fr auto; gap: 8px; }
  .row .when, .row .acts .btn.ghost { display: none; }
  .grid2, .grid3, .frow, .frow3 { grid-template-columns: 1fr; }
  .tabbar { display: flex; position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); background: var(--panel); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); z-index: 35; padding: 6px; }
  .tabbar a, .tabbar button { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 6px 0; font-size: 11px; color: var(--faint); text-decoration: none; border: 0; background: none; border-radius: 14px; }
  .tabbar svg { width: 20px; height: 20px; }
  .tabbar [aria-current="page"] { color: var(--fg); background: var(--tile); }
  .tabbar .add { color: var(--on-acc); background: var(--acc); }
  .drawer { width: 100vw; }
  .msgs { grid-template-columns: 1fr; }
  .hide-m { display: none !important; }
}
@media (min-width: 901px) { .show-m { display: none !important; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Print: desk card and monthly report */
#print-area { display: none; }
@media print {
  body > #app { display: none; }
  #print-area { display: block; }
  body { background: #fff; color: #111; }
  .pcard { width: 5in; min-height: 7in; padding: .4in; border: 1px solid #ccc; border-radius: 16px; font-size: 13pt; }
  .pcard h1 { font-size: 22pt; margin-bottom: 10pt; }
  .pcard ol { padding-left: 1.1em; } .pcard li { margin-bottom: 10pt; }
  .preport { padding: .3in; font-size: 11pt; }
  .preport table { width: 100%; border-collapse: collapse; } .preport td, .preport th { border-bottom: 1px solid #ddd; padding: 6pt 4pt; text-align: left; }
}
