/* Verivane UI
   Layout: fixed sidebar on desktop, top bar + bottom tab bar on phones.
   Palette: verdigris (the green patina of a copper weather vane) with a copper accent; slate neutrals tinted toward the green. */
:root {
  --brand: #0f6b62;
  --brand-2: #22a594;
  --copper: #d9772f;
  --copper-soft: #fcefe3;
  --brand-ink: #ffffff;
  --brand-soft: #e3f6f3;
  --glow: rgba(20, 184, 166, .28);

  --bg: #f4f7f7;
  --bg-2: #eaf0f0;
  --surface: #ffffff;
  --surface-2: #f8fbfb;
  --line: #e1e8e8;
  --text: #0f1f24;
  --text-2: #4b5d63;
  --text-3: #7c8d92;

  --success: #12805c; --success-soft: #e2f5ed;
  --warning: #a86200; --warning-soft: #fdf1dc;
  --danger:  #d23f31; --danger-soft:  #fde6e3;
  --info:    #2563c9; --info-soft:    #e4edfc;
  --violet:  #6d4fd8; --violet-soft:  #eeeafd;

  --side-bg: #0c1c20;
  --side-text: #a9bcbf;
  --side-on: #ffffff;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 31, 36, .06);
  --shadow: 0 1px 2px rgba(15, 31, 36, .05), 0 8px 24px -8px rgba(15, 31, 36, .12);
  --shadow-lg: 0 24px 60px -12px rgba(15, 31, 36, .28);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --tabbar-h: 68px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --brand: #3cc4ae; --brand-2: #7ee0cf; --copper: #f5a462; --copper-soft: #33220f; --brand-ink: #04201c; --brand-soft: #0f2e2b; --glow: rgba(45, 212, 191, .22);
  --bg: #0a1215; --bg-2: #0e181b; --surface: #111d21; --surface-2: #15232780; --line: #1f3035;
  --text: #e6f0f0; --text-2: #a3b6ba; --text-3: #6f868b;
  --success: #3ddc97; --success-soft: #0f2a20; --warning: #f5b449; --warning-soft: #2e2410;
  --danger: #ff7b6e; --danger-soft: #331816; --info: #7aa7ff; --info-soft: #14213a;
  --violet: #a996ff; --violet-soft: #221c3d;
  --side-bg: #070e10; --side-text: #8aa0a4; --side-on: #ffffff;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -8px rgba(0,0,0,.5); --shadow-lg: 0 24px 60px -12px rgba(0,0,0,.7);
  color-scheme: dark; } }
:root[data-theme="dark"] {
  --brand: #3cc4ae; --brand-2: #7ee0cf; --copper: #f5a462; --copper-soft: #33220f; --brand-ink: #04201c; --brand-soft: #0f2e2b; --glow: rgba(45, 212, 191, .22);
  --bg: #0a1215; --bg-2: #0e181b; --surface: #111d21; --surface-2: #15232780; --line: #1f3035;
  --text: #e6f0f0; --text-2: #a3b6ba; --text-3: #6f868b;
  --success: #3ddc97; --success-soft: #0f2a20; --warning: #f5b449; --warning-soft: #2e2410;
  --danger: #ff7b6e; --danger-soft: #331816; --info: #7aa7ff; --info-soft: #14213a;
  --violet: #a996ff; --violet-soft: #221c3d;
  --side-bg: #070e10; --side-text: #8aa0a4; --side-on: #ffffff;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -8px rgba(0,0,0,.5); --shadow-lg: 0 24px 60px -12px rgba(0,0,0,.7);
  color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.55; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; text-wrap: balance; }
p { margin: 0; }
[hidden] { display: none !important; }
.i { width: 20px; height: 20px; flex: none; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.muted { color: var(--text-3); }
.small { font-size: .85rem; }
.nums { font-variant-numeric: tabular-nums; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--brand-2); outline-offset: 2px; border-radius: 8px; }

/* ---------- Shell ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 264px; background: var(--side-bg); color: var(--side-text);
  display: flex; flex-direction: column; gap: 16px; padding: 22px 16px; z-index: 30;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
}
.sidebar::before { content: ""; position: absolute; inset: 0; background: radial-gradient(400px 260px at 0 0, rgba(20,184,166,.22), transparent 70%); pointer-events: none; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--side-on); font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; position: relative; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; box-shadow: 0 6px 18px -4px rgba(34,165,148,.6); }
.brand-mark .logo { width: 100%; height: 100%; display: block; }
.brand:hover .logo path:last-child { animation: vane 1.2s var(--ease); transform-origin: 44px 20px; }
@keyframes vane { 30% { transform: rotate(-14deg); } 65% { transform: rotate(8deg); } }
.org-chip { position: relative; display: flex; align-items: center; gap: 8px; font-size: .85rem; padding: 8px 12px; border-radius: 10px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.07); }
.org-dot { width: 8px; height: 8px; border-radius: 50%; background: #3ddc97; box-shadow: 0 0 0 3px rgba(61,220,151,.2); flex: none; }
.side-nav { position: relative; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: var(--side-text); font-weight: 600; font-size: .95rem; transition: background .2s, color .2s; }
.side-nav a:hover { background: rgba(255,255,255,.05); color: var(--side-on); }
.side-nav a.on { background: linear-gradient(90deg, rgba(20,184,166,.22), rgba(20,184,166,.06)); color: var(--side-on); box-shadow: inset 0 0 0 1px rgba(94,234,212,.14); }
.side-nav a.on .i { color: #5eead4; }
.side-nav .count.soft { background: rgba(255,255,255,.12); }
.side-nav .count { margin-left: auto; background: #e8793a; color: #fff; font-size: .72rem; padding: 1px 8px; border-radius: 999px; }
.side-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; padding: 16px 12px 6px; color: #5d7378; font-weight: 700; }
.side-help { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 12px; color: var(--side-text); font-size: .88rem; font-weight: 600; border-radius: 10px; }
.side-help:hover { color: #fff; background: rgba(255,255,255,.05); }
.side-help .i { width: 18px; height: 18px; }
.trial-card { position: relative; border-radius: 14px; padding: 14px; background: linear-gradient(140deg, rgba(20,184,166,.25), rgba(109,79,216,.2)); border: 1px solid rgba(255,255,255,.08); color: var(--side-on); display: flex; flex-direction: column; gap: 6px; }
.trial-top { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: .85rem; }
.trial-top .i { width: 16px; height: 16px; }
.trial-card p { font-size: .85rem; color: var(--side-text); }
.side-foot { position: relative; display: flex; align-items: center; gap: 8px; border-top: 1px solid rgba(255,255,255,.07); padding-top: 14px; }
.me { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: var(--side-on); }
.me-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.me-text small { color: var(--side-text); }
.sidebar .icon-btn { color: var(--side-text); }
.sidebar .icon-btn:hover { background: rgba(255,255,255,.06); color: #fff; }

.shell { margin-left: 264px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 14px 32px; padding-top: calc(14px + env(safe-area-inset-top, 0px));
  background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.brand-mobile { display: none; color: var(--text); }
.page-title { font-size: 1.35rem; font-weight: 800; flex: 1; min-width: 0; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn { position: relative; width: 42px; height: 42px; display: inline-grid; place-items: center; border-radius: 12px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; transition: background .2s, color .2s, transform .15s; }
.icon-btn:hover { background: var(--bg-2); color: var(--text); }
.icon-btn:active { transform: scale(.94); }
.bell .dot { position: absolute; top: 5px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }
.t-sun { display: none; }
:root[data-theme="dark"] .t-sun { display: block; } :root[data-theme="dark"] .t-moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .t-sun { display: block; } :root:not([data-theme="light"]) .t-moon { display: none; } }

.main { padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 24px; width: 100%; max-width: 1280px; animation: rise .45s var(--ease) both; }
@keyframes rise { from { opacity: .001; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.tabbar, .sheet { display: none; }

/* ---------- Building blocks ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 1.05rem; font-weight: 700; }
.card-head .sub { font-size: .85rem; color: var(--text-3); }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-lg { display: flex; flex-direction: column; gap: 24px; }

.hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 26px 28px; color: #fff;
  background: radial-gradient(600px 300px at 100% 0, rgba(94,234,212,.45), transparent 60%), linear-gradient(130deg, #073f3a, #0b7a6f 55%, #109f90);
  box-shadow: 0 20px 50px -20px rgba(11,122,111,.6);
}
.hero::after { content: ""; position: absolute; right: -60px; bottom: -80px; width: 260px; height: 260px; border-radius: 50%; border: 40px solid rgba(255,255,255,.06); }
.hero h2 { font-size: 1.6rem; font-weight: 800; }
.hero p { color: rgba(255,255,255,.82); margin-top: 6px; max-width: 60ch; }
.hero .row { margin-top: 18px; position: relative; z-index: 1; }

.stat { padding: 20px; display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden; transition: transform .25s var(--ease), box-shadow .25s; }
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-label { font-size: .85rem; font-weight: 600; color: var(--text-2); }
.stat-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }
.stat-value { font-size: 2.1rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-foot { font-size: .82rem; color: var(--text-3); }
.tone-brand { background: var(--brand-soft); color: var(--brand); }
.tone-success { background: var(--success-soft); color: var(--success); }
.tone-warning { background: var(--warning-soft); color: var(--warning); }
.tone-danger { background: var(--danger-soft); color: var(--danger); }
.tone-info { background: var(--info-soft); color: var(--info); }
.tone-violet { background: var(--violet-soft); color: var(--violet); }
.tone-copper { background: var(--copper-soft); color: var(--copper); }
.tone-muted { background: var(--bg-2); color: var(--text-2); }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer; transition: transform .15s, box-shadow .2s, background .2s, filter .2s; white-space: nowrap; text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn-primary { color: var(--brand-ink); background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 8px 20px -8px var(--glow), inset 0 1px 0 rgba(255,255,255,.2); }
.btn-primary:hover { filter: brightness(1.06); box-shadow: 0 12px 28px -8px var(--glow); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-2); }
.btn-light { background: rgba(255,255,255,.95); color: #073f3a; }
.btn-glass { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.2); backdrop-filter: blur(6px); }
.btn-glass:hover { background: rgba(255,255,255,.22); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-sm { height: 36px; padding: 0 12px; font-size: .85rem; border-radius: 10px; }
.btn-block { width: 100%; }
.btn .i { width: 18px; height: 18px; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); font-weight: 700; cursor: pointer; }

/* Forms */
.form { display: flex; flex-direction: column; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .label { font-size: .85rem; font-weight: 700; color: var(--text-2); }
.field .hint { font-size: .8rem; color: var(--text-3); }
.input, select.input, textarea.input {
  width: 100%; height: 46px; padding: 0 14px; font: inherit; font-size: 16px; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; transition: border-color .2s, box-shadow .2s;
}
textarea.input { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; }
.input:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 4px var(--glow); }
.input-icon { position: relative; }
.input-icon .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-icon .input { padding-left: 44px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }
.file-drop { display: flex; align-items: center; gap: 12px; padding: 16px; border: 2px dashed var(--line); border-radius: 14px; background: var(--surface-2); cursor: pointer; transition: border-color .2s, background .2s; }
.file-drop:hover, .file-drop.drag { border-color: var(--brand-2); background: var(--brand-soft); }
.file-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.seg { display: inline-flex; padding: 4px; background: var(--bg-2); border-radius: 12px; gap: 4px; }
.seg a, .seg button { padding: 8px 14px; border-radius: 9px; font-weight: 700; font-size: .88rem; color: var(--text-2); border: 0; background: none; cursor: pointer; font-family: inherit; }
.seg .on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* Lists */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 14px 22px; border-top: 1px solid var(--line); color: var(--text); transition: background .15s; min-width: 0; }
.list-item:first-child { border-top: 0; }
a.list-item:hover { background: var(--surface-2); }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 700; }
.list-item .meta { font-size: .85rem; color: var(--text-3); }
.li-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.avatar { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: .9rem; flex: none;
  color: hsl(var(--h, 170) 60% 28%); background: hsl(var(--h, 170) 70% 90%); }
:root[data-theme="dark"] .avatar { color: hsl(var(--h, 170) 80% 80%); background: hsl(var(--h, 170) 40% 20%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .avatar { color: hsl(var(--h, 170) 80% 80%); background: hsl(var(--h, 170) 40% 20%); } }
.avatar-lg { width: 64px; height: 64px; border-radius: 18px; font-size: 1.3rem; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 700; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: var(--surface-2); }

/* Progress / meters */
.meter { height: 8px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transform-origin: left; animation: grow 1s var(--ease) both; }
@keyframes grow { from { transform: scaleX(0); } }
.ring { --p: 0; --c: var(--brand); width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--bg-2) 0); }
.ring > span { width: 42px; height: 42px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: .78rem; font-weight: 800; }
.donut { --a: 0; --w: 0; --x: 0; width: 150px; height: 150px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--success) 0 calc(var(--a) * 1%), var(--warning) 0 calc((var(--a) + var(--w)) * 1%), var(--danger) 0 calc((var(--a) + var(--w) + var(--x)) * 1%), var(--bg-2) 0);
  display: grid; place-items: center; }
.donut > div { width: 108px; height: 108px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; text-align: center; line-height: 1.1; }
.donut b { font-size: 1.8rem; font-weight: 800; }
.legend { display: flex; flex-direction: column; gap: 10px; font-size: .9rem; }
.legend span { display: flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.pipeline { display: flex; flex-direction: column; gap: 14px; }
.pipe-row { display: grid; grid-template-columns: 110px 1fr 32px; align-items: center; gap: 12px; font-size: .9rem; font-weight: 600; }
.pipe-row .meter { height: 10px; }

/* Kanban */
.kanban { align-items: start; display: grid; grid-template-columns: repeat(5, minmax(240px, 1fr)); gap: 16px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.col { background: var(--bg-2); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 10px; scroll-snap-align: start; min-width: 0; }
.col-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px; font-weight: 800; font-size: .9rem; }
.col-head .n { font-size: .8rem; background: var(--surface); padding: 2px 9px; border-radius: 999px; color: var(--text-2); }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow-sm); transition: transform .2s var(--ease), box-shadow .2s; }
.kcard:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kcard.focus { box-shadow: 0 0 0 3px var(--brand-2), var(--shadow); }
.kcard .payer { font-weight: 800; }
.kcard .who { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--text-2); }
.kcard .who .avatar { width: 28px; height: 28px; border-radius: 8px; font-size: .7rem; }
.kcard select { height: 36px; font-size: .85rem; border-radius: 10px; padding: 0 10px; }
.col-empty { font-size: .85rem; color: var(--text-3); text-align: center; padding: 18px 8px; border: 1.5px dashed var(--line); border-radius: 12px; }

/* Provider cards */
.pcard { padding: 20px; display: flex; flex-direction: column; gap: 16px; color: var(--text); transition: transform .25s var(--ease), box-shadow .25s; }
.pcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.pcard-top { display: flex; gap: 14px; align-items: center; }
.pcard-top .grow { flex: 1; min-width: 0; }
.pcard h3 { font-size: 1.05rem; }
.pcard .meta { color: var(--text-3); font-size: .88rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.kv div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 6px; }
.kv b { display: block; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.kv small { color: var(--text-3); font-size: .75rem; font-weight: 600; }

.profile { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.profile .grow { flex: 1; min-width: 200px; }
.profile h2 { font-size: 1.5rem; font-weight: 800; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { padding: 12px 16px; font-weight: 700; color: var(--text-2); border-bottom: 2.5px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--brand); border-color: var(--brand); }

.empty { text-align: center; padding: 40px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text-2); }
.empty-i { width: 48px; height: 48px; color: var(--brand); background: var(--brand-soft); padding: 12px; border-radius: 16px; margin-bottom: 6px; }
.empty h3 { color: var(--text); }

/* Toasts */
.toast { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; font-weight: 600; box-shadow: var(--shadow); animation: slide .4s var(--ease) both; }
.toast-success { background: var(--success-soft); color: var(--success); }
.toast-error { background: var(--danger-soft); color: var(--danger); }
.toast-info { background: var(--info-soft); color: var(--info); }
.toast span { flex: 1; }
.toast-x { background: none; border: 0; color: inherit; cursor: pointer; padding: 4px; display: grid; }
@keyframes slide { from { opacity: .001; transform: translateY(-8px); } }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; }
.modal-backdrop, .sheet-backdrop { position: absolute; inset: 0; background: rgba(5, 15, 18, .5); backdrop-filter: blur(4px); animation: fade .25s both; }
.modal-panel { position: relative; width: min(640px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg); padding: 22px; animation: pop .3s var(--ease) both; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-head h2 { font-size: 1.2rem; font-weight: 800; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.98); } }

/* Elig rows */
.elig-card { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 16px 22px; border-top: 1px solid var(--line); }
.elig-card:first-child { border-top: 0; }
.elig-time { font-weight: 800; font-size: .9rem; font-variant-numeric: tabular-nums; }
.elig-time small { display: block; color: var(--text-3); font-weight: 600; }
.elig-detail { font-size: .85rem; color: var(--text-2); margin-top: 2px; }
.elig-money { display: flex; gap: 14px; font-size: .82rem; color: var(--text-3); margin-top: 4px; flex-wrap: wrap; }
.elig-money b { color: var(--text); }
.stripe-active { box-shadow: inset 4px 0 0 var(--success); }
.stripe-warning { box-shadow: inset 4px 0 0 var(--warning); }
.stripe-inactive, .stripe-error { box-shadow: inset 4px 0 0 var(--danger); }
.stripe-pending { box-shadow: inset 4px 0 0 var(--line); }
.scan { position: relative; overflow: hidden; }
.scan.running::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, var(--glow), transparent); animation: scan 1.1s linear infinite; }
@keyframes scan { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.activity { display: flex; flex-direction: column; gap: 16px; padding: 20px 22px; }
.act { display: flex; gap: 12px; font-size: .9rem; }
.act-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; background: var(--brand-2); box-shadow: 0 0 0 4px var(--brand-soft); flex: none; }
.act small { display: block; color: var(--text-3); }

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; font-size: .9rem; }
.notice .i { margin-top: 2px; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85em; background: var(--bg-2); padding: 2px 6px; border-radius: 6px; }

/* Plans */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.plan { padding: 22px; display: flex; flex-direction: column; gap: 12px; position: relative; }
.plan.pop { border-color: var(--brand-2); box-shadow: 0 0 0 1px var(--brand-2), var(--shadow); }
.plan .price { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; }
.plan .price small { font-size: .9rem; color: var(--text-3); font-weight: 600; }
.plan ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: .9rem; }
.plan li { display: flex; gap: 8px; }
.plan li .i { color: var(--success); width: 18px; height: 18px; margin-top: 2px; }
.ribbon { position: absolute; top: -11px; right: 18px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: var(--brand-ink); font-size: .72rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; }

/* ---------- Auth pages ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--bg); }
.auth-art { position: relative; overflow: hidden; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(700px 400px at 90% 10%, rgba(94,234,212,.4), transparent 60%), radial-gradient(500px 400px at 0% 100%, rgba(109,79,216,.35), transparent 60%), linear-gradient(150deg, #052b28, #0b5f57 60%, #0b7a6f); }
.auth-art .brand { font-size: 1.4rem; }
.auth-art h1 { font-size: clamp(2rem, 3.4vw, 3rem); font-weight: 800; letter-spacing: -.03em; max-width: 14ch; }
.auth-art p { color: rgba(255,255,255,.8); max-width: 44ch; margin-top: 14px; font-size: 1.05rem; }
.float-cards { display: flex; flex-direction: column; gap: 12px; max-width: 360px; }
.float-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(10px); animation: floaty 6s ease-in-out infinite; }
.float-card:nth-child(2) { animation-delay: -2s; margin-left: 32px; }
.float-card:nth-child(3) { animation-delay: -4s; }
.float-card .li-icon { background: rgba(255,255,255,.16); color: #fff; }
.float-card small { display: block; color: rgba(255,255,255,.7); }
@keyframes floaty { 50% { transform: translateY(-6px); } }
.auth-form { display: grid; place-items: center; padding: 32px 20px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.auth-box { width: min(420px, 100%); display: flex; flex-direction: column; gap: 22px; }
.auth-box h2 { font-size: 1.8rem; font-weight: 800; letter-spacing: -.02em; }
.demo-box { padding: 14px 16px; border-radius: 14px; background: var(--brand-soft); color: var(--text-2); font-size: .88rem; }
.demo-box b { color: var(--text); }

/* Owner viewing a practice */
.imp-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 32px; background: linear-gradient(90deg, #8a3d12, #c4651f); color: #fff; font-size: .9rem; font-weight: 600; }
.imp-bar span { flex: 1; min-width: 200px; }
@media (max-width: 860px) { .imp-bar { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); } }

/* ---------- Motion & illustration ---------- */
.reveal { animation: rise .55s var(--ease) both; animation-delay: calc(var(--d, 0) * 70ms); }
.hero-vane { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); opacity: .9; pointer-events: none; }
.hero-vane .vane-arm { transform-origin: 120px 100px; animation: sway 7s ease-in-out infinite; }
.hero-vane .wind path { stroke-dasharray: 60 140; animation: wind 3.2s linear infinite; }
.hero-vane .wind path:nth-child(2) { animation-delay: -1.1s; }
.hero-vane .wind path:nth-child(3) { animation-delay: -2.2s; }
@keyframes sway { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(5deg); } }
@keyframes wind { from { stroke-dashoffset: 200; } to { stroke-dashoffset: 0; } }
.hero > *:not(.hero-vane) { position: relative; z-index: 1; }
.hero p { padding-right: 160px; }
.pulse-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--success); position: relative; display: inline-block; }
.pulse-dot::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: inherit; animation: ping 1.8s cubic-bezier(0,0,.2,1) infinite; }
@keyframes ping { 75%, 100% { transform: scale(2.6); opacity: 0; } }
.illus { width: 100%; max-width: 220px; height: auto; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; }
.shimmer { background: linear-gradient(90deg, var(--bg-2) 25%, var(--surface-2) 50%, var(--bg-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

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

/* ---------- Tablet ---------- */
@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: minmax(0, 1fr); }
  .plans { grid-template-columns: 1fr; }
}

/* ---------- Phone ---------- */
@media (max-width: 860px) {
  body { font-size: 16px; }
  .sidebar { display: none; }
  .shell { margin-left: 0; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }
  .topbar { padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top, 0px)); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(10px, env(safe-area-inset-right, 0px)); }
  body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 21; background: var(--bg); }
  .brand-mobile { display: flex; }
  .brand-mobile .brand-mark { width: 32px; height: 32px; border-radius: 10px; }
  .brand-mobile .brand-name { display: none; }
  .page-title { font-size: 1.15rem; }
  .main { padding: 18px 16px 28px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); gap: 18px; }
  .grid-2, .grid-3, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat { padding: 16px; }
  .stat-value { font-size: 1.7rem; }
  .hero { padding: 22px 20px; border-radius: 20px; }
  .hero h2 { font-size: 1.35rem; }
  .hero p { padding-right: 0; }
  .hero-vane { display: none; }
  .card-head, .list-item, .elig-card { padding-left: 16px; padding-right: 16px; }
  .card-pad { padding: 16px; }
  .elig-card { grid-template-columns: 52px minmax(0, 1fr); }
  .elig-card .elig-side { grid-column: 2; justify-self: start; }
  .kanban { grid-template-columns: repeat(5, 84%); gap: 12px; margin: 0 -16px; padding: 0 16px 8px; scroll-padding: 0 16px; }
  .btn { height: 48px; }
  .btn-sm { height: 38px; }
  .hide-sm { display: none !important; }

  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px);
    background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
    border-top: 1px solid var(--line); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--text-3); font: inherit; font-size: .7rem; font-weight: 700; background: none; border: 0; cursor: pointer; position: relative; transition: color .2s; }
  .tabbar .i { width: 24px; height: 24px; transition: transform .25s var(--ease); }
  .tabbar .on { color: var(--brand); }
  .tabbar .on .i { transform: translateY(-2px); }
  .tabbar .on::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 4px 4px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }

  .sheet:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 50; }
  .sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; background: var(--surface); border-radius: 24px 24px 0 0; padding: 10px 16px calc(20px + env(safe-area-inset-bottom, 0px)); box-shadow: var(--shadow-lg); animation: up .32s var(--ease) both; }
  .sheet-grip { width: 40px; height: 5px; border-radius: 9px; background: var(--line); margin: 0 auto 14px; }
  .sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .sheet-grid a { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 6px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); font-weight: 700; font-size: .85rem; }
  .sheet-grid .i { width: 26px; height: 26px; color: var(--brand); }
  @keyframes up { from { transform: translateY(100%); } }

  .modal { place-items: end center; padding: 0; }
  .modal-panel { border-radius: 24px 24px 0 0; max-height: 92vh; padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px)); animation: up .32s var(--ease) both; }
  .modal-foot .btn { flex: 1; }

  .fab { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom, 0px)); z-index: 35; width: 58px; height: 58px; border-radius: 18px; padding: 0; box-shadow: 0 14px 30px -10px var(--glow), 0 6px 14px rgba(0,0,0,.15); }
  .fab .i { width: 26px; height: 26px; }
  .fab-label { display: none; }

  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 28px 20px; padding-top: calc(28px + env(safe-area-inset-top, 0px)); min-height: auto; gap: 18px; }
  .auth-art .float-cards { display: none; }
  .auth-art h1 { font-size: 1.8rem; }
  .table .hide-sm { display: none; }
}
@media (min-width: 861px) { .fab .i { width: 18px; height: 18px; } }

/* ---------- Billing & membership ---------- */
.imp-bar.warn { background: linear-gradient(90deg, #8a5a00, #c98a12); }
.bill-hero { position: relative; overflow: hidden; }
.bill-hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--brand-2) 22%, transparent), transparent 70%); pointer-events: none; }
.bill-plan { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; }
.plan.current { border-color: var(--brand); }
.save-pill { display: inline-block; margin-left: 4px; padding: 2px 7px; border-radius: 999px; background: var(--success-soft); color: var(--success); font-size: .7rem; font-weight: 800; }
.pay-methods { display: flex; flex-direction: column; gap: 6px; margin-top: auto; }
.pay-opt { display: block; cursor: pointer; }
.pay-opt input { position: absolute; opacity: 0; pointer-events: none; }
.pay-opt span { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 11px; font-size: .86rem; font-weight: 600; transition: border-color .15s, background .15s; }
.pay-opt span .i { width: 18px; height: 18px; color: var(--text-3); }
.pay-opt input:checked + span { border-color: var(--brand-2); background: color-mix(in srgb, var(--brand-2) 9%, transparent); }
.pay-opt input:checked + span .i { color: var(--brand); }
.pay-opt input:focus-visible + span { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.center { text-align: center; }
.center .i { width: 15px; height: 15px; vertical-align: -2px; }

/* Receipt */
.receipt { max-width: 760px; margin: 0 auto; width: 100%; }
.receipt-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.receipt-lines { width: 100%; border-collapse: collapse; }
.receipt-lines td { padding: 12px 0; border-bottom: 1px solid var(--line); }
.receipt-lines td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.receipt-lines tr.total td { font-weight: 800; font-size: 1.1rem; border-bottom: 0; }
.pre-box { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; font-size: .92rem; }
@media print {
  .sidebar, .topbar, .tabbar, .imp-bar, .no-print, .sheet, .toast { display: none !important; }
  .shell, .main { display: block !important; padding: 0 !important; margin: 0 !important; }
  body { background: #fff !important; color: #000 !important; }
  .card { box-shadow: none !important; border: 0 !important; }
}

/* Owner panel extras */
.weekbars { display: flex; align-items: flex-end; gap: 8px; height: 170px; }
.weekbars .wb { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; min-width: 0; }
.weekbars .bar-col { flex: 1; width: 100%; max-width: 40px; display: flex; align-items: flex-end; background: var(--bg-2); border-radius: 8px; overflow: hidden; }
.weekbars .bar-col i { display: block; width: 100%; border-radius: 8px; background: linear-gradient(180deg, var(--brand-2), var(--brand)); transform-origin: bottom; animation: barrise .9s var(--ease) both; }
.weekbars .wb small { font-size: .7rem; color: var(--text-3); white-space: nowrap; }
.weekbars .wb b { font-size: .78rem; }
@keyframes barrise { from { transform: scaleY(0); } }
.switch { position: relative; display: inline-flex; width: 42px; height: 24px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s var(--ease); }
.switch input:checked + span { background: var(--brand-2); border-color: var(--brand-2); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.switch input:disabled + span { opacity: .4; }
.matrix { width: 100%; border-collapse: collapse; }
.matrix th { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); text-align: center; padding: 10px 8px; font-weight: 700; }
.matrix th:first-child { text-align: left; }
.matrix td { padding: 14px 8px; border-top: 1px solid var(--line); text-align: center; vertical-align: middle; }
.matrix td:first-child { text-align: left; }
.matrix td small { display: block; color: var(--text-3); font-size: .8rem; margin-top: 2px; }
.matrix .na { color: var(--text-3); font-size: .8rem; }
.chk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.chk-grid label { display: flex; gap: 8px; align-items: center; font-size: .88rem; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; font-size: .92rem; margin: 0; }
.dl dt { color: var(--text-3); font-weight: 600; }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 860px) {
  .plans { grid-template-columns: minmax(0, 1fr); }
  .matrix th, .matrix td { padding-left: 4px; padding-right: 4px; }
  .dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .dl dd { margin-bottom: 8px; }
}
@media (min-width: 861px) and (max-height: 960px) {
  .side-nav a { padding: 8px 12px; }
  .side-label { margin-top: 6px; }
  .trial-card p { display: none; }
}

/* AI results */
.ai-out { white-space: pre-wrap; background: color-mix(in srgb, var(--brand) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--line)); border-radius: 12px; padding: 12px 14px; font-size: .92rem; line-height: 1.5; }
.ai-out.ai-err { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.btn.is-busy { opacity: .7; cursor: progress; }

/* Revenue recovery */
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.neg { color: var(--danger); font-weight: 700; }
.pos { color: var(--success); font-weight: 700; }
.hbar { display: grid; grid-template-columns: minmax(90px, 160px) 1fr auto; gap: 10px; align-items: center; font-size: .88rem; }
.hbar .meter { height: 10px; }
.hbar-list { display: flex; flex-direction: column; gap: 10px; }
.code-pill { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; font-size: .82rem; background: var(--bg-2); border-radius: 8px; padding: 2px 8px; white-space: nowrap; }
.fix-list { margin: 6px 0 0 18px; display: flex; flex-direction: column; gap: 4px; }
.detail-row td { background: var(--surface-2); }
.items-table input.input { height: 38px; padding: 0 10px; }
.items-table td { padding: 6px 6px; }
.report-sheet { max-width: 900px; margin: 0 auto; width: 100%; }
.report-brand { display: flex; align-items: center; gap: 14px; }
.report-brand img { max-height: 48px; max-width: 180px; }
.big-num { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.select-all { width: 18px; height: 18px; accent-color: var(--brand); }
.step-dots { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 720px) { .hbar { grid-template-columns: 90px 1fr auto; } .hide-md { display: none; } }
@media print { .report-sheet { max-width: none; } .ai-out { border: 0; background: none; padding: 0; } }
