:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17212b;
  background: #f6f8f5;
  --ink: #17212b;
  --muted: #66736d;
  --line: #dde5de;
  --surface: #ffffff;
  --surface-soft: #f8faf8;
  --card-shadow: 0 10px 26px rgba(28, 43, 35, 0.045);
  --card-shadow-hover: 0 14px 34px rgba(28, 43, 35, 0.075);
  --accent: #0f766e;
  --accent-dark: #0b5f59;
  --accent-soft: #e6f5f1;
  --green: #147a4c;
  --green-soft: #e7f6ed;
  --amber: #8a5b09;
  --amber-soft: #fff3d8;
  --red: #a33b32;
  --red-soft: #fdecea;
  --blue: #3569a8;
  --blue-soft: #eaf1fb;
  --cat-client-income: #00a76f;
  --cat-client-income-soft: #e2f8ef;
  --cat-expense: #e25544;
  --cat-expense-soft: #fdecea;
  --cat-transfer: #3b82f6;
  --cat-transfer-soft: #e8f1ff;
  --cat-refund: #14b8a6;
  --cat-refund-soft: #ddf8f4;
  --cat-airdrop: #8b5cf6;
  --cat-airdrop-soft: #f0eaff;
  --cat-swap: #6366f1;
  --cat-swap-soft: #ececff;
  --cat-possible-spam: #f59e0b;
  --cat-possible-spam-soft: #fff3d8;
  --cat-ignore: #94a3b8;
  --cat-ignore-soft: #f1f5f9;
  --cat-unknown: #d97706;
  --cat-unknown-soft: #fff1dc;
  --status-needs-review: #f59e0b;
  --status-needs-review-soft: #fff3d8;
  --status-reviewed: #0ea5e9;
  --status-reviewed-soft: #e5f6ff;
  --status-matched: #00a76f;
  --status-matched-soft: #e2f8ef;
  --status-ignored: #94a3b8;
  --status-ignored-soft: #f1f5f9;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: #f6f8f5; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }
button, input, select, textarea { font: inherit; }

.app-shell {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: rgba(255, 255, 255, 0.97);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: 100vh;
  padding: 24px 18px;
  position: sticky;
  top: 0;
}

.site-header {
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.nav {
  align-items: center;
  display: grid;
  gap: 24px;
  grid-template-columns: auto 1fr auto;
  margin: 0 auto;
  max-width: 1360px;
  min-height: 68px;
  padding: 0 28px;
}

.brand { align-items: center; color: var(--ink); display: inline-flex; font-size: 19px; font-weight: 800; gap: 10px; }
.brand:hover { color: var(--ink); }
.brand-mark { align-items: center; background: var(--ink); border-radius: 7px; color: #fff; display: inline-flex; height: 30px; justify-content: center; width: 30px; }
.sidebar-brand { padding: 2px 8px; }
.sidebar-nav { display: grid; gap: 5px; }
.sidebar-link {
  align-items: center;
  border-radius: 7px;
  color: #53605a;
  display: grid;
  font-size: 14px;
  font-weight: 700;
  gap: 10px;
  grid-template-columns: 10px 1fr;
  min-height: 40px;
  padding: 9px 11px;
}
.sidebar-link:hover { background: #f4f7f5; color: var(--ink); }
.sidebar-link.active { background: var(--accent-soft); color: var(--ink); }
.sidebar-link.active .nav-dot { background: var(--accent); }
.nav-dot { background: transparent; border-radius: 999px; height: 6px; width: 6px; }
.sidebar-footer { border-top: 1px solid var(--line); margin-top: auto; padding-top: 16px; }
.sidebar-feedback { color: var(--accent); }
.sidebar-feedback .nav-dot { background: var(--accent); }

.main-shell { min-width: 0; }
.utility-header {
  align-items: center;
  background: rgba(245, 247, 244, 0.86);
  border-bottom: 1px solid rgba(223, 229, 223, 0.76);
  display: flex;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 18;
}
.utility-actions { align-items: center; display: flex; gap: 10px; }
.utility-import { min-height: 38px; }
.utility-import.active { background: var(--accent-dark); border-color: var(--accent-dark); }
.env-badge {
  background: #eef3ef;
  border: 1px solid #d8e1da;
  border-radius: 999px;
  color: #53605a;
  display: inline-flex;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0;
  padding: 6px 9px;
  white-space: nowrap;
}
.account-link {
  border-radius: 7px;
  color: #53605a;
  font-size: 14px;
  font-weight: 750;
  padding: 9px 11px;
  white-space: nowrap;
}
.account-link:hover, .account-link.active { background: #eef3ef; color: var(--ink); }

.nav-links { align-items: center; display: flex; gap: 4px; justify-content: center; min-width: 0; }
.landing-nav-links { grid-column: 3; justify-content: flex-end; }
.nav-links > a, .profile-link { border-radius: 6px; color: #53605a; font-size: 14px; font-weight: 650; padding: 9px 10px; white-space: nowrap; }
.nav-links > a:hover, .nav-links > a.active, .profile-link:hover, .profile-link.active { background: #f0f4f1; color: var(--ink); }
.nav-links .nav-import { border: 1px solid #cfd8d1; margin-left: 6px; }
.profile-link { justify-self: end; }
.nav-form { display: inline; }
.nav-form button { background: transparent; border: 0; color: var(--muted); cursor: pointer; padding: 0; }

.container { margin: 0 auto; max-width: 1360px; padding: 32px 28px 64px; }
body:has(.transaction-heading) .container { max-width: 1560px; padding-inline: 22px; }
.page-heading { max-width: 720px; }
.page-title-row { align-items: flex-end; display: flex; gap: 28px; justify-content: space-between; margin-bottom: 28px; }
.page-title-row.compact { align-items: center; margin-bottom: 14px; }
.dashboard-heading { align-items: center; }
.transaction-heading { align-items: center; }
.transaction-heading > div:first-child { max-width: 740px; }
.eyebrow { color: #708078; font-size: 11px; font-weight: 800; letter-spacing: 0; margin: 0 0 8px; text-transform: uppercase; }
h1 { font-size: 34px; letter-spacing: 0; line-height: 1.12; margin: 0 0 10px; }
h2 { font-size: 19px; letter-spacing: 0; line-height: 1.25; margin: 0; }
h3 { letter-spacing: 0; }
p { line-height: 1.6; }
.page-subtitle { color: var(--muted); margin: 0; max-width: 720px; }
.muted-divider { color: #aab3ae; margin: 0 5px; }

.button-row, .filter-row { align-items: center; display: flex; flex-wrap: wrap; gap: 9px; }
.button, .action-card {
  align-items: center;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 7px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-weight: 750;
  justify-content: center;
  min-height: 42px;
  padding: 10px 15px;
}
.button:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.button.secondary { background: #fff; border-color: #d2dad4; color: var(--ink); }
.button.secondary:hover { background: #f7f9f7; border-color: #bec9c1; }
.button.danger { background: var(--cat-expense); border-color: var(--cat-expense); color: #fff; }
.button.danger:hover { background: #bd3f32; border-color: #bd3f32; color: #fff; }
.button.small { min-height: 36px; padding: 7px 12px; }
.text-link, .row-action { color: var(--accent); font-size: 14px; font-weight: 750; }
.link-button { background: transparent; border: 0; color: var(--accent); cursor: pointer; font-size: 14px; font-weight: 750; padding: 0; }
.link-button.danger { color: var(--cat-expense); }
.link-button:hover { color: var(--accent-dark); }
.link-button.danger:hover { color: #bd3f32; }
.inline-form { align-items: center; display: inline-flex; gap: 8px; }
.inline-select-label { align-items: center; color: var(--muted); display: inline-flex; font-size: 11px; font-weight: 750; gap: 6px; text-transform: uppercase; white-space: nowrap; }
.inline-select-label select { border-radius: 999px; min-height: 34px; padding: 6px 28px 6px 10px; width: auto; }
.inline-select-label.compact span { display: none; }

.notice { border: 1px solid; border-radius: 7px; font-weight: 650; margin: 0 0 20px; padding: 12px 14px; }
.notice.success { background: var(--green-soft); border-color: #c7e8d4; color: #17603d; }
.notice.error { background: var(--red-soft); border-color: #f2d0cc; color: #8e2e27; }

.metric-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); margin-bottom: 24px; }
.metric-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--card-shadow); color: var(--ink); display: flex; flex-direction: column; min-height: 142px; padding: 18px; position: relative; }
.metric-card::before { background: #93a19a; border-radius: 50%; content: ""; height: 7px; margin-bottom: 18px; width: 7px; }
.metric-card:hover { border-color: #c6d1c9; box-shadow: var(--card-shadow-hover); color: var(--ink); }
.metric-card.metric-primary::before { background: var(--green); }
.metric-card.metric-warning::before { background: #d58c1c; }
.metric-label { color: var(--muted); font-size: 12px; font-weight: 750; }
.metric-card strong { font-size: 23px; line-height: 1.25; margin: 6px 0 auto; }
.metric-card strong small { color: var(--muted); font-size: 11px; font-weight: 750; }
.metric-help { color: #849089; font-size: 11px; margin-top: 8px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--card-shadow); min-width: 0; padding: 24px; }
.dashboard-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.6fr) minmax(290px, .75fr); }
.section-heading { align-items: flex-start; display: flex; gap: 18px; justify-content: space-between; margin-bottom: 18px; }
.section-subtitle { color: var(--muted); font-size: 13px; line-height: 1.45; margin: 5px 0 0; }
.progress-pill { background: var(--accent-soft); border-radius: 999px; color: var(--accent-dark); font-size: 12px; font-weight: 750; padding: 6px 10px; }
.chart-range-row { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.chart-range-row a, .chart-range-row button {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 12px;
}
.chart-range-row a:hover, .chart-range-row a.active, .chart-range-row button:hover, .chart-range-row button.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chart-overview { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 16px; }
.supporting-chart-grid { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 24px; }
.chart-card { min-height: 340px; }
.chart-card-main { grid-column: 1 / -1; min-height: 410px; }
.chart-card-wide { grid-column: 1 / -1; min-height: 300px; }
.supporting-chart-card { min-height: 318px; }
.chart-frame { height: 270px; position: relative; }
.chart-card-main .chart-frame { height: 330px; }
.chart-frame-short { height: 220px; }
.chart-frame canvas { display: block; max-height: 100%; width: 100%; }
.chart-control { align-items: end; display: flex; gap: 8px; }
.chart-control label { color: var(--muted); font-size: 11px; gap: 5px; min-width: 138px; text-transform: uppercase; }
.chart-control select { background: #fff; border-color: #d5ddd7; border-radius: 999px; color: var(--ink); font-size: 13px; font-weight: 750; min-height: 36px; padding: 7px 34px 7px 12px; }
.workflow-list { display: grid; gap: 0; list-style: none; margin: 0; padding: 0; }
.workflow-list li { align-items: center; border-top: 1px solid #edf0ed; display: grid; gap: 12px; grid-template-columns: 28px 1fr; padding: 11px 0; }
.workflow-list li > span { align-items: center; background: #f0f4f1; border-radius: 50%; color: #5e6d65; display: flex; font-size: 11px; font-weight: 800; height: 26px; justify-content: center; width: 26px; }
.workflow-list div { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.workflow-list strong { font-size: 14px; }
.workflow-list small { color: var(--muted); font-size: 13px; }
.quick-actions-panel h2 { margin-bottom: 16px; }
.action-list { display: grid; }
.action-list a { border-top: 1px solid #edf0ed; color: var(--ink); display: grid; gap: 3px; padding: 14px 4px; }
.action-list a::after { color: var(--accent); content: "→"; grid-column: 2; grid-row: 1 / span 2; place-self: center end; }
.action-list strong { font-size: 14px; }
.action-list span { color: var(--muted); font-size: 12px; }
.dashboard-section { margin-top: 16px; }
.analytics-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.analytics-table { display: grid; max-height: 420px; overflow: auto; overscroll-behavior: contain; }
.analytics-head, .analytics-row { align-items: center; display: grid; gap: 12px; grid-template-columns: 1fr 1.35fr .6fr .8fr .8fr; min-width: 510px; }
.analytics-head { background: var(--surface); color: var(--muted); font-size: 11px; font-weight: 750; padding: 9px 6px; position: sticky; text-transform: uppercase; top: 0; z-index: 1; }
.analytics-row { border-top: 1px solid #edf0ed; color: var(--ink); font-size: 13px; padding: 11px 6px; }
.analytics-row:hover { background: #fafcfb; color: var(--ink); }

.transaction-toolbar { align-items: flex-start; display: grid; gap: 10px; grid-template-columns: minmax(320px, 1fr) auto; margin-bottom: 14px; }
.search-field { display: block; font-weight: 400; position: relative; }
.search-field input { background: #fff; height: 46px; padding: 10px 58px 10px 43px; }
.search-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(15, 118, 110, .1); outline: none; }
.search-icon { color: var(--muted); font-size: 25px; left: 14px; line-height: 1; position: absolute; top: 9px; z-index: 1; }
.search-field kbd { background: #f1f4f1; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); font-family: inherit; font-size: 11px; padding: 3px 6px; position: absolute; right: 11px; top: 11px; }
.filter-panel { position: relative; }
.filter-panel summary { background: #fff; border: 1px solid #d2dad4; border-radius: 7px; cursor: pointer; font-size: 14px; font-weight: 750; list-style: none; min-height: 46px; padding: 12px 15px; }
.filter-panel summary::-webkit-details-marker { display: none; }
.filter-panel[open] summary { border-color: var(--accent); }
.filter-form { background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 18px 40px rgba(28, 43, 35, .12); display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(150px, 1fr)); padding: 18px; position: absolute; right: 0; top: 52px; width: min(860px, calc(100vw - 56px)); z-index: 10; }
.filter-actions { align-items: center; display: flex; gap: 12px; }
.filter-row { border-bottom: 1px solid var(--line); gap: 4px; margin-bottom: 16px; overflow-x: auto; }
.filter-row a { border-bottom: 2px solid transparent; color: var(--muted); font-size: 13px; font-weight: 750; padding: 10px 12px; white-space: nowrap; }
.filter-row a:hover { color: var(--ink); }
.filter-row a.active { border-bottom-color: var(--accent); color: var(--ink); }

.bulk-actions { align-items: center; display: flex; gap: 9px; margin-bottom: 10px; }
.bulk-actions select { max-width: 210px; min-height: 36px; padding: 7px 10px; }
.select-all { align-items: center; display: flex; flex-direction: row; font-size: 13px; font-weight: 650; gap: 7px; margin-right: 4px; }
.select-all input, .row-checkbox { accent-color: var(--accent); height: 15px; margin: 0; width: 15px; }
.result-count { color: var(--muted); font-size: 12px; margin-left: auto; }
.table-wrap { border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--card-shadow); overflow-x: auto; }
table { background: #fff; border-collapse: collapse; width: 100%; }
th, td { border-bottom: 1px solid #e8ece8; padding: 13px 14px; text-align: left; vertical-align: middle; }
th { background: #fafbfa; color: #6c7872; font-size: 11px; font-weight: 800; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcfb; }
.clean-table td strong, .clean-table td small { display: block; }
.clean-table td small { color: var(--muted); margin-top: 3px; }
.transaction-table-wrap { background: #fff; max-height: 70vh; overflow: auto; overscroll-behavior: contain; }
.transaction-table { min-width: 1500px; table-layout: fixed; }
.transaction-table th { position: sticky; top: 0; z-index: 2; }
.transaction-table th:nth-child(1) { width: 38px; }
.transaction-table th:nth-child(2) { width: 92px; }
.transaction-table th:nth-child(3) { width: 160px; }
.transaction-table th:nth-child(4) { width: 92px; }
.transaction-table th:nth-child(5) { width: 115px; }
.transaction-table th:nth-child(6) { width: 155px; }
.transaction-table th:nth-child(7) { width: 190px; }
.transaction-table th:nth-child(8) { width: 145px; }
.transaction-table th:nth-child(9) { width: 190px; }
.transaction-table th:nth-child(10) { width: 190px; }
.transaction-table th:nth-child(11) { width: 70px; }
.date-cell strong, .date-cell small, .wallet-cell strong, .wallet-cell small, .context-cell strong, .context-cell small, .amount small { display: block; }
.date-cell strong, .wallet-cell strong, .context-cell strong { font-size: 13px; }
.date-cell small, .wallet-cell small, .context-cell small, .amount small { color: var(--muted); font-size: 11px; margin-top: 3px; }
.amount { font-variant-numeric: tabular-nums; font-weight: 800; white-space: nowrap; }
.amount.incoming { color: var(--green); }
.amount.outgoing { color: var(--ink); }
.direction { font-size: 12px; font-weight: 750; }
.direction-incoming { color: var(--green); }
.direction-outgoing { color: #5d6870; }
.inline-input, .inline-select { background: transparent; border: 1px solid transparent; border-radius: 6px; min-height: 34px; padding: 7px 8px; }
.inline-input:hover, .inline-select:hover, .inline-input:focus, .inline-select:focus { background: #fff; border-color: #cfd8d1; outline: none; }
.inline-select { cursor: pointer; font-size: 12px; font-weight: 750; }
.pill-select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 13px) 50%, calc(100% - 8px) 50%;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  border-radius: 999px;
  max-width: 100%;
  padding: 6px 24px 6px 10px;
}
.client-select {
  background: #fff;
  border-color: #e5ebe6;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  min-height: 32px;
  padding: 6px 8px;
}
.note-input { color: #354139; font-size: 12px; }
.note-input::placeholder, .tags-input::placeholder { color: #9aa6a0; }
.tags-input { color: var(--muted); font-size: 11px; margin-top: 4px; }
.tag-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.tag-chip { background: var(--blue-soft); border-radius: 999px; color: #315e95; display: inline-block; font-size: 10px; font-weight: 750; max-width: 110px; overflow: hidden; padding: 4px 7px; text-overflow: ellipsis; white-space: nowrap; }
.save-state { display: block; font-size: 10px; margin-top: 4px; min-height: 13px; }
.save-state.saving { color: var(--muted); }
.save-state.saved { color: var(--green); }
.save-state.error { color: var(--red); }

.status, .category { border-radius: 999px; display: inline-block; font-size: 10px; font-weight: 800; padding: 5px 8px; white-space: nowrap; }
.status-needs_review, .status-unpaid, .status-partially_paid { background-color: var(--status-needs-review-soft); color: var(--status-needs-review); }
.status-reviewed { background-color: var(--status-reviewed-soft); color: var(--status-reviewed); }
.status-paid, .status-overpaid, .status-matched_to_invoice { background-color: var(--status-matched-soft); color: var(--status-matched); }
.status-ignored { background-color: var(--status-ignored-soft); color: #64748b; }
.status-possible_spam { background-color: var(--cat-possible-spam-soft); color: var(--cat-possible-spam); }
.status-select.status-needs_review { background-color: var(--status-needs-review-soft); color: var(--status-needs-review); }
.status-select.status-reviewed { background-color: var(--status-reviewed-soft); color: var(--status-reviewed); }
.status-select.status-matched_to_invoice { background-color: var(--status-matched-soft); color: var(--status-matched); }
.status-select.status-ignored { background-color: var(--status-ignored-soft); color: #64748b; }
.category-select.category-client_income, .category-client_income { background-color: var(--cat-client-income-soft); color: var(--cat-client-income); }
.category-select.category-expense, .category-expense { background-color: var(--cat-expense-soft); color: var(--cat-expense); }
.category-select.category-transfer, .category-transfer { background-color: var(--cat-transfer-soft); color: var(--cat-transfer); }
.category-select.category-refund, .category-refund { background-color: var(--cat-refund-soft); color: var(--cat-refund); }
.category-select.category-airdrop, .category-airdrop { background-color: var(--cat-airdrop-soft); color: var(--cat-airdrop); }
.category-select.category-swap, .category-swap { background-color: var(--cat-swap-soft); color: var(--cat-swap); }
.category-select.category-possible_spam, .category-possible_spam { background-color: var(--cat-possible-spam-soft); color: var(--cat-possible-spam); }
.category-select.category-ignore, .category-ignore { background-color: var(--cat-ignore-soft); color: #64748b; }
.category-select.category-unknown, .category-unknown { background-color: var(--cat-unknown-soft); color: var(--cat-unknown); }

.empty-state { align-items: center; color: var(--muted); display: flex; flex-direction: column; gap: 5px; justify-content: center; padding: 30px; text-align: center; }
.empty-state strong { color: var(--ink); font-size: 15px; }
.empty-state.large { background: #fff; border: 1px dashed #cdd6cf; border-radius: 12px; box-shadow: var(--card-shadow); gap: 10px; min-height: 230px; }
.empty-state.compact { padding: 22px 10px; }
.empty-state .button-row { margin-top: 8px; }

.quick-links { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-top: 28px; }
.action-card { align-items: flex-start; background: #fff; border-color: var(--line); border-radius: 12px; box-shadow: var(--card-shadow); color: var(--ink); justify-content: flex-start; min-height: 100px; padding: 18px; }
.action-card:hover { background: #fbfcfb; border-color: #bdc9c0; color: var(--ink); }
.export-grid { display: grid; gap: 16px; grid-template-columns: 1fr; margin-top: 28px; }
.export-card { display: grid; gap: 16px; }
.export-card-header { align-items: flex-start; display: flex; gap: 16px; justify-content: space-between; }
.export-title-row { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; }
.export-badge { background: var(--green-soft); border-radius: 999px; color: var(--green); font-size: 10px; font-weight: 800; padding: 5px 8px; text-transform: uppercase; }
.row-count { background: #f4f7f5; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); flex: 0 0 auto; font-size: 12px; font-weight: 800; padding: 6px 9px; }
.column-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.column-chip { background: #f6f8f7; border: 1px solid #e2e8e4; border-radius: 999px; color: #57655e; font-size: 11px; font-weight: 750; padding: 5px 8px; }
.export-preview { flex-basis: 100%; }
.export-preview summary { list-style: none; width: max-content; }
.export-preview summary::-webkit-details-marker { display: none; }
.preview-panel { margin-top: 12px; max-width: 100%; }
.sample-label { color: var(--muted); font-size: 12px; margin: 0 0 8px; }
.table-scroll { max-width: 100%; overflow-x: auto; }
.preview-table { min-width: 620px; }
.preview-table th, .preview-table td { font-size: 12px; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wallet-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.wallet-card { display: grid; gap: 16px; }
.wallet-card-header { align-items: flex-start; display: flex; gap: 16px; justify-content: space-between; }
.wallet-card-header h2 { margin-bottom: 4px; }
.wallet-card-header p { color: var(--muted); margin: 0; }
.page-end-action { margin-top: 16px; }
.wallet-meta { background: transparent; border: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.wallet-meta div { border: 1px solid #edf0ed; border-radius: 7px; padding: 11px; }
.wallet-meta dt, .wallet-meta dd { border: 0; padding: 0; }
.wallet-meta dt { color: var(--muted); font-size: 10px; margin-bottom: 4px; text-transform: uppercase; }
.wallet-meta dd { font-size: 13px; font-weight: 750; }
.form-page { max-width: 680px; }
.auth-form-page {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(33, 49, 41, 0.08);
  margin: 48px auto 0;
  max-width: 460px;
  padding: 30px;
  width: 100%;
}
.auth-form-page h1 { margin-bottom: 22px; text-align: center; }
.auth-form-page .button { width: 100%; }
.auth-container {
  align-items: center;
  display: flex;
  flex-direction: column;
}
.auth-switch {
  color: var(--muted);
  font-size: 13px;
  margin: 18px 0 0;
  text-align: center;
}
.auth-switch a {
  font-weight: 750;
}
.profile-section { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 24px; }
.profile-section h2 { margin-bottom: 16px; }

.landing-container {
  display: block;
  max-width: 1240px;
  padding-top: 84px;
}
.landing-hero {
  margin: 0 auto 86px;
  max-width: 760px;
  text-align: center;
}
.landing-hero h1 {
  font-size: clamp(44px, 6vw, 72px);
  letter-spacing: -0.03em;
  line-height: .98;
  margin-bottom: 22px;
}
.landing-hero-copy {
  color: var(--muted);
  font-size: 17px;
  margin: 0 auto;
  max-width: 720px;
}
.landing-cta-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 26px;
}
.landing-trust-line {
  color: #58655f;
  font-size: 13px;
  font-weight: 700;
  margin: 18px 0 0;
}
.landing-preview-section { margin-bottom: 100px; }
.landing-preview-card,
.landing-mini-card,
.landing-feature-card,
.landing-final-cta {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 22px 60px rgba(28, 43, 35, 0.08);
}
.landing-preview-card {
  padding: 28px;
}
.landing-preview-topline,
.landing-feature-split,
.landing-preview-metrics,
.landing-preview-table div,
.landing-account-row {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}
.landing-preview-topline { margin-bottom: 22px; }
.landing-preview-button {
  background: var(--accent);
  border-radius: 7px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 9px 12px;
}
.landing-preview-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}
.landing-preview-metrics div {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
}
.landing-preview-metrics span,
.landing-preview-metrics small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 750;
}
.landing-preview-metrics strong {
  display: block;
  font-size: 28px;
  margin: 6px 0 2px;
}
.landing-preview-metrics small:first-of-type { color: var(--green); }
.landing-dashboard-image {
  border: 1px solid var(--line);
  border-radius: 12px;
  display: block;
  height: auto;
  width: 100%;
}
.landing-chart-placeholder {
  background: #f9fbfa;
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 190px;
  padding: 18px;
  position: relative;
}
.landing-chart-placeholder > span,
.landing-image-placeholder {
  color: #849089;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}
.landing-fake-bars {
  align-items: end;
  bottom: 18px;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  left: 18px;
  position: absolute;
  right: 18px;
}
.landing-fake-bars i {
  background: #7bcabe;
  border-radius: 3px 3px 0 0;
  display: block;
  height: 52px;
}
.landing-fake-bars i:nth-child(2) { background: #59b8ab; height: 84px; }
.landing-fake-bars i:nth-child(3) { background: #48a99b; height: 68px; }
.landing-fake-bars i:nth-child(4) { background: var(--accent); height: 112px; }
.landing-preview-table {
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-top: 18px;
  overflow: hidden;
}
.landing-preview-table div {
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  padding: 12px 14px;
}
.landing-preview-table div:last-child { border-bottom: 0; }
.landing-feature-split {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(320px, .75fr);
  margin-bottom: 72px;
}
.landing-feature-split h2,
.landing-feature-card h2,
.landing-safety h2,
.landing-customer-section h2,
.landing-final-cta h2 {
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.04;
  margin-bottom: 14px;
}
.landing-feature-split p,
.landing-feature-card p,
.landing-safety p,
.landing-customer-section p,
.landing-final-cta p {
  color: var(--muted);
  margin: 0;
}
.landing-mini-card {
  display: grid;
  gap: 10px;
  padding: 18px;
}
.landing-account-row {
  border: 1px solid var(--line);
  border-radius: 9px;
  display: grid;
  grid-template-columns: 1fr auto;
  padding: 13px;
}
.landing-account-row span {
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
}
.landing-account-row small {
  color: var(--muted);
  grid-column: 1 / -1;
}
.landing-feature-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 72px;
}
.landing-feature-card {
  display: flex;
  flex-direction: column;
  min-height: 360px;
  padding: 26px;
}
.landing-image-placeholder,
.landing-suggestion-box,
.landing-export-grid {
  background: #f8faf8;
  border: 1px dashed #cad5cd;
  border-radius: 10px;
  margin-top: auto;
  padding: 18px;
}
.landing-suggestion-box {
  background: var(--accent-soft);
  border-style: solid;
  display: grid;
  gap: 6px;
}
.landing-suggestion-box span { color: #31423b; font-size: 13px; }
.landing-export-grid {
  border-style: solid;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
  margin-top: auto;
}
.landing-export-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  padding: 12px;
}
.landing-export-grid strong { color: var(--ink); }
.landing-feature-card .landing-image-placeholder { margin-top: 18px; min-height: 86px; }
.landing-safety {
  background: var(--accent-soft);
  border-radius: 14px;
  margin-bottom: 72px;
  padding: 48px;
  text-align: center;
}
.landing-safety p {
  margin: 0 auto;
  max-width: 680px;
}
.landing-safety-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 24px;
}
.landing-safety-list span {
  background: rgba(255, 255, 255, .72);
  border: 1px solid #cce7df;
  border-radius: 999px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  padding: 8px 11px;
}
.landing-support-line {
  font-size: 13px;
  font-weight: 750;
  margin-top: 18px !important;
}
.landing-customer-section {
  margin: 0 auto 72px;
  max-width: 860px;
  text-align: center;
}
.landing-final-cta {
  margin: 0 auto 10px;
  max-width: 820px;
  padding: 44px;
  text-align: center;
}
form { display: grid; gap: 15px; }
label { display: grid; font-size: 13px; font-weight: 750; gap: 6px; }
input, select, textarea { background: #fff; border: 1px solid #cfd7d1; border-radius: 7px; color: var(--ink); padding: 10px 11px; width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(15, 118, 110, .09); outline: none; }
textarea { resize: vertical; }
.field-note { color: var(--muted); font-size: 12px; font-weight: 400; }
.password-field { display: block; position: relative; }
.password-field input { padding-right: 48px; }
.password-toggle { align-items: center; background: transparent; border: 0; color: var(--muted); cursor: pointer; display: flex; height: 100%; justify-content: center; padding: 0 12px; position: absolute; right: 0; top: 0; }
.password-toggle svg { fill: none; height: 20px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; width: 20px; }
.checkbox-field { align-items: center; display: flex; flex-direction: row; gap: 9px; }
.checkbox-field input { accent-color: var(--accent); width: auto; }

.detail-grid { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--card-shadow); display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin-bottom: 22px; overflow: hidden; }
.detail-grid div { border-bottom: 1px solid var(--line); padding: 16px; }
.detail-grid span, .receipt-header span { color: var(--muted); display: block; font-size: 11px; margin-bottom: 6px; text-transform: uppercase; }
.detail-grid strong { font-size: 13px; }
.description-block, .payment-block { margin: 24px 0; }
.match-list { display: grid; gap: 12px; }
.match-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--card-shadow); display: grid; gap: 16px; padding: 18px; }
.match-card h3 { margin: 0 0 5px; }
.match-card p { margin: 0; }
.match-meta { background: transparent; border: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.match-meta div { display: grid; gap: 3px; }
.match-meta dt, .match-meta dd { border: 0; padding: 0; }
.match-meta dt { color: var(--muted); font-size: 11px; }
.receipt-box { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--card-shadow); padding: 24px; }
.receipt-header { display: flex; gap: 24px; justify-content: space-between; margin-bottom: 24px; }
.receipt-header strong { font-size: 22px; }
dl { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--card-shadow); display: grid; grid-template-columns: 180px 1fr; margin: 0; overflow: hidden; }
dt, dd { border-bottom: 1px solid var(--line); margin: 0; padding: 12px; }
dt { color: var(--muted); font-weight: 750; }
.link-list { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--card-shadow); list-style: none; margin: 0; padding: 0; }
.link-list li { border-bottom: 1px solid var(--line); padding: 13px; }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; overflow-wrap: anywhere; }

.app-footer {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 14px 24px;
  justify-content: center;
  margin-top: 56px;
  padding-top: 22px;
  text-align: center;
}
.footer-disclaimer {
  font-size: 12px;
  line-height: 1.55;
  margin: 0;
  max-width: 760px;
}
.footer-links {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.footer-links a {
  color: #53605a;
  font-size: 12px;
  font-weight: 750;
}
.footer-links a:hover { color: var(--accent-dark); }
.footer-made-with {
  color: #7a8780;
  font-size: 12px;
  margin: -4px 0 0;
}
.footer-heart {
  color: #e25544;
}
.auth-footer {
  align-items: center;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  width: min(100%, 980px);
}
.auth-footer .footer-disclaimer {
  max-width: 760px;
}
.landing-footer {
  width: 100%;
}
.legal-page { max-width: 920px; }
.legal-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  margin-top: 24px;
  padding: 28px;
}
.legal-section + .legal-section {
  border-top: 1px solid var(--line);
  margin-top: 22px;
  padding-top: 22px;
}
.legal-section h2 { margin-bottom: 8px; }
.legal-section p {
  color: #43514b;
  margin: 0;
}

@media (max-width: 1320px) {
  .app-shell .metric-grid { grid-template-columns: repeat(4, minmax(160px, 1fr)); }
}

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 222px minmax(0, 1fr); }
  .sidebar { padding-inline: 14px; }
  .nav { gap: 14px; padding: 0 18px; }
  .nav-links { justify-content: flex-start; overflow-x: auto; }
  .nav-links > a { padding-inline: 8px; }
  .metric-grid { grid-template-columns: repeat(4, minmax(160px, 1fr)); }
}

@media (max-width: 860px) {
  .app-shell { display: block; }
  .sidebar {
    border-bottom: 1px solid var(--line);
    border-right: 0;
    height: auto;
    padding: 14px 18px;
    position: relative;
  }
  .sidebar-brand { padding: 0; }
  .sidebar-nav {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .sidebar-link { flex: 0 0 auto; grid-template-columns: 8px max-content; min-height: 38px; }
  .utility-header { min-height: 62px; padding: 0 18px; position: sticky; }
  .utility-spacer { display: none; }
  .utility-actions { justify-content: flex-end; width: 100%; }
  .nav { grid-template-columns: auto 1fr; padding-block: 10px; }
  .nav-links { grid-column: 1 / -1; grid-row: 2; order: 3; }
  .profile-link { grid-column: 2; grid-row: 1; }
  .container { padding: 28px 18px 50px; }
  .page-title-row { align-items: flex-start; flex-direction: column; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-layout, .analytics-grid, .chart-overview, .supporting-chart-grid, .export-grid { grid-template-columns: 1fr; }
  .landing-container { padding-top: 54px; }
  .landing-preview-metrics, .landing-feature-split, .landing-feature-grid { grid-template-columns: 1fr; }
  .landing-feature-split { gap: 22px; }
  .landing-feature-card { min-height: 0; }
  .chart-card-wide { grid-column: auto; }
  .transaction-toolbar { grid-template-columns: 1fr; }
  .filter-panel summary { width: max-content; }
  .filter-form { grid-template-columns: repeat(2, minmax(150px, 1fr)); left: 0; right: auto; }
}

@media (max-width: 560px) {
  .nav { min-height: 60px; }
  .brand { font-size: 17px; }
  .sidebar { gap: 14px; }
  .sidebar-link { font-size: 13px; padding: 8px 10px; }
  .utility-actions .button { flex: 1; }
  .account-link { text-align: center; }
  .nav-links .nav-import { margin-left: 0; }
  .landing-hero { margin-bottom: 56px; }
  .landing-hero h1 { font-size: 42px; }
  .landing-preview-card, .landing-final-cta, .landing-safety { padding: 24px; }
  .landing-cta-row .button { width: 100%; }
  .landing-export-grid { grid-template-columns: 1fr; }
  h1 { font-size: 29px; }
  .button-row { width: 100%; }
  .button-row .button, .button-row form { flex: 1; }
  .button-row form .button { width: 100%; }
  .metric-grid, .app-shell .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 132px; padding: 14px; }
  .metric-card strong { font-size: 20px; }
  .panel { padding: 17px; }
  .filter-form { grid-template-columns: 1fr; width: calc(100vw - 36px); }
  .bulk-actions { align-items: stretch; flex-wrap: wrap; }
  .result-count { margin-left: 0; width: 100%; }
  .search-field kbd { display: none; }
  .search-field input { padding-right: 12px; }
  .receipt-header { align-items: flex-start; flex-direction: column; }
  dl { grid-template-columns: 1fr; }
}
