:root {
  color-scheme: light;
  --money-navy: #071b33;
  --money-blue: #0b4ea2;
  --money-blue-bright: #1479d8;
  --money-blue-soft: #dceeff;
  --money-bg: #f4f8fc;
  --money-text: #334155;
  --money-muted: #738297;
  --money-border: #d9e2ec;
  --money-white: #fff;
  --money-green: #147a57;
  --money-red: #b74646;
  --sidebar-width: 236px;
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  color: var(--money-text);
  background: var(--money-bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--money-bg); }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 2;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 27px 17px 18px;
  color: #f1f7ff;
  background: var(--money-navy);
}
.brand { display: inline-flex; width: fit-content; align-items: center; gap: 11px; color: inherit; font-size: 19px; font-weight: 700; }
.brand-mark { display: grid; width: 32px; aspect-ratio: 1; place-items: center; border-radius: 8px; color: var(--money-navy); background: #9bcdf9; font-family: Georgia, serif; font-size: 19px; }
.sidebar-label, .eyebrow { color: #7792ad; font-size: 10px; font-weight: 700; letter-spacing: 1.1px; }
.sidebar-label { margin: 52px 11px 13px; color: #7186a0; }
.primary-nav { display: grid; gap: 5px; }
.nav-link { display: flex; min-height: 42px; align-items: center; gap: 12px; padding: 0 11px; border-radius: 6px; color: #bdcad9; font-size: 13px; transition: background-color .16s ease, color .16s ease; }
.nav-link:hover, .nav-link.is-active { color: white; background: #173856; }
.nav-link.is-active { box-shadow: inset 2px 0 #61b5ff; }
.nav-icon { width: 18px; color: #7f9bb7; font-family: Georgia, serif; font-size: 10px; }
.sidebar-footer { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 14px 3px 0; border-top: 1px solid #1b3550; }
.user-avatar, .account-monogram { display: grid; flex: 0 0 auto; width: 34px; aspect-ratio: 1; place-items: center; border-radius: 50%; color: #d7edff; background: #21496b; font-size: 12px; font-weight: 700; }
.user-meta { display: grid; min-width: 0; gap: 3px; flex: 1; }
.user-meta strong { overflow: hidden; color: #f0f5fa; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.user-meta span { color: #8ca0b5; font-size: 10px; }
.logout-button { width: 30px; height: 30px; border: 1px solid #28435e; border-radius: 5px; color: #bdd0e3; background: transparent; cursor: pointer; }
.logout-button:hover { color: white; background: #173856; }
.main-content { min-height: 100vh; margin-left: var(--sidebar-width); padding: 49px clamp(25px, 5.4vw, 76px) 64px; }
.page-header { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 0 auto 32px; max-width: 1120px; }
.page-header .eyebrow { color: var(--money-blue); }
h1, h2, h3, p { margin-top: 0; }
.page-header h1 { margin: 9px 0 7px; color: var(--money-navy); font-family: Georgia, "Times New Roman", serif; font-size: 34px; font-weight: 500; line-height: 1.15; }
.page-header p { margin-bottom: 0; color: var(--money-muted); font-size: 13px; }
.date-stamp { padding-bottom: 2px; color: var(--money-navy); font-size: 12px; font-weight: 600; text-align: right; }
.date-stamp span { display: block; margin-top: 5px; color: var(--money-muted); font-size: 11px; font-weight: 400; }
.metric-grid, .overview-lower { max-width: 1120px; margin: 0 auto; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.metric-card { min-height: 150px; padding: 19px 19px 17px; border: 1px solid var(--money-border); border-radius: 7px; background: var(--money-white); }
.metric-featured { border-top: 3px solid var(--money-blue-bright); padding-top: 17px; }
.metric-top { display: flex; align-items: center; justify-content: space-between; color: #65768a; font-size: 12px; font-weight: 600; }
.metric-symbol { display: grid; width: 26px; aspect-ratio: 1; place-items: center; border: 1px solid #dbeaf7; border-radius: 5px; color: var(--money-blue); background: #f2f8fd; font-size: 13px; }
.metric-value { margin: 15px 0 2px; color: var(--money-navy); font-family: Georgia, "Times New Roman", serif; font-size: 30px; line-height: 1; }
.metric-card p { margin: 8px 0 0; color: #8491a0; font-size: 11px; }
.overview-lower { margin-top: 44px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.section-heading .eyebrow { color: var(--money-blue); }
.section-heading h2 { margin: 6px 0 0; color: var(--money-navy); font-family: Georgia, "Times New Roman", serif; font-size: 21px; font-weight: 500; }
.text-link { color: var(--money-blue); font-size: 12px; font-weight: 600; }
.text-link:hover { color: var(--money-blue-bright); }
.text-link span { margin-left: 3px; }
.empty-state { display: grid; justify-items: center; text-align: center; }
.compact-empty { min-height: 202px; align-content: center; padding: 26px; border: 1px dashed #bfd0df; border-radius: 7px; background: #f9fbfd; }
.empty-icon { display: grid; width: 38px; aspect-ratio: 1; place-items: center; margin-bottom: 12px; border: 1px solid #d3e5f4; border-radius: 50%; color: var(--money-blue); background: #eaf5ff; font-family: Georgia, serif; font-size: 17px; }
.empty-state h2, .empty-state h3 { margin: 0 0 7px; color: var(--money-navy); font-family: Georgia, "Times New Roman", serif; font-size: 17px; font-weight: 500; }
.empty-state p { max-width: 430px; margin: 0; color: var(--money-muted); font-size: 12px; line-height: 1.7; }
.compact-empty .text-link { margin-top: 14px; }
.record-count { padding: 8px 10px; border: 1px solid var(--money-border); border-radius: 5px; color: #63758a; background: white; font-size: 11px; white-space: nowrap; }
.data-table-wrap { overflow-x: auto; max-width: 1120px; margin: 0 auto; border: 1px solid var(--money-border); border-radius: 7px; background: white; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; text-align: left; }
.data-table th { padding: 13px 15px; border-bottom: 1px solid var(--money-border); color: #75869a; background: #f8fafc; font-size: 10px; font-weight: 700; }
.data-table td { padding: 14px 15px; border-bottom: 1px solid #edf1f5; color: #627286; white-space: nowrap; }
.data-table tr:last-child td { border-bottom: 0; }
.table-primary { color: var(--money-navy); font-weight: 600; }
.amount-column { text-align: right; font-variant-numeric: tabular-nums; }
.amount-negative { color: var(--money-red) !important; }
.amount-positive { color: var(--money-green) !important; }
.page-empty { max-width: 1120px; min-height: 280px; align-content: center; padding: 32px; border: 1px dashed #bfd0df; border-radius: 7px; background: #f9fbfd; }
.pagination { display: flex; max-width: 1120px; align-items: center; justify-content: space-between; margin: 16px auto 0; color: var(--money-muted); font-size: 11px; }
.pagination a { color: var(--money-blue); font-weight: 600; }
.account-list, .rule-list { max-width: 1120px; margin: 0 auto; border: 1px solid var(--money-border); border-radius: 7px; background: white; }
.account-row, .rule-row { display: flex; min-height: 75px; align-items: center; gap: 15px; padding: 13px 18px; border-bottom: 1px solid #edf1f5; }
.account-row:last-child, .rule-row:last-child { border-bottom: 0; }
.account-row .account-monogram { color: var(--money-blue); background: #e7f3fd; }
.account-main, .rule-main { min-width: 0; flex: 1; }
.account-main h2, .rule-main h2 { margin: 0 0 4px; color: var(--money-navy); font-size: 13px; font-weight: 600; }
.account-main p, .rule-main p { overflow: hidden; margin: 0; color: var(--money-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.currency-label { color: #627286; font-size: 11px; font-weight: 700; }
.status-indicator { padding: 5px 8px; border-radius: 4px; color: #146447; background: #e8f5ef; font-size: 10px; font-weight: 700; }
.status-inactive { color: #738092; background: #edf1f4; }
.rule-priority { display: grid; width: 29px; aspect-ratio: 1; place-items: center; border-radius: 5px; color: var(--money-blue); background: #eaf5ff; font-size: 10px; font-variant-numeric: tabular-nums; }
.rule-action { color: #53677e; font-size: 11px; }

.auth-shell { display: grid; min-height: 100vh; background: white; }
.auth-content { display: grid; min-height: 100vh; margin: 0; padding: 0; }
.login-layout { display: grid; min-height: 100vh; grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.05fr); }
.login-brand-panel { display: flex; flex-direction: column; padding: 38px clamp(30px, 6vw, 85px); color: white; background: var(--money-navy); }
.brand-light { color: white; }
.login-message { max-width: 430px; margin: auto 0; padding: 75px 0; }
.login-message .eyebrow { color: #8fc5f1; }
.login-message h1 { margin: 17px 0 12px; color: white; font-family: Georgia, "Times New Roman", serif; font-size: clamp(38px, 4.2vw, 58px); font-weight: 400; line-height: 1.08; }
.login-message p { max-width: 350px; margin: 0; color: #bbcad9; font-size: 14px; line-height: 1.7; }
.panel-footnote { color: #8ca0b5; font-size: 10px; }
.login-form-panel { display: grid; align-items: center; justify-items: center; padding: 38px; }
.login-form { display: grid; width: min(100%, 360px); }
.login-form .eyebrow { color: var(--money-blue); }
.login-form h2 { margin: 10px 0 7px; color: var(--money-navy); font-family: Georgia, "Times New Roman", serif; font-size: 29px; font-weight: 500; }
.form-intro { margin: 0 0 25px; color: var(--money-muted); font-size: 12px; line-height: 1.6; }
.login-form label { margin: 0 0 7px; color: #405269; font-size: 11px; font-weight: 700; }
.login-form input:not([type="hidden"]) { width: 100%; height: 43px; margin: 0 0 17px; padding: 0 12px; border: 1px solid #cbd6e1; border-radius: 5px; outline: 0; color: var(--money-navy); background: white; font-size: 13px; }
.login-form input:focus { border-color: var(--money-blue-bright); box-shadow: 0 0 0 3px #dceeff; }
.primary-button { display: flex; height: 44px; align-items: center; justify-content: space-between; margin-top: 6px; padding: 0 14px; border: 0; border-radius: 5px; color: white; background: var(--money-blue); cursor: pointer; font-size: 12px; font-weight: 700; }
.primary-button:hover { background: #083f83; }
.primary-button span { font-size: 17px; }
.form-error { margin: 0 0 17px; padding: 10px 11px; border-left: 3px solid var(--money-red); color: #8b3434; background: #fff4f2; font-size: 11px; }

@media (max-width: 760px) {
  :root { --sidebar-width: 0px; }
  .sidebar { position: relative; width: auto; height: auto; padding: 15px 18px 10px; }
  .sidebar-label { display: none; }
  .brand { margin-bottom: 13px; }
  .primary-nav { display: flex; gap: 3px; overflow-x: auto; padding-bottom: 1px; }
  .sidebar-footer { justify-content: flex-end; margin-top: 5px; padding: 5px 2px 0; border-top: 0; }
  .user-avatar, .user-meta { display: none; }
  .nav-link { min-height: 36px; flex: 0 0 auto; gap: 7px; padding: 0 9px; font-size: 11px; }
  .nav-icon { display: none; }
  .main-content { margin-left: 0; padding: 31px 19px 42px; }
  .page-header { align-items: start; margin-bottom: 24px; }
  .page-header h1 { font-size: 29px; }
  .page-header p { max-width: 330px; line-height: 1.5; }
  .date-stamp { max-width: 115px; font-size: 10px; }
  .metric-grid { grid-template-columns: 1fr; gap: 9px; }
  .metric-card { min-height: 128px; }
  .overview-lower { margin-top: 34px; }
  .section-heading { align-items: center; }
  .account-row, .rule-row { gap: 10px; padding: 12px; }
  .rule-action { display: none; }
  .record-count { padding: 7px; font-size: 10px; }
  .login-layout { grid-template-columns: 1fr; }
  .login-brand-panel { min-height: 260px; padding: 23px 26px; }
  .login-message { padding: 36px 0 26px; }
  .login-message h1 { max-width: 390px; font-size: 39px; }
  .login-message p { font-size: 12px; }
  .panel-footnote { display: none; }
  .login-form-panel { align-items: start; padding: 41px 26px; }
}

@media (max-width: 420px) {
  .nav-link { padding: 0 7px; font-size: 10px; }
  .page-header { gap: 10px; }
  .page-header h1 { font-size: 26px; }
  .record-count { white-space: normal; text-align: center; }
  .currency-label { display: none; }
}
