:root {
  --ink: #142a3d;
  --muted: #687887;
  --line: #dce5e9;
  --paper: #f4f6f4;
  --panel: #ffffff;
  --navy: #173b4e;
  --navy-soft: #e6eef1;
  --teal: #0e766e;
  --teal-soft: #dcf0eb;
  --amber: #b67b2d;
  --amber-soft: #fbefd9;
  --red: #b54d47;
  --shadow: 0 16px 40px rgba(24, 53, 66, 0.08);
}

/* Supermarket cashier batch entry */
.journal-filter-actions .supermarket-batch-trigger { color: #075f58; border-color: #a9cec8; background: #edf8f5; }
.journal-filter-actions .supermarket-batch-trigger:hover { color: #fff; border-color: #0b7168; background: #0b7168; }
#supermarket-batch-modal { grid-template-columns: minmax(28px, 1fr) minmax(820px, 88vw); }
.supermarket-batch-drawer { position: relative; width: 100%; height: 100dvh; padding: 20px 24px 24px; overflow: auto; }
.supermarket-batch-header { align-items: center; padding-bottom: 14px; }
.supermarket-batch-header .section-label { margin-bottom: 4px; font-size: 9px; }
.supermarket-batch-header h2 { font-size: 23px; letter-spacing: -.02em; }
.supermarket-batch-header p { margin-top: 4px; font-size: 11px; }
.supermarket-configuration-warning { margin-top: 12px; padding: 10px 12px; border: 1px solid #efc4bb; border-radius: 9px; color: #a5483f; background: #fff3f1; font-size: 11px; font-weight: 750; }
.supermarket-batch-toolbar { display: grid; grid-template-columns: 150px 170px minmax(260px, 1fr) auto; gap: 10px; align-items: end; margin-top: 14px; padding: 12px; border: 1px solid #dbe6e5; border-radius: 12px; background: #f7faf9; }
.supermarket-batch-toolbar label { display: grid; gap: 5px; color: #62747c; font-size: 10px; font-weight: 800; }
.supermarket-batch-toolbar input { width: 100%; min-height: 38px; padding: 8px 9px; border: 1px solid #cbd8db; border-radius: 8px; color: var(--ink); background: #fff; font: inherit; }
.supermarket-batch-toolbar input:focus { border-color: var(--teal); outline: 0; box-shadow: 0 0 0 3px #dff0ec; }
.supermarket-fixed-account { min-width: 0; min-height: 60px; display: grid; align-content: center; padding: 7px 12px; border-left: 1px solid #dbe5e4; }
.supermarket-fixed-account span, .supermarket-fixed-account small { color: #74868c; font-size: 9px; }
.supermarket-fixed-account strong { overflow: hidden; margin: 3px 0; color: #17394a; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.supermarket-batch-toolbar > button { min-height: 38px; display: inline-flex; align-items: center; gap: 6px; justify-content: center; box-shadow: none; }
.supermarket-entry-panel { margin-top: 12px; overflow: hidden; border: 1px solid #dbe5e6; border-radius: 12px; background: #fff; }
.supermarket-entry-heading { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 13px; border-bottom: 1px solid #dbe5e6; }
.supermarket-entry-heading .section-label { margin-bottom: 2px; font-size: 8px; }
.supermarket-entry-heading h3 { margin: 0; color: #17394a; font-size: 15px; }
.supermarket-batch-table-wrap { max-height: calc(100dvh - 405px); min-height: 210px; }
.supermarket-batch-table { min-width: 1080px; table-layout: fixed; font-variant-numeric: tabular-nums; }
.supermarket-batch-table th { position: sticky; top: 0; z-index: 1; padding: 9px 12px; background: #eef4f3; font-size: 10px; }
.supermarket-batch-table th:first-child { width: 14%; }
.supermarket-batch-table th:nth-child(2), .supermarket-batch-table th:nth-child(3), .supermarket-batch-table th:nth-child(4) { width: 15%; }
.supermarket-batch-table th:nth-child(5) { width: 30%; }
.supermarket-batch-table th:last-child { width: 11%; }
.supermarket-batch-table td { height: 52px; padding: 7px 12px; vertical-align: middle; }
.supermarket-cashier-identity strong, .supermarket-cashier-identity small { display: block; }
.supermarket-cashier-identity strong { color: #17394a; font-size: 12px; }
.supermarket-cashier-identity small { margin-top: 3px; color: #71838a; font-size: 9px; }
.supermarket-batch-table input { width: 100%; min-height: 35px; padding: 7px 9px; border: 1px solid #cad8da; border-radius: 8px; color: #17394a; background: #fff; font: inherit; font-weight: 750; }
.supermarket-batch-table input:focus { border-color: var(--teal); outline: 0; box-shadow: 0 0 0 3px #dff0ec; }
.supermarket-batch-table input[readonly] { border-color: transparent; background: #f2f6f5; }
.supermarket-row-ready td { background: #f8fcfb; }
.supermarket-row-memo { display: -webkit-box; overflow: hidden; color: #71838a; font-size: 9px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.supermarket-row-ready .supermarket-row-memo { color: #405b66; }
.supermarket-row-state { display: inline-flex; min-height: 24px; align-items: center; padding: 4px 8px; border-radius: 999px; color: #71838a; background: #edf2f3; font-size: 9px; font-weight: 850; }
.supermarket-row-ready .supermarket-row-state { color: #08776d; background: #dff2ed; }
.supermarket-auto-payment-preview { display: grid; grid-template-columns: 42px minmax(240px, 1.5fr) minmax(105px, .55fr) minmax(230px, 1fr) minmax(155px, .7fr); align-items: center; gap: 12px; margin-top: 12px; padding: 12px 14px; border: 1px solid #efc9c3; border-radius: 12px; background: #fff8f6; box-shadow: 0 6px 18px rgba(147,64,54,.05); }
.supermarket-auto-payment-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: #b44a42; background: #fbe4e0; font-size: 21px; }
.supermarket-auto-payment-main { min-width: 0; }
.supermarket-auto-payment-main .section-label { margin-bottom: 2px; color: #a84b43; font-size: 8px; }
.supermarket-auto-payment-main h3 { margin: 0; color: #17394a; font-size: 14px; }
.supermarket-auto-payment-main p { overflow: hidden; margin: 4px 0 0; color: #7b6864; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.supermarket-auto-payment-meta, .supermarket-auto-payment-amount { min-width: 0; padding-left: 12px; border-left: 1px solid #efd9d5; }
.supermarket-auto-payment-meta > span, .supermarket-auto-payment-amount > span { display: block; color: #8a7772; font-size: 8px; font-weight: 800; }
.supermarket-auto-payment-meta > strong { display: flex; align-items: center; gap: 6px; overflow: hidden; margin-top: 5px; color: #17394a; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.supermarket-expense-badge { flex: 0 0 auto; padding: 3px 6px; border-radius: 999px; color: #b54840; background: #fbe2de; font-size: 8px; }
.supermarket-auto-payment-amount { text-align: right; }
.supermarket-auto-payment-amount label { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 3px; }
.supermarket-auto-payment-amount label b { color: #c7433e; font-size: 15px; }
.supermarket-auto-payment-amount input { width: 105px; min-height: 32px; padding: 5px 7px; border: 1px solid #dfa59e; border-radius: 7px; color: #c7433e; background: #fff; font: inherit; font-size: 16px; font-weight: 850; text-align: right; font-variant-numeric: tabular-nums; }
.supermarket-auto-payment-amount input:focus { border-color: #c7433e; outline: 0; box-shadow: 0 0 0 3px #f8deda; }
.supermarket-auto-payment-amount input.is-invalid { border-color: #c7433e; background: #fff0ed; }
.supermarket-auto-payment-amount small { display: block; margin-top: 2px; color: #8d7570; font-size: 8px; }
.supermarket-auto-payment-amount button { margin-top: 4px; padding: 0; border: 0; color: #a04d46; background: transparent; font-size: 8px; font-weight: 800; cursor: pointer; }
.supermarket-batch-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 12px; overflow: hidden; border: 1px solid #cfe2df; border-radius: 12px; background: #f7fbfa; }
.supermarket-batch-summary > div { min-height: 72px; display: grid; align-content: center; padding: 10px 14px; border-right: 1px solid #d8e7e5; }
.supermarket-batch-summary > div:last-child { border-right: 0; }
.supermarket-batch-summary span { color: #6d8087; font-size: 9px; font-weight: 750; }
.supermarket-batch-summary strong { margin-top: 5px; color: #17394a; font-size: 16px; }
.supermarket-batch-summary .supermarket-summary-operating { background: #e9f6f2; }
.supermarket-batch-summary .supermarket-summary-operating strong { color: #08766d; }
.supermarket-batch-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 12px; }
.supermarket-batch-footer p { display: flex; align-items: center; gap: 6px; margin: 0; color: #71838a; font-size: 10px; }
.supermarket-batch-footer .primary-button { min-width: 170px; min-height: 40px; box-shadow: none; }
.supermarket-cashier-drawer { position: fixed; z-index: 1010; top: 0; right: 0; width: min(390px, 92vw); height: 100dvh; padding: 20px; overflow: auto; border-left: 1px solid #cfdddd; background: #fff; box-shadow: -18px 0 46px rgba(12,32,43,.24); }
.supermarket-cashier-drawer > header { display: flex; justify-content: space-between; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid #dfe7e8; }
.supermarket-cashier-drawer h3 { margin: 3px 0 4px; color: #17394a; font-size: 20px; }
.supermarket-cashier-drawer header p { margin: 0; color: #71838a; font-size: 10px; line-height: 1.5; }
.supermarket-cashier-form { display: grid; gap: 10px; margin-top: 14px; padding: 12px; border: 1px solid #dce7e7; border-radius: 11px; background: #f7faf9; }
.supermarket-cashier-form label { display: grid; gap: 5px; color: #62747c; font-size: 10px; font-weight: 800; }
.supermarket-cashier-form input { width: 100%; min-height: 36px; padding: 7px 9px; border: 1px solid #cbd8db; border-radius: 8px; color: var(--ink); background: #fff; font: inherit; }
.supermarket-cashier-form > div { display: flex; justify-content: flex-end; gap: 7px; }
.supermarket-cashier-form button { min-height: 34px; padding: 7px 11px; box-shadow: none; font-size: 10px; }
.supermarket-cashier-list { display: grid; gap: 7px; margin-top: 12px; }
.supermarket-cashier-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 11px; border: 1px solid #dfe8e9; border-radius: 10px; background: #fff; }
.supermarket-cashier-card.inactive { opacity: .58; background: #f4f6f6; }
.supermarket-cashier-card strong, .supermarket-cashier-card small { display: block; }
.supermarket-cashier-card strong { color: #17394a; font-size: 12px; }
.supermarket-cashier-card small { margin-top: 3px; color: #71838a; font-size: 9px; }
.supermarket-cashier-card-actions { display: flex; gap: 5px; }
.supermarket-cashier-card-actions button { border: 0; border-radius: 7px; padding: 6px 8px; color: #08766d; background: #e2f2ee; font-size: 9px; font-weight: 850; }
.supermarket-cashier-card-actions button[data-toggle-supermarket-cashier] { color: #7a6b42; background: #f7efd9; }

@media (max-width: 980px) {
  #supermarket-batch-modal { grid-template-columns: 1fr; }
  #supermarket-batch-modal > .modal-backdrop { display: none; }
  .supermarket-batch-drawer { width: 100vw; padding: 18px 15px 22px; }
  .supermarket-batch-toolbar { grid-template-columns: 1fr 1fr; }
  .supermarket-fixed-account { border-left: 0; }
  .supermarket-batch-summary { grid-template-columns: 1fr 1fr; }
  .supermarket-batch-summary > div:nth-child(2) { border-right: 0; }
  .supermarket-batch-summary > div:nth-child(-n+2) { border-bottom: 1px solid #d8e7e5; }
  .supermarket-auto-payment-preview { grid-template-columns: 42px minmax(210px, 1fr) minmax(120px, .7fr); }
  .supermarket-auto-payment-meta:nth-of-type(2), .supermarket-auto-payment-amount { grid-column: span 1; }
}

@media (max-width: 620px) {
  .supermarket-batch-toolbar, .supermarket-batch-summary { grid-template-columns: 1fr; }
  .supermarket-batch-summary > div { border-right: 0; border-bottom: 1px solid #d8e7e5; }
  .supermarket-batch-footer { align-items: stretch; flex-direction: column; }
  .supermarket-batch-footer .primary-button { width: 100%; }
  .supermarket-auto-payment-preview { grid-template-columns: 38px minmax(0, 1fr); }
  .supermarket-auto-payment-meta, .supermarket-auto-payment-amount { grid-column: 1 / -1; padding: 8px 0 0; border-top: 1px solid #efd9d5; border-left: 0; text-align: left; }
}

* { box-sizing: border-box; }

html { max-width: 100%; overflow-x: hidden; }

body {
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .58; transform: none !important; }
.hidden { display: none !important; }

.login-screen {
  min-height: 100dvh; display: grid; place-items: center; padding: 28px;
  background:
    radial-gradient(circle at 14% 18%, rgba(121, 191, 178, .22), transparent 34%),
    linear-gradient(145deg, #102f41 0%, #173f50 48%, #e9f1ef 48%, #f4f6f4 100%);
}
.login-card {
  width: min(440px, 100%); padding: 36px; border: 1px solid rgba(216, 231, 231, .92); border-radius: 24px;
  background: rgba(255, 255, 255, .97); box-shadow: 0 28px 70px rgba(8, 33, 45, .22);
}
.login-brand { display: flex; align-items: center; gap: 13px; padding-bottom: 26px; border-bottom: 1px solid #e6eeee; }
.login-brand > span {
  flex: 0 0 48px; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px;
  color: var(--navy); background: #d7eee8; font-size: 23px; font-weight: 850;
}
.login-brand strong, .login-brand small { display: block; }
.login-brand strong { color: var(--navy); font-size: 17px; }
.login-brand small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.login-heading { padding: 28px 0 20px; }
.login-heading h1 { margin: 0; color: var(--navy); font-size: 32px; letter-spacing: -.035em; }
.login-heading p { margin: 9px 0 0; color: var(--muted); font-size: 13px; }
.login-form { display: grid; gap: 16px; }
.login-form label { display: grid; gap: 7px; color: #50666f; font-size: 11px; font-weight: 800; }
.login-form input {
  width: 100%; min-height: 47px; padding: 11px 13px; border: 1px solid #cbdadd; border-radius: 10px;
  color: var(--ink); background: #fff; outline: 0;
}
.login-form input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px #dff0ec; }
.login-form .login-remember { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; }
.login-form .login-remember input { flex: 0 0 auto; width: 16px; min-height: 16px; margin: 2px 0 0; accent-color: var(--teal); box-shadow: none; }
.login-remember span, .login-remember b, .login-remember small { display: block; }
.login-remember b { color: #3f5963; font-size: 12px; }
.login-remember small { margin-top: 3px; color: #829198; font-size: 10px; font-weight: 600; line-height: 1.4; }
.login-form .primary-button { min-height: 48px; margin-top: 3px; color: #fff; background: var(--teal); box-shadow: 0 9px 20px rgba(14, 118, 110, .2); }
.login-form .primary-button:hover { background: #095f59; }
.login-error { margin: -3px 0 0; padding: 10px 12px; border-radius: 9px; color: #963f3a; background: #f9e4e1; font-size: 11px; line-height: 1.5; }
.login-error.success { color: #11685f; background: #e0f2ed; }
.login-note { display: block; margin-top: 20px; color: #829198; text-align: center; font-size: 10px; }

.app-shell {
  --sidebar-width: 250px;
  min-height: 100vh;
  padding-left: var(--sidebar-width);
  transition: padding-left .22s ease;
}

.sidebar {
  position: fixed; z-index: 100; inset: 0 auto 0 0; width: var(--sidebar-width); height: 100vh; padding: 28px 18px 22px;
  overflow-y: auto;
  background: var(--navy); color: #fff; display: flex; flex-direction: column;
  transition: width .22s ease, padding .22s ease;
}
.brand { display: flex; gap: 12px; align-items: center; min-height: 42px; padding: 0 48px 30px 8px; }
.brand-mark {
  flex: 0 0 42px; width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center;
  background: #d7eee8; color: var(--navy); font-weight: 800; font-size: 20px;
}
.brand-copy { min-width: 0; white-space: nowrap; }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 15px; letter-spacing: .02em; }
.brand span { margin-top: 4px; font-size: 12px; color: #b9ccd4; }
nav { display: grid; gap: 7px; }
.nav-item {
  width: 100%; border: 0; border-radius: 12px; background: transparent; color: #c9d8de;
  display: flex; gap: 12px; text-align: left; align-items: center; padding: 12px;
}
.nav-item:hover { background: rgba(255,255,255,.06); }
.nav-item.active { background: #fff; color: var(--navy); box-shadow: 0 10px 24px rgba(0,0,0,.16); }
.nav-icon { font-size: 20px; width: 24px; text-align: center; }
.nav-item b, .nav-item small { display: block; }
.nav-item b { font-size: 14px; }
.nav-item small { color: #8fa5ae; margin-top: 3px; font-size: 11px; }
.nav-item.active small { color: #71828a; }
.sidebar-foot { margin-top: auto; padding: 16px; border-top: 1px solid rgba(255,255,255,.12); }
.sidebar-foot span, .sidebar-foot small, .sidebar-foot strong { display: block; }
.sidebar-foot span { color: #95adb6; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.sidebar-foot strong { margin: 8px 0 3px; font-size: 15px; }
.sidebar-foot small { color: #b5c7ce; }
.sidebar-session { margin-top: auto; padding: 17px 13px 13px; border-top: 1px solid rgba(255,255,255,.12); }
.sidebar-session span, .sidebar-session small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-session span { color: #fff; font-size: 12px; font-weight: 800; }
.sidebar-session small { margin-top: 4px; color: #a9c0c8; font-size: 10px; }
.sidebar-session-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 10px; }
.sidebar-session button {
  width: 100%; margin: 0; padding: 7px 9px; border: 1px solid rgba(255,255,255,.18); border-radius: 8px;
  color: #d7e5e8; background: rgba(255,255,255,.07); font-size: 10px; font-weight: 800;
}
.sidebar-session button:hover { color: #fff; background: rgba(255,255,255,.14); }
.sidebar-toggle {
  position: fixed; z-index: 110; top: 31px; left: calc(var(--sidebar-width) - 50px);
  width: 34px; height: 34px; padding: 7px; border: 1px solid rgba(255,255,255,.24); border-radius: 9px;
  background: rgba(255,255,255,.1); color: #d9e8ec; box-shadow: 0 6px 18px rgba(0,0,0,.12);
  transition: left .22s ease, background .18s ease, color .18s ease;
}
.sidebar-toggle:hover { background: rgba(255,255,255,.18); color: #fff; }
.sidebar-toggle:focus-visible { outline: 3px solid rgba(166,222,211,.55); outline-offset: 2px; }
.sidebar-toggle img { display: block; width: 100%; height: 100%; filter: brightness(0) invert(1); transition: transform .22s ease; }
.app-shell.sidebar-is-collapsed { --sidebar-width: 78px; }
.sidebar-is-collapsed .sidebar { padding-inline: 12px; }
.sidebar-is-collapsed .brand { justify-content: center; padding: 0 0 30px; }
.sidebar-is-collapsed .brand-mark, .sidebar-is-collapsed .brand-copy, .sidebar-is-collapsed .nav-item > span:not(.nav-icon), .sidebar-is-collapsed .sidebar-session, .sidebar-is-collapsed .sidebar-foot { display: none; }
.sidebar-is-collapsed .nav-item { justify-content: center; gap: 0; padding-inline: 0; }
.sidebar-is-collapsed .nav-icon { flex: 0 0 24px; }
.sidebar-is-collapsed .sidebar-toggle img { transform: rotate(180deg); }

.workspace { width: 100%; max-width: 100%; padding: 24px 42px 60px; min-width: 0; }
.eyebrow, .section-label { margin: 0 0 8px; color: var(--teal); font-weight: 800; font-size: 11px; letter-spacing: .13em; text-transform: uppercase; }

.content-stack { display: grid; min-width: 0; max-width: 100%; gap: 20px; }
.workspace-module-tabs {
  display: inline-flex; width: fit-content; max-width: 100%; gap: 4px; padding: 4px;
  border: 1px solid var(--line); border-radius: 12px; background: #eaf0f0; overflow-x: auto;
}
.workspace-module-tabs button {
  flex: 0 0 auto; min-height: 34px; padding: 7px 15px; border: 0; border-radius: 8px;
  color: #657881; background: transparent; font-size: 12px; font-weight: 800; white-space: nowrap;
}
.workspace-module-tabs button:hover { color: var(--navy); background: rgba(255,255,255,.62); }
.workspace-module-tabs button.active, .workspace-module-tabs button[aria-current="page"] {
  color: var(--navy); background: #fff; box-shadow: 0 3px 10px rgba(22,53,66,.08);
}
.workspace-module-tabs button:focus-visible { outline: 3px solid #9bcfc5; outline-offset: 1px; }
.journal-heading {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 8px 2px 2px;
}
.journal-heading h1 { margin: 0; color: var(--navy); font-size: clamp(28px, 4vw, 42px); letter-spacing: -.04em; }
.journal-heading p { margin: 10px 0 0; max-width: 720px; color: var(--muted); line-height: 1.7; }
.journal-create { min-height: 36px; background: var(--teal); color: #fff; }
.journal-create:hover { background: #095f59; }
.journal-overview-toggle { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 9px 13px; color: #40616d; background: #e9eff0; box-shadow: none; }
.journal-overview-toggle:hover { color: var(--navy); background: #dde7e8; }
.journal-overview-toggle i { font-size: 15px; }
.journal-balance-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.journal-balance-grid article { padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 7px 22px rgba(22,53,66,.04); }
.journal-balance-grid article.pending { background: #fffaf0; border-color: #ecd8ae; }
.journal-balance-grid span, .journal-balance-grid strong, .journal-balance-grid small { display: block; }
.journal-balance-grid span { color: var(--muted); font-size: 12px; font-weight: 700; }
.journal-balance-grid strong { margin: 12px 0 7px; color: var(--navy); font-size: 25px; font-variant-numeric: tabular-nums; }
.journal-balance-grid strong b { display: block; font-size: 18px; line-height: 1.35; white-space: nowrap; }
.journal-balance-grid strong b + b { margin-top: 3px; }
.journal-balance-grid small { color: #89979e; font-size: 11px; }
.journal-account-overview { display: grid; gap: 14px; }
.journal-fund-overview {
  display: grid; grid-template-columns: 1.35fr repeat(3, minmax(0, 1fr)); min-height: 92px;
  border: 1px solid #d7e1e4; background: #fff; box-shadow: 0 6px 18px rgba(22,53,66,.025);
}
.journal-fund-overview-total, .journal-fund-overview-item { min-width: 0; min-height: 112px; padding: 18px 20px; }
.journal-fund-overview-total { display: grid; align-content: center; }
.journal-fund-overview-total > span { margin-bottom: 8px; color: var(--navy); font-size: 13px; font-weight: 850; }
.journal-fund-overview-total strong, .journal-fund-overview-item strong { display: grid; gap: 2px; color: var(--navy); font-variant-numeric: tabular-nums; }
.journal-fund-overview-total strong b { display: block; font-size: 19px; line-height: 1.2; white-space: nowrap; }
.journal-fund-overview-total strong b + b { color: #657887; font-size: 14px; }
.journal-fund-overview-item { display: flex; align-items: center; gap: 13px; border-left: 1px solid #dce5e7; }
.journal-fund-overview-item > i { flex: 0 0 40px; color: var(--teal); font-size: 35px; }
.journal-fund-overview-bank > i { color: #1670bf; }
.journal-fund-overview-pending > i { color: #d5962e; }
.journal-fund-overview-item > span { min-width: 0; }
.journal-fund-overview-item small { display: block; margin-bottom: 6px; color: #445e69; font-size: 12px; font-weight: 800; }
.journal-fund-overview-item strong b { display: block; overflow: hidden; font-size: 14px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.journal-account-groups {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 0; min-width: 0;
  overflow: hidden; border: 1px solid #d5e0e3; background: #fff; box-shadow: 0 8px 24px rgba(22,53,66,.04);
}
.journal-account-group { min-width: 0; display: flex; flex-direction: column; background: #fff; }
.journal-account-group + .journal-account-group { border-left: 1px solid #d8e2e4; }
.journal-account-group-other {
  grid-column: 1 / -1; display: grid; grid-template-columns: minmax(360px, 1.35fr) minmax(0, 4fr) auto;
  align-items: stretch; border-top: 1px solid #d8e2e4; border-left: 0 !important;
}
.journal-account-group-other > header { border-right: 1px solid #dce5e7; border-bottom: 0; }
.journal-account-groups.has-expanded-group { grid-template-columns: 1fr; }
.journal-account-groups.has-expanded-group .journal-account-group { grid-column: 1; border-left: 0; }
.journal-account-groups.has-expanded-group .journal-account-group + .journal-account-group { border-top: 1px solid #d8e2e4; }
.journal-account-group > header { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 14px; border-bottom: 1px solid #dce5e7; }
.journal-account-group-title { display: flex; align-items: center; min-width: 0; gap: 8px; }
.journal-account-group-title > i { color: var(--teal); font-size: 23px; }
.journal-account-group-bank .journal-account-group-title > i { color: #1670bf; }
.journal-account-group-title > strong { color: var(--navy); font-size: 13px; }
.journal-account-group-title > b { min-width: 22px; padding: 2px 6px; border-radius: 999px; color: var(--teal); background: #def1ed; text-align: center; font-size: 9px; }
.journal-account-group-bank .journal-account-group-title > b { color: #166bb0; background: #e4f0fb; }
.journal-account-group-total { display: grid; justify-items: end; gap: 1px; color: var(--teal); font-variant-numeric: tabular-nums; }
.journal-account-group-bank .journal-account-group-total { color: #166bb0; }
.journal-account-group-total b { display: block; font-size: 13px; line-height: 1.2; white-space: nowrap; }
.journal-account-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; }
.journal-account-group-other .journal-account-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.journal-account-group-other .journal-account-row { min-height: 52px; border-bottom: 0; }
.journal-account-row {
  position: relative; width: 100%; min-width: 0; min-height: 50px; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center; gap: 8px; padding: 6px 12px; border: 0; border-bottom: 1px solid #e1e8ea;
  color: inherit; background: #fff; text-align: left; transition: background .16s ease, box-shadow .16s ease;
}
.journal-account-list .journal-account-row:nth-child(odd) { border-right: 1px solid #e1e8ea; }
.journal-account-group-other .journal-account-row:not(:nth-child(4n)) { border-right: 1px solid #e1e8ea; }
.journal-account-group-other .journal-account-row:nth-child(4n) { border-right: 0; }
.journal-account-groups.has-expanded-group .journal-account-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.journal-account-groups.has-expanded-group .journal-account-row:not(:nth-child(4n)) { border-right: 1px solid #e1e8ea; }
.journal-account-groups.has-expanded-group .journal-account-row:nth-child(4n) { border-right: 0; }
.journal-account-row:hover { background: #f5faf9; }
.journal-account-row:focus-visible { z-index: 1; outline: 3px solid #8fc9c0; outline-offset: -3px; }
.journal-account-row.selected { background: #f0f8f6; box-shadow: inset 4px 0 0 #159888; }
.journal-account-row-icon { width: 26px; height: 26px; display: grid; place-items: center; color: #31586d; font-size: 23px; }
.journal-account-row-name, .journal-account-row-name strong, .journal-account-row-name small { display: block; min-width: 0; }
.journal-account-row-name strong, .journal-account-row-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.journal-account-row-name strong { color: var(--navy); font-size: 12px; }
.journal-account-row-name small { margin-top: 1px; color: #71838e; font-size: 9px; }
.journal-account-row-amount { display: grid; justify-items: end; gap: 1px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.journal-account-row-amount small { color: #728491; font-size: 8px; }
.journal-account-row-amount strong { min-width: 68px; color: var(--navy); text-align: right; font-size: 11px; }
.journal-account-group > footer { min-height: 30px; display: flex; align-items: center; margin-top: auto; padding: 0 14px; color: #66808a; font-size: 9px; font-weight: 800; }
.journal-account-group-other > footer { min-height: 52px; margin: 0; border-left: 1px solid #e1e8ea; }
.journal-account-group-other > footer:has(> span) { display: none; }
.journal-account-group > footer button { display: inline-flex; align-items: center; gap: 7px; padding: 0; border: 0; color: var(--teal); background: transparent; font-size: 9px; font-weight: 850; }
.journal-account-group > footer button:hover { color: #075f58; }
.journal-selected-account {
  min-height: 65px; display: grid; grid-template-columns: minmax(230px, 1.35fr) 2.7fr auto; align-items: center;
  border: 1px solid #82c9bf; border-radius: 4px; background: #f7fcfb; overflow: hidden;
}
.journal-selected-identity { min-width: 0; display: flex; align-items: center; gap: 10px; padding: 9px 16px; }
.journal-selected-icon { flex: 0 0 44px; width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid #8fc9c0; border-radius: 50%; color: #31586d; font-size: 27px; background: #fff; }
.journal-selected-identity > span:last-child, .journal-selected-identity strong, .journal-selected-identity small { display: block; min-width: 0; }
.journal-selected-identity strong, .journal-selected-identity small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.journal-selected-identity strong { color: var(--navy); font-size: 13px; }
.journal-selected-identity small { margin-top: 4px; color: #637a87; font-size: 9px; }
.journal-selected-metrics { min-width: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.journal-selected-metric { min-width: 0; min-height: 48px; display: grid; align-content: center; gap: 3px; padding: 3px 13px; border: 0; border-left: 1px solid #cddcdd; color: inherit; background: transparent; text-align: center; }
button.journal-selected-metric:hover, button.journal-selected-metric.active { background: #e3f3f0; }
.journal-selected-metric span, .journal-selected-metric strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.journal-selected-metric span { color: #6a7f89; font-size: 10px; font-weight: 750; }
.journal-selected-metric strong { color: var(--navy); font-size: 13px; font-variant-numeric: tabular-nums; }
.journal-selected-detail { display: inline-flex; align-items: center; gap: 7px; height: 74px; padding: 0 18px; border: 0; color: #08766d; background: transparent; font-size: 10px; font-weight: 850; white-space: nowrap; }
.journal-selected-detail:hover { background: #e4f4f1; }
.journal-account-overview-loading { grid-column: 1 / -1; padding: 38px; border: 1px dashed #c9d8da; border-radius: 15px; color: var(--muted); background: #fff; text-align: center; font-size: 12px; }
.journal-interactive-filter { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -4px 0 12px; padding: 8px 10px; border-radius: 9px; color: #285d58; background: #e5f3f0; font-size: 11px; }
.journal-interactive-filter button { border: 0; border-radius: 7px; padding: 5px 8px; color: #166f67; background: #fff; font-size: 10px; font-weight: 800; }
.journal-ledger-panel { padding: 0; overflow: hidden; }
.journal-filter-pills { display: inline-flex; gap: 4px; padding: 4px; border-radius: 10px; background: #edf2f3; }
.journal-filter-pills button { border: 0; border-radius: 7px; padding: 7px 12px; color: var(--muted); background: transparent; font-size: 12px; }
.journal-filter-pills button.active { color: #fff; background: var(--navy); }
.journal-preview-table { border-top: 1px solid var(--line); }
.journal-preview-row { display: grid; grid-template-columns: 110px 140px 1.2fr 1fr 1fr 130px 90px; gap: 12px; align-items: center; min-width: 860px; padding: 12px 22px; }
.journal-preview-row.head { color: #667b85; background: #f3f7f6; font-size: 11px; font-weight: 800; }
.journal-empty-state { padding: 58px 24px 64px; text-align: center; }
.journal-empty-state b { color: var(--navy); font-size: 16px; }
.journal-empty-state p { max-width: 560px; margin: 10px auto 0; color: var(--muted); line-height: 1.7; font-size: 13px; }
.hero-panel, .report-banner {
  min-height: 190px; background: linear-gradient(135deg, #173b4e 0%, #245769 72%, #2c6972 100%);
  color: #fff; border-radius: 20px; padding: 32px 34px; display: flex; align-items: center; justify-content: space-between; gap: 24px;
  box-shadow: var(--shadow); overflow: hidden; position: relative;
}
.hero-panel::after, .report-banner::after {
  content: ""; position: absolute; width: 220px; height: 220px; border: 1px solid rgba(255,255,255,.15);
  border-radius: 50%; right: -55px; top: -90px; box-shadow: 0 0 0 38px rgba(255,255,255,.035);
}
.hero-panel .section-label, .report-banner .section-label { color: #9edbd0; }
.hero-panel h2, .report-banner h2 { margin: 0 0 10px; font-size: 27px; }
.hero-panel p, .report-banner p { margin: 0; max-width: 650px; color: #d6e4e8; line-height: 1.75; }
.primary-button, .secondary-button {
  border: 0; border-radius: 10px; padding: 12px 18px; font-weight: 700; white-space: nowrap;
}
.primary-button { background: #d8eee7; color: #16443f; box-shadow: 0 8px 18px rgba(0,0,0,.12); position: relative; z-index: 1; }
.primary-button:hover { background: #c6e6dd; transform: translateY(-1px); }
.primary-button.small { padding: 10px 14px; }
.secondary-button { background: #eef2f3; color: #526773; }
.disabled { opacity: .6; pointer-events: none; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.metric-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px; min-height: 132px; box-shadow: 0 7px 22px rgba(22,53,66,.04); }
.metric-card.emphasis { border-top: 4px solid var(--teal); }
.metric-card.warning { border-top: 4px solid #d6a14d; }
.metric-card span, .metric-card small, .metric-card strong { display: block; }
.metric-card span { font-size: 12px; color: var(--muted); }
.metric-card strong { margin: 15px 0 8px; font-size: 30px; letter-spacing: -.03em; }
.metric-card strong.textual { font-size: 24px; color: var(--teal); }
.metric-card small { color: #89979e; line-height: 1.4; }

.two-column { display: grid; grid-template-columns: 1.15fr .85fr; gap: 20px; }
.panel { min-width: 0; max-width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 17px; padding: 24px; box-shadow: 0 8px 24px rgba(20,50,64,.04); }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 18px; }
.panel h3, .rule-summary h2 { margin: 0; font-size: 20px; }
.quiet-badge, .count-badge, .pass-badge {
  display: inline-flex; border-radius: 999px; padding: 6px 10px; font-size: 11px; font-weight: 800;
}
.quiet-badge { background: #edf2f4; color: #6b7b84; }
.count-badge { background: var(--amber-soft); color: #99641f; }
.pass-badge { background: var(--teal-soft); color: var(--teal); }
.pass-badge.large { padding: 10px 16px; font-size: 13px; position: relative; z-index: 1; }
.flow-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.flow-list li { display: flex; gap: 12px; padding: 13px; border-radius: 12px; background: #f6f8f7; }
.flow-list li > b { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: #dcece8; color: var(--teal); }
.flow-list strong, .flow-list small { display: block; }
.flow-list strong { font-size: 13px; }
.flow-list small { margin-top: 4px; color: var(--muted); line-height: 1.4; }
.check-list { margin: 0; }
.check-list div { display: flex; justify-content: space-between; gap: 20px; padding: 13px 0; border-top: 1px solid #edf1f2; }
.check-list dt { color: var(--muted); }
.check-list dd { margin: 0; text-align: right; font-weight: 700; }

.message {
  position: fixed; z-index: 120; top: 18px; right: 22px; width: min(460px, calc(100vw - 32px));
  margin: 0; padding: 12px 15px; border-radius: 10px; display: flex; justify-content: space-between; align-items: center;
  box-shadow: 0 12px 34px rgba(19, 46, 57, .18);
}
.message.success { background: var(--teal-soft); color: #175c56; }
.message.error { background: #f9e4e1; color: #963f3a; }
.message button { background: transparent; border: 0; font-size: 20px; color: inherit; }

.upload-panel { background: #fff; border: 1px dashed #a9bdc4; border-radius: 20px; padding: 50px 30px; text-align: center; }
.upload-symbol { width: 54px; height: 54px; margin: 0 auto 18px; border-radius: 16px; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal); font-size: 28px; }
.upload-panel h2 { margin: 0 0 10px; font-size: 25px; }
.upload-panel p { max-width: 580px; margin: 0 auto 22px; color: var(--muted); line-height: 1.7; }
.upload-panel label { display: inline-block; }
.upload-panel input { display: none; }
.upload-panel > small { display: block; color: #89979e; margin-top: 15px; }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { text-align: left; color: #6e7e87; font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 13px 12px; border-bottom: 1px solid #edf1f2; vertical-align: top; }
tbody tr:hover { background: #fafcfc; }
.empty-cell { text-align: center; padding: 35px; color: #89979e; }
code { background: #edf2f3; padding: 3px 6px; border-radius: 5px; color: var(--navy); }
.compact { max-height: 450px; }

.rule-summary { display: flex; justify-content: space-between; align-items: end; gap: 24px; padding: 6px 2px 2px; }
.rule-summary p { color: var(--muted); margin: 8px 0 0; }
.rule-search { min-width: 310px; }
.rule-search label { display: block; margin-bottom: 7px; font-size: 11px; font-weight: 700; color: var(--muted); }
.rule-search input { width: 100%; border: 1px solid #cfdade; border-radius: 9px; padding: 11px 12px; background: #fff; outline: none; }
.rule-search input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px #dff0ec; }
.rule-search small { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.candidate-list { display: grid; gap: 14px; }
.candidate-card { background: #fff; border: 1px solid var(--line); border-left: 4px solid #d29a47; border-radius: 15px; padding: 22px; box-shadow: 0 6px 22px rgba(20,50,64,.04); }
.candidate-top { display: flex; justify-content: space-between; gap: 25px; }
.candidate-top h3 { margin: 8px 0 6px; font-size: 18px; }
.candidate-top p { margin: 0; color: var(--muted); }
.confidence { border-radius: 999px; padding: 4px 8px; font-size: 10px; font-weight: 800; }
.confidence.high { background: var(--teal-soft); color: var(--teal); }
.confidence.medium { background: var(--amber-soft); color: #98651f; }
.confidence.low { background: #f2e6e4; color: #994b45; }
.impact { min-width: 150px; text-align: right; }
.impact span, .impact small, .impact strong { display: block; }
.impact span, .impact small { color: var(--muted); font-size: 11px; }
.impact strong { margin: 4px 0; font-size: 20px; }
.evidence-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.evidence-grid div { padding: 12px; border-radius: 10px; background: #f5f8f7; }
.evidence-grid span, .evidence-grid b { display: block; }
.evidence-grid span { color: var(--muted); font-size: 10px; margin-bottom: 5px; }
.evidence-grid b { font-size: 12px; }
.sample-box { margin-top: 12px; padding: 12px 14px; border-left: 3px solid #bdd5d2; background: #f8faf9; }
.sample-box span { color: var(--muted); font-size: 10px; font-weight: 800; }
.sample-box p { margin: 4px 0 0; line-height: 1.55; font-size: 12px; }
.card-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.edit-grid { margin-top: 16px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.edit-grid label { color: var(--muted); font-size: 10px; font-weight: 700; }
.edit-grid input {
  width: 100%; margin-top: 6px; border: 1px solid #cfdade; border-radius: 8px;
  padding: 9px 10px; background: #fff; color: var(--ink); outline: none;
}
.edit-grid input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px #dff0ec; }

.report-banner { min-height: 165px; }
.roadmap h3 { font-size: 22px; margin: 0 0 20px; }
.roadmap-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.roadmap-grid div { border-top: 3px solid #bfd5d2; padding: 18px 4px 0; }
.roadmap-grid b { color: var(--teal); font-size: 11px; }
.roadmap-grid strong { display: block; margin: 9px 0 6px; }
.roadmap-grid p { color: var(--muted); font-size: 12px; line-height: 1.55; margin: 0; }

.budget-banner { min-height: 150px; padding: 27px 30px; border-radius: 20px; color: #fff; background: linear-gradient(128deg,#183c50,#1f6570 65%,#267a70); display:flex; align-items:center; justify-content:space-between; gap:28px; box-shadow:var(--shadow); }
.budget-banner .section-label { color:#a9e2d7; }
.budget-banner h2 { margin:0 0 9px; font-size:27px; }
.budget-banner p { margin:0; max-width:760px; color:#d9e9ea; line-height:1.65; }
.budget-version { flex:0 0 225px; padding:17px 19px; border:1px solid rgba(255,255,255,.22); border-radius:14px; background:rgba(255,255,255,.08); }
.budget-version span,.budget-version strong,.budget-version small { display:block; }
.budget-version span,.budget-version small { color:#c4dcde; font-size:11px; }
.budget-version strong { margin:7px 0 5px; font-size:18px; }
.budget-filter-grid { display:grid; grid-template-columns:170px minmax(260px,1fr) minmax(260px,1fr); gap:14px; align-items:end; }
.budget-filter-grid > label,.budget-filter-grid legend { color:var(--muted); font-size:10px; font-weight:750; }
.budget-filter-grid select { width:100%; min-height:40px; margin-top:7px; padding:8px 10px; border:1px solid #cad7db; border-radius:9px; background:#fff; }
.budget-filter-grid fieldset { min-width:0; margin:0; padding:0; border:0; }
.budget-checks { display:flex; flex-wrap:wrap; gap:6px; margin-top:7px; }
.budget-checks label { display:flex; align-items:center; gap:5px; min-height:36px; padding:7px 9px; border:1px solid #d3dfe2; border-radius:9px; background:#f9fbfa; font-size:10px; font-weight:700; }
.budget-checks input { margin:0; accent-color:var(--teal); }
.budget-note { margin:7px 0 0; color:var(--muted); font-size:12px; }
.budget-report-panel { padding:22px 0 0; overflow:hidden; }
.budget-report-panel > .panel-heading { padding:0 24px; }
.budget-table-wrap { max-height:66vh; min-height:360px; border-top:1px solid var(--line); }
.budget-table { min-width:1360px; font-variant-numeric:tabular-nums; }
.budget-table th { position:sticky; top:0; z-index:3; text-align:right; background:#f0f5f5; color:#355260; }
.budget-table td { text-align:right; vertical-align:middle; white-space:nowrap; }
.budget-table .budget-subject { position:sticky; left:0; z-index:2; min-width:310px; text-align:left; background:#fff; box-shadow:1px 0 0 var(--line); }
.budget-table th.budget-subject { z-index:4; background:#e8f0f1; }
.budget-total-row td,.budget-total-row td.budget-subject { background:#e9f4f2; font-weight:800; }
.budget-table .net-row td,.budget-table .net-row td.budget-subject { background:#dfeaec; border-top:2px solid #9fb9c0; font-weight:850; }
@media (max-width:1050px) { .budget-filter-grid { grid-template-columns:1fr 1fr; } }
@media (max-width:720px) { .budget-banner { align-items:flex-start; flex-direction:column; } .budget-version { width:100%; flex-basis:auto; } .budget-filter-grid { grid-template-columns:1fr; } }
.text-button { border: 0; background: transparent; color: var(--teal); font-weight: 750; padding: 7px 0; }
.text-button:hover { text-decoration: underline; }
.filter-panel { padding-bottom: 20px; }
.filter-grid { display: grid; grid-template-columns: repeat(6, minmax(120px, 1fr)); align-items: end; gap: 12px; }
.filter-grid label, .filter-field { color: var(--muted); font-size: 10px; font-weight: 750; }
.filter-grid input, .filter-grid select {
  display: block; width: 100%; min-height: 40px; margin-top: 7px; padding: 8px 10px;
  color: var(--ink); border: 1px solid #cad7db; border-radius: 9px; background: #fff; outline: none;
}
.filter-grid input:focus, .filter-grid select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px #dff0ec; }
.multi-select { position: relative; margin-top: 7px; }
.multi-select-trigger {
  width: 100%; min-height: 40px; padding: 8px 30px 8px 10px; overflow: hidden; text-align: left;
  color: var(--ink); white-space: nowrap; text-overflow: ellipsis; border: 1px solid #cad7db;
  border-radius: 9px; background: #fff; position: relative;
}
.multi-select-trigger::after { content: "⌄"; position: absolute; right: 10px; top: 9px; color: #54717d; }
.multi-select-trigger:focus, .multi-select-trigger.has-selection { border-color: var(--teal); box-shadow: 0 0 0 3px #dff0ec; }
.multi-select-menu {
  position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; min-width: 220px; width: max-content;
  max-width: 320px; padding: 7px; border: 1px solid #cad7db; border-radius: 10px; background: #fff;
  box-shadow: 0 14px 30px rgba(18,53,69,.16);
}
.multi-select-all { width: 100%; padding: 8px 9px; text-align: left; color: var(--teal); border: 0; border-radius: 7px; background: #edf7f4; font-size: 11px; font-weight: 750; }
.multi-select-options { max-height: 260px; margin-top: 5px; overflow-y: auto; }
.multi-select-option { display: flex; align-items: center; gap: 8px; min-width: 200px; padding: 7px 8px; border-radius: 7px; color: var(--ink) !important; font-size: 11px !important; cursor: pointer; }
.multi-select-option:hover { background: #f2f7f6; }
.multi-select-option input { width: 15px !important; min-height: 15px !important; margin: 0 !important; padding: 0 !important; accent-color: var(--teal); box-shadow: none !important; }
.auto-refresh-note { min-height: 24px; display:flex; align-items:center; gap:7px; color:var(--teal); font-size:10px; font-weight:750; }
.auto-refresh-note::before { content:""; width:7px; height:7px; border-radius:50%; background:#33b388; box-shadow:0 0 0 3px #dff0ec; }
.report-table-heading { align-items: center; }
.report-table-heading p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.analysis-tabs { display: inline-flex; padding: 4px; border-radius: 11px; background: #edf2f3; white-space: nowrap; }
.analysis-tabs button { border: 0; border-radius: 8px; padding: 9px 14px; color: #637680; background: transparent; font-size: 12px; font-weight: 750; }
.analysis-tabs button.active { color: #fff; background: var(--navy); box-shadow: 0 4px 10px rgba(19,54,69,.18); }
.report-explainer { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: -2px 0 14px; color: var(--muted); font-size: 11px; }
.report-explainer span::before { content: "\2022"; margin-right: 7px; color: var(--teal); }
.subject-report-panel { padding: 22px 0 0; overflow: hidden; }
.subject-report-panel > .panel-heading { padding: 0 24px; }
.analysis-report-tab { min-width: 0; }
.analysis-report-tab .report-explainer { padding: 0 24px; }
.cash-net-summary { display: grid; grid-template-columns: repeat(3, minmax(210px, 1fr)); gap: 12px; padding: 0 24px 14px; }
.cash-net-summary article { border: 1px solid var(--line); border-radius: 14px; background: #f7faf9; padding: 13px 15px; }
.cash-net-summary article.primary { background: #e8f5f1; border-color: #b9ded3; }
.cash-net-summary span { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.cash-net-summary strong { display: block; margin: 6px 0 4px; color: var(--ink); font-size: 21px; }
.cash-net-summary small { display: block; color: var(--muted); font-size: 11px; line-height: 1.45; }
.cashflow-summary { grid-template-columns: repeat(4, minmax(180px, 1fr)); }
.cashflow-summary .warning-summary { background: #fff8ea; border-color: #efd8a8; }
.cashflow-filter-grid { grid-template-columns: repeat(6, minmax(130px, 1fr)) auto; }
.preview-badge { padding: 7px 11px; border-radius: 999px; background: var(--amber-soft); color: #8e611f; font-size: 11px; font-weight: 800; white-space: nowrap; }
.matrix-report-panel { overflow: hidden; padding: 22px 0 0; border-color: #d4dfe2; box-shadow: 0 12px 34px rgba(25,54,67,.06); }
.matrix-report-panel > .panel-heading { padding: 0 26px; margin-bottom: 14px; }
.cashflow-matrix-wrap {
  position: relative; isolation: isolate; width: 100%; max-width: 100%; height: calc(100dvh - 48px); min-height: 560px; max-height: none;
  overflow: auto; border-top: 1px solid #d6e0e2; background: #fff; overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges; scroll-padding-left: 280px;
}
.cashflow-matrix-wrap { scrollbar-width: thin; scrollbar-color: #9fb0b6 #edf1f2; }
.cashflow-matrix-wrap::-webkit-scrollbar { width: 9px; height: 9px; }
.cashflow-matrix-wrap::-webkit-scrollbar-track { background: #edf1f2; }
.cashflow-matrix-wrap::-webkit-scrollbar-thumb { border: 2px solid #edf1f2; border-radius: 999px; background: #9fb0b6; }
.cashflow-matrix-wrap::-webkit-scrollbar-thumb:hover { background: #7f959d; }
.cashflow-matrix-table { position: relative; width: max-content; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-variant-numeric: tabular-nums; }
.cashflow-matrix-table th, .cashflow-matrix-table td {
  width: 132px; min-width: 132px; max-width: 132px; height: 48px; padding: 8px 12px;
  text-align: right; vertical-align: middle; white-space: nowrap; border-bottom: 1px solid #edf1f2;
}
.cashflow-matrix-table thead th {
  position: sticky; z-index: 12; height: 36px; padding: 7px 10px; text-align: center; vertical-align: middle;
  background: #eef4f3; color: #294b57; border-bottom: 1px solid #d8e3e3; box-shadow: none;
  font-size: 11px; font-weight: 800; letter-spacing: .015em;
}
.cashflow-matrix-table thead tr:first-child th { top: 0; height: 36px; }
.cashflow-matrix-table thead tr:nth-child(2) th { top: 36px; z-index: 13; height: 34px; background: #fafcfc; color: #687c84; border-bottom-color: #cbd9db; font-size: 10px; font-weight: 750; }
.cashflow-matrix-table .matrix-project-header { text-align: center; vertical-align: middle; border-bottom: 2px solid #77a9a1; }
.cashflow-matrix-table .matrix-tone-0, .cashflow-matrix-table .matrix-tone-1 { background-color: transparent; }
.cashflow-matrix-table thead tr:first-child .matrix-tone-0, .cashflow-matrix-table thead tr:first-child .matrix-tone-1 { background-color: #eef4f3; }
.cashflow-matrix-table thead tr:nth-child(2) .matrix-tone-0, .cashflow-matrix-table thead tr:nth-child(2) .matrix-tone-1 { background-color: #fafcfc; }
.cashflow-matrix-table .matrix-group-start { border-left: 1px solid #dbe4e5; }
.cashflow-matrix-table thead tr:first-child .matrix-group-start { border-left-color: #d3dfe0; }
.cashflow-matrix-table .matrix-group-end { border-right: 0; }
.cashflow-matrix-table .matrix-project-summary { background: #f5f8f5; border-left: 1px solid #d2ddcf; color: #35584f; font-weight: 820; }
.cashflow-matrix-table thead .matrix-project-summary { background: #f0f5f1 !important; color: #4d695f; }
.cashflow-matrix-table .matrix-subject-column {
  position: -webkit-sticky !important; position: sticky !important; left: 0 !important; z-index: 30;
  width: 280px; min-width: 280px; max-width: 280px; text-align: left; background: #fff;
  border-right: 1px solid #bdced2; box-shadow: 10px 0 18px -16px rgba(16,48,61,.65);
  background-clip: padding-box; transform: translateZ(0);
}
.cashflow-matrix-table thead .matrix-subject-column { z-index: 40; text-align: left; background: #e3eded; color: #294b57; border-right-color: #bfcfd2; border-bottom: 1px solid #cbd9db; }
.cashflow-matrix-table .matrix-subject-column .tree-node { min-height: 30px; }
.cashflow-matrix-table tbody tr:nth-child(even):not(.depth-0):not(.net-row) td { background-color: #fbfcfc; }
.cashflow-matrix-table .group-row td { font-weight: 650; }
.cashflow-matrix-table .group-row td.matrix-subject-column { background: #fbfcfc; }
.cashflow-matrix-table .depth-0 td { background: #e9f3f0; border-top: 1px solid #c7dad5; border-bottom-color: #c7dad5; font-weight: 820; }
.cashflow-matrix-table .depth-0 td.matrix-subject-column { background: #e3efec; }
.cashflow-matrix-table .net-row td { background: #dfeaec; border-top: 2px solid #789aa4; color: var(--navy); font-weight: 850; }
.cashflow-matrix-table .net-row td.matrix-subject-column { background: #d8e6e9; }
.cashflow-matrix-table .leaf-row:hover td { background: #fffaf0 !important; }
.cashflow-matrix-table .leaf-row:hover td.matrix-subject-column { background: #fff5dd !important; }
.cashflow-matrix-table .matrix-grand-total { background: #edf5ea; color: var(--navy); border-left: 1px solid #c6d7c2; font-weight: 850; }
.cashflow-matrix-table thead .matrix-result-header { z-index: 12; background: #eef1e8; color: #596447; border-bottom: 2px solid #a9b887; }
.cashflow-matrix-table thead .matrix-grand-total { z-index: 14; background: #f4f7ed; color: #596447; border-left-color: #d4ddca; }
.matrix-drill { width: 100%; min-height: 30px; padding: 4px 1px; text-align: right; }
.matrix-adjustment-editor { position: relative; width: 100%; min-height: 32px; padding: 4px 20px 4px 1px; border: 0; border-radius: 7px; background: transparent; color: inherit; text-align: right; font: inherit; font-weight: inherit; }
.matrix-adjustment-editor:hover, .matrix-adjustment-editor:focus-visible { background: #e7f2ef; outline: 2px solid #8dbbb2; outline-offset: -2px; }
.matrix-adjustment-editor .adjustment-edit-mark { position: absolute; right: 4px; top: 50%; translate: 0 -50%; color: #2f7669; font-size: 13px; font-weight: 900; opacity: .45; }
.matrix-adjustment-editor:hover .adjustment-edit-mark, .matrix-adjustment-editor:focus-visible .adjustment-edit-mark { opacity: 1; }
.cashflow-matrix-table .amount-drill span:not(.zero-value) { text-decoration: none; }
.cashflow-matrix-table .amount-drill:hover span:not(.zero-value), .cashflow-matrix-table .amount-drill:focus-visible span:not(.zero-value) { text-decoration: underline; text-underline-offset: 3px; }
.cashflow-matrix-table td > .zero-value { display: inline-block; min-width: 18px; color: #b2bec3; text-align: right; }
.matrix-toolbar { display: flex; align-items: center; flex-wrap: wrap; padding: 0 26px 14px; gap: 10px 22px; }
.matrix-toolbar-section { display: flex; align-items: center; gap: 7px; }
.matrix-toolbar-section > span { margin-right: 2px; color: #71828a; font-size: 11px; font-weight: 750; white-space: nowrap; }
.matrix-toolbar-buttons { display: inline-flex; align-items: center; gap: 5px; }
.matrix-toolbar > small { margin-left: auto; color: #7f9096; font-size: 10px; }
.matrix-toolbar button { padding: 6px 12px; border-color: #d4dfe2; color: #516874; background: #fff; }
.matrix-toolbar button.is-active { border-color: #315d54; color: #fff; background: #315d54; box-shadow: 0 4px 10px rgba(31,78,68,.15); }
.matrix-measure-filter { padding: 5px 7px 5px 10px; border: 1px solid #dbe5e4; border-radius: 12px; background: #f7faf9; }
.matrix-measure-filter .matrix-toolbar-buttons { padding: 3px; border-radius: 9px; background: #e9f0ee; }
.matrix-measure-filter button { border: 0; border-radius: 7px; padding: 6px 13px; background: transparent; }
.tree-level-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; padding: 0 24px 12px; color: var(--muted); font-size: 12px; }
.tree-level-toolbar button { border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); padding: 6px 11px; cursor: pointer; font: inherit; font-weight: 700; }
.tree-level-toolbar button:hover { border-color: var(--teal); color: var(--teal); background: #f0faf7; }
@media (max-width: 900px) { .cash-net-summary { grid-template-columns: 1fr; } }
.subject-table-wrap { max-height: 66vh; min-height: 360px; border-top: 1px solid var(--line); }
.subject-tree-table { min-width: 1900px; font-variant-numeric: tabular-nums; }
.cash-attribution-table { min-width: 1050px; table-layout: fixed; }
.subject-tree-table.cash-attribution-table .subject-column {
  width: 300px;
  min-width: 300px;
  max-width: 300px;
}
.cash-attribution-table th:not(:first-child), .cash-attribution-table td:not(:first-child) { width: auto; }
.cash-attribution-table .tree-label { min-width: 0; overflow: hidden; }
.cash-attribution-table .tree-label b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trend-tree-table { min-width: 980px; }
.subject-tree-table th { position: sticky; top: 0; z-index: 3; background: #f0f5f5; color: #355260; text-align: right; }
.subject-tree-table td { text-align: right; white-space: nowrap; vertical-align: middle; }
.subject-tree-table .subject-column { position: sticky; left: 0; z-index: 2; min-width: 300px; max-width: 390px; text-align: left; background: #fff; box-shadow: 1px 0 0 var(--line); }
.subject-tree-table th.subject-column { z-index: 4; background: #e8f0f1; }
.subject-tree-table .group-row td { background: #f8fbfa; font-weight: 700; }
.subject-tree-table .group-row td.subject-column { background: #f8fbfa; }
.subject-tree-table .depth-0 td { background: #e9f4f2; border-bottom-color: #d0e3df; font-weight: 800; }
.subject-tree-table .depth-0 td.subject-column { background: #e9f4f2; }
.subject-tree-table .net-row td { background: #dfeaec; border-top: 2px solid #9fb9c0; border-bottom-color: #b9ccd1; color: var(--navy); font-weight: 850; }
.subject-tree-table .net-row td.subject-column { background: #dfeaec; }
.subject-tree-table .leaf-row:hover td, .subject-tree-table .leaf-row:hover td.subject-column { background: #fffaf0; }
.tree-node { width: 100%; min-height: 34px; display: flex; align-items: center; gap: 8px; border: 0; background: transparent; color: var(--ink); padding: 4px 6px 4px calc(6px + var(--tree-depth) * 22px); text-align: left; }
.tree-node:hover { color: var(--teal); }
.tree-marker { flex: 0 0 20px; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; background: #dceae7; color: var(--teal); font-size: 15px; font-weight: 800; line-height: 1; }
.tree-node.leaf .tree-marker {
  background: #edf3f2;
  color: #8b9da2;
  font-size: 11px;
  font-weight: 750;
}
.net-row .tree-node.leaf .tree-marker { background: transparent; color: #9aa8ae; font-size: 15px; }
.tree-label { min-width: 0; }
.tree-label b, .tree-label small { display: block; }
.tree-label b { overflow: hidden; text-overflow: ellipsis; }
.tree-label small { margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 500; }
.zero-value { color: #9aa8ae; }
.amount-drill { border: 0; border-radius: 6px; padding: 5px 7px; background: transparent; color: inherit; font: inherit; font-weight: inherit; font-variant-numeric: tabular-nums; }
.amount-drill span:not(.zero-value) { text-decoration: underline dotted #8ca7ad; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.amount-drill:hover, .amount-drill:focus-visible { background: #dff0ec; outline: 1px solid #9acbc2; }
.amount-drill:hover span { color: var(--teal); text-decoration: underline; text-underline-offset: 3px; }
.amount-drill:hover span.negative { color: var(--red); }
.facts-table { min-width: 1600px; }
.cash-attribution-details { min-width: 2350px; }
.analysis-facts-panel { scroll-margin-top: 16px; }
#analysis-facts-panel { padding: 0; overflow: clip; }
#analysis-facts-panel > .panel-heading {
  position: sticky;
  z-index: 12;
  top: 0;
  margin: 0;
  padding: 20px 24px 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 4px 12px rgba(20,50,64,.05);
}
#analysis-facts-panel > .table-wrap {
  width: 100%;
  max-width: 100%;
  min-height: 420px;
  max-height: calc(100vh - 220px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
}
#analysis-facts-panel .facts-table th {
  position: sticky;
  z-index: 6;
  top: 0;
  background: #f0f5f5;
  box-shadow: 0 1px 0 var(--line);
}
.cash-attribution-details .summary-cell { min-width: 260px; max-width: 360px; white-space: normal; line-height: 1.55; }
.trace-chain { max-width: 420px; display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow-wrap: anywhere; }
.attribution-status { display: inline-flex; padding: 4px 7px; border-radius: 999px; background: var(--teal-soft); color: var(--teal); font-size: 10px; font-weight: 800; }
.attribution-status.pending { background: var(--amber-soft); color: #8e611f; }
.secondary-action { background: #edf2f3; color: var(--navy); }
.action-details-table { min-width: 1800px; }
.action-summary-cell { min-width: 340px; max-width: 460px; }
.action-summary-text, .action-source-text {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
}
.action-summary-text { -webkit-line-clamp: 4; }
.action-source-text { -webkit-line-clamp: 2; }
.drill-amount-cell { background: #fff8e8; font-weight: 800; }
.analysis-metrics .metric-card { min-height: 142px; }
.analysis-metrics .metric-card strong { font-size: clamp(22px, 2.2vw, 30px); }
.analysis-metrics .metric-card strong .negative { color: var(--red); }
.drill-heading { align-items: center; }
.segmented { display: inline-flex; padding: 4px; border-radius: 11px; background: #edf2f3; }
.segmented button { border: 0; border-radius: 8px; padding: 8px 12px; color: #637680; background: transparent; font-size: 12px; font-weight: 750; }
.segmented button.active { color: #fff; background: var(--navy); box-shadow: 0 4px 10px rgba(19,54,69,.18); }
.breadcrumb { display: flex; align-items: center; gap: 8px; min-height: 38px; margin: -4px 0 12px; overflow-x: auto; }
.breadcrumb button { border: 1px solid #d9e2e5; border-radius: 9px; padding: 7px 10px; background: #f8faf9; color: var(--navy); white-space: nowrap; font-size: 12px; }
.breadcrumb button:hover { border-color: #9bc2bb; }
.breadcrumb button small { margin-right: 6px; color: var(--muted); }
.breadcrumb span { color: #9eabb1; }
.analysis-table-wrap { min-height: 250px; }
.analysis-table td { vertical-align: middle; }
.analysis-table th:not(:first-child), .analysis-table td:not(:first-child) { text-align: right; }
.drill-link { border: 0; background: transparent; color: var(--ink); padding: 0; text-align: left; }
.drill-link span, .drill-link small { display: block; }
.drill-link span { font-weight: 800; }
.drill-link small, .cell-note { margin-top: 4px; color: var(--muted); font-size: 10px; }
.cell-note { display: block; line-height: 1.45; }
.table-action { border: 0; border-radius: 8px; padding: 7px 10px; background: var(--teal-soft); color: var(--teal); font-size: 11px; font-weight: 800; white-space: nowrap; }
.table-action:hover { background: #cce8e1; }
.negative { color: var(--red); }
.modal-open { overflow: hidden; }
.modal { position: fixed; z-index: 1000; inset: 0; display: grid; grid-template-columns: minmax(40px, 1fr) minmax(720px, 76vw); }
.modal-backdrop { background: rgba(12,32,43,.48); backdrop-filter: blur(2px); }
.voucher-drawer { height: 100vh; overflow: auto; background: #fff; padding: 28px 30px 42px; box-shadow: -20px 0 50px rgba(12,32,43,.2); }
.voucher-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 22px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.voucher-header h2 { margin: 0; font-size: 26px; }
.voucher-header p { margin: 7px 0 0; color: var(--muted); }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: #f6f8f8; color: var(--ink); font-size: 24px; line-height: 1; }
.voucher-balance { display: flex; gap: 12px; margin: 18px 0; }
.voucher-balance span { min-width: 160px; padding: 12px 14px; border-radius: 11px; background: #f2f6f5; color: var(--muted); font-size: 11px; }
.voucher-balance strong { display: block; margin-top: 5px; color: var(--ink); font-size: 17px; }
.voucher-table-wrap { max-height: calc(100vh - 190px); }
.voucher-table-wrap table { min-width: 1050px; }
.voucher-table-wrap th { position: sticky; top: 0; z-index: 1; background: #fff; }
.adjustment-drawer { padding-bottom: 50px; }
.management-adjustment-form { margin-top: 20px; padding: 18px; border: 1px solid #d9e4e3; border-radius: 15px; background: #f8faf9; }
.adjustment-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.management-adjustment-form label { display: grid; gap: 7px; color: #62747c; font-size: 11px; font-weight: 800; }
.management-adjustment-form input, .management-adjustment-form select, .management-adjustment-form textarea { width: 100%; border: 1px solid #cbd8db; border-radius: 9px; padding: 10px 11px; background: #fff; color: var(--ink); font: inherit; }
.management-adjustment-form input[readonly] { background: #eef3f2; color: #526971; }
.management-adjustment-form input:focus, .management-adjustment-form select:focus, .management-adjustment-form textarea:focus { border-color: var(--teal); outline: 0; box-shadow: 0 0 0 3px #dff0ec; }
.adjustment-wide-field { margin-top: 14px; }
.adjustment-form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 16px; }
.adjustment-form-actions .secondary-button, .adjustment-form-actions .primary-button { min-width: 110px; }
.adjustment-records { margin-top: 24px; }
.adjustment-records-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 10px; }
.adjustment-records-heading h3 { margin: 3px 0 0; }
.adjustment-record-list { display: grid; gap: 9px; }
.adjustment-record { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 14px; padding: 14px 15px; border: 1px solid #dce5e6; border-radius: 12px; background: #fff; }
.adjustment-record strong, .adjustment-record small { display: block; }
.adjustment-record small { margin-top: 5px; color: var(--muted); line-height: 1.45; }
.adjustment-record-amount { text-align: right; font-weight: 850; }
.adjustment-record-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 8px; }
.adjustment-record-actions button { border: 0; border-radius: 7px; padding: 6px 9px; background: var(--teal-soft); color: var(--teal); font-size: 10px; font-weight: 800; }
.adjustment-record-actions button.danger { background: #fbe9e6; color: #a7483f; }
.summary-cell { min-width: 280px; max-width: 430px; line-height: 1.5; }
.aux-cell { min-width: 260px; max-width: 380px; line-height: 1.5; }

.journal-ledger-toolbar { padding: 12px 14px; border-bottom: 1px solid var(--line); background: #fff; }
.journal-transfer-inbox { overflow: hidden; border: 1px solid #e4c879; border-radius: 14px; background: #fffaf0; box-shadow: 0 8px 22px rgba(100,75,20,.07); }
.journal-transfer-inbox > header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 16px; border-bottom: 1px solid #ead9aa; }
.journal-transfer-inbox h2 { display: flex; align-items: center; gap: 8px; margin: 2px 0 3px; font-size: 17px; }
.journal-transfer-inbox h2 b { padding: 3px 7px; border-radius: 999px; color: #815d10; background: #f7e8bd; font-size: 9px; }
.journal-transfer-inbox header p { margin: 0; color: #756640; font-size: 10px; }
.journal-transfer-inbox-summary { flex: 0 0 auto; text-align: right; }
.journal-transfer-inbox-summary span { display: block; color: #806b36; font-size: 9px; font-weight: 800; }
.journal-transfer-inbox-summary strong { display: flex; flex-direction: column; margin-top: 3px; color: #17394a; font-size: 12px; }
.journal-transfer-inbox-items { display: grid; max-height: 250px; overflow: auto; }
.journal-transfer-inbox-item { display: grid; grid-template-columns: 92px minmax(290px, 1.4fr) 118px minmax(160px, 1fr) auto; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid #eee2c1; }
.journal-transfer-inbox-item:last-child { border-bottom: 0; }
.journal-transfer-inbox-date span, .journal-transfer-inbox-route small { display: block; color: #7d704c; font-size: 9px; }
.journal-transfer-inbox-date strong, .journal-transfer-inbox-route b { color: #17394a; font-size: 11px; }
.journal-transfer-inbox-route { display: grid; grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr); align-items: center; gap: 8px; min-width: 0; }
.journal-transfer-inbox-route span { min-width: 0; }
.journal-transfer-inbox-route b, .journal-transfer-inbox-route small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.journal-transfer-inbox-route i { color: #a47e24; }
.journal-transfer-inbox-amount { color: #17394a; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.journal-transfer-inbox-item > p { overflow: hidden; margin: 0; color: #5e6d70; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.journal-transfer-inbox-actions { display: flex; gap: 6px; }
.journal-transfer-inbox-actions button { min-height: 32px; padding: 6px 9px; box-shadow: none; font-size: 10px; }
.journal-filters { display: grid; grid-template-columns: repeat(5, minmax(108px, .7fr)) minmax(190px, 1.35fr) auto; gap: 8px; align-items: end; }
.journal-filters label, .journal-form label, .allocation-line label { display: grid; gap: 6px; color: #62747c; font-size: 11px; font-weight: 800; }
.journal-filters input, .journal-filters select, .journal-form input, .journal-form select, .journal-form textarea, .allocation-line input, .allocation-line select {
  width: 100%; min-width: 0; border: 1px solid #cbd8db; border-radius: 8px; padding: 8px 9px; background: #fff; color: var(--ink); font: inherit;
}
.journal-filters input:focus, .journal-filters select:focus, .journal-form input:focus, .journal-form select:focus, .journal-form textarea:focus, .allocation-line input:focus, .allocation-line select:focus { border-color: var(--teal); outline: 0; box-shadow: 0 0 0 3px #dff0ec; }
.journal-filter-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-height: 36px; white-space: nowrap; }
.journal-filter-actions .quiet-badge { padding: 5px 8px; font-size: 10px; }
.journal-filter-actions .primary-button, .journal-filter-actions .secondary-button { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 8px 11px; border-radius: 8px; box-shadow: none; font-size: 11px; }
.journal-filter-actions .journal-create { color: #fff; background: #075268; }
.journal-filter-actions .journal-create:hover { color: #fff; background: #063f51; transform: none; }
.journal-filter-actions i { font-size: 14px; }
.journal-table-wrap { max-height: calc(100vh - 240px); min-height: 360px; }
.journal-pagination {
  min-height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 9px 12px; border-top: 1px solid #dbe6e6; background: #fbfcfc;
}
.journal-page-summary { color: #687b83; font-size: 10px; font-weight: 750; white-space: nowrap; }
.journal-page-tools, .journal-page-nav, .journal-page-numbers, .journal-page-size { display: inline-flex; align-items: center; }
.journal-page-tools { gap: 12px; }
.journal-page-size { gap: 5px; color: #687b83; font-size: 10px; font-weight: 750; white-space: nowrap; }
.journal-page-size select { width: 68px; min-height: 30px; padding: 5px 22px 5px 9px; border-radius: 7px; font-size: 10px; font-variant-numeric: tabular-nums; }
.journal-page-nav, .journal-page-numbers { gap: 4px; }
.journal-page-nav button {
  min-width: 30px; min-height: 30px; padding: 5px 8px; border: 1px solid #d8e3e4; border-radius: 7px;
  color: #536b74; background: #fff; font-size: 10px; font-weight: 800; box-shadow: none;
}
.journal-page-nav > button { min-width: 52px; }
.journal-page-nav button:hover, .journal-page-nav button:focus-visible { color: var(--teal); border-color: #9fc8c2; background: #eef8f5; outline: 0; }
.journal-page-nav button.active { color: #fff; border-color: var(--teal); background: var(--teal); }
.journal-page-nav button:disabled { cursor: default; opacity: .42; color: #7b8c92; border-color: #dfe7e8; background: #eef2f3; }
.journal-page-ellipsis { display: inline-grid; width: 22px; min-height: 30px; place-items: center; color: #8a989d; font-size: 11px; }
.journal-table { min-width: 1000px; table-layout: fixed; font-variant-numeric: tabular-nums; }
.journal-col-date { width: 90px; }
.journal-col-scope { width: 108px; }
.journal-col-category { width: 120px; }
.journal-col-account { width: 145px; }
.journal-col-amount { width: 122px; }
.journal-col-allocation { width: 76px; }
.journal-col-memo { width: 170px; }
.journal-col-status { width: 169px; }
.journal-table th { position: sticky; top: 0; z-index: 2; background: #eef4f3; }
.journal-table th { padding: 9px 8px; }
.journal-table td { padding: 10px 8px; vertical-align: middle; line-height: 1.4; }
.journal-table td:nth-child(2), .journal-table td:nth-child(3), .journal-table td:nth-child(4) { overflow-wrap: anywhere; }
.journal-row { cursor: pointer; }
.journal-row:hover td { background: #fffaf0; }
.journal-row:focus-visible { outline: 3px solid #8fc4ba; outline-offset: -3px; }
.journal-row.is-void { opacity: .6; }
.journal-row.is-void td { text-decoration-color: #b9c3c6; }
.journal-row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.journal-row-actions .status-badge { margin: 0; }
.journal-transfer-status { display: inline-flex; min-height: 24px; align-items: center; padding: 4px 7px; border-radius: 999px; color: #7d5b11; background: #fff0c9; font-size: 9px; font-weight: 850; white-space: nowrap; }
.journal-transfer-status.confirmed { color: var(--teal); background: var(--teal-soft); }
.journal-transfer-status.rejected { color: #a7483f; background: #fbe9e6; }
.journal-row-action {
  display: inline-flex; align-items: center; justify-content: center; min-height: 25px; padding: 4px 7px;
  border: 0; border-radius: 7px; color: var(--teal); background: var(--teal-soft);
  font-size: 9px; font-weight: 850;
}
.journal-row-action:hover, .journal-row-action:focus-visible { color: #fff; background: var(--teal); outline: 0; }
.journal-row-action.void { color: #a7483f; background: #fbe9e6; }
.journal-row-action.void:hover, .journal-row-action.void:focus-visible { color: #fff; background: #ad4c43; }
.journal-row-action.confirm { color: #fff; background: var(--teal); }
.journal-row-action.reject { color: #8a651a; background: #fff0c9; }
.journal-row-action.reject:hover, .journal-row-action.reject:focus-visible { color: #fff; background: #946c17; }
#journal-void-modal, #journal-transfer-review-modal, #change-password-modal { grid-template-columns: 1fr; place-items: center; padding: 20px; }
#journal-void-modal .modal-backdrop, #journal-transfer-review-modal .modal-backdrop, #change-password-modal .modal-backdrop { position: absolute; inset: 0; }
.journal-void-dialog {
  position: relative; z-index: 1; width: min(440px, calc(100vw - 32px)); padding: 22px;
  border-radius: 16px; background: #fff; box-shadow: 0 24px 70px rgba(12,32,43,.28);
}
.journal-void-dialog header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.journal-void-dialog h2 { margin: 3px 0 4px; font-size: 23px; }
.journal-void-dialog p { margin: 0; color: var(--muted); font-size: 12px; }
.journal-void-dialog form { display: grid; gap: 16px; padding-top: 16px; }
.journal-void-dialog label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 800; }
.journal-void-dialog textarea { min-height: 90px; resize: vertical; }
.journal-transfer-review-dialog input, .journal-transfer-review-dialog textarea { width: 100%; border: 1px solid #cbd8db; border-radius: 8px; padding: 9px 10px; background: #fff; color: var(--ink); font: inherit; }
.change-password-dialog input { width: 100%; border: 1px solid #cbd8db; border-radius: 8px; padding: 10px 11px; background: #fff; color: var(--ink); font: inherit; outline: 0; }
.change-password-dialog input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px #dff0ec; }
.journal-transfer-review-note { padding: 9px 10px; border-radius: 9px; color: #596d74 !important; background: #eef5f3; line-height: 1.55; }
.journal-void-actions { display: flex; justify-content: flex-end; gap: 8px; }
.danger-button { border: 1px solid #efc2bc; color: #a7483f; background: #fff3f1; }
.danger-button:hover, .danger-button:focus-visible { color: #fff; background: #ad4c43; border-color: #ad4c43; }
.journal-empty-cell { height: 116px; }
.journal-quick-row > td { height: 54px; padding: 7px 5px; border-bottom: 1px solid #8fc5ba; background: #f3faf8; }
.journal-quick-row > td:first-child { border-left: 4px solid var(--teal); padding-left: 7px; }
.journal-quick-row:hover > td { background: #f5faf8; }
.journal-quick-row input, .journal-quick-row select {
  width: 100%; min-width: 0; height: 36px; padding: 6px 7px; border: 1px solid #c6d6d8;
  border-radius: 7px; color: var(--ink); background: #fff; font: inherit;
}
.journal-quick-row input:focus, .journal-quick-row select:focus { border-color: var(--teal); outline: 0; box-shadow: 0 0 0 2px #dff0ec; }
.journal-quick-pair { display: flex; align-items: center; gap: 5px; min-width: 0; }
.journal-quick-pair > select, .journal-quick-pair > .journal-search-select { flex: 1 1 0; min-width: 0; }
.journal-quick-category-pair select:first-child { flex: 0 0 88px; }
.journal-auto-direction {
  flex: 0 0 auto; display: inline-flex; min-width: 58px; height: 28px; align-items: center; justify-content: center; gap: 3px;
  padding: 4px 7px; border-radius: 999px; color: #a5483f; background: #fbe9e6; font-size: 9px; font-weight: 850; white-space: nowrap;
}
.journal-auto-direction small { font-size: 8px; font-weight: 750; opacity: .72; }
.journal-auto-direction.income { color: var(--teal); background: var(--teal-soft); }
.journal-auto-direction.transfer { color: #496c78; background: #e7f0f2; }
.journal-auto-direction.pending { color: #6f8188; background: #edf2f3; }
.journal-account-transfer-pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: 5px; min-width: 0; }
.journal-account-flow-field { display: grid; min-width: 0; gap: 2px; }
.journal-account-flow-field > small { color: #61757d; font-size: 8px; font-weight: 850; line-height: 1; white-space: nowrap; }
.journal-transfer-arrow { padding-bottom: 10px; color: var(--teal); font-size: 14px; font-weight: 900; }
.journal-quick-row.has-error > td { border-bottom-color: #d96860; background: #fff7f5; }
.journal-quick-row [aria-invalid="true"] { border-color: #c9574f !important; box-shadow: 0 0 0 2px #f9dcd8 !important; }
.journal-quick-error-row td { padding: 0 6px 7px; border-bottom: 1px solid #d96860; background: #fff7f5; }
.journal-quick-error-row div {
  position: sticky; left: 6px; display: flex; align-items: center; gap: 8px; width: max-content;
  max-width: calc(100vw - var(--sidebar-width, 0px) - 90px); min-height: 32px; padding: 6px 10px;
  border-radius: 7px; color: #913d37; background: #f9e4e1; font-size: 10px;
}
.journal-quick-error-row strong { white-space: nowrap; }
.journal-search-select { position: relative; }
.journal-search-select-menu {
  position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; width: max(100%, 210px); max-width: 300px;
  max-height: 190px; overflow: auto; padding: 4px; border: 1px solid #b9cece; border-radius: 9px;
  background: #fff; box-shadow: 0 12px 26px rgba(19, 51, 64, .16);
}
.journal-search-select-option {
  display: grid; gap: 2px; width: 100%; min-height: 34px; padding: 6px 8px; border: 0; border-radius: 6px;
  text-align: left; color: var(--ink); background: transparent; font: inherit; cursor: pointer;
}
.journal-search-select-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.journal-search-select-option small { overflow: hidden; color: #75878e; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.journal-search-select-option:hover, .journal-search-select-option.is-active { color: #0a5f57; background: #e2f2ee; }
.journal-search-select-option[aria-selected="true"] { font-weight: 850; }
.journal-search-select-option[hidden], .journal-search-select-empty[hidden] { display: none; }
.journal-search-select-empty { padding: 9px; color: #819197; text-align: center; font-size: 10px; }
.journal-quick-allocation { text-align: center; }
.journal-quick-allocation input { width: 17px; height: 17px; margin: 0; padding: 0; accent-color: var(--teal); }
.journal-quick-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; white-space: nowrap; }
.journal-quick-row-actions button { min-height: 32px; padding: 6px 8px; border-radius: 7px; box-shadow: none; font-size: 9px; }
.journal-quick-row-actions .journal-quick-close { width: 30px; padding: 0; border: 0; color: #73858c; background: #e6eeee; font-size: 17px; }
.journal-quick-row-actions .journal-quick-close:hover { color: #9f443c; background: #f8e8e5; }
.journal-category-name { display: block; }
.journal-memo-cell { color: #536871; line-height: 1.45; overflow-wrap: anywhere; }
.journal-memo-cell > span {
  display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
}
.journal-direction, .journal-allocation-status, .status-badge { display: inline-flex; align-items: center; width: max-content; margin-bottom: 5px; padding: 3px 7px; border-radius: 999px; font-size: 9px; font-weight: 850; }
.journal-direction.income { color: #087267; background: #dff2ed; }
.journal-direction.expense { color: #a7483f; background: #fbe9e6; }
.journal-direction.transfer { color: #426879; background: #e5eef2; }
.journal-amount { display: block; }
.journal-amount.negative { color: var(--red); }
.journal-allocation-status.pending { color: #8e611f; background: var(--amber-soft); }
.journal-allocation-status.complete { color: var(--teal); background: var(--teal-soft); }
.journal-allocation-status.not_required { color: #6b7d84; background: #edf2f3; }
.status-badge.active { color: var(--teal); background: var(--teal-soft); }
.status-badge.void { color: #9a5049; background: #f5e7e5; }

.income-reporting-panel { overflow: hidden; padding: 0; border-color: #d2dfe1; box-shadow: 0 14px 34px rgba(22, 53, 66, .055); }
.income-reporting-heading { padding-top: 0; }
.income-reporting-heading .section-label { margin-bottom: 3px; font-size: 9px; }
.income-reporting-heading h1 { font-size: clamp(25px, 2.2vw, 31px); letter-spacing: -.035em; }
.income-reporting-heading p { margin-top: 4px; font-size: 11px; line-height: 1.45; }
.income-reporting-heading .settings-rule-note { min-width: 250px; padding: 7px 11px; border-radius: 9px; }
.income-reporting-heading .settings-rule-note b,
.income-reporting-heading .settings-rule-note span { display: inline; font-size: 10px; }
.income-reporting-heading .settings-rule-note span { margin: 0 0 0 8px; }
#income-reporting-view { gap: 10px; }
.income-month-toolbar {
  display: grid; grid-template-columns: 170px minmax(280px, 1fr) auto; gap: 14px; align-items: end;
  padding: 10px 16px; border-bottom: 1px solid #dce6e7; background: linear-gradient(180deg, #fbfdfc, #f7faf9);
}
.income-month-toolbar label { display: grid; gap: 3px; color: #5d727b; font-size: 9px; font-weight: 820; }
.income-month-toolbar input { height: 32px; border-color: #bfd1d4; background: #fff; color: #193c4b; font-size: 12px; font-weight: 800; }
.income-month-guidance { min-height: 32px; display: flex; align-items: center; gap: 7px; color: #61767e; font-size: 10px; line-height: 1.35; }
.income-month-guidance i { color: #16847a; font-size: 14px; }
.income-month-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; white-space: nowrap; }
.income-month-actions .quiet-badge { min-height: 26px; padding: 5px 9px; font-size: 9px; }
.income-month-actions .secondary-button { min-height: 30px; padding: 6px 10px; font-size: 10px; }
.income-month-ledger-wrap { width: calc(100% - 32px); max-width: 1120px; margin: 8px auto 0; overflow: auto; border: 1px solid #cad9dc; border-radius: 10px; background: #fff; }
.income-month-ledger-table { width: 100%; min-width: 820px; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-variant-numeric: tabular-nums; }
.income-month-ledger-table col.income-ledger-project-col { width: 16%; }
.income-month-ledger-table col.income-ledger-board-col { width: 16%; }
.income-month-ledger-table col.income-ledger-amount-col { width: 25%; }
.income-month-ledger-table col.income-ledger-reporter-col { width: 32%; }
.income-month-ledger-table col.income-ledger-action-col { width: 11%; }
.income-month-ledger-table th, .income-month-ledger-table td { height: 33px; padding: 3px 8px; border-right: 1px solid #e1e8e9; border-bottom: 1px solid #e1e8e9; vertical-align: middle; }
.income-month-ledger-table th:last-child, .income-month-ledger-table td:last-child { border-right: 0; }
.income-month-ledger-table thead th { position: sticky; top: 0; z-index: 4; height: 31px; color: #294a56; background: #eaf2f1; text-align: center; font-size: 9px; font-weight: 850; border-bottom: 2px solid #74a9a1; }
.income-month-ledger-table tbody td { color: #4e646d; background: #fff; font-size: 10px; text-align: center; }
.income-month-ledger-table tbody tr:hover td { background: #fbfdfc; }
.income-month-ledger-table tbody tr:last-child th, .income-month-ledger-table tbody tr:last-child td { border-bottom: 0; }
.income-ledger-group { color: #1e4654; background: #dfeeed; text-align: center; font-size: 10px; font-weight: 850; }
.income-ledger-board { color: #294e5b; background: #f1f6f5; text-align: center; font-size: 10px; font-weight: 800; }
.income-ledger-standalone { background: #e6f1ef; }
.income-ledger-assessment { color: #b33531; background: #edf4e8; }
.income-ledger-summary-row th, .income-ledger-summary-row td { background: #edf5e9 !important; border-top: 1px solid #c8d9bd; border-bottom-color: #c8d9bd; }
.income-ledger-summary-amount { color: #14786d; font-size: 11px; }
.income-month-ledger-table input[data-income-month-amount] {
  width: min(100%, 220px); height: 26px; border: 1px solid #c4d4d7; border-radius: 6px; padding: 3px 8px;
  color: #173c4d; background: #fff; text-align: right; font-size: 11px; font-weight: 820; font-variant-numeric: tabular-nums;
}
.income-month-ledger-table input[data-income-month-amount]:hover { border-color: #8eb9b3; }
.income-month-ledger-table input[data-income-month-amount]:focus { border-color: #258c81; outline: 0; box-shadow: 0 0 0 3px #dcefeb; }
.income-month-ledger-table input[data-income-month-amount]::placeholder { color: #9caeb4; font-size: 9px; font-weight: 650; }
.income-ledger-reporter { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.income-ledger-reporter strong, .income-ledger-reporter small { display: inline; }
.income-ledger-reporter strong { color: #274a57; font-size: 10px; }
.income-ledger-reporter small { margin-left: 7px; color: #7a8d94; font-size: 9px; }
.income-ledger-reporter > span, .income-ledger-locked, .income-ledger-no-action { color: #93a3a8; }
.income-ledger-save { min-width: 50px; min-height: 25px; border: 1px solid #b8dcd5; border-radius: 6px; padding: 4px 8px; color: #0d7369; background: #e4f3ef; font-size: 9px; font-weight: 850; }
.income-ledger-save:hover, .income-ledger-save.has-change { color: #fff; border-color: #0f776d; background: #0f776d; }
.income-ledger-save:disabled { opacity: .55; cursor: wait; }
.income-ledger-auto { display: inline-flex; padding: 3px 8px; border-radius: 999px; color: #5c7454; background: #dfead8; font-size: 8px; font-weight: 850; }
.income-ledger-readonly td { background: #fafbfb; }
.income-month-footer { width: calc(100% - 32px); max-width: 1120px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 auto; padding: 8px 0 10px; color: #647981; font-size: 9px; }
.income-month-footer span { display: flex; align-items: center; gap: 7px; }
.income-month-footer i { color: #16847a; font-size: 13px; }
.income-month-footer b { color: #13776d; font-size: 11px; white-space: nowrap; }
.statistics-page { gap: 16px; }
.statistics-workbench {
  overflow: hidden; padding: 0; border-color: #d5e0e2; border-radius: 18px; background: #fff;
  box-shadow: 0 12px 34px rgba(22, 53, 66, .055);
}
.statistics-workbench-header {
  min-height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 22px;
  padding: 18px 24px; border-bottom: 1px solid #dce6e8;
}
.statistics-title-block { min-width: 0; }
.statistics-title-block .section-label { margin-bottom: 4px; color: #17786e; font-size: 11px; letter-spacing: .06em; }
.statistics-title-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px 18px; }
.statistics-title-line h2 { margin: 0; color: var(--navy); font-size: clamp(23px, 2vw, 28px); line-height: 1.18; letter-spacing: -.035em; }
.statistics-live-status { display: inline-flex; align-items: center; gap: 5px; color: #188177; font-size: 11px; font-weight: 750; white-space: nowrap; }
.statistics-live-status i { font-size: 13px; }
#statistics-refresh-time { color: #3d938a; font-size: 11px; font-variant-numeric: tabular-nums; }
.statistics-header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; white-space: nowrap; }
.statistics-workspace-tabs { width: auto; display: inline-flex; grid-template-columns: none; gap: 2px; padding: 3px; border-radius: 9px; }
.statistics-workspace-tabs button { min-width: 52px; padding: 6px 9px; border-radius: 7px; font-size: 10px; }
.statistics-quiet-action, .statistics-export-button {
  min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: 8px; padding: 8px 13px; font-size: 11px; font-weight: 800;
}
.statistics-quiet-action { border: 0; color: #657984; background: transparent; }
.statistics-quiet-action:hover { color: var(--teal); background: #eef6f4; }
.statistics-export-button { border: 1px solid #0d766d; color: #fff; background: #0d766d; box-shadow: 0 5px 12px rgba(13, 118, 109, .15); }
.statistics-export-button:hover { background: #09645d; }
.statistics-export-button i { font-size: 15px; }

.statistics-filter-grid {
  display: grid; grid-template-columns: minmax(330px, 1.1fr) minmax(220px, 1fr) minmax(220px, 1fr); gap: 28px;
  align-items: end; padding: 15px 24px 17px; border-bottom: 1px solid #dce6e8;
}
.statistics-filter-grid label { min-width: 0; display: grid; gap: 7px; color: #5f7280; font-size: 11px; font-weight: 800; }
.statistics-filter-grid label > span { display: block; }
.statistics-filter-grid select {
  width: 100%; min-width: 0; height: 38px; border: 1px solid #cad7db; border-radius: 7px; padding: 7px 12px;
  color: #213b4d; background: #fff; font-size: 12px; outline: 0;
}
.statistics-filter-grid select:focus, .statistics-date-range:focus-within { border-color: #61a99e; box-shadow: 0 0 0 3px #e0f1ed; }
.statistics-date-range {
  min-width: 0; height: 38px; display: grid; grid-template-columns: minmax(128px, 1fr) auto minmax(128px, 1fr); align-items: center;
  border: 1px solid #cad7db; border-radius: 7px; background: #fff;
}
.statistics-date-range input { width: 100%; min-width: 0; height: 36px; border: 0; padding: 6px 10px; color: #213b4d; background: transparent; font-size: 12px; outline: 0; }
.statistics-date-range b { color: #6b7d86; font-size: 10px; }

.statistics-summary {
  display: grid; grid-template-columns: 1.2fr 1fr 1fr 1.3fr; min-height: 112px;
  padding: 0 24px; border-bottom: 1px solid #dce6e8;
}
.statistics-summary article { min-width: 0; align-self: center; padding: 14px 28px; }
.statistics-summary article:first-child { padding-left: 0; }
.statistics-summary article + article { border-left: 1px solid #dbe4e6; }
.statistics-summary span { display: block; color: #5c707d; font-size: 11px; font-weight: 800; }
.statistics-summary strong { display: block; margin-top: 12px; color: #172f41; font-size: clamp(21px, 2vw, 29px); line-height: 1; letter-spacing: -.025em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.statistics-summary-primary strong { color: #bf4743; font-size: clamp(25px, 2.3vw, 32px); }
.statistics-quality-card > div { display: flex; align-items: center; gap: 7px; margin-top: 9px; }
.statistics-quality-card > div i { color: #23877d; font-size: 18px; }
.statistics-quality-card > div strong { display: inline; margin: 0; font-size: 18px; }
.statistics-quality-card small { display: block; margin-top: 9px; overflow: hidden; color: #72838c; font-size: 10px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.statistics-quality-card.has-warning > div i { color: #dfa041; }

.statistics-matrix-wrap {
  position: relative; isolation: isolate; width: calc(100% - 36px); max-width: calc(100% - 36px); height: min(55vh, 560px); min-height: 420px;
  margin: 0 18px; overflow: auto; border: 1px solid #d2dfe2; border-radius: 11px; background: #fff;
  overscroll-behavior: contain; scrollbar-gutter: stable; scroll-padding-left: 210px;
  scrollbar-width: thin; scrollbar-color: #9fb0b6 #edf1f2;
}
.statistics-matrix-wrap::-webkit-scrollbar { width: 8px; height: 8px; }
.statistics-matrix-wrap::-webkit-scrollbar-track { background: #edf1f2; }
.statistics-matrix-wrap::-webkit-scrollbar-thumb { border: 2px solid #edf1f2; border-radius: 999px; background: #9fb0b6; }
#statistics-matrix-table th, #statistics-matrix-table td { width: 82px; min-width: 82px; max-width: 82px; height: 45px; padding: 6px 5px; font-size: 11px; }
#statistics-matrix-table thead th { height: 37px; padding: 6px 5px; color: #294654; background: #f5f8f8; font-size: 10px; letter-spacing: 0; }
#statistics-matrix-table thead tr:first-child th { top: 0; height: 37px; }
#statistics-matrix-table thead tr:nth-child(2) th {
  top: 37px; height: 35px; color: #4f6670; background: #fbfcfc;
  border-bottom: 2px solid #73aaa1; font-size: 10px;
}
#statistics-matrix-table .matrix-subject-column { width: 210px; min-width: 210px; max-width: 210px; padding-left: 14px; padding-right: 10px; }
#statistics-matrix-table thead .matrix-subject-column { display: table-cell; color: #294654; background: #f4f8f7; text-align: left; }
#statistics-matrix-table thead .matrix-subject-column span { vertical-align: middle; }
#statistics-matrix-table thead .matrix-subject-column i { margin-left: 5px; color: #78909a; font-size: 12px; vertical-align: middle; }
#statistics-matrix-table .matrix-project-header { border-bottom-color: #73aaa1; }
#statistics-matrix-table thead tr:first-child .statistics-detail-group { border-bottom: 1px solid #d8e3e3; }
#statistics-matrix-table .matrix-project-summary { color: #294654; background: #f8faf9; font-weight: 820; }
#statistics-matrix-table .statistics-total-row td { background: #eaf4f1; border-bottom-color: #c8dcd7; font-weight: 820; }
#statistics-matrix-table .statistics-total-row td.matrix-subject-column { background: #e4f0ed; }
#statistics-matrix-table .statistics-leaf-row td { background: #fff; }
#statistics-matrix-table .statistics-leaf-row:hover td { background: #fbfdfc !important; }
#statistics-matrix-table .statistics-leaf-row td.matrix-subject-column { background: #fff; }
#statistics-matrix-table .statistics-row:last-child td { border-bottom: 0; }
#statistics-matrix-table tfoot td {
  position: sticky; bottom: 0; z-index: 20; background: #dfeeea; border-top: 2px solid #6f9f97; border-bottom: 0;
  color: #08766d; font-weight: 850; box-shadow: 0 -8px 18px -16px rgba(19, 54, 65, .75);
}
#statistics-matrix-table tfoot td.matrix-subject-column { z-index: 41; background: #d7e9e5; }
#statistics-matrix-table .statistics-net-row .statistics-subject-label b { font-size: 12px; }
#statistics-matrix-table .statistics-net-row .statistics-drill:not(.statistics-negative) { color: #08766d; font-weight: 850; }
.statistics-tree-toggle, .statistics-subject-label {
  width: 100%; min-height: 28px; display: flex; align-items: center; gap: 8px; border: 0; padding: 0; color: #274554; background: transparent; text-align: left;
}
.statistics-tree-toggle { cursor: pointer; }
.statistics-tree-toggle:hover { color: var(--teal); }
.statistics-tree-toggle i, .statistics-tree-spacer { flex: 0 0 12px; width: 12px; color: #426975; font-size: 12px; text-align: center; }
.statistics-subject-label.depth-1 { padding-left: 21px; }
.statistics-tree-toggle b, .statistics-subject-label b { font-size: 11px; }
.statistics-tree-toggle small, .statistics-subject-label small { margin-left: 7px; color: #6f818a; font-size: 9px; font-weight: 650; }
.statistics-zero-number { display: inline-block; min-width: 18px; color: #344d5b; text-align: right; }
.statistics-negative { color: #d24440 !important; }
.statistics-drill { width: 100%; min-height: 27px; border: 0; padding: 2px 0; color: #254252; background: transparent; text-align: right; font: inherit; font-size: 11px; font-weight: inherit; cursor: pointer; }
.statistics-drill:hover, .statistics-drill:focus-visible { text-decoration: underline; text-underline-offset: 3px; }

.statistics-focus-summary {
  min-height: 86px; display: flex; align-items: center; gap: 24px; margin: 18px; padding: 13px 16px;
  border: 1px solid #b8d9d3; border-radius: 11px; background: #f4faf8;
}
.statistics-focus-title { flex: 1 1 330px; min-width: 260px; display: flex; align-items: center; gap: 13px; }
.statistics-focus-title > i { flex: 0 0 46px; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; color: #17786e; background: #dcefe9; font-size: 24px; }
.statistics-focus-title b, .statistics-focus-title strong { display: block; }
.statistics-focus-title b { color: #244653; font-size: 13px; }
.statistics-focus-title strong { margin-top: 5px; font-size: 20px; }
.statistics-focus-metric { flex: 0 1 150px; min-width: 92px; text-align: center; }
.statistics-focus-metric span, .statistics-focus-metric b { display: block; }
.statistics-focus-metric span { color: #5c747d; font-size: 10px; font-weight: 750; }
.statistics-focus-metric b { margin-top: 7px; color: #203c4c; font-size: 15px; font-variant-numeric: tabular-nums; }
.statistics-focus-link { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; border: 0; padding: 9px 4px; color: #14766d; background: transparent; font-size: 11px; font-weight: 800; }
.statistics-focus-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.statistics-details-panel { overflow: hidden; scroll-margin-top: 14px; }
.statistics-details-panel > .table-wrap { max-height: 52vh; }
.statistics-details-table { min-width: 1040px; }
.statistics-details-table td small { display: block; margin-top: 3px; color: var(--muted); }
.journal-master-check { grid-template-columns: auto 1fr; align-items: center; align-self: end; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.journal-master-check input { width: 18px; height: 18px; }
.journal-master-check span { display: grid; gap: 2px; color: var(--ink); font-size: 12px; font-weight: 800; }
.journal-master-check small { color: var(--muted); font-size: 10px; font-weight: 600; }

@media (max-width: 1400px) {
  .income-month-toolbar { grid-template-columns: 160px minmax(220px, 1fr) auto; }
  .statistics-workbench-header { align-items: flex-start; }
  .statistics-header-actions { flex-wrap: wrap; }
  .statistics-focus-summary { gap: 14px; }
}

@media (max-width: 720px) {
  .income-month-toolbar { grid-template-columns: 1fr; padding: 16px; }
  .income-month-actions { align-items: stretch; flex-direction: column; }
  .income-month-actions button { width: 100%; }
  .income-month-ledger-wrap { margin: 14px 10px 0; }
  .income-month-footer { align-items: flex-start; flex-direction: column; padding: 13px 16px 17px; }
  .statistics-workbench-header { flex-direction: column; }
  .statistics-header-actions { width: 100%; justify-content: flex-start; }
  .statistics-filter-grid { grid-template-columns: 1fr; }
  .statistics-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 14px; }
  .statistics-summary article { padding: 14px; }
  .statistics-summary article:nth-child(3) { border-left: 0; border-top: 1px solid #dbe4e6; }
  .statistics-summary article:nth-child(4) { border-top: 1px solid #dbe4e6; }
  .statistics-matrix-wrap { width: calc(100% - 20px); max-width: calc(100% - 20px); margin: 0 10px; }
  .statistics-focus-summary { align-items: flex-start; flex-wrap: wrap; margin: 10px; }
  .statistics-focus-title { flex-basis: 100%; }
}
.journal-settings-heading { align-items: flex-end; padding-top: 0; }
.journal-settings-heading h1 { font-size: clamp(26px, 3vw, 34px); }
.journal-settings-heading p { margin-top: 6px; max-width: 760px; font-size: 13px; line-height: 1.55; }
.settings-rule-note { min-width: 280px; padding: 10px 13px; border: 1px solid #cfe0dd; border-radius: 11px; background: #edf7f4; }
.settings-rule-note b, .settings-rule-note span { display: block; }
.settings-rule-note b { color: var(--teal); font-size: 11px; }
.settings-rule-note span { margin-top: 3px; color: #54706e; font-size: 11px; }
.journal-settings-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; padding: 5px; border: 1px solid var(--line); border-radius: 13px; background: #eaf0f0; }
.journal-settings-tabs button { min-width: 0; border: 0; border-radius: 9px; padding: 9px 11px; color: #667981; background: transparent; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 12px; font-weight: 750; }
.journal-settings-tabs button:hover { color: var(--navy); background: rgba(255,255,255,.58); }
.journal-settings-tabs button.active { color: var(--navy); background: #fff; box-shadow: 0 3px 10px rgba(22,53,66,.08); }
.journal-settings-tabs button:focus-visible { outline: 3px solid #9bcfc5; outline-offset: 1px; }
.journal-settings-tabs b { min-width: 22px; padding: 2px 6px; border-radius: 999px; color: #718189; background: #dfe8e9; font-size: 10px; font-variant-numeric: tabular-nums; }
.journal-settings-tabs button.active b { color: var(--teal); background: var(--teal-soft); }
.journal-settings-grid { display: block; }
.master-panel { display: none; min-height: 0; padding: 18px; border-radius: 14px; }
.master-panel.active { display: block; }
.master-panel .panel-heading { align-items: center; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid #e8eeee; }
.master-panel .panel-heading h3 { font-size: 18px; }
.master-panel .panel-heading .section-label { margin-bottom: 4px; font-size: 9px; }
.master-panel .panel-heading p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.master-panel .panel-heading .primary-button { padding: 9px 13px; box-shadow: none; }
.master-account-toolbar {
  display: grid; grid-template-columns: minmax(450px, 1fr) 170px minmax(190px, 250px); gap: 10px;
  align-items: end; margin-bottom: 14px; padding: 10px; border: 1px solid #e0e8e8; border-radius: 11px; background: #f6f9f8;
}
.master-account-type-filters { display: inline-flex; gap: 4px; min-width: 0; padding: 3px; border-radius: 9px; background: #e8efef; }
.master-account-type-filters button {
  min-width: 0; border: 0; border-radius: 7px; padding: 7px 10px; color: #63777f; background: transparent;
  font-size: 10px; font-weight: 800; white-space: nowrap;
}
.master-account-type-filters button:hover { color: var(--navy); background: rgba(255,255,255,.7); }
.master-account-type-filters button.active { color: #fff; background: var(--navy); box-shadow: 0 3px 8px rgba(23,59,78,.14); }
.master-account-type-filters button:focus-visible { outline: 3px solid #9bcfc5; outline-offset: 1px; }
.master-account-type-filters b { margin-left: 4px; font-size: 9px; font-variant-numeric: tabular-nums; }
.master-account-owner-filter, .master-account-search { display: grid; gap: 4px; color: #667981; font-size: 9px; font-weight: 800; }
.master-account-owner-filter select, .master-account-search input {
  width: 100%; min-width: 0; height: 34px; border: 1px solid #cbd8db; border-radius: 8px; padding: 6px 9px;
  color: var(--ink); background: #fff; font: inherit; font-size: 10px;
}
.master-account-owner-filter select:focus, .master-account-search input:focus { border-color: var(--teal); outline: 0; box-shadow: 0 0 0 3px #dff0ec; }
.master-account-groups { display: grid; gap: 13px; }
.master-account-type-group { overflow: hidden; border: 1px solid #dbe6e6; border-radius: 12px; background: #fbfcfc; }
.master-account-type-heading {
  display: flex; align-items: center; justify-content: space-between; min-height: 42px; padding: 9px 13px;
  border-bottom: 1px solid #e0e9e9; background: #edf5f3;
}
.master-account-type-heading div { display: flex; align-items: center; gap: 8px; }
.master-account-type-heading b { color: var(--navy); font-size: 13px; }
.master-account-type-heading span { padding: 2px 7px; border-radius: 999px; color: var(--teal); background: #d9eee9; font-size: 9px; font-weight: 800; }
.master-account-owner-groups { display: grid; gap: 11px; padding: 11px; }
.master-account-owner-group { min-width: 0; }
.master-account-owner-group + .master-account-owner-group { padding-top: 11px; border-top: 1px solid #e5ecec; }
.master-account-owner-group > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; padding: 0 2px; }
.master-account-owner-group > header div { display: flex; align-items: baseline; gap: 6px; }
.master-account-owner-group > header span { color: #7b8c91; font-size: 9px; font-weight: 750; }
.master-account-owner-group > header b { color: #38535d; font-size: 11px; }
.master-account-owner-group > header small { color: #839298; font-size: 9px; }
.master-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 7px 10px; }
.master-list-item { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 9px 8px 11px; border: 1px solid #e0e8ea; border-radius: 9px; background: #fafcfc; }
.master-list-item:hover { border-color: #c7d8d8; background: #f5faf9; }
.master-list-item.inactive { opacity: .55; }
.master-list-item b, .master-list-item small { display: block; }
.master-list-item b { font-size: 13px; }
.master-list-item small { margin-top: 2px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.master-list-actions { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; }
.master-account-order-actions { display: inline-flex; align-items: center; gap: 2px; margin-right: 2px; padding-right: 6px; border-right: 1px solid #dce6e7; }
.master-list-item .master-account-order-actions button { min-width: 25px; padding: 5px 6px; color: #0c786f; background: #e5f3f0; font-size: 11px; line-height: 1; }
.master-list-item .master-account-order-actions button:hover:not(:disabled) { color: #fff; background: var(--teal); }
.master-list-item .master-account-order-actions button:disabled { opacity: .35; cursor: not-allowed; }
.master-list-item button { flex: 0 0 auto; border: 0; border-radius: 7px; padding: 5px 8px; color: #687a82; background: #eaf0f1; font-size: 9px; font-weight: 800; }
.master-list-item button[data-edit-master] { color: var(--teal); background: var(--teal-soft); }
.master-list-item button[data-edit-master]:hover { color: #fff; background: var(--teal); }
.master-list-item button[data-toggle-master]:hover { color: #9b473f; background: #f8e9e6; }
.master-empty { grid-column: 1 / -1; min-height: 116px; border: 1px dashed #cfdcde; border-radius: 10px; display: grid; place-content: center; justify-items: center; gap: 5px; color: #829198; background: #fbfcfc; }
.master-empty b { color: #60737b; font-size: 13px; }
.master-empty span { font-size: 10px; }
#journal-drawer { grid-template-columns: minmax(40px, 1fr) min(1120px, 82vw); }
.journal-drawer-panel {
  width: 100%; height: 100dvh; padding: 18px 20px 24px; overflow-y: auto; scrollbar-gutter: stable;
}
#journal-drawer .voucher-header { align-items: center; gap: 16px; padding-bottom: 12px; }
#journal-drawer .voucher-header .section-label { margin-bottom: 4px; font-size: 9px; }
#journal-drawer .voucher-header h2 { font-size: 22px; letter-spacing: -.02em; }
#journal-drawer .voucher-header p { margin-top: 4px; font-size: 11px; }
#journal-drawer .voucher-header .icon-button { width: 34px; height: 34px; border-radius: 9px; font-size: 20px; }
.journal-master-drawer { width: min(720px, 70vw); }
#journal-master-modal { grid-template-columns: 1fr; place-items: center; padding: 24px; }
#journal-master-modal .modal-backdrop { position: absolute; inset: 0; }
#journal-master-modal .journal-master-drawer {
  position: relative; z-index: 1; width: min(660px, calc(100vw - 48px)); height: auto;
  max-height: calc(100dvh - 48px); padding: 20px 22px 22px; overflow: auto;
  border: 1px solid rgba(205,220,223,.9); border-radius: 18px;
  box-shadow: 0 24px 70px rgba(12,32,43,.24);
}
#journal-master-modal .voucher-header { align-items: center; padding-bottom: 13px; }
#journal-master-modal .voucher-header .section-label { margin-bottom: 5px; font-size: 9px; }
#journal-master-modal .voucher-header h2 { font-size: 22px; letter-spacing: -.02em; }
#journal-master-modal .voucher-header p { margin-top: 4px; font-size: 11px; }
#journal-master-modal .voucher-header .icon-button { width: 36px; height: 36px; }
#journal-master-modal .journal-form { margin-top: 13px; padding: 14px; border-radius: 12px; }
#journal-master-modal .journal-form-grid { gap: 11px 12px; }
#journal-master-modal .journal-form input,
#journal-master-modal .journal-form select { padding: 9px 10px; }
#journal-master-modal .journal-form-actions { margin-top: 13px; padding-top: 12px; border-top: 1px solid #e2e9e9; }
#journal-master-modal .journal-form-actions .primary-button { min-width: 116px; padding: 10px 14px; box-shadow: none; }
.journal-form { margin-top: 14px; padding: 14px; border: 1px solid #d9e4e3; border-radius: 13px; background: #f8faf9; }
.journal-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px 12px; }
.journal-form input, .journal-form select { min-height: 38px; padding: 8px 9px; }
.journal-form textarea { min-height: 70px; resize: vertical; }
.journal-form-memo { grid-column: span 2; }
#journal-drawer .journal-form { margin-top: 12px; padding: 12px; border-radius: 11px; }
#journal-drawer .journal-form-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px 10px; }
#journal-drawer .journal-form-grid > label { min-width: 0; }
#journal-drawer .journal-form label { gap: 4px; font-size: 10px; }
#journal-drawer .journal-form input, #journal-drawer .journal-form select { width: 100%; min-width: 0; min-height: 36px; padding: 7px 9px; }
#journal-drawer .journal-form-memo { grid-column: auto; }
#journal-drawer .journal-form-memo input { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.journal-field-caption { display: flex; align-items: baseline; white-space: nowrap; }
.journal-field-caption b { color: inherit; font: inherit; }
.permission-fieldset { margin: 14px 0 0; padding: 14px; border: 1px solid #d4e2e1; border-radius: 11px; background: #fff; }
.permission-fieldset legend { padding: 0 6px; color: #3c5c64; font-size: 11px; font-weight: 850; }
.permission-fieldset > p { margin: 0 0 11px; color: #71838a; font-size: 10px; line-height: 1.5; }
.permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.permission-grid label {
  display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 8px 10px;
  border: 1px solid #dce7e7; border-radius: 9px; color: #415d65; background: #f7faf9; font-size: 10px; font-weight: 800;
}
.permission-grid label:has(input:checked) { border-color: #9fcac3; color: #0b6f67; background: #e7f4f1; }
.permission-grid input { flex: 0 0 auto; width: 16px !important; height: 16px; margin: 0; padding: 0 !important; accent-color: var(--teal); box-shadow: none !important; }
#journal-master-account-users label > span { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
#journal-master-account-users label small { color: #71838a; font-size: 9px; font-weight: 700; }
.journal-check-field { display: flex !important; grid-template-columns: auto 1fr; align-items: center; gap: 9px !important; margin-top: 11px; }
.journal-check-field input { width: 17px; height: 17px; margin: 0; accent-color: var(--teal); }
.journal-form-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid #e1e9e8; }
.journal-form-actions .primary-button, .journal-form-actions .secondary-button { min-height: 38px; padding: 9px 13px; box-shadow: none; }
.journal-form-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 10px; padding-top: 10px; border-top: 1px solid #e1e9e8; }
#journal-drawer .journal-check-field { min-width: 0; margin: 0; color: #657980; font-size: 10px; }
#journal-drawer .journal-check-field input { width: 16px; height: 16px; }
#journal-drawer .journal-form-actions { flex: 0 0 auto; margin: 0; padding: 0; border: 0; }
#journal-drawer .journal-form-actions .primary-button, #journal-drawer .journal-form-actions .secondary-button { min-height: 36px; padding: 8px 12px; font-size: 11px; }
.journal-subsection { margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.journal-subsection .panel-heading { align-items: center; margin-bottom: 9px; }
.journal-subsection .panel-heading .section-label { margin-bottom: 3px; font-size: 8px; }
.journal-subsection .panel-heading h3 { margin: 0; font-size: 16px; letter-spacing: -.01em; }
.journal-subsection .panel-heading .text-button { font-size: 10px; }
.journal-allocation-summary { background: #f9fcfb; }
.journal-allocation-summary .panel-heading { margin-bottom: 7px; }
.journal-allocation-summary .quiet-badge.pending { color: #95671c; background: #fbefd7; }
.journal-allocation-summary-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 9px; }
.journal-allocation-summary-row {
  min-width: 0; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 8px; align-items: center;
  min-height: 49px; padding: 7px 9px; border: 1px solid #dfe9e7; border-radius: 9px; background: #fff;
}
.journal-allocation-line-number {
  width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px;
  color: var(--teal); background: var(--teal-soft); font-size: 9px; font-weight: 850; font-variant-numeric: tabular-nums;
}
.journal-allocation-scope, .journal-allocation-value { min-width: 0; }
.journal-allocation-scope strong, .journal-allocation-scope span, .journal-allocation-value strong, .journal-allocation-value span { display: block; }
.journal-allocation-scope strong { overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.journal-allocation-scope span { overflow: hidden; margin-top: 3px; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.journal-allocation-value { padding-left: 10px; text-align: right; }
.journal-allocation-value strong { color: var(--navy); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.journal-allocation-value span { margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 750; }
.journal-allocation-empty { grid-column: 1 / -1; margin: 0; padding: 10px 12px; border: 1px dashed #d4e1df; border-radius: 9px; color: var(--muted); background: #fff; font-size: 10px; }
.journal-allocation-summary-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 8px; padding-top: 8px; border-top: 1px solid #e2eae9; }
.journal-allocation-summary-footer strong { color: #31505a; font-size: 10px; font-variant-numeric: tabular-nums; }
.journal-allocation-summary-footer strong.is-unbalanced { color: #b84a43; }
.journal-allocation-summary-footer span { color: var(--muted); font-size: 9px; }
.allocation-line { display: grid; grid-template-columns: 1fr 1fr 1fr 120px 1fr 34px; gap: 8px; align-items: end; padding: 8px 0; border-bottom: 1px solid #edf1f2; }
.allocation-line:last-child { border-bottom: 0; }
.allocation-line .icon-button { margin-bottom: 1px; }
.allocation-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--line); }
.allocation-reconciliation {
  display: grid; grid-template-columns: repeat(3, minmax(122px, auto)); gap: 5px 16px; align-items: center;
  min-width: 0; font-variant-numeric: tabular-nums;
}
.allocation-reconciliation > div { min-width: 0; padding-right: 16px; border-right: 1px solid #dde7e5; }
.allocation-reconciliation > div:nth-child(3) { padding-right: 0; border-right: 0; }
.allocation-reconciliation span, .allocation-reconciliation strong { display: block; }
.allocation-reconciliation span { color: var(--muted); font-size: 8px; font-weight: 800; }
.allocation-reconciliation strong { margin-top: 2px; color: var(--ink); font-size: 11px; white-space: nowrap; }
.allocation-reconciliation p { grid-column: 1 / -1; margin: 1px 0 0; font-size: 9px; font-weight: 750; }
.allocation-reconciliation.is-unbalanced .allocation-difference strong,
.allocation-reconciliation.is-unbalanced p { color: #b84a43; }
.allocation-reconciliation.is-balanced .allocation-difference strong,
.allocation-reconciliation.is-balanced p { color: var(--teal); }
.allocation-footer .primary-button.small { min-height: 34px; padding: 7px 11px; font-size: 10px; box-shadow: none; }
.journal-history { display: grid; gap: 0; }
.journal-history-item {
  display: grid; grid-template-columns: 14px 170px minmax(0, 1fr); gap: 8px 10px; align-items: start;
  padding: 9px 0; border-top: 1px solid #e7eeed;
}
.journal-history-item:first-child { padding-top: 2px; border-top: 0; }
.journal-history-dot { position: relative; width: 10px; height: 10px; margin-top: 4px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); }
.journal-history-item > header { min-width: 0; }
.journal-history-item > header b { display: block; color: var(--ink); font-size: 11px; }
.journal-history-item > header p { margin: 3px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.journal-history-changes { display: grid; gap: 4px; min-width: 0; }
.journal-history-change {
  display: grid; grid-template-columns: 86px minmax(0, 1fr) 14px minmax(0, 1fr); gap: 6px; align-items: center;
  min-width: 0; min-height: 26px; padding: 4px 7px; border-radius: 7px; background: #f7faf9;
}
.journal-history-change > span { color: var(--muted); font-size: 9px; font-weight: 800; }
.journal-history-change del, .journal-history-change ins {
  overflow: hidden; min-width: 0; color: #6b7d84; font-size: 10px; font-style: normal; text-decoration: none; text-overflow: ellipsis; white-space: nowrap;
}
.journal-history-change ins { color: var(--ink); font-weight: 800; }
.journal-history-change i { color: #8aa09f; font-size: 10px; text-align: center; }
.journal-history-created { display: grid; grid-template-columns: .7fr 1.15fr 1.2fr 1.25fr 1fr; gap: 5px; min-width: 0; }
.journal-history-created > span { min-width: 0; padding: 5px 7px; border-radius: 7px; background: #f7faf9; }
.journal-history-created small, .journal-history-created strong { display: block; }
.journal-history-created small { color: var(--muted); font-size: 8px; font-weight: 800; }
.journal-history-created strong { overflow: hidden; margin-top: 2px; color: var(--ink); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.journal-history-allocation { display: grid; gap: 5px; min-width: 0; }
.journal-history-allocation.has-before-after { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.journal-history-allocation > div { min-width: 0; padding: 6px 8px; border: 1px solid #e1eae8; border-radius: 8px; background: #fbfdfc; }
.journal-history-allocation b { display: block; margin-bottom: 4px; color: var(--muted); font-size: 9px; }
.journal-history-allocation ul { display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; }
.journal-history-allocation li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; min-width: 0; font-size: 9px; }
.journal-history-allocation li span { overflow: hidden; color: #496169; text-overflow: ellipsis; white-space: nowrap; }
.journal-history-allocation li strong { color: var(--navy); font-size: 9px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.journal-history-no-change { margin: 0; padding: 6px 8px; border-radius: 7px; color: #6b7d84; background: #f7faf9; font-size: 9px; }
@media (max-width: 900px) {
  .journal-history-item { grid-template-columns: 14px minmax(0, 1fr); }
  .journal-history-item > header { grid-column: 2; }
  .journal-history-item > :last-child { grid-column: 2; }
  .journal-history-created { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .journal-history-allocation.has-before-after { grid-template-columns: 1fr; }
}

@media (max-width: 1050px) {
  .app-shell { --sidebar-width: 210px; }
  .app-shell.sidebar-is-collapsed { --sidebar-width: 72px; }
  .workspace { padding: 28px 24px 50px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .two-column { grid-template-columns: 1fr; }
  .evidence-grid, .roadmap-grid, .edit-grid { grid-template-columns: 1fr 1fr; }
  .filter-grid { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
  .filter-apply { width: 100%; }
  .journal-balance-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .journal-fund-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .journal-fund-overview-total { grid-column: 1 / -1; border-bottom: 1px solid #dce5e7; }
  .journal-fund-overview-item:nth-child(2), .journal-fund-overview-item:nth-child(4) { border-left: 0; }
  .journal-account-groups { grid-template-columns: 1fr; }
  .journal-account-group-other { grid-template-columns: minmax(300px, 1.35fr) minmax(0, 3fr) auto; }
  .journal-account-group + .journal-account-group { border-top: 1px solid #d8e2e4; border-left: 0; }
  .journal-selected-account { grid-template-columns: minmax(220px, 1.2fr) 2.3fr; }
  .journal-selected-detail { grid-column: 1 / -1; justify-content: center; height: 38px; border-top: 1px solid #d6e4e3; }
  .journal-filters { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
  .journal-transfer-inbox-item { grid-template-columns: 86px minmax(260px, 1fr) 110px auto; }
  .journal-transfer-inbox-item > p { display: none; }
  .journal-filter-actions { grid-column: 1 / -1; }
  .journal-settings-heading { align-items: flex-start; }
  .settings-rule-note { min-width: 0; }
  .journal-settings-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .master-account-toolbar { grid-template-columns: 1fr 170px; }
  .master-account-type-filters { grid-column: 1 / -1; }
  .allocation-line { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .journal-allocation-summary-list { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  #journal-drawer .journal-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #journal-drawer .journal-form-memo { grid-column: auto; }
}

@media (max-width: 720px) {
  .login-screen { padding: 14px; background: linear-gradient(160deg, #123649 0%, #1a4a59 34%, #eef3f1 34%, #f4f6f4 100%); }
  .login-card { padding: 25px 21px; border-radius: 19px; }
  .login-heading { padding-top: 24px; }
  .app-shell, .app-shell.sidebar-is-collapsed { --sidebar-width: 0px; padding-left: 0; }
  .sidebar { position: static; width: auto; height: auto; padding: 16px; overflow: visible; }
  .sidebar-toggle { display: none; }
  .brand, .sidebar-is-collapsed .brand { justify-content: flex-start; padding: 0 8px 14px; }
  .sidebar-is-collapsed .brand-mark { display: grid; }
  .sidebar-is-collapsed .brand-copy, .sidebar-is-collapsed .nav-item > span:not(.nav-icon) { display: block; }
  .sidebar-is-collapsed .nav-item { justify-content: flex-start; gap: 12px; padding: 12px; }
  nav { grid-template-columns: 1fr 1fr; }
  .nav-item small, .sidebar-foot { display: none; }
  .sidebar-session { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: center; margin-top: 12px; padding: 13px 8px 0; }
  .sidebar-session small { grid-column: 1; }
  .sidebar-session button { grid-column: 2; grid-row: 1 / span 2; width: auto; margin: 0; }
  .workspace { padding: 22px 14px 40px; }
  .workspace-module-tabs { display: flex; width: 100%; grid-template-columns: none; }
  .workspace-module-tabs button { flex: 1 0 auto; }
  .hero-panel, .report-banner, .rule-summary, .candidate-top { align-items: flex-start; flex-direction: column; }
  .metric-grid, .metric-grid.three, .flow-list, .evidence-grid, .roadmap-grid, .edit-grid { grid-template-columns: 1fr; }
  .rule-search { min-width: 0; width: 100%; }
  .impact { text-align: left; }
  .filter-grid { grid-template-columns: 1fr; }
  .drill-heading { align-items: flex-start; }
  .segmented { width: 100%; }
  .segmented button { flex: 1; }
  .report-table-heading { align-items: flex-start; flex-direction: column; }
  .cashflow-matrix-wrap { height: calc(100dvh - 24px); min-height: 520px; }
  .analysis-tabs { width: 100%; }
  .analysis-tabs button { flex: 1; white-space: normal; }
  .subject-tree-table .subject-column { min-width: 245px; }
  .modal, #journal-drawer { grid-template-columns: 1fr; }
  .modal-backdrop { display: none; }
  .voucher-drawer { width: 100vw; padding: 22px 16px 35px; }
  .adjustment-form-grid { grid-template-columns: 1fr; }
  .journal-heading { align-items: flex-start; flex-direction: column; }
  .journal-fund-overview { grid-template-columns: 1fr; }
  .journal-fund-overview-total, .journal-fund-overview-item { grid-column: auto; min-height: 72px; border-bottom: 1px solid #dce5e7; border-left: 0; }
  .journal-fund-overview-item:last-child { border-bottom: 0; }
  .journal-account-groups { grid-template-columns: 1fr; }
  .journal-account-group-other { display: flex; }
  .journal-account-group-other > header { border-right: 0; border-bottom: 1px solid #dce5e7; }
  .journal-account-group-other .journal-account-list { grid-template-columns: 1fr; }
  .journal-account-group-other .journal-account-row { border-right: 0; }
  .journal-account-group-other > footer { min-height: 30px; border-left: 0; }
  .journal-account-group-other > footer:has(> span) { display: flex; }
  .journal-account-group > header { padding-inline: 14px; }
  .journal-account-row { grid-template-columns: 34px minmax(0, 1fr) auto; padding-inline: 13px; }
  .journal-account-row-amount { display: grid; justify-items: end; gap: 2px; }
  .journal-selected-account { grid-template-columns: 1fr; }
  .journal-selected-identity { border-bottom: 1px solid #d6e4e3; }
  .journal-selected-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .journal-selected-metric { border-bottom: 1px solid #d6e4e3; }
  .journal-overview-toggle { flex: 0 0 auto; }
  .journal-balance-grid, .journal-filters, .journal-form-grid, .allocation-line { grid-template-columns: 1fr; }
  .journal-pagination { align-items: stretch; flex-direction: column; gap: 8px; }
  .journal-page-tools { justify-content: space-between; flex-wrap: wrap; }
  .journal-page-nav { flex-wrap: wrap; }
  .journal-form-memo { grid-column: auto; }
  .journal-filter-actions { grid-column: auto; display: grid; grid-template-columns: auto 1fr 1fr; }
  .journal-filter-actions .primary-button, .journal-filter-actions .secondary-button { justify-content: center; }
  .journal-drawer-panel, .journal-master-drawer { width: 100vw; }
  #journal-drawer .journal-form-grid { grid-template-columns: 1fr; }
  #journal-drawer .journal-form-memo { grid-column: auto; }
  .allocation-footer { align-items: stretch; flex-direction: column; }
  .allocation-reconciliation { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .allocation-footer .primary-button.small { width: 100%; }
  .journal-form-footer { align-items: stretch; flex-direction: column; }
  .journal-transfer-inbox > header { align-items: flex-start; flex-direction: column; }
  .journal-transfer-inbox-summary { text-align: left; }
  .journal-transfer-inbox-item { grid-template-columns: 1fr auto; }
  .journal-transfer-inbox-route, .journal-transfer-inbox-item > p { grid-column: 1 / -1; }
  #journal-drawer .journal-form-actions { width: 100%; }
  #journal-drawer .journal-form-actions .primary-button, #journal-drawer .journal-form-actions .secondary-button { flex: 1; }
  #journal-master-modal { align-items: end; padding: 0; }
  #journal-master-modal .journal-master-drawer { width: 100vw; max-height: 92dvh; padding: 18px 16px 20px; border-radius: 18px 18px 0 0; }
  #journal-master-modal .journal-form-grid { grid-template-columns: 1fr; }
  .permission-grid { grid-template-columns: 1fr; }
  .journal-settings-heading { gap: 10px; }
  .settings-rule-note { width: 100%; }
  .journal-settings-tabs { display: flex; overflow-x: auto; padding: 4px; }
  .journal-settings-tabs button { flex: 0 0 auto; }
  .master-panel { padding: 14px; }
  .master-panel .panel-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .master-panel .panel-heading .primary-button { width: 100%; }
  .master-account-toolbar { grid-template-columns: 1fr; }
  .master-account-type-filters { grid-column: auto; overflow-x: auto; }
  .master-account-type-filters button { flex: 0 0 auto; }
  .master-account-owner-group > header { align-items: flex-start; }
  .master-list { grid-template-columns: 1fr; }
  .allocation-footer { align-items: stretch; flex-direction: column; }
  .voucher-balance { overflow-x: auto; }
  #analysis-facts-panel > .table-wrap { min-height: 360px; max-height: calc(100vh - 180px); }
}
