/* ExpenSMC design system: one stylesheet for every page. Loaded after each page's own <style>, so these
   rules win. Colors are tokens on :root; components below use only the tokens. */

@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap; src: url("/static/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-style: normal; font-display: swap; src: url("/static/fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap; src: url("/static/fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-style: normal; font-display: swap; src: url("/static/fonts/inter-latin-700-normal.woff2") format("woff2"); }

:root {
  --brand: #1d5cff;
  --brand-600: #174ad9;
  --brand-700: #1037ab;
  --brand-50: #eef3ff;
  --brand-100: #d7e3ff;
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e4e8ee;
  --border-strong: #cfd6df;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --danger: #d92d20;
  --danger-bg: #fef3f2;
  --danger-border: #fecdca;
  --warn: #b54708;
  --warn-bg: #fffaeb;
  --warn-border: #fedf89;
  --ok: #067647;
  --ok-bg: #ecfdf3;
  --info: #175cd3;
  --info-bg: #eff8ff;
  /* category colors */
  --c-transport: #2e90fa; --c-transport-bg: #eff8ff;
  --c-air: #0ba5ec;       --c-air-bg: #f0f9ff;
  --c-lodging: #7a5af8;   --c-lodging-bg: #f4f3ff;
  --c-meals: #f79009;     --c-meals-bg: #fffaeb;
  --c-business: #ee46bc;  --c-business-bg: #fdf2fa;
  --c-parking: #15b79e;   --c-parking-bg: #f0fdf9;
  --c-other: #667085;     --c-other-bg: #f2f4f7;
  --c-mileage: #12b76a;   --c-mileage-bg: #ecfdf3;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 24px -6px rgba(16, 24, 40, .12), 0 4px 8px -4px rgba(16, 24, 40, .06);
  --accent: var(--brand);   /* older pages refer to --accent */
  --sidebar-w: 248px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg); color: var(--text); margin: 0;
  font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
h1, h2, h3 { color: var(--text); letter-spacing: -0.01em; }
h2 { font-size: 20px; font-weight: 700; margin: 0 0 12px; }
h3 { font-size: 16px; font-weight: 600; margin: 0 0 10px; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.num, .amount { font-variant-numeric: tabular-nums; }

/* icons */
.ic { width: 18px; height: 18px; flex-shrink: 0; display: inline-block; vertical-align: -3px; }
.ic-sm { width: 15px; height: 15px; vertical-align: -2px; }
.ic-lg { width: 22px; height: 22px; }
.ic-badge { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px;
  background: var(--brand-50); color: var(--brand); flex-shrink: 0; }
.ic-badge .ic { width: 18px; height: 18px; }
.ic-badge.lg { width: 44px; height: 44px; border-radius: 12px; }
.ic-badge.lg .ic { width: 22px; height: 22px; }

/* buttons */
button, .btn {
  font-family: inherit; cursor: pointer; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text-2); font-weight: 600; font-size: 14px; padding: 9px 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; line-height: 1.2;
  transition: background .12s, border-color .12s, box-shadow .12s, color .12s; box-shadow: var(--shadow-sm);
}
button:hover, .btn:hover { background: var(--surface-2); border-color: var(--border-strong); text-decoration: none; }
button:focus-visible, .btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--brand-100); outline-offset: 1px;
}
button.primary, .btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
button.primary:hover, .btn.primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
button.primary:disabled, button:disabled { background: #e7ebf0; border-color: #e7ebf0; color: #98a2b3; cursor: not-allowed; box-shadow: none; }
button.ghost, .btn.ghost { background: var(--surface); }
button.danger, .btn.danger { color: var(--danger); border-color: var(--danger-border); }
button.danger:hover { background: var(--danger-bg); }
button.small, .btn.small { padding: 6px 11px; font-size: 13px; border-radius: 8px; gap: 5px; }
button.link, .link-btn { background: none; border: none; box-shadow: none; padding: 0; color: var(--brand); font-weight: 500; }
button.link:hover, .link-btn:hover { background: none; text-decoration: underline; }
button.icon-btn { padding: 7px; border-radius: 9px; }

/* inputs */
input[type=text], input[type=date], input[type=number], input[type=email], input[type=password], input:not([type]), select, textarea {
  font-family: inherit; font-size: 14px; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 9px 12px; width: 100%;
  box-shadow: var(--shadow-sm); transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); outline: none; }
input:disabled { background: var(--surface-2); color: var(--muted); }
input[type=file] { font-family: inherit; font-size: 13px; }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin: 12px 0 6px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.5; }

/* cards and surfaces */
section.card, .card, .panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow); display: flex; gap: 12px; align-items: flex-start; }
.tile .k { font-size: 13px; color: var(--muted); font-weight: 500; }
.tile .v { font-size: 24px; font-weight: 700; margin-top: 2px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tile.hero { background: linear-gradient(135deg, #2f6bff 0%, var(--brand) 45%, var(--brand-700) 100%); color: #fff; border: none; box-shadow: 0 10px 24px -8px rgba(29,92,255,.55); }
.tile.hero .k { color: rgba(255,255,255,.8); }
.tile.hero .ic-badge { background: rgba(255,255,255,.16); color: #fff; }

/* pills */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px;
  border-radius: 999px; background: var(--brand-50); color: var(--brand-600); white-space: nowrap; }
.pill.green { background: var(--ok-bg); color: var(--ok); }
.pill.gray { background: var(--c-other-bg); color: #475467; }
.pill.blue { background: var(--info-bg); color: var(--info); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.red, .pill.blocked { background: var(--danger-bg); color: var(--danger); }
.pill.purple { background: var(--c-lodging-bg); color: #5925dc; }

/* notices */
.notice { display: flex; gap: 10px; align-items: flex-start; border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13.5px;
  border: 1px solid var(--warn-border); background: var(--warn-bg); color: #7a2e0e; margin-bottom: 10px; }
.notice .ic { color: var(--warn); margin-top: 1px; }
.notice.info { border-color: #b2ddff; background: var(--info-bg); color: #194185; }
.notice.info .ic { color: var(--info); }
.notice.danger { border-color: var(--danger-border); background: var(--danger-bg); color: #912018; }
.notice.danger .ic { color: var(--danger); }

/* spinner */
.spin, .spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--brand-100); border-top-color: var(--brand);
  border-radius: 50%; animation: rm-spin .8s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes rm-spin { to { transform: rotate(360deg); } }

/* ===== App shell (main app) ===== */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); color: var(--text-2); padding: 20px 14px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; color: var(--text); font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.brand small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #98a2b3; padding: 14px 12px 6px; font-weight: 600; }
.nav a, .nav button { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 12px; border-radius: 10px;
  color: var(--text-2); font-weight: 500; font-size: 14px; background: none; border: none; box-shadow: none; justify-content: flex-start; }
.nav a:hover, .nav button:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active, .nav button.active { background: var(--brand-50); color: var(--brand); font-weight: 600; }
.nav .ic { width: 18px; height: 18px; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--border); padding-top: 12px; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px 10px 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; display: flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.me .who { font-size: 13px; color: var(--text); font-weight: 600; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; }
.me .who small { display: block; color: var(--muted); font-weight: 500; }
.pilot-note { font-size: 11.5px; color: var(--muted); padding: 8px 12px 0; line-height: 1.45; }
.pilot-note a { color: var(--brand); }

.content { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(243,245,248,.88); backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border);
  padding: 14px 32px; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.topbar h1 { font-size: 20px; font-weight: 700; margin: 0; }
.topbar .sub { font-size: 13px; color: var(--muted); }
.content main { width: 100%; max-width: 1080px; margin: 0 auto; padding: 24px 32px 60px; }
body.wide .content main { max-width: 1500px; }

/* stepper */
.stepper { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.stepper .st { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 500; }
.stepper .dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border-strong); display: flex; align-items: center;
  justify-content: center; font-size: 12px; font-weight: 700; background: var(--surface); color: var(--muted); }
.stepper .st.done .dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.stepper .st.now .dot { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); }
.stepper .st.now { color: var(--text); font-weight: 600; }
.stepper .bar { width: 28px; height: 2px; background: var(--border-strong); border-radius: 2px; }
.stepper .bar.done { background: var(--brand); }

/* mobile shell */
.mobile-bar { display: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-bar { display: flex; align-items: center; gap: 8px; background: var(--surface); border-bottom: 1px solid var(--border); color: var(--text); padding: 10px 14px; position: sticky; top: 0; z-index: 40; overflow-x: auto; }
  .mobile-bar .brand { padding: 0 6px 0 0; font-size: 16px; }
  .mobile-bar .brand img { width: 28px; height: 28px; }
  .mobile-bar a, .mobile-bar button { color: var(--text-2); background: none; border: none; box-shadow: none; padding: 6px 8px; font-size: 13px; white-space: nowrap; }
  .topbar { position: static; padding: 12px 16px; flex-direction: column; align-items: flex-start; }
  .content main { padding: 16px 14px 60px; }
  .stepper .lbl { display: none; }
  .stepper .st.now .lbl { display: inline; }
}

/* ===== My claims ===== */
.home-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.home-head p { margin: 2px 0 0; color: var(--muted); }
.claim-list { display: flex; flex-direction: column; gap: 10px; }
.claim-row { display: grid; grid-template-columns: auto 1fr auto auto; gap: 16px; align-items: center; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow-sm);
  transition: box-shadow .15s, border-color .15s; }
.claim-row:hover { box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.claim-row .name { font-weight: 600; font-size: 15px; color: var(--text); }
.claim-row .meta { font-size: 13px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 3px; }
.claim-row .amt { font-weight: 700; font-size: 17px; text-align: right; font-variant-numeric: tabular-nums; }
.claim-row .amt small { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.claim-row .acts { display: flex; gap: 6px; align-items: center; }
.empty-state { text-align: center; padding: 34px 16px; color: var(--muted); border: 1.5px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.empty-state .ic-badge { margin-bottom: 10px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 24px 0 10px; }
.section-title h3 { margin: 0; font-size: 15px; }
@media (max-width: 700px) {
  .claim-row { grid-template-columns: auto 1fr auto; gap: 12px; padding: 14px; }
  .claim-row .amt { grid-column: 3; grid-row: 1; font-size: 15px; }
  .claim-row > div:nth-child(2) { grid-column: 2; grid-row: 1; }
  .claim-row .acts { grid-column: 1 / -1; justify-content: flex-end; }
  .claim-row .meta span:nth-child(n+4) { display: none; }
  .section-title .hint { display: none; }
}

/* ===== Screen 1: form ===== */
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px 20px; margin: 16px 0 0; background: var(--surface); }
legend { font-weight: 700; font-size: 15px; color: var(--text); padding: 0 8px; margin-left: -8px; display: flex; align-items: center; gap: 8px; }
legend .ic { color: var(--brand); }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.row3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }
.dropzone { border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 22px; background: var(--surface-2);
  text-align: center; transition: border-color .12s, background .12s; }
.dropzone.drag-over { border-color: var(--brand); background: var(--brand-50); }
.dropzone > div:first-child { justify-content: center; }
.dz-icon { width: 46px; height: 46px; border-radius: 50%; background: var(--brand-50); color: var(--brand); display: inline-flex;
  align-items: center; justify-content: center; margin-bottom: 8px; }
.file-row { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 7px 4px; border-bottom: 1px solid var(--border); text-align: left; }
.file-row .remove-file { box-shadow: none; border: none; background: none; color: var(--muted); padding: 2px 6px; font-size: 18px; }
.file-row .remove-file:hover { color: var(--danger); }
.form-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
#pretrip-choice button { padding: 12px 18px; }
details summary { cursor: pointer; font-weight: 600; color: var(--text-2); }
table { border-collapse: collapse; width: 100%; }
th { font-size: 12px; color: var(--muted); font-weight: 600; text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
td { padding: 9px 10px; border-bottom: 1px solid var(--border); font-size: 13.5px; }

/* ===== Screen 2: review ===== */
.review-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 16px; }
.bucket { margin-bottom: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); }
.buckets-wrap .grand-total { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px;
  box-shadow: var(--shadow); margin: 0 0 16px; }
.item-card { border-color: var(--border); box-shadow: none; }
.item-card + .item-card { margin-top: 0; }
input.field-input[type=date] { width: auto; color: var(--muted); }
.bucket-head { display: flex; justify-content: space-between; align-items: center; border-bottom: none; padding: 0 0 10px; margin-bottom: 4px; }
.bucket-head h3 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 10px; }
.bucket-head .total { font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.cards { display: grid; gap: 10px; }
.item-card { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: start; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; background: var(--surface); box-shadow: var(--shadow-sm); position: relative; }
.item-card::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--cat, var(--c-other)); }
.item-card.flagged { border-color: var(--danger-border); background: var(--danger-bg); }
.thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); cursor: zoom-in; background: var(--surface-2); }
.thumb.empty { display: flex; align-items: center; justify-content: center; font-size: 10px; color: var(--muted); text-align: center; }
.meta { font-size: 13px; line-height: 1.5; min-width: 0; }
.meta .sub { color: var(--muted); }
input.field-input { border: 1px solid transparent; background: transparent; box-shadow: none; padding: 3px 6px; border-radius: 7px; font-size: 13px; width: 100%; color: var(--text-2); }
input.field-input:hover { border-color: var(--border); background: var(--surface); }
input.field-input:focus { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 3px var(--brand-100); }
input.field-input.vendor { font-weight: 600; font-size: 15px; color: var(--text); }
input.field-input.amount { font-weight: 700; font-size: 17px; text-align: right; width: 120px; color: var(--text); }
.controls { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; min-width: 190px; }
.controls select, .controls input:not(.amount) { font-size: 13px; padding: 7px 30px 7px 10px; width: 210px; }
.biz-fields { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin-top: 4px;
  border-top: 1px dashed var(--border-strong); padding-top: 10px; }
.reasoning { font-size: 12.5px; color: var(--muted); font-style: normal; margin-top: 6px; padding-left: 10px; border-left: 2px solid var(--brand-100); }
.support-note, .proof-toggle { font-size: 12px; color: var(--muted); margin-top: 6px; }
.proof-toggle select { width: auto; font-size: 12px; padding: 4px 28px 4px 8px; display: inline-block; }
.card-note { background: var(--warn-bg); border: 1px solid var(--warn-border); border-radius: 9px; padding: 8px 10px; margin-top: 8px; font-size: 12.5px;
  display: flex; gap: 8px; align-items: center; justify-content: space-between; color: #7a2e0e; }
.grand-total { font-size: 22px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border);
  padding-top: 16px; margin-top: 8px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
#needs-attention { border: 1px solid var(--danger-border); background: var(--surface); }
#needs-attention h2 { color: var(--danger); display: flex; align-items: center; gap: 8px; font-size: 17px; }
.flag-item { border-bottom: 1px solid var(--border); font-size: 14px; }
.flag-item:last-child { border-bottom: none; }
#questions-card { border: 1px solid var(--warn-border); background: var(--surface); }
.question-item { border-bottom: 1px solid var(--border); }
.trip-row { border-bottom: 1px solid var(--border); }
.trip-row.flagged { background: var(--danger-bg); border-radius: 10px; padding: 8px; }
.sticky-actions { position: sticky; bottom: 12px; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  flex-wrap: wrap; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 16px; box-shadow: var(--shadow-lg); margin-top: 8px; }
.bucket.cat-transport { --cat: var(--c-transport); }
.bucket.cat-lodging { --cat: var(--c-lodging); }
.bucket.cat-meals { --cat: var(--c-meals); }
.bucket.cat-other { --cat: var(--c-other); }
@media (max-width: 760px) {
  .item-card { grid-template-columns: 56px 1fr; }
  .controls { grid-column: 1 / -1; align-items: stretch; min-width: 0; }
  .controls select, .controls input:not(.amount) { width: 100%; }
  input.field-input.amount { width: 100%; text-align: left; }
}

/* category badge colors */
.cat-transport-ic { background: var(--c-transport-bg); color: var(--c-transport); }
.cat-air-ic { background: var(--c-air-bg); color: var(--c-air); }
.cat-lodging-ic { background: var(--c-lodging-bg); color: var(--c-lodging); }
.cat-meals-ic { background: var(--c-meals-bg); color: var(--c-meals); }
.cat-business-ic { background: var(--c-business-bg); color: var(--c-business); }
.cat-parking-ic { background: var(--c-parking-bg); color: var(--c-parking); }
.cat-other-ic { background: var(--c-other-bg); color: var(--c-other); }
.cat-mileage-ic { background: var(--c-mileage-bg); color: var(--c-mileage); }

/* ===== Check labels / final ===== */
.labels-form-strip { background: var(--surface); border-bottom: 1px solid var(--border); }
.labels-form-scroll { border-radius: var(--radius-sm); border-color: var(--border); }
.labels-page-frame img { border-radius: var(--radius-sm); border-color: var(--border); box-shadow: var(--shadow); }
.label-pick { border-radius: 12px; box-shadow: var(--shadow-lg); border-color: var(--border); padding: 6px; }
.label-pick button { box-shadow: none; border: none; justify-content: flex-start; }
.labels-warning, .r2-warning { border: 1px solid var(--warn-border); background: var(--warn-bg); border-radius: var(--radius-sm); color: #7a2e0e; }
.r2-summary-item { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; min-width: 140px; }
.r2-summary-item .label { font-size: 12px; color: var(--muted); text-transform: none; letter-spacing: 0; font-weight: 500; }
.r2-summary-item .value { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
#r2-downloads { border-color: var(--brand-100); background: linear-gradient(180deg, var(--brand-50), var(--surface) 70%); }

/* modal */
.modal-bg { background: rgba(15, 23, 42, .72); backdrop-filter: blur(4px); }
.modal-bg img { border-radius: 10px; box-shadow: var(--shadow-lg); }

/* recovery banner */
#recovery-banner { background: var(--warn-bg) !important; border-bottom: 1px solid var(--warn-border) !important; color: #7a2e0e; top: 0 !important; }

/* home hero (balance-card style) */
.home-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 16px; margin-bottom: 12px; }
.hero-card { position: relative; overflow: hidden; border-radius: 20px; padding: 22px 24px; color: #fff;
  background: linear-gradient(135deg, #3a78ff 0%, var(--brand) 40%, var(--brand-700) 100%);
  box-shadow: 0 16px 32px -12px rgba(29, 92, 255, .55); }
.hero-card::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.18), rgba(255,255,255,0) 70%); }
.hero-top { display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: rgba(255,255,255,.85); font-weight: 500; }
.hero-pill { background: rgba(255,255,255,.18); color: #fff; }
.hero-amt { font-size: 38px; font-weight: 700; letter-spacing: -0.03em; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.hero-sub { font-size: 13.5px; color: rgba(255,255,255,.85); }
.quick { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; position: relative; z-index: 1; }
.quick button, .quick a { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); color: #fff; box-shadow: none;
  border-radius: 12px; padding: 9px 14px; font-weight: 600; font-size: 13.5px; display: inline-flex; align-items: center; gap: 8px; }
.quick button:hover, .quick a:hover { background: rgba(255,255,255,.24); text-decoration: none; }
.q-ic { width: 26px; height: 26px; border-radius: 8px; background: #fff; color: var(--brand); display: inline-flex; align-items: center; justify-content: center; }
.q-ic .ic { width: 15px; height: 15px; }
.side-tiles { display: grid; gap: 16px; }
.side-tiles .tile { margin: 0; align-items: center; }
@media (max-width: 760px) { .home-grid { grid-template-columns: 1fr; } .side-tiles { grid-template-columns: 1fr 1fr; } .hero-amt { font-size: 32px; } }

/* check labels: receipt and its labels side by side */
.labels-body { display: grid; grid-template-columns: minmax(0, 720px) minmax(260px, 1fr); gap: 20px; align-items: start; }
.labels-body .labels-page-frame { max-width: 100%; }
#labels-legend table { font-size: 13px; }
@media (max-width: 1100px) { .labels-body { grid-template-columns: 1fr; } }

/* fieldset titles sit inside the card */
fieldset > legend { float: left; width: 100%; padding: 0; margin: 0 0 4px; }
fieldset > legend + * { clear: both; }
