/* Reimbly — warm, simple, friendly. */

/* Thin line icons (replace the old emoji). They inherit the surrounding text
   colour and size, so they sit naturally in buttons, rows, chips and labels. */
.icon {
  width: 1.15em; height: 1.15em; flex: none; display: inline-block; vertical-align: -0.17em;
  stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.btn .icon, .link-btn .icon { vertical-align: -0.16em; }

:root {
  --bg: #f6f7fb;
  --bg-soft: #eef0f7;
  --card: #ffffff;
  --ink: #17223b; /* deep navy (wordmark) */
  --ink-soft: #5c6580;
  --line: #e6e8f1;
  --brand: #e11d74; /* magenta — primary actions */
  --brand-ink: #c4155f; /* darker magenta — text / hover */
  --brand-soft: #ffe6f1; /* light pink tint */
  --accent: #0e9d8c; /* brand teal (approved) */
  --danger: #dc2626;
  --warn: #d97706;
  /* Brand gradient (teal → yellow → orange → magenta) for the logo + accents. */
  --grad: linear-gradient(120deg, #17c0a6 0%, #f7c948 36%, #fb7a1e 64%, #f5327f 100%);
  --shadow: 0 1px 2px rgba(23, 34, 59, 0.06), 0 8px 24px rgba(23, 34, 59, 0.10);
  --radius: 16px;
  --radius-sm: 10px;
  font-synthesis: none;
}

* { box-sizing: border-box; }

/* The `hidden` attribute must always win over class-based `display` rules
   (e.g. .signin { display:grid }), otherwise views stack on top of each other. */
[hidden] { display: none !important; }

html, body { height: 100%; }
body { overflow-x: hidden; } /* nothing may scroll the page sideways */

body {
  margin: 0;
  background: radial-gradient(1200px 600px at 50% -10%, #fdeaf3 0%, var(--bg) 55%) fixed;
  color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }

/* ---------- Boot splash ---------- */
.boot {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  color: var(--ink-soft);
}
.spinner {
  width: 34px; height: 34px;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Wordmark ---------- */
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; }
.wordmark img.mark { width: 34px; height: 34px; border-radius: 9px; display: block; }
.tagline { display: flex; gap: 8px; margin: 6px 0 0; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.tagline span:nth-child(1) { color: #f5327f; }
.tagline span:nth-child(2) { color: #fb7a1e; }
.tagline span:nth-child(3) { color: #17c0a6; }
.wordmark .name { font-size: 1.5rem; color: var(--ink); letter-spacing: -0.02em; text-transform: lowercase; }
.wordmark.small .name { font-size: 1.15rem; }
.wordmark.small img.mark { width: 27px; height: 27px; border-radius: 7px; }

/* ---------- Sign in ---------- */
.signin {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 24px;
  gap: 28px;
}
.signin-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 40px 34px;
  max-width: 420px;
  width: 100%;
  text-align: center;
}
.signin-card h1 { margin: 22px 0 10px; font-size: 1.9rem; }

/* Login: big mark on top, wordmark under it, then the tagline. */
.brand-stack { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.hero-mark { width: 136px; height: 136px; display: block; }
.hero-name { font-size: 2.4rem; font-weight: 800; color: var(--ink); letter-spacing: -0.03em; text-transform: lowercase; line-height: 1; }
.brand-stack .tagline { justify-content: center; margin: 2px 0 0; }

.lede { color: var(--ink-soft); margin: 22px 0 26px; }
.google-btn { display: flex; justify-content: center; min-height: 44px; }
.hint { color: var(--ink-soft); font-size: 0.85rem; margin: 16px 0 0; min-height: 1.2em; }
.hint.error { color: var(--danger); }
.signin-foot { color: var(--ink-soft); font-size: 0.8rem; }

/* ---------- App shell ---------- */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-wrap: wrap;
}
.tabs {
  display: flex; gap: 4px; margin-left: 8px;
  background: var(--bg-soft); padding: 4px; border-radius: 999px;
  min-width: 0; max-width: 100%;
  overflow-x: auto; overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  border: 0; background: transparent; cursor: pointer;
  font: inherit; font-weight: 600; color: var(--ink-soft);
  padding: 8px 16px; border-radius: 999px;
  flex: 0 0 auto; white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.active { background: var(--card); color: var(--brand-ink); box-shadow: var(--shadow); }

/* "Management" dropdown that groups the admin screens */
.tab-menu { flex: 0 0 auto; }
.tab-menu-list {
  position: fixed; z-index: 50; min-width: 200px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(22, 32, 58, 0.18); padding: 6px;
  display: flex; flex-direction: column;
}
.menu-item {
  border: 0; background: none; cursor: pointer; font: inherit; font-weight: 600; color: var(--ink);
  text-align: left; padding: 10px 12px; border-radius: 8px; white-space: nowrap;
}
.menu-item:hover { background: var(--bg-soft); }
.menu-item.active { color: var(--brand-ink); background: #fff5fa; }
/* Small group labels inside the Management menu. */
.menu-section {
  font-size: 0.66rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-soft); padding: 10px 12px 4px; margin-top: 2px;
}
.menu-section:first-child { margin-top: 0; }
.who { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.who-name { font-weight: 600; }
/* The name is a button that opens the account menu (Face ID, alerts, sign out). */
.who-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: #fff; cursor: pointer;
  font: inherit; color: var(--ink); padding: 6px 12px; border-radius: 999px;
}
.who-btn:hover { background: var(--bg-soft); }
.who-caret { color: var(--ink-soft); font-size: 0.75rem; }
.acct-list { right: 0; }
.acct-list .menu-item { width: 100%; }
.acct-list .menu-item.danger { color: var(--danger); }
.acct-role {
  margin: 2px 4px 6px; padding: 0 8px 8px; border-bottom: 1px solid var(--line);
  font-size: 0.8rem; color: var(--ink-soft); white-space: nowrap;
}
.acct-role strong { color: var(--ink); }
.acct-section { margin: 8px 4px 2px; padding: 6px 8px 2px; border-top: 1px solid var(--line); font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); }
.menu-item.subtle { color: var(--ink-soft); font-weight: 600; }

/* Email-receipts explainer modal */
.ei-points { margin: 4px 0 14px; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; color: var(--ink); font-size: 0.92rem; line-height: 1.45; }
.ei-points li::marker { color: var(--accent); }
.ei-h { margin: 6px 0 6px; font-size: 0.95rem; }
.ei-steps { margin: 0 0 12px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--ink); font-size: 0.92rem; line-height: 1.45; }
.ei-actions { display: flex; align-items: center; gap: 14px; margin-top: 6px; flex-wrap: wrap; }
.ei-state[hidden] { display: none; }
.ei-connected-line { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-ink); font-size: 0.92rem; line-height: 1.4; }
.ei-connected-line .icon { flex: none; color: var(--ok, var(--accent)); }
.pill {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--brand-ink); background: var(--brand-soft);
  padding: 3px 10px; border-radius: 999px;
}
.link-btn { border: 0; background: none; color: var(--brand-ink); font: inherit; font-weight: 600; cursor: pointer; padding: 4px; white-space: nowrap; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--danger); }

.edit-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--brand-soft); color: var(--brand-ink);
  border: 1px solid #fcd9a8; border-radius: var(--radius-sm);
  padding: 10px 14px; margin-bottom: 18px; font-weight: 600; font-size: 0.9rem;
}

/* Fill the whole screen on desktop. On a big monitor the old centered column
   left huge empty margins; the data screens (dashboard, timing, review,
   waiting-to-be-paid) all read better using the full width. Only the side
   padding keeps content off the very edges. */
.content { flex: 1; width: 100%; max-width: none; margin: 0 auto; padding: clamp(20px, 4vw, 36px) clamp(16px, 3vw, 48px) 64px; }

/* The New Expense / Import form is the exception: long text fields are hard to
   read stretched across a wide monitor, so cap just that entry panel. */
.add-panel { max-width: 820px; }

/* ---------- Panels & forms ---------- */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(20px, 4vw, 30px);
}
.panel h2 { margin: 0 0 4px; font-size: 1.35rem; }
.panel-sub { margin: 0 0 22px; color: var(--ink-soft); }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.head-actions { display: flex; gap: 16px; align-items: center; }
.panel-head h2 { margin: 0; }

.form { display: grid; gap: 18px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 6px; font-weight: 600; font-size: 0.9rem; }
.field .opt { font-weight: 500; color: var(--ink-soft); font-style: normal; }
.field input, .field select {
  font: inherit; font-weight: 500;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fffdfa;
  color: var(--ink);
  width: 100%;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
/* A field Reimbly pre-filled from your history — highlighted to glance-confirm. */
.field select.suggested {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, #fffdfa);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
.coding-suggest {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  margin: -2px 0 4px; padding: 9px 12px;
  background: color-mix(in srgb, var(--accent) 8%, var(--card));
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
  border-radius: var(--radius-sm);
  font-size: 0.86rem; color: var(--ink-soft);
}
.coding-suggest .icon { color: var(--accent); flex: none; }
.coding-suggest .cs-text { flex: 1 1 auto; min-width: 0; }
.coding-suggest .cs-ok {
  flex: none; font: inherit; font-size: 0.82rem; font-weight: 700;
  color: #fff; background: var(--accent); border: 0; border-radius: 999px;
  padding: 5px 13px; cursor: pointer;
}
.coding-suggest .cs-ok:hover { background: var(--accent-ink, var(--brand-ink)); }
.amount-field input { font-size: 1.1rem; font-weight: 700; }
.receipt-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.receipt-buttons .btn { flex: 1 1 auto; }
.file-hint { font-weight: 500; color: var(--ink-soft); font-size: 0.82rem; min-height: 1em; }

.btn {
  font: inherit; font-weight: 700; cursor: pointer;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 12px 18px;
}
.btn.primary { background: var(--brand); color: #fff; box-shadow: var(--shadow); }
.btn.primary:hover { background: var(--brand-ink); }
.btn.primary:disabled { opacity: 0.6; cursor: progress; }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { background: var(--bg-soft); }
.btn.small { padding: 8px 14px; font-size: 0.9rem; }
.btn.danger { background: #e11d48; color: #fff; }
.btn.danger:hover { background: #be123c; }

/* Inline "are you sure?" shown in place of a Delete button */
.confirm-inline { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1 1 100%; justify-content: flex-end; margin-top: 6px; }
.confirm-q { font-size: 0.85rem; font-weight: 700; color: #b91c1c; margin-right: auto; }

/* ---------- Lists / cards ---------- */
.list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.expense {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: grid;
  gap: 10px;
  background: #fffdfa;
}
.expense-top { display: flex; align-items: flex-start; gap: 12px; }
.expense-main { flex: 1; min-width: 0; }

/* One-line collapsible cards (My expenses) */
.expense.mini { padding: 0; gap: 0; display: block; }
.mini-row {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; background: none; border: 0; font: inherit;
  text-align: left; cursor: pointer; color: inherit;
}
.mini-date { flex: none; width: 48px; color: var(--ink-soft); font-size: 0.85rem; font-weight: 600; }
.mini-who { flex: 1; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Whose expense this is, when pooled with a partner */
.mini-who-tag {
  flex: none; font-size: 0.68rem; font-weight: 700; vertical-align: middle;
  color: #5b4b6b; background: #f0ecf5; border: 1px solid #e3dcec;
  padding: 1px 7px; border-radius: 999px; white-space: nowrap;
}
/* When it sits in the report-name (not a flex row), keep a little gap */
.rc-name .mini-who-tag { margin-left: 7px; }
.mini-amt { flex: none; font-weight: 800; white-space: nowrap; }
/* Foreign expense: bank USD on top, the original amount + rate beneath */
.mini-amt.has-fx { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; max-width: 40%; }
.mini-amt.has-fx .ma-usd { font-weight: 800; }
.mini-amt.has-fx .ma-fx { font-size: 0.72rem; font-weight: 600; color: var(--ink-soft); }
.dot { display: inline-block; flex: none; width: 9px; height: 9px; border-radius: 50%; background: #d6cbb8; }
.dot.submitted { background: #f59e0b; }
.dot.approved { background: #16a34a; }
.dot.rejected { background: #dc2626; }
.dot.waitingtobepaid { background: #7c3aed; }
.dot.reimbursed { background: #2563eb; }
.dot.draft { background: #9ca3af; }
/* Source dots — the color tells you where an expense came from */
.dot.src-ynab { background: #16a34a; }
.dot.src-email { background: #2563eb; }
.dot.src-photo { background: #0891b2; }
.dot.src-manual { background: #8b5cf6; }
.dot.src-csv { background: #d97706; }
.mini-caret { flex: none; color: var(--ink-soft); font-size: 0.7rem; transition: transform 0.15s; }
.expense.mini.open .mini-caret { transform: rotate(180deg); }

/* Over $50 — the ones that need a receipt. Highlighted so they stand out;
   the amount is emphasized, and any still missing a receipt is flagged amber. */
.expense.mini.over50 { border-color: #f5d9a8; background: #fffaf0; }
.expense.mini.over50 .mini-amt { color: #92600e; }
.expense.mini.needs-receipt { border-color: #f0b46a; background: #fff6ea; }
.mini-need {
  flex: none; font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em;
  color: #9a3412; background: #ffe4c4; border: 1px solid #f6cfa0;
  padding: 2px 7px; border-radius: 999px; white-space: nowrap;
}

/* The over-$50 receipt scoreboard at the top of the list */
.over50-summary {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: #fff6ea; border: 1px solid #f5d9a8; border-radius: var(--radius-sm);
  padding: 10px 14px; margin-bottom: 12px; font-size: 0.92rem; color: var(--ink);
}
.over50-summary.all-done { background: #eefaf0; border-color: #bfe6c8; }
.over50-summary .rs-icon { font-size: 1.05rem; }
.over50-summary .rs-have { color: #15803d; }
.over50-summary .rs-need { color: #b45309; }
.mini-details { padding: 4px 16px 14px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.mini-desc { font-weight: 700; margin-top: 10px; }
.expense.mini .trail-box { padding: 12px 16px; margin-top: 0; }
.expense-desc { font-weight: 700; }
.expense-meta { color: var(--ink-soft); font-size: 0.85rem; margin-top: 2px; }
.expense-amt { text-align: right; font-weight: 800; white-space: nowrap; }
.expense-amt small { display: block; font-weight: 600; color: var(--ink-soft); font-size: 0.72rem; }

.badge {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
/* Status badges read as a journey: from the pink of a fresh (Unsubmitted)
   expense, warming through approval, and cooling to green once it's Paid.
   Denied sits off that happy path in red; Empty is a neutral "not started". */
.badge.empty { background: #eef1f5; color: #6b7280; }        /* not started */
.badge.draft { background: #ffe1ec; color: #b4145a; }        /* Unsubmitted — pink, like "New report" */
.badge.submitted { background: #ffe6c9; color: #9a5300; }    /* Pending approval — orange */
.badge.approved { background: #e6f4c3; color: #4d7000; }     /* Pending payment — lime, nearing green */
.badge.waitingtobepaid { background: #ede9fe; color: #6b21a8; } /* Waiting to be paid — violet */
.badge.reimbursed { background: #c9edd4; color: #15803d; }   /* Paid — green */
.badge.rejected { background: #fee2e2; color: #b91c1c; }     /* Denied — off the happy path */

/* How an expense got in (provenance) */
.src-badge {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
  background: #f1eee8; color: #5b5347; border: 1px solid #e5e0d6;
}
.src-badge.src-email { background: #eef4ff; color: #1e4fa3; border-color: #d6e4ff; }
.src-badge.src-ynab { background: #ecfdf5; color: #05704f; border-color: #c9f0df; }
.src-badge.src-csv { background: #fef6e7; color: #92600e; border-color: #f6e6c4; }
.src-badge.src-manual { background: #f3f1f5; color: #5b4b6b; border-color: #e6e1ec; }
.src-badge.src-photo { background: #e6f7fb; color: #076983; border-color: #c7ebf4; }
.mini-src { flex: none; font-size: 0.9rem; line-height: 1; opacity: 0.85; }

/* The "What does the dot mean?" legend above the expense list */
.key { margin: 4px 0 10px; font-size: 0.82rem; }
.key > summary {
  cursor: pointer; color: #6b6357; font-weight: 600;
  padding: 4px 0; list-style: none; user-select: none;
}
.key > summary::-webkit-details-marker { display: none; }
.key > summary::before { content: '▸ '; color: #b0a892; }
.key[open] > summary::before { content: '▾ '; }
.key-body { padding: 6px 2px 2px; }
.key-note { margin: 4px 0; color: #6b6357; }
.key-group { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 6px 0; }
.key-item { display: inline-flex; align-items: center; gap: 7px; color: #4a4438; }
.key-item .dot { width: 10px; height: 10px; }

.expense-note {
  font-size: 0.85rem; color: var(--warn);
  background: #fffbeb; border: 1px solid #fef3c7; border-radius: 8px; padding: 8px 10px;
}
.expense-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.receipt-link { font-size: 0.85rem; color: var(--brand-ink); font-weight: 600; text-decoration: none; }
.receipt-link:hover { text-decoration: underline; }

.paid-on { font-size: 0.8rem; color: var(--ink-soft); font-weight: 600; }

/* ---------- Activity trail ---------- */
.trail-box { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.state.small { font-size: 0.85rem; padding: 6px 0; }
.trail { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.trail-item { display: flex; gap: 10px; align-items: flex-start; }
.trail-icon { flex: none; width: 22px; text-align: center; }
.trail-body { flex: 1; }
.trail-line { font-size: 0.9rem; }
.trail-when { font-size: 0.78rem; color: var(--ink-soft); margin-top: 1px; }
.trail-note { font-size: 0.85rem; color: var(--ink-soft); font-style: italic; margin-top: 3px; }
.trail-empty { font-size: 0.85rem; color: var(--ink-soft); }

/* ---------- Import ---------- */
.import-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 6px 0 14px; }
.import-summary-line { font-weight: 700; margin-bottom: 4px; }
.import-note { font-size: 0.82rem; color: var(--ink-soft); margin-bottom: 8px; }

/* "New expense" + "Import" buttons, side by side, on the Add-expense tab */
.add-actions { display: flex; gap: 10px; }
.add-action {
  flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; cursor: pointer; font: inherit; font-weight: 800; font-size: 0.95rem; color: var(--ink);
  text-align: center;
}
.add-action span:not(.add-plus):not(.add-ico) { white-space: normal; }
.add-action:hover { background: var(--bg-soft); }
.add-action.active { border-color: var(--brand); background: #fff5fa; color: var(--brand-ink); }
.add-action.ghost { font-weight: 700; color: var(--ink-soft); }
.add-ico { font-size: 1.1rem; }
.add-plus {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff;
  font-weight: 700; font-size: 1rem; flex-shrink: 0;
}
.add-action.active .add-plus { transform: rotate(45deg); transition: transform 0.15s; }
.add-toggle-title { letter-spacing: -0.01em; }
#add-form-body, #import-body { margin-top: 14px; }

/* Possible duplicates review */
.dupes-panel h2 { color: #92400e; }
.dup-group { border: 1px solid #fde68a; background: #fffbeb; border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 12px; }
.dup-reason { font-size: 0.85rem; font-weight: 700; color: #92400e; margin-bottom: 10px; }
.dup-item { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid #fde68a; }
.dup-actions { margin-top: 10px; padding-top: 10px; border-top: 1px solid #fde68a; }
.dup-item:first-of-type { border-top: 0; }
.dup-item-main { min-width: 0; flex: 1; }
.dup-item-top { display: flex; justify-content: space-between; gap: 10px; }
.dup-item-amt { font-weight: 700; white-space: nowrap; }
.dup-item-meta { font-size: 0.82rem; color: var(--ink-soft); margin: 2px 0 6px; }
.dup-item-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dup-item .btn { flex-shrink: 0; }

/* Report cards (My reports) */
.report-card { border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; margin-bottom: 12px; overflow: hidden; border-left: 4px solid var(--line); }
/* Report health at a glance: green = all good, yellow = something unfinished,
   red = something sent back to fix. */
.report-card.rc-h-green { border-left-color: var(--accent); }
.report-card.rc-h-yellow { border-left-color: var(--warn); }
.report-card.rc-h-red { border-left-color: var(--danger); }
.rc-health-pill { display: inline-block; margin-left: 8px; font-size: 0.72rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; vertical-align: middle; }
.rc-health-pill.green { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--card)); }
.rc-health-pill.yellow { color: var(--warn); background: color-mix(in srgb, var(--warn) 16%, var(--card)); }
/* An unfinished expense row inside a report. */
.expense.mini.incomplete { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); background: color-mix(in srgb, var(--warn) 6%, var(--card)); }
.rc-top { display: flex; align-items: center; }
.rc-head { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; text-align: left; background: none; border: 0; cursor: pointer; padding: 14px 16px; font: inherit; }
.rc-head:hover { background: var(--bg-soft); }
.rc-select { flex: none; display: flex; align-items: center; justify-content: center; width: 40px; align-self: stretch; cursor: pointer; }
.rc-select input { width: 17px; height: 17px; cursor: pointer; }
.rc-select-spacer { width: 40px; }
.rc-export-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 11px 14px; margin-bottom: 12px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.rc-export-hint { flex: 1 1 auto; color: var(--ink-soft); font-size: 0.86rem; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.rc-main { flex: 1; min-width: 0; }
.rc-name { font-weight: 700; font-size: 1.02rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-sub { font-size: 0.85rem; color: var(--ink-soft); margin-top: 2px; }
.report-card .mini-caret { transition: transform 0.15s; color: var(--ink-soft); }
.report-card.open .mini-caret { transform: rotate(180deg); }
.rc-body { padding: 4px 16px 14px; border-top: 1px solid var(--line); }
.rc-item { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.rc-item:last-of-type { border-bottom: 0; }
.rc-item .mini-date { color: var(--ink-soft); white-space: nowrap; min-width: 52px; }
.rc-item .mini-who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-item .mini-amt { font-weight: 700; white-space: nowrap; }
.rc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 12px; }

/* ---- Report lifecycle: the process a report moves through in My reports ---- */
/* Section groupings: Being worked on → On its way → Paid. */
.rp-section { margin: 0 0 22px; }
.rp-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 6px 2px 10px; }
.rp-title { font-weight: 800; font-size: 1.05rem; color: var(--ink); }
.rp-sub { font-size: 0.82rem; color: var(--ink-soft); }
.rp-count { display: inline-block; margin-left: 4px; font-size: 0.78rem; font-weight: 800; color: var(--ink-soft); background: var(--bg-soft); border-radius: 999px; padding: 1px 8px; vertical-align: middle; }
/* The Paid pile collapses so months of history stay tidy. */
.rp-paid { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-soft); padding: 10px 12px; }
.rp-paid > summary { cursor: pointer; list-style: none; margin-bottom: 0; }
.rp-paid[open] > summary { margin-bottom: 12px; }
.rp-paid > summary::-webkit-details-marker { display: none; }
.rp-paid[open] { background: #fff; }
.rp-month { margin-bottom: 14px; }
.rp-month-head { font-weight: 700; font-size: 0.9rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.03em; margin: 0 2px 8px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }

/* The stepper under a submitted report's header: Submitted → Approved →
   Reimbursing → Paid, with the current stage lit up. */
.rc-steps { display: flex; align-items: center; gap: 0; padding: 2px 16px 12px; }
.rc-step { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 0 0 auto; }
.rc-step-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--line); box-shadow: 0 0 0 3px var(--card); }
.rc-step-lbl { font-size: 0.72rem; color: var(--ink-soft); white-space: nowrap; }
.rc-step.done .rc-step-dot { background: var(--accent); }
.rc-step.now .rc-step-dot { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, var(--card)); }
.rc-step.now .rc-step-lbl { color: var(--accent); font-weight: 800; }
.rc-step-bar { flex: 1 1 auto; height: 2px; background: var(--line); margin: 0 4px 18px; min-width: 12px; }
.rc-paid-on { padding: 0 16px 12px; font-size: 0.82rem; color: var(--ink-soft); }

.mini-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }

/* Clickable Date / Description / Cost sort headers above an expense list.
   Floats just under the (sticky) top bar so it stays reachable while scrolling. */
.sort-head {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  position: sticky; top: var(--topbar-h, 62px); z-index: 6;
  background: var(--card); padding: 8px 0; margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.sort-hint { font-size: 0.8rem; color: var(--ink-soft); font-weight: 600; margin-right: 2px; }
.sort-col {
  font: inherit; font-size: 0.85rem; font-weight: 700; cursor: pointer; color: var(--ink-soft);
  background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px;
}
.sort-col:hover { background: var(--bg-soft); color: var(--ink); }
.sort-col.active { color: var(--brand-ink); border-color: var(--brand); background: #fff5fa; }

/* Inline editor shown when you open an expense */
.inline-edit { display: flex; flex-direction: column; gap: 10px; }
/* Read-only foreign-currency breakdown inside the editor */
.ie-fx {
  background: #eef4ff; border: 1px solid #d6e4ff; border-radius: var(--radius-sm);
  padding: 8px 12px; display: flex; flex-direction: column; gap: 2px;
}
.ie-fx-title { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: #1e4fa3; }
.ie-fx-body { font-size: 0.88rem; color: var(--ink); }

/* Missing-receipt affidavit — read-out in the editor + the sign window */
.ie-affidavit { border-radius: var(--radius-sm); padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.ie-affidavit.aff-pending { background: #fff6ea; border: 1px solid #f5d9a8; }
.ie-affidavit.aff-ok { background: #eefaf0; border: 1px solid #bfe6c8; }
.ie-affidavit.aff-bad { background: #fdecec; border: 1px solid #f3c2c2; }
.aff-title { font-size: 0.74rem; font-weight: 800; }
.aff-pending .aff-title { color: #9a5300; }
.aff-ok .aff-title { color: #15803d; }
.aff-bad .aff-title { color: #b91c1c; }
.aff-body { font-size: 0.86rem; color: var(--ink); }
.aff-summary { background: var(--bg-soft); border-radius: var(--radius-sm); padding: 10px 12px; margin: 4px 0 12px; display: flex; flex-direction: column; gap: 4px; }
.aff-sum-row { display: flex; justify-content: space-between; gap: 12px; font-size: 0.9rem; }
.aff-sum-row span { color: var(--ink-soft); }
.aff-statement { font-size: 0.85rem; color: var(--ink-soft); margin: 10px 0; }
#affidavit-modal .check-row { display: flex; gap: 9px; align-items: flex-start; font-size: 0.9rem; margin: 4px 0 4px; }
#affidavit-modal textarea { font: inherit; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fffdfa; width: 100%; resize: vertical; }
.ie-row { display: flex; gap: 10px; }
.ie-f { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.ie-f > span { font-size: 0.78rem; font-weight: 600; color: var(--ink-soft); }
.ie-cur { flex: 0 0 96px; }
.ie-f input, .ie-f select { font: inherit; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fffdfa; width: 100%; }
.ie-hint { font-size: 0.78rem; color: var(--ink-soft); }
/* Stack the receipt options vertically so "No receipt yet" sits above the
   three buttons (Take a picture / Add a receipt / Declare) — cleaner on a phone. */
.ie-receipt { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.ie-receipt .btn { width: 100%; }
.ie-noreceipt { font-size: 0.88rem; color: var(--ink-soft); }
.ie-receipt-name { font-size: 0.82rem; }
.mini-clip { font-size: 0.85rem; }

/* On a wider screen the stacked, full-width fields and buttons read as big white
   bars across the report. Give the fields a sensible width and lay the whole
   editor out in two columns; let the receipt buttons sit side by side. Phones
   keep the simple stacked layout above. */
@media (min-width: 720px) {
  .inline-edit {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; align-items: start;
  }
  /* Full-width rows span both columns; the rest pair up two-across. */
  .inline-edit > .mini-badges,
  .inline-edit > .ie-fx,
  .inline-edit > .ie-row,
  .inline-edit > .report-row,
  .inline-edit > .ie-f-wide,
  .inline-edit > .expense-actions,
  .inline-edit > .ie-affidavit,
  .inline-edit > .ie-hint,
  .inline-edit > .expense-note { grid-column: 1 / -1; }
  .ie-f input, .ie-f select { max-width: 460px; }
  .ie-receipt { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .ie-receipt .btn { width: auto; }
}

/* Per-expense report picker on the Add-expense list */
.report-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-size: 0.88rem; color: var(--ink-soft); }
.report-row > span { font-weight: 600; }
.report-pick { font: inherit; font-size: 0.88rem; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; max-width: 240px; }
.ir-file { margin-top: 8px; }

/* "You have N unsubmitted expenses — Submit for approval" bar on My expenses. */
.submit-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap; margin-bottom: 14px; padding: 14px 16px;
  border: 1px solid #fbcfe8; border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #fff5fa, #fffdfd);
}
.submit-bar-text { display: flex; flex-direction: column; gap: 2px; font-size: 0.9rem; color: var(--ink-soft); }
.submit-bar-text strong { color: var(--ink); font-size: 0.98rem; }
.submit-bar .btn { flex-shrink: 0; }
.import-preview { display: flex; flex-direction: column; gap: 10px; }
.inbox-clear { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.import-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fffdfa; }
.import-row.dup { background: #fff7ed; border-color: #fed7aa; }
.import-row.bad { opacity: 0.7; }
.import-row .ir-check { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: var(--brand-ink); }
.ir-main { flex: 1; min-width: 0; }
.ir-top { display: flex; justify-content: space-between; gap: 10px; }
.ir-amt { font-weight: 800; white-space: nowrap; }
.ir-meta { font-size: 0.85rem; color: var(--ink-soft); margin-top: 2px; }
.ir-flags { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.ir-acct { flex: none; max-width: 190px; font: inherit; font-size: 0.85rem; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.import-actions { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.inbox-thumb { flex: none; width: 40px; height: 40px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); background: #fff; }
.inbox-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
#inbox-list { display: grid; gap: 8px; }
@media (max-width: 560px) {
  .import-row { flex-wrap: wrap; }
  .ir-acct { max-width: none; width: 100%; }
}
.recon-summary { border-radius: var(--radius-sm); padding: 12px 14px; font-weight: 700; margin-bottom: 4px; }
.recon-summary.good { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.recon-summary.warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.recon-line { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.recon-line:last-child { border-bottom: 0; }
.recon-title { font-weight: 700; }
.recon-amt { font-weight: 800; white-space: nowrap; }

.import-help { margin: 4px 0 16px; font-size: 0.88rem; color: var(--ink-soft); }
.import-help summary { cursor: pointer; font-weight: 700; color: var(--brand-ink); }
.import-help ul { margin: 8px 0; padding-left: 20px; }
.import-help li { margin: 3px 0; }
.import-help code { background: var(--bg-soft); padding: 1px 5px; border-radius: 5px; font-size: 0.85em; }

/* ---------- Expense type toggle + photo hero + mileage ---------- */
.type-toggle { display: flex; gap: 6px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; padding: 4px; margin: 6px 0 18px; }
.type-btn { flex: 1; font: inherit; font-weight: 700; font-size: 0.95rem; padding: 10px 12px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-soft); cursor: pointer; transition: background .15s, color .15s; }
.type-btn.active { background: var(--card); color: var(--brand-ink); box-shadow: 0 1px 3px rgba(44,35,24,.12); }

/* "Write it for me" + remembered descriptions */
.field-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.describe-options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.describe-cap { flex-basis: 100%; font-size: 0.78rem; color: var(--ink-soft); font-weight: 600; }
.describe-chip {
  font: inherit; font-size: 0.86rem; font-weight: 600; cursor: pointer; text-align: left;
  background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 7px 13px; color: var(--ink);
}
.describe-chip:hover { background: var(--bg-soft); border-color: var(--brand); }
.describe-chip.remembered { background: #fff5fa; border-color: #fbcfe8; color: var(--brand-ink); }

.receipt-hero { display: flex; flex-direction: column; align-items: stretch; gap: 10px; margin-bottom: 18px; }
.btn.big { font-size: 1.1rem; padding: 18px 20px; border-radius: 16px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.hero-hint { text-align: center; font-size: 0.82rem; color: var(--ink-soft); margin: 2px 0 0; }

.mileage-calc { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 0.95rem; color: var(--ink-soft); margin-top: 4px; }
.mileage-calc strong { color: var(--brand-ink); font-size: 1.1rem; }

/* ---------- Mileage rate management ---------- */
.rate-form { margin-bottom: 8px; }
.check-row { display: flex; align-items: center; gap: 10px; font-size: 0.92rem; cursor: pointer; }
.check-row input { width: 18px; height: 18px; accent-color: var(--brand-ink); }
.rate-form-actions { display: flex; align-items: center; gap: 14px; margin-top: 6px; }
.rate-row.off { opacity: 0.6; }

/* Receipt rules: the "$ [amount]" input on the Receipt rules screen. */
.rule-amount { display: flex; align-items: center; gap: 8px; max-width: 200px; }
.rule-dollar { font-size: 1.4rem; font-weight: 800; color: var(--ink-soft); }
.rule-amount input { font-size: 1.2rem; font-weight: 700; }
.rule-note { color: var(--accent); font-weight: 700; font-size: 0.9rem; }

/* Add / edit a single person on the People & access screen. */
.person-row .expense-top { align-items: center; }
.person-row .expense-top .btn { flex: none; }
.person-form { display: flex; flex-direction: column; gap: 12px; width: 100%; }
#person-add .person-form { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-soft); padding: 14px; margin-bottom: 14px; }
.pf-row { display: flex; flex-wrap: wrap; gap: 12px; }
.pf-field { flex: 1 1 220px; display: flex; flex-direction: column; gap: 5px; font-size: 0.85rem; font-weight: 700; color: var(--ink-soft); }
.pf-field .opt { font-weight: 400; font-style: normal; color: var(--ink-soft); opacity: 0.8; }
.pf-field input, .pf-field select { font: inherit; font-weight: 500; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; color: var(--ink); }
.pf-field input:disabled { background: var(--bg-soft); color: var(--ink-soft); }
.pf-actions { display: flex; align-items: center; gap: 14px; }

/* Gentle "what's outstanding" nudge at the top of My reports. */
.nudge { display: flex; align-items: center; gap: 10px; padding: 11px 14px; margin-bottom: 14px; background: color-mix(in srgb, var(--accent) 9%, var(--card)); border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line)); border-radius: var(--radius-sm); }
.nudge-ico { font-size: 1.1rem; flex: none; }
.nudge-text { flex: 1 1 auto; font-size: 0.92rem; color: var(--ink); }
.nudge-x { flex: none; background: none; border: 0; color: var(--ink-soft); font-size: 0.9rem; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.nudge-x:hover { background: var(--bg-soft); color: var(--ink); }
.nudge-urgent { color: var(--warn); }
.nudge.nudge-hot { background: color-mix(in srgb, var(--danger) 8%, var(--card)); border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); }
.nudge.nudge-hot .nudge-urgent { color: var(--danger); }

/* "Repeats monthly" toggle in the inline expense editor. */
.ie-recurring { display: flex; align-items: center; gap: 9px; margin: 4px 0 2px; font-size: 0.9rem; font-weight: 700; color: var(--ink); cursor: pointer; }
.ie-recurring input { width: 17px; height: 17px; flex: none; }
.ie-recurring .opt { font-weight: 400; font-style: normal; color: var(--ink-soft); }

.sendback-row { display: none; gap: 8px; width: 100%; }
.sendback-row.open { display: flex; }
.sendback-row input { flex: 1; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }

/* ---------- Audit ---------- */
.audit-summary { font-weight: 700; border-radius: var(--radius-sm); padding: 0; }
.audit-summary.good { background: #ecfdf5; color: #0f766e; border: 1px solid #a7f3d0; padding: 14px 16px; margin-bottom: 8px; }
.audit-summary.warn { background: #fffbeb; color: #a16207; border: 1px solid #fde68a; padding: 14px 16px; margin-bottom: 16px; }
.issues { display: flex; flex-wrap: wrap; gap: 6px; }
.issue {
  font-size: 0.75rem; font-weight: 600; color: #b91c1c;
  background: #fee2e2; border: 1px solid #fecaca;
  padding: 3px 9px; border-radius: 999px;
}

/* ---------- Approval reports (batch by person) ---------- */
.report { border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fffdfa; margin-bottom: 14px; overflow: hidden; }
.report-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px; background: var(--bg-soft); border-bottom: 1px solid var(--line);
}
.report-name { font-weight: 800; }
.report-sub { color: var(--ink-soft); font-size: 0.85rem; margin-top: 1px; }
.report-items { padding: 12px; display: grid; gap: 10px; }
.report-items .expense { background: #fff; }

/* ---------- Dashboard ---------- */
.dash-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tile { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; }
.tile-val { font-size: 1.45rem; font-weight: 800; color: var(--brand-ink); letter-spacing: -0.02em; line-height: 1.1; }
.tile-label { font-size: 0.8rem; color: var(--ink-soft); font-weight: 600; margin-top: 3px; }
.dash-h { font-size: 1rem; margin: 26px 0 12px; }
.bar-row { margin-bottom: 13px; }
.bar-top { display: flex; justify-content: space-between; gap: 10px; font-size: 0.9rem; margin-bottom: 5px; }
.bar-label { font-weight: 600; }
.bar-val { color: var(--ink-soft); font-weight: 700; white-space: nowrap; }
.bar-track { height: 9px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--grad); border-radius: 999px; }
.dash-status { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Spending breakdown (donut dashboard) ---------- */
.dash-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 18px; }
.period-nav { display: flex; align-items: center; gap: 6px; }
.pill-btn {
  font: inherit; font-weight: 700; cursor: pointer; color: var(--brand-ink);
  background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; line-height: 1;
}
.pill-btn:hover { background: var(--bg-soft); }
.period-label { min-width: 150px; }
.dash-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.dash-select {
  font: inherit; font-weight: 600; color: var(--ink); cursor: pointer;
  background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px;
}
.dash-range { display: flex; gap: 14px; flex-basis: 100%; font-size: 0.85rem; color: var(--ink-soft); }
.dash-range input { font: inherit; margin-left: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; }

/* Chart and ranking sit side-by-side on a laptop, stack on smaller screens. */
.dash-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .dash-grid { grid-template-columns: 1fr; } }
.dash-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.donut-cap { font-size: 0.78rem; color: var(--ink-soft); font-weight: 600; }
.donut-total { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); line-height: 1.1; }
.donut-head { margin-bottom: 6px; }
.donut-card { display: flex; flex-direction: column; }
.donut-wrap { position: relative; width: 100%; max-width: 520px; margin: 8px auto 2px; aspect-ratio: 480 / 300; }
.donut { width: 100%; height: 100%; }
.dl-name { font-size: 10.5px; font-weight: 700; fill: var(--ink); }
.dl-sub { font-size: 9.5px; font-weight: 600; fill: var(--ink-soft); }
.donut-label { cursor: pointer; }
.donut-slice { cursor: pointer; transition: opacity 0.15s; }
.donut-slice:hover { opacity: 0.85 !important; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; }
.donut-center-total { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.donut-empty { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--ink-soft); font-size: 0.9rem; text-align: center; }

.rank-head { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--ink-soft); font-weight: 700; padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.rank-list { display: flex; flex-direction: column; }
.rank-row {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name amt" "bar pct";
  gap: 2px 10px; align-items: center; width: 100%; text-align: left; cursor: pointer;
  background: none; border: 0; border-bottom: 1px solid var(--line); padding: 11px 4px; font: inherit;
}
.rank-row:hover { background: var(--bg-soft); }
.rank-row.on { background: #fff5fa; }
.rank-name { grid-area: name; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-amt { grid-area: amt; font-weight: 700; color: var(--ink); white-space: nowrap; }
.rank-bar { grid-area: bar; height: 7px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; align-self: center; }
.rank-fill { display: block; height: 100%; border-radius: 999px; }
.rank-pct { grid-area: pct; font-size: 0.8rem; color: var(--ink-soft); font-weight: 600; text-align: right; }

.detail-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.detail-head h3 { margin: 0; font-size: 1.1rem; }

/* Drill-in pop-up */
.modal-overlay {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  background: rgba(22, 32, 58, 0.5); padding: 18px;
  /* No backdrop-filter — it makes the modal feel laggy on phones. */
}
.modal-card {
  background: #fff; border-radius: var(--radius); width: 100%; max-width: 560px;
  max-height: 85vh; overflow-y: auto; padding: 20px 22px; box-shadow: 0 24px 60px rgba(22, 32, 58, 0.3);
}
body.modal-open { overflow: hidden; }

@media (max-width: 640px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-filters { margin-left: 0; width: 100%; }
  .dash-select { flex: 1; }
}

/* ---------- Empty / loading states ---------- */
.state { text-align: center; color: var(--ink-soft); padding: 32px 12px; }
.state .emoji { font-size: 2rem; display: block; margin-bottom: 8px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(8px);
  background: var(--ink); color: #fff;
  padding: 12px 18px; border-radius: 999px; font-weight: 600;
  box-shadow: var(--shadow); z-index: 50;
  opacity: 0; transition: opacity 0.2s, transform 0.2s;
  max-width: min(92vw, 460px); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.good { background: #0f766e; }
.toast.bad { background: var(--danger); }

@media (max-width: 560px) {
  .row { grid-template-columns: 1fr; }
  .topbar { gap: 10px; }
  .tabs { order: 3; width: 100%; margin-left: 0; justify-content: flex-start; }
  .who { order: 2; }
}

/* ---------- Timing / turnaround ---------- */
.panel-sub { color: var(--ink-soft); margin: -4px 0 18px; font-size: 0.95rem; }
.timing-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-bottom: 16px; }
.metric-card {
  position: relative; overflow: hidden; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow);
}
.metric-rail { position: absolute; left: 0; top: 0; bottom: 0; width: 5px; }
.metric-card.approve .metric-rail { background: var(--brand); }
.metric-card.pay .metric-rail { background: var(--accent); }
.metric-cap { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-soft); }
.metric-stage { font-size: 0.84rem; color: var(--ink-soft); margin-top: 1px; }
.metric-big { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.03em; margin: 8px 0 4px; }
.metric-big span { font-size: 1.05rem; font-weight: 800; color: var(--ink-soft); }
.metric-big.muted { font-size: 1.4rem; color: var(--ink-soft); }
.metric-card.approve .metric-big { color: var(--brand-ink); }
.metric-card.pay .metric-big { color: #0a7a6d; }
.metric-delta { font-size: 0.83rem; font-weight: 700; }
.metric-delta.good { color: #0a7a6d; }
.metric-delta.bad { color: var(--warn); }
.metric-delta.muted { color: var(--ink-soft); font-weight: 600; }
.metric-foot { font-size: 0.78rem; color: var(--ink-soft); margin-top: 8px; }

.timing-strip {
  display: flex; gap: 22px; flex-wrap: wrap; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px; box-shadow: var(--shadow); margin-bottom: 18px;
}
.timing-strip .ts { display: flex; flex-direction: column; }
.timing-strip .ts-k { font-size: 0.71rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-soft); }
.timing-strip .ts-v { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; }
.timing-strip .ts-v.warn { color: var(--warn); }
.timing-strip .ts-div { width: 1px; align-self: stretch; background: var(--line); }

.timing-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.timing-chart { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 18px; box-shadow: var(--shadow); }
.tc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.tc-head h3 { font-size: 1rem; margin: 0; }
.tc-sub { font-size: 0.8rem; color: var(--ink-soft); }
.timing-bars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; align-items: end; height: 140px; }
.timing-bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.timing-bar .tb-col {
  width: 62%; max-width: 38px; border-radius: 7px 7px 3px 3px;
  background: color-mix(in srgb, var(--brand) 30%, var(--card));
  border: 1px solid color-mix(in srgb, var(--brand) 42%, var(--line));
}
.timing-bar.now .tb-col { background: var(--brand); border-color: var(--brand); }
.timing-bars.pay .timing-bar .tb-col { background: color-mix(in srgb, var(--accent) 28%, var(--card)); border-color: color-mix(in srgb, var(--accent) 42%, var(--line)); }
.timing-bars.pay .timing-bar.now .tb-col { background: var(--accent); border-color: var(--accent); }
.timing-bar .tb-val { font-size: 0.78rem; font-weight: 800; }
.timing-bar .tb-lab { font-size: 0.73rem; color: var(--ink-soft); font-weight: 700; }
.timing-note {
  margin-top: 16px; padding: 13px 16px; border-radius: var(--radius);
  border: 1px dashed var(--line); background: var(--bg-soft); color: var(--ink-soft); font-size: 0.86rem;
}
.timing-note strong { color: var(--ink); }

/* ---------- "Waiting to be paid" queue (Paid screen) ---------- */
.pay-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 11px 14px; margin-bottom: 12px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.pay-selall { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 0.9rem; cursor: pointer; }
.pay-selall input { width: 17px; height: 17px; }
.pay-count { color: var(--ink-soft); font-size: 0.86rem; font-weight: 700; }
.pay-toolbar .grow { flex: 1 1 auto; }
.pay-fee { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; font-weight: 700; color: var(--ink-soft); }
.pay-fee input { width: 76px; padding: 5px 8px; font-size: 0.86rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); color: var(--ink); }
.pay-check { display: inline-flex; align-items: center; flex: none; }
.pay-check input { width: 18px; height: 18px; cursor: pointer; }

/* A retained download/batch on the waiting-to-be-paid screen: when it was
   downloaded + one button to mark the whole thing paid. */
.pay-intro { color: var(--ink-soft); font-size: 0.9rem; margin: 0 2px 14px; line-height: 1.5; }
.pay-batch { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden; }
.pay-batch-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 13px 16px; background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.pay-batch-who { flex: 1 1 auto; min-width: 0; }
.pay-batch-title { font-weight: 800; font-size: 1rem; color: var(--ink); }
.pay-batch-sub { font-size: 0.85rem; color: var(--ink-soft); margin-top: 2px; }
.pay-batch-head .btn { flex: none; }
.pay-batch-actions { display: flex; gap: 8px; flex: none; flex-wrap: wrap; }
.export-blocked { margin: -4px 0 14px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--danger) 34%, var(--line)); border-left: 3px solid var(--danger); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--danger) 7%, var(--card)); }
.export-blocked .eb-head { margin: 0 0 8px; font-weight: 700; font-size: 0.9rem; color: var(--ink); display: flex; align-items: center; gap: 7px; }
.export-blocked .eb-head .icon { color: var(--danger); flex: none; }
.export-blocked .eb-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; font-size: 0.86rem; color: var(--ink-soft); line-height: 1.4; }
.export-blocked .eb-list em { font-style: normal; font-weight: 700; color: var(--danger); }
.pay-batch-body { padding: 6px 12px 12px; }
.pay-batch-body .report { box-shadow: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; margin: 0; }
.pay-batch-body .report:last-child { border-bottom: 0; }

/* Paid history, management view: one collapsible row per report — its name and
   whose it is — with the expenses tucked inside until you open it. */
.paid-report { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); margin-bottom: 10px; overflow: hidden; }
.paid-report-head { display: flex; align-items: center; gap: 12px; cursor: pointer; padding: 13px 16px; list-style: none; }
.paid-report-head::-webkit-details-marker { display: none; }
.paid-report-head:hover { background: var(--bg-soft); }
.paid-report-who { flex: 1 1 auto; min-width: 0; }
.paid-report-name { font-weight: 700; font-size: 1rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paid-report-person { font-size: 0.85rem; color: var(--ink-soft); margin-top: 2px; }
.paid-report-meta { text-align: right; flex: none; }
.paid-report-total { display: block; font-weight: 800; color: var(--ink); }
.paid-report-sub { display: block; font-size: 0.78rem; color: var(--ink-soft); margin-top: 1px; white-space: nowrap; }
.paid-report .mini-caret { transition: transform 0.15s; color: var(--ink-soft); flex: none; }
.paid-report[open] .mini-caret { transform: rotate(180deg); }
.paid-report-body { padding: 4px 16px 12px; border-top: 1px solid var(--line); }
/* keep the person's name next to its checkbox, button pinned right */
.report-head .report-who { margin-right: auto; }

/* Timing — volume (reports came in) variant, a neutral slate accent */
.metric-card.vol .metric-rail { background: var(--ink-soft); }
.metric-card.vol .metric-big { color: var(--ink); }
.metric-delta.vol { color: var(--ink-soft); }
.timing-bars.vol .timing-bar .tb-col {
  background: color-mix(in srgb, var(--ink) 18%, var(--card));
  border-color: color-mix(in srgb, var(--ink) 30%, var(--line));
}
.timing-bars.vol .timing-bar.now .tb-col { background: var(--ink-soft); border-color: var(--ink-soft); }

/* Timing — combo chart: volume bars + approve-speed line on one timeline */
.combo-card { margin-bottom: 16px; }
.combo-card .tc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.combo-svg { width: 100%; height: auto; display: block; overflow: visible; margin-top: 8px; }
.combo-svg text { font-family: inherit; }
.cc-bar { fill: color-mix(in srgb, var(--ink) 14%, var(--card)); stroke: color-mix(in srgb, var(--ink) 24%, var(--line)); stroke-width: 1; }
.cc-barlab { fill: var(--ink-soft); font-size: 13px; font-weight: 800; text-anchor: middle; }
.cc-line { fill: none; stroke: var(--brand); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.cc-dot { fill: var(--brand); }
.cc-daylab { fill: var(--brand-ink); font-size: 12px; font-weight: 800; text-anchor: middle; }
.cc-mlab { fill: var(--ink-soft); font-size: 13px; font-weight: 700; text-anchor: middle; }
.combo-legend { display: flex; gap: 14px; font-size: 0.8rem; color: var(--ink-soft); font-weight: 700; }
.combo-legend .cl { display: inline-flex; align-items: center; gap: 6px; }
.combo-legend .sw { width: 14px; height: 10px; border-radius: 3px; display: inline-block; }
.combo-legend .sw.bar { background: color-mix(in srgb, var(--ink) 16%, var(--card)); border: 1px solid color-mix(in srgb, var(--ink) 26%, var(--line)); }
.combo-legend .sw.line { height: 0; border-top: 3px solid var(--brand); border-radius: 0; }
.keeping-up { margin-top: 12px; padding: 11px 14px; border-radius: var(--radius-sm); font-size: 0.9rem; font-weight: 600; }
.keeping-up b { font-weight: 800; }
.keeping-up.good { background: color-mix(in srgb, var(--accent) 12%, var(--card)); color: #0a7a6d; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); }
.keeping-up.warn { background: color-mix(in srgb, var(--warn) 12%, var(--card)); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 32%, var(--line)); }

/* ---------- Review queue (split inbox) ---------- */
.rv-lede { color: var(--ink-soft); margin: 0 0 16px; font-size: 1rem; }
.rv-lede b { color: var(--ink); font-weight: 800; }
.rv-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 16px; }
.rv-tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; }
.rv-tile .rv-tk { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-soft); }
.rv-tile .rv-tv { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.rv-tile.warn .rv-tv { color: var(--warn); }
.rv-tile.good .rv-tv { color: #0a7a6d; }

.rv-clearbanner { display: flex; align-items: center; gap: 13px; background: linear-gradient(100deg, color-mix(in srgb, var(--accent) 16%, var(--card)), var(--card) 80%); border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line)); border-radius: var(--radius); padding: 13px 15px; margin-bottom: 16px; }
.rv-clearbanner .rv-cbic { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-content: center; font-weight: 900; flex: none; }
.rv-clearbanner .rv-cbtext { display: flex; flex-direction: column; line-height: 1.3; }
.rv-clearbanner .rv-cbtext b { color: #0a7a6d; font-size: 1rem; }
.rv-clearbanner .rv-cbtext span { color: var(--ink-soft); font-size: 0.84rem; }
.rv-clearbanner .btn { margin-left: auto; }

.rv-inbox { display: grid; grid-template-columns: 320px 1fr; gap: 14px; align-items: start; }
.rv-list { display: flex; flex-direction: column; gap: 8px; }
.rv-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; text-align: left; width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 12px; box-shadow: var(--shadow); cursor: pointer; transition: border-color .12s, background .12s; }
.rv-item:hover { border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); }
.rv-item.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand-soft) 45%, var(--card)); }
.rv-item .rv-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.rv-item .rv-dot.clear { background: var(--accent); }
.rv-item .rv-dot.flag { background: var(--warn); }
.rv-item-name { font-weight: 800; font-size: 0.94rem; }
.rv-item-sub { color: var(--ink-soft); font-size: 0.78rem; margin-top: 1px; }
.rv-ytdchip { display: inline-block; margin-top: 4px; font-size: 0.72rem; font-weight: 800; color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, var(--card)); padding: 2px 7px; border-radius: 999px; }

.rv-chip { font-size: 0.72rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.rv-chip.clear { color: #0a7a6d; background: color-mix(in srgb, var(--accent) 15%, var(--card)); }
.rv-chip.flag { color: var(--warn); background: color-mix(in srgb, var(--warn) 15%, var(--card)); }

.rv-pane { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; min-height: 380px; }
.rv-empty { display: grid; place-content: center; text-align: center; color: var(--ink-soft); min-height: 340px; gap: 6px; }
.rv-empty span { color: color-mix(in srgb, var(--ink-soft) 75%, var(--card)); font-size: 0.85rem; }
.rv-detail-head h3 { margin: 0; font-size: 1.2rem; }
.rv-detail-sub { color: var(--ink-soft); font-size: 0.86rem; margin-top: 2px; }
.rv-banner { display: flex; align-items: flex-start; gap: 11px; border-radius: var(--radius-sm); padding: 12px 14px; margin: 14px 0 4px; border: 1px solid; }
.rv-banner h4 { margin: 0; font-size: 0.98rem; }
.rv-banner p { margin: 2px 0 0; font-size: 0.85rem; }
.rv-banner .rv-bic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-content: center; flex: none; color: #fff; font-weight: 900; }
.rv-banner.clear { background: color-mix(in srgb, var(--accent) 12%, var(--card)); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.rv-banner.clear .rv-bic { background: var(--accent); } .rv-banner.clear h4, .rv-banner.clear p { color: #0a7a6d; }
.rv-banner.flag { background: color-mix(in srgb, var(--warn) 12%, var(--card)); border-color: color-mix(in srgb, var(--warn) 32%, var(--line)); }
.rv-banner.flag .rv-bic { background: var(--warn); } .rv-banner.flag h4, .rv-banner.flag p { color: var(--warn); }
.rv-group { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); margin: 18px 0 9px; display: flex; align-items: center; gap: 8px; }
.rv-group::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.rv-exp { display: grid; grid-template-columns: 1fr auto; gap: 10px; background: color-mix(in srgb, var(--bg-soft) 45%, var(--card)); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 13px; margin-bottom: 8px; }
.rv-exp.flagged { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); background: color-mix(in srgb, var(--warn) 7%, var(--card)); }
.rv-desc { font-weight: 700; font-size: 0.92rem; }
.rv-sub { color: var(--ink-soft); font-size: 0.8rem; margin-top: 2px; }
.rv-exp-right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.rv-amt { font-weight: 800; }
.rv-orig { color: var(--ink-soft); font-weight: 600; font-size: 0.78rem; }
.rv-ok { font-size: 0.74rem; font-weight: 700; color: #0a7a6d; white-space: nowrap; }
.rv-note { grid-column: 1 / -1; margin-top: 4px; padding-top: 9px; border-top: 1px dashed var(--line); display: flex; gap: 9px; align-items: flex-start; }
.rv-note-body { font-size: 0.84rem; }
.rv-q { color: var(--ink-soft); font-style: italic; }
.rv-ytd { margin-top: 14px; padding: 11px 14px; border-radius: var(--radius-sm); border: 1px dashed var(--line); background: color-mix(in srgb, var(--bg-soft) 50%, var(--card)); color: var(--ink-soft); font-size: 0.84rem; }
.rv-ytd b { color: var(--ink); }
.rv-ytd.hot { border-style: solid; border-color: color-mix(in srgb, var(--warn) 38%, var(--line)); background: color-mix(in srgb, var(--warn) 9%, var(--card)); }
/* Report detail: clickable expense list on the left, receipt preview on the right. */
.rv-split { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 16px; margin-top: 12px; align-items: start; }
.rv-exp-col { display: flex; flex-direction: column; }
.rv-exp { cursor: pointer; width: 100%; text-align: left; font: inherit; color: inherit; }
.rv-exp:hover { border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); }
.rv-exp.on { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: color-mix(in srgb, var(--brand-soft) 45%, var(--card)); }
.rv-exp.flagged.on { box-shadow: inset 0 0 0 1px var(--warn); border-color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, var(--card)); }

.rv-preview { position: sticky; top: 78px; background: color-mix(in srgb, var(--bg-soft) 40%, var(--card)); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 15px 16px; }
.rv-pv-empty { color: var(--ink-soft); text-align: center; padding: 44px 12px; }
.rv-pv-head h4 { margin: 0; font-size: 1.05rem; }
.rv-pv-meta { color: var(--ink-soft); font-size: 0.82rem; margin-top: 3px; }
.rv-pv-amt { font-weight: 800; font-size: 1.25rem; margin: 10px 0 12px; }
.rv-pv-orig { color: var(--ink-soft); font-weight: 600; font-size: 0.85rem; }
.rv-pv-flag { border-radius: var(--radius-sm); padding: 11px 13px; font-size: 0.86rem; }
.rv-pv-flag.warn { background: color-mix(in srgb, var(--warn) 10%, var(--card)); border: 1px solid color-mix(in srgb, var(--warn) 32%, var(--line)); color: var(--warn); }
.rv-pv-flag .rv-q { color: var(--ink-soft); font-style: italic; margin-top: 5px; }
.rv-pv-ok { color: #0a7a6d; font-weight: 700; font-size: 0.9rem; padding: 6px 0; }
.rv-rc { margin-top: 4px; }
.rv-rc-imgwrap { position: relative; display: block; line-height: 0; }
.rv-rc-img { width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #fff; display: block; }
/* Soft highlighter marks over the total & date on the receipt image (normalized
   coords). Translucent fill, no hard border — like a highlighter pen, so even if
   it's a little off the text underneath stays readable. */
.rc-mark { position: absolute; box-sizing: border-box; border-radius: 3px; pointer-events: none; mix-blend-mode: multiply; }
.rc-mark.amt { background: color-mix(in srgb, var(--brand) 32%, transparent); }
.rc-mark.date { background: color-mix(in srgb, var(--accent) 32%, transparent); }
.rc-mark-lbl { position: absolute; top: -8px; left: -1px; transform: translateY(-100%); mix-blend-mode: normal;
  font-size: 0.6rem; font-weight: 800; letter-spacing: 0.02em; text-transform: uppercase;
  color: #fff; padding: 1px 5px; border-radius: 999px; white-space: nowrap; line-height: 1.4; opacity: 0.9; }
.rc-mark.amt .rc-mark-lbl { background: var(--brand); }
.rc-mark.date .rc-mark-lbl { background: var(--accent); }
.rv-rc-read { margin-top: 8px; font-size: 0.85rem; color: var(--ink-soft); }
.rv-rc-read b { color: var(--ink); }
.rv-rc-frame { width: 100%; height: 480px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.rv-rc-open { display: inline-block; margin-top: 9px; font-weight: 700; color: var(--brand-ink); font-size: 0.85rem; text-decoration: none; }
.rv-rc-open:hover { text-decoration: underline; }
@media (max-width: 900px) { .rv-split { grid-template-columns: 1fr; } .rv-preview { position: static; } }

.req { color: var(--danger); font-weight: 800; }
.cat-hint { font-size: 0.78rem; }

.rv-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.rv-sendback { display: flex; gap: 8px; margin-top: 12px; }
.rv-sendback input { flex: 1; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-family: inherit; font-size: 0.9rem; }

@media (max-width: 720px) {
  .rv-inbox { grid-template-columns: 1fr; }
}

/* Timing — sent-back → resubmitted (bounce) accent, amber like a gentle nudge */
.metric-card.bounce .metric-rail { background: var(--warn); }
.metric-card.bounce .metric-big { color: var(--warn); }
.timing-bars.bounce .timing-bar .tb-col {
  background: color-mix(in srgb, var(--warn) 26%, var(--card));
  border-color: color-mix(in srgb, var(--warn) 40%, var(--line));
}
.timing-bars.bounce .timing-bar.now .tb-col { background: var(--warn); border-color: var(--warn); }

/* ---------- Sent-back visibility (My reports) ---------- */
.tab-badge {
  display: inline-grid; place-content: center; min-width: 18px; height: 18px;
  padding: 0 5px; margin-left: 6px; border-radius: 999px;
  background: var(--warn); color: #fff; font-size: 0.72rem; font-weight: 800; line-height: 1;
  vertical-align: middle;
}
.fix-banner {
  background: color-mix(in srgb, var(--warn) 10%, var(--card));
  border: 1px solid color-mix(in srgb, var(--warn) 34%, var(--line));
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px;
}
.fix-head { font-weight: 800; color: var(--warn); font-size: 0.98rem; margin-bottom: 10px; }
/* Each sent-back item is its own card that opens the editor inline when tapped. */
.fix-list { display: flex; flex-direction: column; gap: 8px; }
.fix-row { background: color-mix(in srgb, var(--warn) 8%, var(--card)); }
.fix-item { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; width: 100%; text-align: left; padding: 11px 13px; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; }
.fix-item:hover { background: color-mix(in srgb, var(--warn) 10%, transparent); }
.fix-who { font-weight: 700; font-size: 0.9rem; }
.fix-in { color: var(--ink-soft); font-size: 0.82rem; }
.fix-note { color: var(--ink-soft); font-size: 0.85rem; font-style: italic; }
.fix-go { margin-left: auto; font-weight: 800; font-size: 0.85rem; color: var(--warn); white-space: nowrap; }
.fix-row .mini-caret { color: var(--warn); transition: transform 0.15s; }
.fix-tip { margin-top: 11px; font-size: 0.84rem; color: var(--ink-soft); }
.fix-tip b { color: var(--ink); }

/* A report with sent-back items: header tag + the items marked and pulled to top. */
.rc-fixtag { display: inline-block; margin-left: 8px; font-size: 0.72rem; font-weight: 800; color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, var(--card)); padding: 2px 8px; border-radius: 999px; vertical-align: middle; }
.report-card.has-fix { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.expense.mini.sent-back { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); background: color-mix(in srgb, var(--warn) 8%, var(--card)); }
.mini-sentback { font-size: 0.72rem; font-weight: 800; color: var(--warn); background: color-mix(in srgb, var(--warn) 15%, var(--card)); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.mini-fixnote { padding: 2px 16px 10px; color: var(--warn); font-size: 0.85rem; font-style: italic; }
.mini-fixcta { color: var(--ink-soft); font-style: normal; font-weight: 700; }
/* A background pulse (not box-shadow — the report card clips overflow, which would
   hide an outer glow). Clearly visible when you jump to a sent-back item. */
.expense.flash { animation: fix-flash 1.6s ease-out; }
@keyframes fix-flash {
  0%, 25% { background: color-mix(in srgb, var(--warn) 34%, var(--card)); }
  100% { background: color-mix(in srgb, var(--warn) 8%, var(--card)); }
}

/* The read-only "your account" line shown when a person has only one account. */
.ea-single { padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-soft); color: var(--ink); font-weight: 600; }
.ea-default-hint { margin: 6px 2px 0; font-size: 0.8rem; color: var(--ink-soft); }
.ea-default-hint strong { color: var(--brand-ink); font-weight: 700; }

/* ---- Accounts & access (CedarStone back-office) ---- */
.acct-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 4px 0 14px; }
.acct-in { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); color: var(--ink); font-size: 0.95rem; }
.acct-in-name { flex: 1 1 240px; min-width: 180px; }
.acct-toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.acct-search { flex: 1 1 260px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); color: var(--ink); font-size: 0.95rem; }
.acct-showretired { display: inline-flex; gap: 6px; align-items: center; color: var(--ink-soft); font-size: 0.88rem; white-space: nowrap; }
.acct-summary { color: var(--ink-soft); font-size: 0.85rem; margin-bottom: 10px; }
.acct-row { padding: 12px 14px; }
.acct-row.retired { opacity: 0.62; }
.acct-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.acct-main { min-width: 0; flex: 1 1 320px; }
.acct-title { font-weight: 700; color: var(--ink); }
.acct-code { display: inline-block; font-variant-numeric: tabular-nums; font-weight: 800; color: var(--brand-ink); margin-right: 6px; }
.acct-badge { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; margin-left: 6px; }
.acct-access { margin-top: 3px; font-size: 0.85rem; }
.acct-open { color: var(--accent); font-weight: 600; }
.acct-restricted { color: var(--ink-soft); }
.acct-sep { color: var(--line); margin: 0 4px; }
.acc-editor-tools { display: flex; gap: 14px; margin-bottom: 8px; }
.acct-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.acc-editor { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 12px; }
.acc-editor-hint { color: var(--ink-soft); font-size: 0.85rem; margin: 0 0 8px; }
.acc-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; max-height: 320px; overflow-y: auto; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-soft); }
.acc-pick { display: flex; gap: 8px; align-items: center; padding: 5px 6px; border-radius: 8px; cursor: pointer; font-size: 0.9rem; color: var(--ink); }
.acc-pick:hover { background: var(--card); }
.acc-pick em { color: var(--ink-soft); font-style: normal; font-size: 0.8rem; }
.acc-editor-actions { display: flex; gap: 12px; align-items: center; margin-top: 12px; }
