:root {
  --bg: #0b0f17;
  --card: #131a26;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --accent: #f97316;
  --rec: #ef4444;
  --done: #22c55e;
  --warn: #f59e0b;
  --border: #1f2937;
  --src-wa: #25d366;
  --src-gmail: #ea4335;
  --src-audio: #a855f7;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  background: var(--bg); color: var(--text);
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}

header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; padding-top: calc(14px + env(safe-area-inset-top));
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg); z-index: 10;
}
header h1 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: 0.4px; }
.status { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }

/* Tabs */
.tabs {
  display: none;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky; top: 51px; z-index: 9;
}
.tabs.shown { display: flex; }
.tabs button {
  flex: 1; background: transparent; color: var(--muted);
  padding: 12px 8px; border: none; font-size: 14px; font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }

.badge {
  display: inline-block;
  background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 600;
  min-width: 18px; padding: 1px 6px;
  border-radius: 10px;
  margin-left: 4px;
}
.badge.zero, .badge:empty { display: none; }

main { padding: 12px; max-width: 640px; margin: 0 auto; }

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px; margin-bottom: 12px;
}
.card h2 { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.hidden { display: none !important; }
.empty { color: var(--muted); font-style: italic; padding: 20px; text-align: center; }

/* Inputs */
input[type="text"], input[type="password"] {
  width: 100%; padding: 12px;
  background: #0f1623; border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); font-size: 16px; margin-top: 6px;
}

button {
  background: var(--accent); color: #fff; border: none;
  padding: 12px 16px; border-radius: 10px; font-size: 14px; font-weight: 600;
  cursor: pointer;
}

.error { color: var(--rec); font-size: 14px; min-height: 20px; }

/* Filters */
.filters {
  display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 12px;
  margin: -4px -4px 8px;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.filters button {
  background: var(--card); color: var(--muted);
  padding: 8px 12px; border-radius: 18px; font-size: 13px;
  border: 1px solid var(--border);
  white-space: nowrap; flex-shrink: 0;
}
.filters button.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Task list */
#tasksList, #awaitingList { list-style: none; padding: 0; margin: 0; }

.task {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px; margin-bottom: 10px;
  transition: opacity 0.2s, transform 0.25s, max-height 0.25s;
  max-height: 800px; overflow: hidden;
}
.task.updating { opacity: 0.5; }
.task.removed { opacity: 0; transform: translateX(40px); max-height: 0; padding-top: 0; padding-bottom: 0; margin-bottom: 0; border-width: 0; }
.task.awaiting { border-left: 3px solid var(--warn); }

.task-header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.task-title { font-size: 15px; font-weight: 500; flex: 1; min-width: 0; }
.task-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 6px; }
.task-meta .chat { font-style: italic; }
.task-meta .due { font-weight: 600; }
.task-meta .due.overdue { color: var(--rec); }
.task-meta .conf { font-style: italic; }

/* Source pills */
.src {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  padding: 2px 7px; border-radius: 6px; color: #fff;
}
.src-whatsapp { background: var(--src-wa); }
.src-gmail    { background: var(--src-gmail); }
.src-audio    { background: var(--src-audio); }

/* Priority */
.priority {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--warn);
}
.priority:empty { display: none; }
.pri-urgent { color: var(--rec); }
.pri-high   { color: var(--warn); }
.pri-low    { color: var(--muted); }

/* Source pre */
.task details { margin-top: 10px; }
.task summary { color: var(--muted); font-size: 12px; cursor: pointer; }
.task pre {
  white-space: pre-wrap; word-break: break-word;
  font-size: 12px; color: var(--text);
  margin: 8px 0 0; padding: 8px;
  background: #0f1623; border-radius: 8px;
  max-height: 160px; overflow-y: auto;
}

/* Actions */
.actions { display: flex; gap: 6px; margin-top: 12px; }
.actions button {
  flex: 1; padding: 8px; font-size: 13px; font-weight: 500;
  border-radius: 8px;
}
.btn-done   { background: var(--done); }
.btn-snooze { background: #475569; }
.btn-drop   { background: #1f2937; color: var(--muted); }

/* Recorder */
.mode-toggle {
  display: flex; gap: 6px; margin-bottom: 20px;
  background: #0f1623; padding: 4px; border-radius: 10px;
}
.mode-toggle button {
  flex: 1; background: transparent; color: var(--muted);
  padding: 10px; font-size: 13px; font-weight: 500;
}
.mode-toggle button.active { background: var(--accent); color: #fff; }

.record-shell { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px 0; }
#recordBtn {
  width: 110px; height: 110px; border-radius: 50%;
  background: var(--rec); border: 4px solid #1a0a0a;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.1s;
}
#recordBtn:active { transform: scale(0.96); }
#recordBtn .dot { width: 34px; height: 34px; background: #fff; border-radius: 50%; transition: all 0.2s; }
#recordBtn.recording { animation: pulse 1.4s infinite; }
#recordBtn.recording .dot { width: 26px; height: 26px; border-radius: 4px; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
  70% { box-shadow: 0 0 0 22px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
.timer { font-family: "SF Mono", ui-monospace, monospace; font-size: 30px; }
.hint { color: var(--muted); font-size: 13px; }
.meta label { display: block; color: var(--muted); font-size: 13px; margin-top: 14px; }

/* ───── Expenses ───── */
.exp-toolbar {
  display: flex; gap: 8px; align-items: center; margin-bottom: 10px;
}
.exp-toolbar input[type="month"] {
  flex: 1; padding: 10px 12px;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); font-size: 15px; color-scheme: dark;
}
.exp-export {
  background: var(--card); color: var(--text);
  border: 1px solid var(--border); font-size: 13px;
  padding: 10px 14px; white-space: nowrap;
}

.exp-summary { padding: 14px 16px; }
.exp-total-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.exp-total { font-size: 26px; font-weight: 700; }
.exp-total-label { color: var(--muted); font-size: 12px; margin-top: 2px; }
.exp-splits { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.exp-unreimb { margin-top: 10px; font-size: 13px; color: var(--warn); }

.exp-cats { margin-top: 12px; display: flex; flex-direction: column; gap: 5px; }
.exp-cat-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.exp-cat-name { width: 88px; color: var(--muted); text-transform: capitalize; }
.exp-cat-bar { flex: 1; height: 6px; background: #0f1623; border-radius: 3px; overflow: hidden; }
.exp-cat-bar div { height: 100%; background: var(--accent); border-radius: 3px; }
.exp-cat-val { width: 74px; text-align: right; font-variant-numeric: tabular-nums; }

#expensesList { list-style: none; padding: 0; margin: 0; }
.expense {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 10px;
  transition: opacity 0.2s;
}
.expense.updating { opacity: 0.5; }
.exp-row { cursor: pointer; }
.exp-line1 { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.exp-merchant { font-size: 15px; font-weight: 600; }
.exp-amount { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.exp-amount.refund { color: var(--done); }
.exp-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); margin-top: 6px; }

.chip {
  font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 8px;
  border: 1px solid var(--border); color: var(--muted);
}
.chip-cat { text-transform: capitalize; }
.chip-new { color: var(--warn); border-color: var(--warn); }
.chip-conf { color: var(--muted); }
.chip-reimb { color: var(--done); border-color: var(--done); }

.etype {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
  padding: 2px 8px; border-radius: 8px; color: #fff; cursor: pointer;
}
.etype-business { background: #2563eb; }
.etype-personal { background: #059669; }
.etype-unsure   { background: #6b7280; }

.exp-detail { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.exp-desc { margin: 0 0 8px; font-size: 14px; }
.exp-src { margin: 0 0 8px; font-size: 12px; }
.muted { color: var(--muted); }
.exp-receipts { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.btn-receipt {
  background: #0f1623; color: var(--text); border: 1px solid var(--border);
  font-size: 12px; padding: 8px 10px; border-radius: 8px;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.exp-edit label { display: block; color: var(--muted); font-size: 12px; margin: 8px 0; }
.exp-cat-select {
  width: 100%; margin-top: 4px; padding: 10px;
  background: #0f1623; border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: 14px; text-transform: capitalize;
}
.btn-reimb { background: #2563eb; }

/* Recent recordings */
#recent { list-style: none; padding: 0; margin: 0; }
#recent li { padding: 10px 0; border-bottom: 1px solid var(--border); }
#recent li:last-child { border-bottom: none; }
#recent li.empty { color: var(--muted); font-style: italic; }
.r-title { font-size: 14px; font-weight: 500; }
.r-status { font-size: 11px; color: var(--muted); margin-left: 6px; }
.r-meta { color: var(--muted); font-size: 11px; margin-top: 3px; }
.r-tasks { margin-top: 8px; padding: 8px 10px; background: #0f1623; border-radius: 6px; font-size: 13px; }

/* ── Gmail accounts panel (v5.1) ─────────────────────────────────────────── */
#expAccounts input[type="text"],
#expAccounts input[type="password"] {
  width: 100%; box-sizing: border-box; margin: 6px 0;
  padding: 10px 12px; border-radius: 10px; border: 1px solid #2a3446;
  background: #121826; color: #e8ecf4; font-size: 14px;
}
#expAccounts input[type="number"] {
  width: 64px; padding: 6px 8px; border-radius: 8px; border: 1px solid #2a3446;
  background: #121826; color: #e8ecf4; font-size: 14px;
}
#acctList { list-style: none; margin: 10px 0; padding: 0; }
.acct-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 4px; border-bottom: 1px solid #1d2636;
}
.acct-email { flex: 1; font-size: 14px; }
.acct-err { color: #f5b83d; }
.acct-remove { padding: 4px 10px; }
.acct-backfill { margin-top: 14px; padding-top: 12px; border-top: 1px solid #1d2636; }
.acct-backfill label { font-size: 14px; margin-right: 8px; }
.chip-acct { background: #223; color: #9fb4d8; }

/* ── Billing tab (v5.2) ──────────────────────────────────────────────────── */
.bill-toolbar { flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.bill-date { display: flex; flex-direction: column; font-size: 12px; color: #9fb4d8; gap: 3px; }
.bill-date input[type="date"] {
  padding: 8px 10px; border-radius: 10px; border: 1px solid #2a3446;
  background: #121826; color: #e8ecf4; font-size: 14px;
}
.bill-summary .exp-total { font-size: 28px; font-weight: 700; }
.week-card { margin: 12px 0; }
.week-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.week-title { font-size: 15px; font-weight: 600; }
.week-total { font-size: 20px; font-weight: 700; white-space: nowrap; }
.week-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.week-rows { list-style: none; margin: 8px 0 0; padding: 0; }
.bill-line { padding: 8px 0; border-top: 1px solid #1d2636; }
.chip-bill { background: #1f3a2a; color: #7fe0a5; }
.chip-reimb2 { background: #2a2440; color: #c3a8ff; }
.chip-client { background: #33240f; color: #f5b83d; }

/* rules & people */
.rule-list { list-style: none; margin: 8px 0; padding: 0; }
.rule-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 4px; border-bottom: 1px solid #1d2636; font-size: 14px;
}
.rule-row > span { flex: 1; }
.sf-status { margin: 6px 0 8px; font-size: 14px; }
.pnl-ytd { margin-left: auto; white-space: nowrap; }
.pnl-status .warn-line { color: #fca5a5; font-size: 12px; margin: 6px 0 0; }
.pnl-tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.pnl-tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); border-bottom: 1px solid #2a3446; padding: 6px 4px; }
.pnl-tbl th.num, .pnl-tbl td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pnl-tbl td { padding: 5px 4px; }
.pnl-tbl tr.sec td { font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding-top: 12px; border-bottom: 1px solid #2a3446; }
.pnl-tbl tr.grp td { border-top: 1px solid #1d2636; }
.pnl-tbl td.ind { padding-left: 12px; }
.pnl-tbl tr.tot td { font-weight: 700; border-top: 1px solid #2a3446; }
.pnl-tbl tr.net td { font-weight: 800; font-size: 15px; border-top: 2px solid #3a4a63; background: #121a28; }
.pnl-tbl .pct { color: #f0b45a; font-size: 10px; font-weight: 700; }
.inc-row { flex-wrap: wrap; gap: 6px; }
.inc-main { flex: 1 1 100%; font-size: 13px; }
.inc-amt { font-variant-numeric: tabular-nums; font-weight: 600; }
.inc-client { width: 90px; padding: 4px 6px; border-radius: 6px; border: 1px solid #2a3446; background: #121826; color: #e8ecf4; font-size: 12px; }
.inc-cat, .inc-status { padding: 4px 6px; border-radius: 6px; border: 1px solid #2a3446; background: #121826; color: #e8ecf4; font-size: 12px; }
.pnl-close-row { margin-top: 14px; }
.rule-add input[type="password"] {
  width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 10px;
  border: 1px solid #2a3446; background: #121826; color: #e8ecf4; font-size: 14px;
}
.rule-add { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 18px; }
.rule-add input[type="text"], .rule-add select {
  width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 10px;
  border: 1px solid #2a3446; background: #121826; color: #e8ecf4; font-size: 14px;
}
.rule-add input[type="date"] {
  padding: 8px 10px; border-radius: 8px; border: 1px solid #2a3446;
  background: #121826; color: #e8ecf4; font-size: 14px;
}
.rule-dates { display: flex; gap: 12px; }
.rule-dates label { display: flex; flex-direction: column; font-size: 12px; color: #9fb4d8; gap: 3px; }
.chk { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.chk input { width: auto; }

/* Expenses-tab manual billing controls */
.exp-bill-edit { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.exp-bill-edit label { font-size: 13px; }
.exp-inp {
  width: 100%; box-sizing: border-box; padding: 8px 10px; border-radius: 8px;
  border: 1px solid #2a3446; background: #121826; color: #e8ecf4; font-size: 14px;
}
.exp-loc-row { display: flex; gap: 10px; }
.exp-loc-row label { flex: 1; }
.exp-state { text-transform: uppercase; }

/* ── Location, AI reasoning, invoice (v5.3) ──────────────────────────────── */
.chip-loc { background: #142c3a; color: #7fd4f5; }
.ai-reason {
  margin: 6px 0; padding: 8px 10px; border-radius: 8px;
  background: #161b2e; border: 1px solid #26314c; color: #c3cde0; font-size: 13px;
}
.week-actions { margin: 6px 0 4px; }
.btn-invoice {
  width: 100%; padding: 11px 12px; border: none; border-radius: 10px; cursor: pointer;
  background: #1f6feb; color: #fff; font-size: 14px; font-weight: 600;
}
.btn-invoice:disabled { opacity: .6; cursor: default; }

/* trip label chip (v5.4) */
.chip-trip { background: #2a1f3a; color: #d6b8ff; }
.chip-ontrip { background: #123020; color: #6ee7a8; }
.chip-offtrip { background: #33261a; color: #f0b45a; }
.chip-company { background: #1a2740; color: #8fb6ff; }
.chip-personal { background: #24202f; color: #c3a8ff; }
.chip-warn { background: #3a1f1f; color: #fca5a5; font-weight: 600; }
.chip-settle { background: #1f2b3a; color: #7fd0e0; }
.chip-waived { background: #202a20; color: #9ccf9c; }
.bill-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.mini-btn { padding: 5px 10px; border-radius: 8px; border: 1px solid #2a3446; background: #131a28; color: #cbd5e1; font-size: 12px; cursor: pointer; }
.mini-btn:hover { border-color: #3a4a63; }
.mini-dup { color: #fca5a5; }
.chip-waivebtn { background: #1f2937; color: #cbd5e1; cursor: pointer; border: 1px solid #2a3446; }
.rule-eff { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.rule-eff input[type="date"] { padding: 8px 10px; border-radius: 8px; border: 1px solid #2a3446; background: #121826; color: #e8ecf4; }
.record-card { margin-top: 14px; }
.ct-timing { padding: 6px 8px; border-radius: 8px; border: 1px solid #2a3446; background: #121826; color: #e8ecf4; font-size: 13px; }
#tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }

/* ── Profile editors (company + client) ──────────────────────────────────── */
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin: 10px 0 6px; }
.profile-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #9fb4d8; }
.profile-grid label.wide { grid-column: 1 / -1; }
.profile-grid input[type="text"] {
  width: 100%; box-sizing: border-box; padding: 9px 11px; border-radius: 9px;
  border: 1px solid #2a3446; background: #121826; color: #e8ecf4; font-size: 14px;
}
.profile-sub { font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 16px 0 2px; }
.profile-logo { display: flex; align-items: center; gap: 14px; margin: 6px 0; flex-wrap: wrap; }
.co-logo { max-height: 56px; max-width: 180px; border-radius: 8px; background: #fff; padding: 4px; }
.client-profile { border: 1px solid #26314c; border-radius: 12px; padding: 12px; margin: 10px 0; background: #10182a; }
.client-profile > .cp-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.client-profile > .cp-head h3 { margin: 0; font-size: 15px; flex: 1; }
.cp-status { font-size: 12px; color: var(--muted); margin-top: 6px; }
.btn-edit { background: #1a2740; color: #8fb6ff; border: 1px solid #2a3446; border-radius: 8px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
.editing-banner { font-size: 12px; color: #f0b45a; margin: 2px 0 6px; }
@media (max-width: 560px) { .profile-grid { grid-template-columns: 1fr; } }

/* ── Invoicing + Onboarding ──────────────────────────────────────────────── */
.seg { display: inline-flex; border: 1px solid #2a3446; border-radius: 10px; overflow: hidden; margin: 6px 0 12px; }
.seg-btn { background: #121826; color: #9fb4d8; border: none; padding: 9px 16px; font-size: 13px; cursor: pointer; }
.seg-btn.active { background: #1f6feb; color: #fff; font-weight: 600; }
.inv-line { display: grid; grid-template-columns: 1fr 70px 80px 90px 30px; gap: 8px; align-items: center; margin-bottom: 8px; }
.inv-line.travel { grid-template-columns: 110px 1fr 100px 30px; }
.inv-line input { width: 100%; box-sizing: border-box; padding: 8px 10px; border-radius: 8px; border: 1px solid #2a3446; background: #121826; color: #e8ecf4; font-size: 13px; }
.inv-line .li-drop { background: #1f2937; color: var(--muted); border: 1px solid #2a3446; border-radius: 8px; cursor: pointer; padding: 6px; }
.inv-total { margin-left: auto; font-weight: 700; font-size: 15px; align-self: center; }
.inv-who { margin: 8px 0; }
.onb-row { display: flex; align-items: center; gap: 10px; padding: 10px 6px; border-bottom: 1px solid #1d2636; cursor: pointer; }
.onb-row:hover { background: #10182a; }
.onb-row .onb-name { flex: 1; font-weight: 600; }
.onb-meta { font-size: 12px; color: var(--muted); }
.status-pill { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .4px; }
.status-invited { background: #33261a; color: #f0b45a; }
.status-documents_pending { background: #3a1f1f; color: #fca5a5; }
.status-verified { background: #14324a; color: #6ee7ff; }
.status-active { background: #143a2a; color: #6ee7a8; }
.status-inactive { background: #1f2937; color: #9aa4b2; }
.comp-bar { width: 90px; height: 7px; border-radius: 4px; background: #22293a; overflow: hidden; }
.comp-fill { height: 100%; background: linear-gradient(90deg,#f0b45a,#6ee7a8); }
.doc-check { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid #161d2b; font-size: 13px; }
.doc-check .dc-name { flex: 1; }
.dc-have { color: #6ee7a8; } .dc-missing { color: #fca5a5; }
.mini-file { font-size: 12px; }
.tax-tbl { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.tax-tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); border-bottom: 1px solid #2a3446; padding: 7px 5px; }
.tax-tbl td { padding: 8px 5px; border-bottom: 1px solid #1d2636; vertical-align: top; }
.tax-tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.form-chip { display: inline-block; background: #14243a; color: #8fb6ff; border-radius: 6px; padding: 1px 7px; font-size: 11px; margin: 1px 2px 1px 0; }

/* ── AR / AP ─────────────────────────────────────────────────────────────── */
.apar-cards { display: grid; grid-template-columns: repeat(auto-fit,minmax(120px,1fr)); gap: 10px; margin: 10px 0; }
.apar-card { background: #10182a; border: 1px solid #26314c; border-radius: 12px; padding: 12px 14px; }
.apar-card .k { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.apar-card .v { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 4px; }
.apar-card.warn .v { color: #fca5a5; }
.apar-card.good .v { color: #6ee7a8; }
.apar-tbl { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
.apar-tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); border-bottom: 1px solid #2a3446; padding: 7px 5px; }
.apar-tbl td { padding: 8px 5px; border-bottom: 1px solid #1d2636; vertical-align: middle; }
.apar-tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.apar-tbl select { padding: 4px 6px; border-radius: 6px; border: 1px solid #2a3446; background: #121826; color: #e8ecf4; font-size: 12px; }
.due-badge { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
.due-ok { background: #143a2a; color: #6ee7a8; } .due-soon { background: #33261a; color: #f0b45a; } .due-over { background: #3a1f1f; color: #fca5a5; }
.apar-add { margin: 14px 0; }
.apar-add summary { cursor: pointer; color: #8fb6ff; font-size: 13px; margin-bottom: 8px; }
.mini-act { padding: 4px 9px; border-radius: 7px; border: 1px solid #2a3446; background: #131a28; color: #cbd5e1; font-size: 12px; cursor: pointer; margin-left: 4px; }
.mini-act:hover { border-color: #3a4a63; }
.rem-draft { border: 1px solid #26314c; border-radius: 10px; padding: 10px 12px; margin: 8px 0; background: #10182a; }
.rem-head { font-size: 13px; margin-bottom: 6px; }
.rem-subject { font-weight: 600; font-size: 13px; margin: 4px 0; }
.rem-body { width: 100%; box-sizing: border-box; min-height: 120px; padding: 8px 10px; border-radius: 8px; border: 1px solid #2a3446; background: #0e1524; color: #cbd5e1; font-size: 12px; font-family: inherit; resize: vertical; }
.ai-upload { margin: 12px 0; padding: 10px 12px; border: 1px dashed #2a3446; border-radius: 10px; background: #0e1524; }
.ai-upload .muted { display: block; margin-top: 6px; font-size: 12px; }

/* ── Role segregation + Monitor ──────────────────────────────────────────── */
.role-pill { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  padding: 2px 8px; border-radius: 999px; vertical-align: middle; margin-left: 6px; }
.role-pill.admin { background: #14324a; color: #6ee7ff; }
.role-pill.assistant { background: #143a2a; color: #6ee7a8; }
.role-pill.user { background: #241f36; color: #c3a8ff; }
#tabs button[data-role="admin"].role-hidden, #tabs button[data-role="user"].role-hidden { display: none; }
.monitor-tbl { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 8px; }
.monitor-tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); border-bottom: 1px solid #2a3446; padding: 8px 6px; }
.monitor-tbl th.num, .monitor-tbl td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.monitor-tbl td { padding: 9px 6px; border-bottom: 1px solid #1d2636; }
.monitor-tbl td.person { font-weight: 600; }
.monitor-pending { display: inline-block; min-width: 26px; text-align: center; padding: 2px 8px; border-radius: 999px; background: #3a1f1f; color: #fca5a5; font-weight: 700; }
.monitor-sub { font-size: 11px; color: var(--muted); }
.doc-inbox-item { border: 1px solid #2a3446; border-radius: 10px; padding: 12px; margin-bottom: 10px; background: #141b28; }
.doc-inbox-item .dii-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.doc-inbox-item .dii-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.doc-inbox-item .dii-consultant { flex: 1; min-width: 180px; padding: 6px 8px; border-radius: 8px; }
.dup-note { margin-top: 10px; padding: 10px 12px; border: 1px dashed #33507a; border-radius: 10px; background: #0f1930; font-size: 12px; color: var(--muted); }
.dup-note ul { margin: 6px 0 0; padding-left: 18px; }
.form-gen-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.form-gen-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.form-gen-btn .form-kind { font-size: 10px; opacity: .7; font-weight: 400; margin-left: 4px; }
.email-draft { margin-top: 10px; border: 1px solid #2a3446; border-radius: 10px; padding: 12px; background: #0f1930; }
.email-draft label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.email-draft input, .email-draft textarea { width: 100%; margin-top: 3px; padding: 7px 9px; border-radius: 8px; font-family: inherit; }
.email-draft textarea { resize: vertical; line-height: 1.4; }
.email-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.em-attachopts { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 8px 0; font-size: 13px; }
.em-attach { display: inline-flex; align-items: center; gap: 6px; color: var(--text); }
.em-filelist { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
.em-file { display: inline-flex; align-items: center; gap: 6px; background: #1a2233; border: 1px solid #2a3446; border-radius: 999px; padding: 3px 10px; font-size: 12px; }
.em-file-remove { color: #fca5a5; text-decoration: none; font-weight: 700; }
.psa-opts { border: 1px solid #2a3446; border-radius: 10px; padding: 12px; margin: 8px 0; background: #0f1930; }
.psa-opts .psa-leaves { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.psa-opts #psaLeaveTypes { display: inline-flex; flex-wrap: wrap; gap: 12px; transition: opacity .15s; }
.psa-opts textarea { width: 100%; margin-top: 3px; padding: 7px 9px; border-radius: 8px; font-family: inherit; }
.psa-opts .leave-sub { margin-left: 10px; font-size: 11px; color: var(--muted); display: inline-flex; gap: 10px; }
.monitor-row { cursor: pointer; transition: background .12s; }
.monitor-row:hover { background: #1a2233; }
#monitorDrill .exp-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
#monitorDrill .exp-head #monitorChase { margin-left: auto; }
#tabs button { flex: 0 0 auto; }
.authbox { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 12px; }
.auth-email { color: #8fb6ff; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-btn { padding: 5px 10px; border-radius: 8px; border: 1px solid #2a3446; background: #121826; color: #e8ecf4; font-size: 12px; }
.pnl-gate { text-align: center; }
.pnl-gate h2 { margin-top: 4px; }

/* ── Bookkeeping: needs-receipts + statement upload (v5.5) ───────────────── */
.needs-receipts { border: 1px solid #4a3a1a; background: #1c1710; }
.needs-receipts h2 { color: #f5b83d; }
#needsList { list-style: none; margin: 8px 0 0; padding: 0; }
.need-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-top: 1px solid #2a2416;
}
.need-main { flex: 1; min-width: 0; }
.up-btn { white-space: nowrap; cursor: pointer; padding: 8px 12px; }
#stmtFile { width: 100%; box-sizing: border-box; color: #e8ecf4; font-size: 13px; margin: 4px 0; }
#billSettings input[type="file"] { padding: 8px 0; }

/* ============================================================
   P360 Portal — light "Wise-style" theme + left sidebar
   (appended override; wins over earlier dark rules)
   ============================================================ */
:root {
  --bg: #f5f7f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #16a34a;      /* professional green accent */
  --accent-soft: #e8f5ee;
  --rec: #dc2626;
  --done: #16a34a;
  --warn: #d97706;
  --border: #e6e8ec;
}
body { background: var(--bg); color: var(--text); }

/* App shell: sidebar + content */
.app-shell { display: flex; min-height: 100vh; align-items: stretch; }
.sidebar {
  flex: 0 0 232px; width: 232px; background: #ffffff;
  border-right: 1px solid var(--border);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; padding: 14px 12px;
}
.brand { display: flex; align-items: center; gap: 9px; padding: 6px 8px 14px; }
.brand .brand-name { font-size: 18px; font-weight: 800; letter-spacing: -0.2px; color: #0f172a; }
.role-pill { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  background: var(--accent-soft); color: var(--accent); padding: 2px 8px; border-radius: 20px; }

/* Sidebar nav — vertical, Wise-like */
.tabs { display: none; border: none; background: transparent; position: static; }
.tabs.shown { display: flex; flex-direction: column; gap: 2px; }
.tabs button {
  flex: none; width: 100%; text-align: left; display: flex; align-items: center; gap: 8px;
  background: transparent; color: #334155; padding: 10px 12px; border: none;
  border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; border-bottom: none;
}
.tabs button:hover { background: #f1f5f9; color: #0f172a; }
.tabs button.active { background: var(--accent-soft); color: var(--accent); border-bottom: none; }
.sidebar-foot { margin-top: auto; padding: 10px 8px 4px; }
.sidebar-foot .status { font-size: 10px; }

/* Content + sticky topbar with contextual help */
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 28px; background: #ffffff; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.topbar-title h2 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -0.3px; color: #0f172a; }
.view-help { margin: 3px 0 0; font-size: 13px; color: var(--muted); max-width: 780px; }
main { max-width: 1100px; margin: 0; padding: 22px 28px 60px; width: 100%; }

/* Cards — clean white with soft shadow */
.card {
  background: #ffffff; border: 1px solid var(--border); border-radius: 16px;
  padding: 18px; margin-bottom: 14px; box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.card h2 { color: #0f172a; }
.muted { color: var(--muted); }

/* Inputs / selects / textareas → light */
input[type="text"], input[type="password"], input[type="number"], input[type="date"],
input[type="month"], input[type="email"], input[type="search"], select, textarea {
  background: #ffffff; border: 1px solid var(--border); color: var(--text);
  border-radius: 10px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
label { color: #334155; }

/* Buttons: keep accents but soften */
.btn-done { background: var(--accent); color: #fff; }
button { border-radius: 10px; }

/* Tables on white */
table.apar-tbl, table.items, .apar-tbl th, .apar-tbl td { color: var(--text); }
.apar-tbl th { color: var(--muted); border-color: var(--border); }
.apar-tbl td { border-color: var(--border); }

/* Responsive: stack the sidebar on narrow screens */
@media (max-width: 860px) {
  .app-shell { flex-direction: column; }
  .sidebar { flex: none; width: 100%; height: auto; position: sticky; top: 0; z-index: 30; padding: 10px; }
  .tabs.shown { flex-direction: row; overflow-x: auto; gap: 4px; }
  .tabs button { width: auto; white-space: nowrap; }
  .sidebar-foot { display: none; }
  .topbar { padding: 12px 16px; }
  main { padding: 16px; }
}

/* P360 mascot avatar in the sidebar */
.brand-logo { border-radius: 9px; object-fit: cover; box-shadow: 0 1px 3px rgba(15,23,42,.15); display: block; }

/* ============================================================
   P360 Portal v6 — onboarding/form field fixes + Roxi topbar badge
   (appended last; wins over earlier per-section dark rules)
   ============================================================ */
:root { --focus-blue: #2f6fed; --focus-ring: rgba(47,111,237,.20); }

/* Every fillable cell → white with readable text.
   Beats earlier dark backgrounds (.profile-grid, .inv-line, .apar-tbl,
   .rule-add, .email-draft, .rem-body, #expAccounts, .bill-date, etc.) */
input[type="text"], input[type="password"], input[type="number"],
input[type="date"], input[type="month"], input[type="email"],
input[type="search"], input[type="tel"], input[type="url"],
select, textarea {
  background: #ffffff !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: 10px;
}
input::placeholder, textarea::placeholder { color: #9aa7ba; }

/* Hover → subtle grey line; Focus → light blue line (no black outline) */
input:hover, select:hover, textarea:hover { border-color: #b9c6dc !important; }
input:focus, select:focus, textarea:focus {
  outline: none !important;
  border-color: var(--focus-blue) !important;
  box-shadow: 0 0 0 3px var(--focus-ring) !important;
}

/* Onboarding form: readable labels + white sub-cards on the light theme */
.profile-grid label { color: #475569 !important; }
.client-profile { background: #ffffff !important; border-color: var(--border) !important; }

/* Roxi AI badge next to the sign-in / sign-out button */
.topbar-auth { display: flex; align-items: center; gap: 14px; }
.roxi-badge-wrap { display: inline-flex; align-items: center; gap: 8px; }
.roxi-badge {
  border-radius: 50%; object-fit: cover; border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(15,23,42,.18); display: block;
}
.roxi-badge-txt { display: flex; flex-direction: column; line-height: 1.1; }
.roxi-badge-txt b { font-size: 13px; font-weight: 800; color: #0f172a; }
.roxi-badge-txt em { font-size: 10px; font-style: normal; color: var(--muted); }
@media (max-width: 560px) { .roxi-badge-txt { display: none; } }

/* ============================================================
   P360 Portal v7 — remove leftover dark-blue panels so text reads
   (dark boxes with inherited dark ink → light surfaces, dark ink)
   ============================================================ */
.psa-opts, .email-draft, .dup-note, .doc-inbox-item, .rem-draft,
.apar-card, .ai-upload, .r-tasks, .client-profile {
  background: #ffffff !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
}
.dup-note, .ai-upload { border-style: dashed !important; background: #f8fafc !important; }
.psa-opts, .email-draft { background: #f8fafc !important; }
.needs-receipts { background: #fef8ee !important; border: 1px solid #f0dcae !important; }
.needs-receipts h2 { color: #b7791f !important; }

/* Segment / mode toggles → light track, dark labels, accent when active */
.mode-toggle { background: #eef2f7 !important; }
.mode-toggle button { color: #334155 !important; }
.mode-toggle button.active { background: var(--accent) !important; color: #fff !important; }
.seg-btn { background: #eef2f7 !important; color: #334155 !important; }
.seg-btn.active { background: var(--focus-blue) !important; color: #fff !important; }
.exp-cat-bar { background: #e2e8f0 !important; }

/* Small dark drop/pill buttons → light with readable ink */
.inv-line .li-drop { background: #f1f5f9 !important; color: #475569 !important; border: 1px solid var(--border) !important; }

/* P&L net row on light */
.pnl-tbl tr.net td { background: #eef3fb !important; color: #0f172a !important; border-top: 2px solid #cbd5e1 !important; }

/* Safety net: any element with a dark inline/utility bg keeps light ink */
[style*="background:#10182a"], [style*="background:#0f1930"],
[style*="background:#121826"], [style*="background:#0e1524"] { color: #e8ecf4 !important; }

/* ============================================================
   P360 Portal v8 — roster hover fix + company logo branding
   ============================================================ */
/* Roster / monitor rows: hovering a name used to paint a dark band ("black line") */
.onb-row { border-bottom: 1px solid var(--border) !important; }
.onb-row:hover { background: #f1f5f9 !important; }
.monitor-row:hover { background: #f1f5f9 !important; }

/* Company logo in the top-left brand (square icon, shown un-cropped) */
.brand-logo--company {
  object-fit: contain !important;
  background: #ffffff !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  padding: 2px !important;
  box-shadow: none !important;
}

/* ============================================================
   P360 Portal v9 — global light sweep: no black/dark highlights.
   Every remaining dark chip/pill/status/button/track → light tint
   with a saturated dark ink so black text is always readable.
   ============================================================ */

/* ---- Status pills, chips & badges: light tint + saturated ink ---- */
/* green (active / success / on-trip / billable / waived) */
.status-active, .role-pill.assistant, .due-ok, .chip-ontrip, .chip-waived,
.chip-bill { background: #dcfce7 !important; color: #15803d !important; }
/* amber (invited / pending / client / off-trip / due-soon) */
.status-invited, .chip-client, .chip-offtrip, .due-soon
  { background: #fef3c7 !important; color: #b45309 !important; }
/* red (docs pending / warning / overdue / needs attention) */
.status-documents_pending, .chip-warn, .due-over, .monitor-pending
  { background: #fee2e2 !important; color: #dc2626 !important; }
/* cyan (verified / location / settle / admin) */
.status-verified, .chip-loc, .chip-settle, .role-pill.admin
  { background: #cffafe !important; color: #0e7490 !important; }
/* blue (company / generated-form tags) */
.chip-company, .form-chip { background: #dbeafe !important; color: #1d4ed8 !important; }
/* purple (trip / personal / reimbursement) */
.chip-trip, .chip-personal, .chip-reimb2, .role-pill.user
  { background: #ede9fe !important; color: #6d28d9 !important; }
/* slate (inactive / account) */
.status-inactive, .chip-acct { background: #eef2f7 !important; color: #475569 !important; }

/* ---- Bright-on-white text fixes (was designed for a dark bg) ---- */
.dc-have, .apar-card.good .v { color: #15803d !important; }
.dc-missing, .apar-card.bad .v { color: #dc2626 !important; }
.doc-check { border-bottom: 1px solid var(--border) !important; }
.auth-email { color: #334155 !important; }

/* ---- Dark utility buttons → light with readable ink ---- */
.auth-btn, .btn-drop, .mini-btn, .mini-act, .chip-waivebtn, .btn-edit, .em-file {
  background: #eef2f7 !important; color: #334155 !important;
  border: 1px solid var(--border) !important;
}
.auth-btn:hover, .btn-drop:hover, .mini-btn:hover, .mini-act:hover,
.chip-waivebtn:hover, .btn-edit:hover { background: #e2e8f0 !important; }
.btn-edit { color: #1d4ed8 !important; }
.em-file-remove { color: #dc2626 !important; }

/* ---- Progress / meter tracks → light grey ---- */
.comp-bar, .exp-cat-bar { background: #e2e8f0 !important; }

/* ---- Any leftover dark hint/record surfaces → light ---- */
.hint, .r-tasks { background: transparent !important; }

/* ============================================================
   P360 Portal v10 — final stragglers (untyped inputs, receipt
   buttons, AI-reason panel) that escaped the earlier sweeps
   ============================================================ */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]),
select, textarea { background: #ffffff !important; color: var(--text) !important; }
.btn-receipt { background: #eef2f7 !important; color: #334155 !important; border: 1px solid var(--border) !important; }
.btn-receipt:hover { background: #e2e8f0 !important; }
.ai-reason { background: #f8fafc !important; border: 1px solid var(--border) !important; color: #475569 !important; }

/* ============================================================
   P360 Portal — personal-mailbox vendor filter panel
   ============================================================ */
.pv-panel { border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin: 8px 0 4px; background: #f8fafc; }
.pv-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; font-size: 13px; }
.pv-add { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.pv-add input { flex: 1; min-width: 200px; }
.pv-list { display: flex; flex-direction: column; gap: 6px; }
.pv-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #fff; border: 1px solid var(--border); border-radius: 10px; flex-wrap: wrap; }
.pv-main { flex: 1; min-width: 0; }
.pv-name { font-weight: 700; color: #0f172a; }
.pv-meta { font-size: 11px; color: var(--muted); margin-left: 6px; }
.pv-actions { display: flex; gap: 6px; }
.pv-set.pv-on[data-cls="business"] { background: #dcfce7 !important; color: #15803d !important; border-color: #86efac !important; font-weight: 700; }
.pv-set.pv-on[data-cls="personal"] { background: #ede9fe !important; color: #6d28d9 !important; border-color: #c4b5fd !important; font-weight: 700; }

/* ── SOW milestone schedule (client profile) ─────────────────── */
.ms-sched { margin-top: 8px; border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; background: #f8fafc; }
.ms-sched-head { font-size: 13px; margin-bottom: 6px; }
.ms-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.ms-row:first-of-type { border-top: none; }
.ms-desc { flex: 1; min-width: 160px; font-weight: 600; color: #0f172a; }
.ms-amt { font-weight: 700; color: #0f172a; }
.ms-due { font-size: 11px; color: var(--muted); }
.ms-gen { margin-left: auto; }

/* ── Project team costing summary ────────────────────────────── */
.cost-summary { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.cost-tile { flex: 1; min-width: 120px; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.cost-tile span { font-size: 11px; color: var(--muted); }
.cost-tile b { font-size: 15px; color: #0f172a; }
.cost-tile.good b { color: #15803d; }
.cost-tile.bad b { color: #dc2626; }

/* ── Billing schedule Current/Future sub-tabs ────────────────── */
.sched-subtab { background: #eef2f7; color: #334155; border: 1px solid var(--border); border-radius: 8px; padding: 6px 14px; font-size: 13px; font-weight: 600; cursor: pointer; }
.sched-subtab.active { background: var(--focus-blue); color: #fff; border-color: var(--focus-blue); }
.proj-subtab { background: #eef2f7; color: #334155; border: 1px solid var(--border); border-radius: 8px; padding: 6px 14px; font-size: 13px; font-weight: 600; cursor: pointer; }
.proj-subtab.active { background: var(--focus-blue); color: #fff; border-color: var(--focus-blue); }

/* ── Billing: per-client project cards ───────────────────────── */
.bill-client { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin: 8px 0; background: #fff; }
.bill-client .bc-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.bill-client .bc-head b { font-size: 15px; }
.chip-direct { background: #e0f2fe; color: #075985; }
.chip-partner { background: #ede9fe; color: #5b21b6; }
.bc-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 8px; border-radius: 8px; margin: 4px 0; background: #f8fafc; border: 1px solid var(--border); }
.bc-row .ms-desc { flex: 1; min-width: 140px; }
.bc-row .ms-amt { font-variant-numeric: tabular-nums; font-weight: 600; }
.bc-row.overdue { background: #fef2f2; border-color: #fecaca; }
.bc-row.due { background: #fffbeb; border-color: #fde68a; }
.bc-row .ms-due.warn { color: #b91c1c; font-weight: 600; }
.bc-row.invoiced-row { opacity: .6; }
.bc-ondemand .bc-gen-form input { padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; }

/* ── Invoice Master Tracker table ────────────────────────────── */
.inv-master { width: 100%; border-collapse: collapse; font-size: 13px; }
.inv-master th, .inv-master td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.inv-master th { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: #64748b; background: #f8fafc; }
.inv-master td.num, .inv-master th.num { text-align: right; font-variant-numeric: tabular-nums; }
.inv-master tr.late td { background: #fef2f2; }
.inv-master .late-badge { display: inline-block; min-width: 22px; text-align: center; background: #dc2626; color: #fff; border-radius: 999px; padding: 1px 8px; font-weight: 700; }

/* ── Receipts: per-vendor business/personal tagging ──────────── */
.vendor-tag { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0; padding: 6px 8px; background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; }
.vendor-tag .vtag-status { margin-left: 4px; }

/* ── Vendor classification: drill-down + suggestion ──────────── */
.vr-row2 { flex-direction: row; flex-wrap: wrap; align-items: center; cursor: default; }
.vr-toggle { cursor: pointer; display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.vr-caret { color: var(--muted); font-size: 12px; width: 12px; }
.vr-sugg { font-size: 10px; color: #b45309; background: #fef3c7; border-radius: 999px; padding: 1px 7px; }
.vr-set.pv-on[data-cls="mixed"] { background: #fef3c7 !important; color: #b45309 !important; border-color: #fcd34d !important; font-weight: 700; }
.vr-drill { flex-basis: 100%; margin-top: 8px; border-top: 1px dashed var(--border); padding-top: 8px; }
.vr-receipts { display: flex; flex-direction: column; gap: 4px; }
.vr-rcpt { display: grid; grid-template-columns: 92px 1fr auto auto auto auto; gap: 8px; align-items: center; font-size: 12px; padding: 3px 0; border-bottom: 1px solid #f1f5f9; }
.vr-r-date { color: var(--muted); }
.vr-r-loc { color: #475569; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vr-r-card { color: #334155; white-space: nowrap; }
.vr-r-amt { font-weight: 700; text-align: right; }
@media (max-width: 640px){ .vr-rcpt { grid-template-columns: 1fr auto; } .vr-r-loc,.vr-r-card { display:none; } }
