:root {
  --bg: #f4f5fb;
  --card: #ffffff;
  --tx: #1b1d2e;
  --mu: #7a7f99;
  --bd: #e6e8f2;
  --ac: #6c5ce7;
  --ac-soft: rgba(108, 92, 231, .11);
  --ok: #00b894;
  --ok-soft: rgba(0, 184, 148, .16);
  --rd: #e17055;
  --rd-soft: rgba(225, 112, 85, .16);
  --sh: 0 4px 20px rgba(60, 60, 120, .07);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1120;
    --card: #181b2e;
    --tx: #eceefb;
    --mu: #8b90ad;
    --bd: #262a45;
    --ac-soft: rgba(108, 92, 231, .14);
    --ok-soft: rgba(0, 184, 148, .16);
    --rd-soft: rgba(225, 112, 85, .16);
    --sh: none;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0f1120;
  --card: #181b2e;
  --tx: #eceefb;
  --mu: #8b90ad;
  --bd: #262a45;
  --ac-soft: rgba(108, 92, 231, .14);
  --ok-soft: rgba(0, 184, 148, .16);
  --rd-soft: rgba(225, 112, 85, .16);
  --sh: none;
  color-scheme: dark;
}

:root[data-theme="night"] {
  --bg: #080b13;
  --card: #111725;
  --tx: #e8edf8;
  --mu: #9aa7bd;
  --bd: #293246;
  --ac: #9884ff;
  --ac-soft: rgba(152, 132, 255, .16);
  --ok-soft: rgba(0, 184, 148, .18);
  --rd-soft: rgba(225, 112, 85, .18);
  --sh: 0 8px 28px rgba(0, 0, 0, .24);
  color-scheme: dark;
}

:root[data-theme="dark"] .pos-sales-table .pos-fixed-heading,
:root[data-theme="night"] .pos-sales-table .pos-fixed-heading,
:root[data-theme="dark"] .pos-sales-table .pos-column-heading,
:root[data-theme="night"] .pos-sales-table .pos-column-heading {
  background: var(--card);
  color: var(--tx);
}
:root[data-theme="dark"] .pos-sales-table .pos-group-sales,
:root[data-theme="night"] .pos-sales-table .pos-group-sales,
:root[data-theme="dark"] .pos-sales-table .pos-group-details,
:root[data-theme="night"] .pos-sales-table .pos-group-details { background: color-mix(in srgb, var(--ac) 24%, var(--card)); color: var(--tx); }
:root[data-theme="dark"] .pos-sales-table .pos-group-discounts,
:root[data-theme="night"] .pos-sales-table .pos-group-discounts { background: color-mix(in srgb, var(--ok) 20%, var(--card)); color: var(--tx); }
:root[data-theme="dark"] .pos-sales-table .pos-group-payment,
:root[data-theme="night"] .pos-sales-table .pos-group-payment,
:root[data-theme="dark"] .pos-sales-table .pos-group-reconciliation,
:root[data-theme="night"] .pos-sales-table .pos-group-reconciliation { background: color-mix(in srgb, #3986d7 24%, var(--card)); color: var(--tx); }
:root[data-theme="dark"] .pos-sales-table .pos-group-ewt,
:root[data-theme="night"] .pos-sales-table .pos-group-ewt,
:root[data-theme="dark"] .pos-sales-table .pos-group-warnings,
:root[data-theme="night"] .pos-sales-table .pos-group-warnings { background: color-mix(in srgb, #d8a527 20%, var(--card)); color: var(--tx); }
:root[data-theme="dark"] .pos-sales-table .pos-group-fees,
:root[data-theme="night"] .pos-sales-table .pos-group-fees { background: color-mix(in srgb, var(--rd) 22%, var(--card)); color: var(--tx); }
:root[data-theme="dark"] .pos-sales-table .pos-total-row th,
:root[data-theme="night"] .pos-sales-table .pos-total-row th,
:root[data-theme="dark"] .pos-sales-table .pos-total-row td,
:root[data-theme="night"] .pos-sales-table .pos-total-row td,
:root[data-theme="dark"] .statement-table .statement-section td,
:root[data-theme="night"] .statement-table .statement-section td { background: color-mix(in srgb, var(--ac) 16%, var(--card)); color: var(--tx); }
:root[data-theme="dark"] .report-signatures b,
:root[data-theme="night"] .report-signatures b { color: var(--tx); }
:root[data-theme="dark"] .report-signatures .signature-line,
:root[data-theme="night"] .report-signatures .signature-line { border-color: var(--mu); }
:root[data-theme="dark"] .report-signatures small,
:root[data-theme="night"] .report-signatures small { color: var(--mu); }

* { box-sizing: border-box; }
html { min-height: 100%; scroll-padding-top: 76px; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--tx);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
a { color: var(--ac); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--ac) 30%, transparent);
  outline-offset: 2px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 55px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--bd);
  background: color-mix(in srgb, var(--card) 94%, transparent);
  backdrop-filter: blur(14px);
}
.menu-toggle {
  display: grid;
  align-content: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  padding: 10px;
  border: 1px solid var(--bd);
  border-radius: 10px;
  background: var(--card);
  cursor: pointer;
}
.menu-toggle span { display: block; height: 2px; border-radius: 2px; background: var(--tx); }
.topbar-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: var(--tx);
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
}
.topbar-brand span { color: var(--mu); font-size: 12px; font-weight: 600; }
.topbar-title { overflow: hidden; font-size: 14px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.topbar-spacer { flex: 1; }
.branch-switcher select {
  width: min(310px, 36vw);
  min-height: 40px;
  padding: 8px 34px 8px 12px;
  border: 1px solid var(--bd);
  border-radius: 10px;
  background: var(--card);
  color: var(--tx);
}
.branch-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 240px;
  padding: 8px 12px;
  border: 1px solid var(--bd);
  border-radius: 10px;
  color: var(--mu);
  font-size: 12px;
  font-weight: 700;
}
.branch-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--ok); }
.account-menu { display: grid; gap: 0; min-width: 90px; }
.account-name { max-width: 180px; overflow: hidden; color: var(--tx); font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.account-role { color: var(--mu); font-size: 11px; }
.signout-form { margin: 0; }
.signout-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--bd);
  border-radius: 10px;
  background: var(--card);
  color: var(--mu);
  cursor: pointer;
  font-size: 18px;
}
.signout-button:hover { border-color: var(--ac); color: var(--ac); }
.theme-toggle { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 40px; min-width: 40px; height: 40px; padding: 0; border-color: var(--bd); background: var(--card); color: var(--ac); font-size: 20px; }
.theme-toggle:hover { border-color: var(--ac); background: var(--ac-soft); color: var(--ac); }
.theme-toggle-public { position: fixed; z-index: 2; top: 16px; right: 16px; }

.sidebar {
  position: fixed;
  z-index: 50;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  width: 250px;
  max-width: min(84vw, 320px);
  padding: max(18px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
  overflow-y: auto;
  border-right: 1px solid var(--bd);
  background: var(--card);
  box-shadow: 0 24px 60px rgba(12, 14, 32, .16);
  transform: translateX(-105%);
  transition: transform .22s ease;
}
body.nav-open .sidebar { transform: translateX(0); }
.nav-scrim {
  position: fixed;
  z-index: 40;
  inset: 0;
  visibility: hidden;
  background: rgba(13, 15, 32, .42);
  opacity: 0;
  transition: opacity .22s ease, visibility .22s ease;
}
body.nav-open .nav-scrim { visibility: visible; opacity: 1; }
.brand-mark {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 9px 16px;
  background: linear-gradient(90deg, var(--ac), var(--ok));
  background-clip: text;
  color: transparent;
  font-size: 19px;
  font-weight: 800;
  text-decoration: none;
  -webkit-background-clip: text;
}
.brand-mark .icon-symbol { flex-basis: auto; color: var(--ac); font-size: 20px; }
.sidebar-user { margin: -9px 8px 12px; color: var(--mu); font-size: 12px; }
.sidebar-nav { display: grid; gap: 3px; }
.nav-link, .nav-group summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 11px;
  border: 0;
  border-radius: 9px;
  color: var(--mu);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  list-style: none;
}
.nav-link:hover, .nav-group summary:hover { background: var(--bg); color: var(--tx); }
.nav-link.active { background: var(--ac-soft); color: var(--ac); }
.icon-symbol { display: inline-flex; flex: 0 0 20px; align-items: center; justify-content: center; color: currentColor; font-size: 16px; }
.brand-mark .icon-symbol { flex-basis: auto; color: var(--ac); font-size: 22px; }
.icon-button { width: 38px; min-width: 38px; height: 38px; min-height: 38px; padding: 0; color: var(--mu); font-size: 18px; }
.nav-group { margin-top: 5px; }
.nav-group summary { justify-content: space-between; color: var(--mu); font-size: 13px; font-weight: 650; letter-spacing: 0; text-transform: none; }
.nav-group summary::after { content: "▸"; color: var(--mu); font-size: 12px; transition: transform .18s ease; }
.nav-group[open] summary::after { transform: rotate(90deg); }
.nav-group > .nav-link { margin-left: 5px; }
.sidebar-signout { margin-top: auto; padding: 10px 11px 0; border-top: 1px solid var(--bd); }
.sidebar-signout button { width: 100%; padding: 8px 0; border: 0; background: transparent; color: var(--mu); text-align: left; font: inherit; cursor: pointer; }
.sidebar-signout button:hover { color: var(--rd); }
.sidebar-foot { display: none; }
.sidebar-foot span { color: var(--ac); }
.main-content, .public-shell { width: 100%; min-width: 0; max-width: 1500px; margin: 0 auto; padding: 26px clamp(16px, 3vw, 38px) 48px; }
.public-shell { display: grid; min-height: 100vh; place-items: center; padding: 24px 16px; }
.flash-message { padding: 11px 14px; border: 1px solid var(--bd); border-radius: 10px; background: var(--card); }
.flash-message.success { border-color: color-mix(in srgb, var(--ok) 35%, var(--bd)); color: var(--ok); }
.flash-message.error, .flash-message.warning { border-color: color-mix(in srgb, var(--rd) 35%, var(--bd)); color: var(--rd); }
.toast-stack { position: fixed; z-index: 12000; top: calc(16px + env(safe-area-inset-top, 0px)); left: 50%; display: grid; width: min(560px, calc(100vw - 32px)); gap: 8px; transform: translateX(-50%); pointer-events: none; }
.toast-message { display: grid; grid-template-columns: minmax(0, 1fr) 32px; align-items: start; gap: 12px; padding: 12px; border: 1px solid var(--bd); border-left: 4px solid var(--ac); border-radius: 8px; background: var(--card); color: var(--tx); box-shadow: 0 8px 30px rgba(20, 25, 40, .16); overflow-wrap: anywhere; pointer-events: auto; animation: toast-enter .18s ease-out both; }
.toast-message[data-toast-persistent] { grid-template-columns: minmax(0, 1fr); }
.toast-actions { display: flex; justify-content: flex-end; gap: 8px; }
.backup-checklist { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 16px; padding: 14px; border: 1px solid var(--bd); border-radius: 8px; }
.backup-checklist legend { padding: 0 6px; font-weight: 700; }
.backup-checklist label { display: flex; align-items: center; gap: 8px; }
.toast-message.success { border-left-color: var(--ok); }
.toast-message.error, .toast-message.warning { border-left-color: var(--rd); }
.toast-message.info { border-left-color: var(--ac); }
.toast-dismiss { display: grid; width: 32px; height: 32px; place-items: center; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--mu); font: inherit; font-size: 20px; line-height: 1; cursor: pointer; }
.toast-dismiss:hover { background: var(--ac-soft); color: var(--tx); }
.toast-message-leaving { animation: toast-exit .18s ease-in both; }
@keyframes toast-enter { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-exit { to { opacity: 0; transform: translateY(-6px); } }
@media (max-width: 560px) { .toast-stack { top: calc(10px + env(safe-area-inset-top, 0px)); width: calc(100vw - 20px); } }
@media (prefers-reduced-motion: reduce) { .toast-message, .toast-message-leaving { animation: none; } }
.approval-dialog { width: min(440px, calc(100vw - 32px)); max-width: none; padding: 28px; border: 1px solid var(--bd); border-radius: 18px; background: var(--card); color: var(--tx); box-shadow: 0 24px 70px rgba(12, 14, 32, .28); text-align: center; }
.approval-dialog::backdrop { background: rgba(12, 15, 32, .58); backdrop-filter: blur(3px); }
.approval-dialog-icon { display: grid; width: 56px; height: 56px; place-items: center; margin: 0 auto 16px; border-radius: 50%; background: var(--ac-soft); color: var(--ac); font-size: 28px; font-weight: 800; }
.approval-dialog h2 { margin: 0 0 10px; font-size: 20px; }
.approval-dialog p { margin: 0; color: var(--mu); line-height: 1.6; }
.approval-dialog-actions { display: flex; justify-content: center; margin-top: 22px; }
.approval-dialog-actions .btn { min-width: 110px; }

h1, h2, h3, h4 { color: var(--tx); }
h1 { margin: 0; font-size: 23px; line-height: 1.25; }
h2 { font-size: 19px; }
h3 { margin: 0 0 8px; font-size: 15px; }
p { line-height: 1.55; }
.muted, .note { color: var(--mu); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.page-head h1 { margin: 0; }
.page-head > div:first-child p { margin: 5px 0 0; color: var(--mu); }
.page-head .btn, .page-head .button { flex: 0 0 auto; }
.page-head-actions { display: flex; align-items: center; gap: 8px; }
.card, .paper {
  border: 1px solid var(--bd);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--sh);
}
.card { padding: 16px; }
h1 { margin: 0; font-size: 22px; line-height: 1.25; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 13px; margin-bottom: 15px; }
.kpi { min-height: 98px; padding: 15px 17px; }
.kpi-link { color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
.kpi-link:hover { border-color: var(--ac); box-shadow: var(--sh); transform: translateY(-1px); }
.kpi-link:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; }
.kpi-link.is-selected { border-color: var(--ac); box-shadow: inset 0 0 0 1px var(--ac); }
.kpi small, .kpi span { color: var(--mu); font-size: 12px; font-weight: 700; }
.kpi b { display: block; margin-top: 5px; color: var(--tx); font-size: 23px; line-height: 1.2; }
.kpi .kpi-detail { display: block; margin-top: 5px; font-size: 11px; font-weight: 500; }
.kpi .positive { color: var(--ok); }
.kpi .negative { color: var(--rd); }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chart-card { min-width: 0; padding: 17px; }
.chart-card h3 { margin-bottom: 14px; }
.chart { position: relative; height: 250px; }

.btn, button.btn, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--bd);
  border-radius: 9px;
  background: var(--card);
  color: var(--tx);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease, transform .15s ease;
}
.btn:hover, button.btn:hover, .button:hover { border-color: color-mix(in srgb, var(--ac) 45%, var(--bd)); color: var(--ac); }
.btn.primary, button.btn.primary, .button.primary { border-color: var(--ac); background: var(--ac); color: #fff; }
.btn.primary:hover, button.btn.primary:hover { background: #5b4bd5; }
.btn.toolbar-export-button { border-color: var(--ac); background: var(--ac); color: #fff; }
.btn.toolbar-export-button:hover { border-color: #5b4bd5; background: #5b4bd5; color: #fff; }
.btn.toolbar-import-button { border-color: var(--ok); background: var(--ok); color: #fff; }
.btn.toolbar-import-button:hover { border-color: #009b7d; background: #009b7d; color: #fff; }
.btn.danger, button.btn.danger { color: var(--rd); }
.btn.wide { width: 100%; }
button:disabled { cursor: not-allowed; opacity: .5; }

.table-wrap, .tw { width: 100%; overflow-x: auto; }
.table-wrap { max-height: min(70vh, 720px); overflow-y: auto; padding-top: 0; }
.cash-bulk-post-form { margin: 0 0 10px; }
.cash-bulk-post-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.cash-bulk-post-actions label { display: inline-flex; align-items: center; gap: 7px; margin: 0 auto 0 0; }
.cash-bulk-post-actions input[type="checkbox"] { width: 17px; min-height: 17px; accent-color: var(--ac); }
.data-table, table { width: 100%; border-collapse: collapse; }
.data-table { border-collapse: separate; border-spacing: 0; }
#records-pos.pos-sales-table { width: max-content; min-width: 100%; table-layout: fixed; }
.pos-sales-table-wrap { max-height: min(72vh, 760px); overscroll-behavior: contain; }
.pos-sticky-header { position: fixed; z-index: 25; overflow: hidden; background: var(--card); box-shadow: 0 4px 8px rgba(20, 30, 60, .12); pointer-events: none; }
.pos-sticky-header[hidden] { display: none; }
.pos-sticky-header .pos-sales-table { margin: 0; }
.pos-calendar-month { width: auto; min-width: 160px; }
.toolbar-right { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.pos-month-post-control { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.pos-month-post-form { display: flex; margin: 0; }
.pos-month-hint { max-width: 220px; color: var(--mu); font-size: 11px; line-height: 1.3; }
@media (max-width: 650px) { .pos-calendar-month { flex: 1; } }
.pos-sales-table th, .pos-sales-table td { padding: 7px 8px; font-size: 11px; }
.pos-sales-table th { text-align: center; }
.pos-sales-table .pos-group-heading { position: sticky; top: 0; z-index: 4; height: 30px; border-bottom: 0; font-size: 10px; letter-spacing: .04em; }
.pos-sales-table .pos-fixed-heading { position: sticky; top: 0; z-index: 5; min-width: 70px; background: #f1f5fb; vertical-align: middle; }
.pos-sales-table .pos-group-heading-row th:first-child { border-top-left-radius: 8px; }
.pos-sales-table .pos-column-heading { position: sticky; top: 30px; z-index: 3; height: 48px; min-width: 68px; white-space: normal; line-height: 1.25; background: #f7f9fd; }
.pos-sales-table .pos-group-sales { background: #e9e5ff; color: #5743b2; }
.pos-sales-table .pos-group-discounts { background: #e4f5ef; color: #18785d; }
.pos-sales-table .pos-group-payment { background: #e4efff; color: #245b9e; }
.pos-sales-table .pos-group-ewt { background: #fff0e4; color: #a7591c; }
.pos-sales-table .pos-group-fees { background: #ffe9ec; color: #a9364a; }
.pos-sales-table .pos-group-details { background: #f0eaff; color: #6840a0; }
.pos-sales-table .pos-group-reconciliation { background: #ddf4f7; color: #176c79; }
.pos-sales-table .pos-group-warnings { background: #fff4db; color: #866000; }
.pos-sales-table .pos-table-cell { min-width: 68px; max-width: 150px; text-align: center; vertical-align: middle; overflow-wrap: anywhere; }
.pos-sales-table .pos-numeric { min-width: 88px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pos-sales-table .pos-nowrap { white-space: nowrap; }
.pos-sales-table td:nth-child(3) { min-width: 120px; }
.pos-sales-table .pos-warning-cell { min-width: 180px; color: var(--rd); }
.pos-sales-table .pos-status-cell { text-align: center; white-space: nowrap; }
.pos-sales-table .pos-status-text { color: var(--tx); font-weight: 650; }
.pos-sales-table .pos-posting-status { color: var(--mu); }
.pos-sales-table .pos-actions-heading, .pos-sales-table .pos-actions-cell { position: sticky; right: 0; z-index: 5; min-width: 74px; background: var(--card); }
.pos-sales-table .pos-total-row th, .pos-sales-table .pos-total-row td { position: sticky; bottom: 0; z-index: 2; border-top: 1px solid var(--bd); background: #f3f1ff; color: var(--tx); font-weight: 800; }
.pos-sales-table .pos-total-row .pos-total-label { z-index: 3; text-align: left; color: #5743b2; }
#records-cash_disbursements { min-width: 1500px; }
#records-cash_disbursements { min-width: 1500px; }
#records-cash_disbursements th:nth-last-child(6), #records-cash_disbursements td:nth-last-child(6) { min-width: 220px; }
#records-cash_disbursements th:nth-last-child(5), #records-cash_disbursements td:nth-last-child(5) { min-width: 210px; }
#records-cash_disbursements th:nth-last-child(4), #records-cash_disbursements td:nth-last-child(4) { min-width: 115px; white-space: nowrap; }
#records-cash_disbursements th:nth-last-child(3), #records-cash_disbursements td:nth-last-child(3),
#records-cash_disbursements th:nth-last-child(2), #records-cash_disbursements td:nth-last-child(2) { min-width: 120px; white-space: nowrap; }
.data-table th, .data-table td, th, td { padding: 10px 12px; border-bottom: 1px solid var(--bd); text-align: left; }
.data-table thead th { border-bottom: 2px solid var(--tx); }
.table-wrap > table thead th { position: sticky; z-index: 2; top: 0; background: var(--card); box-shadow: inset 0 -2px 0 var(--tx); }
.data-table th, th { color: var(--mu); font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.data-table td, td { color: var(--tx); font-size: 13px; }
.data-table tbody tr:hover { background: color-mix(in srgb, var(--ac) 3%, transparent); }
.data-table tbody tr:last-child td { border-bottom: 0; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
tr.t td { border-top: 2px solid var(--tx); font-weight: 800; }
tr.h td { background: var(--ac-soft); color: var(--ac); font-weight: 800; }
tr.dup td { background: var(--rd-soft); }
.journal-balance-summary { margin: 0 0 10px; }
.journal-table-wrap > table { min-width: 1050px; }
.journal-entry-row td { vertical-align: top; }
.journal-entry-date { box-shadow: inset 4px 0 0 var(--ac); white-space: nowrap; }
.journal-entry-reference { min-width: 140px; }
.journal-entry-reference .tag { margin-top: 4px; }
.journal-lines-cell { min-width: 300px; }
.journal-lines-detail { min-width: 270px; }
.journal-line { display: grid; grid-template-columns: minmax(110px, 1fr) repeat(2, minmax(72px, auto)); align-items: baseline; gap: 8px; min-height: 23px; padding: 3px 0; border-bottom: 1px dashed var(--bd); }
.journal-line > span:first-child { overflow-wrap: anywhere; }
.journal-line .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.journal-line-heading { color: var(--mu); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.journal-line:last-child { border-bottom: 0; }
.journal-total-line { border-top: 1px solid var(--bd); font-weight: 800; }
.journal-amount-cell { min-width: 95px; white-space: nowrap; }
.journal-table td.journal-actions { display: table-cell; width: 1%; vertical-align: middle; text-align: right; white-space: nowrap; }
.journal-actions .table-action-menu { display: inline-block; }
.journal-pager { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.journal-pager .page-size-form { margin: 0; }
.journal-pager select { width: auto; min-height: 34px; padding: 5px 8px; }
.journal-pager .note { font-size: 12px; }
.tag { display: inline-flex; align-items: center; min-height: 22px; padding: 2px 9px; border-radius: 999px; background: var(--ac-soft); color: var(--ac); font-size: 11px; font-weight: 750; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.bad { background: var(--rd-soft); color: var(--rd); }

.form-card { width: min(760px, 100%); margin-inline: auto; padding: clamp(18px, 3vw, 28px); }
.pos-entry-card { width: min(1100px, 100%); }
.pos-entry-form .pos-entry-note { grid-column: 1 / -1; margin: 0 0 12px; color: var(--mu); font-size: 12px; }
.pos-entry-form .pos-entry-section { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; min-width: 0; margin: 0 0 14px; padding: 16px; border: 1px solid var(--bd); border-radius: 10px; }
.pos-entry-section h2 { grid-column: 1 / -1; margin: 0 0 14px; font-size: 15px; }
.pos-entry-form .pos-entry-section .field { min-width: 0; }
.pos-entry-form .pos-entry-section .field-wide { grid-column: 1 / -1; }
.pos-entry-form .pos-entry-section .field-checkbox { align-self: center; }
.pos-entry-form .form-actions { grid-column: 1 / -1; }
.form-card h1, .form-card h2 { margin-bottom: 18px; }
.form-card form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-card form .field-wide { grid-column: 1 / -1; }
.form-card form > p, .form-card form > button, .form-card form > .form-errors, .form-card form > .non-field-errors { grid-column: 1 / -1; }
.form-card form > .form-actions { grid-column: 1 / -1; }
.cash-posting-preview { grid-column: 1 / -1; min-width: 0; margin: 6px 0 14px; padding: 16px; border: 1px solid var(--bd); border-radius: 8px; background: color-mix(in srgb, var(--ac-soft) 35%, var(--card)); }
.cash-posting-preview-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.cash-posting-preview-heading h2 { margin: 0; font-size: 15px; }
.cash-posting-preview-heading p { margin: 3px 0 0; }
.cash-posting-table { width: 100%; border-collapse: collapse; }
.cash-posting-table th, .cash-posting-table td { padding: 7px 9px; border-bottom: 1px solid var(--bd); }
.cash-posting-table th { color: var(--mu); font-size: 11px; }
.cash-posting-table .amount { text-align: right; font-variant-numeric: tabular-nums; }
.cash-posting-table tfoot th, .cash-posting-table tfoot td { border-top: 2px solid var(--tx); border-bottom: 0; font-weight: 750; }
.field { min-width: 0; margin-bottom: 13px; }
.field label, label { display: block; margin: 0 0 5px; color: var(--mu); font-size: 11px; font-weight: 800; }
.field input, .field select, .field textarea, input, select, textarea {
  max-width: 100%;
  min-height: 39px;
  padding: 9px 11px;
  border: 1px solid var(--bd);
  border-radius: 9px;
  background: var(--card);
  color: var(--tx);
}
.field input, .field select, .field textarea { width: 100%; }
.field textarea { min-height: 96px; resize: vertical; }
.form-card input[type="checkbox"], input[type="checkbox"] { width: 17px; min-height: 17px; accent-color: var(--ac); }
.field ul.errorlist, ul.errorlist, .error { margin: 5px 0 0; padding: 0; color: var(--rd); font-size: 12px; list-style: none; }
.form-card form > p { margin: 0 0 13px; }
.form-card form > p label { margin-bottom: 5px; }
.form-card form > p input, .form-card form > p select { width: 100%; }

.searchbar { display: flex; align-items: center; gap: 10px; width: 230px; min-width: 0; margin: 0; flex: 0 1 230px; }
.searchbar input { width: 100%; min-height: 42px; padding: 9px 14px; border-radius: 10px; background: var(--card); }
.searchbar input[type="hidden"] { display: none; }
.search-wrap { position: relative; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.toolbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.toolbar > .tag { margin-left: auto; }
.report-page-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 10px; }
.report-page-heading h1 { margin: 0; font-size: 22px; }
.report-page-heading .data-tools { flex: 0 0 auto; }
.report-filter-row { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.report-filter-row .date-filter { justify-content: flex-end; }
.report-filter-row.general-ledger-filter-row { justify-content: space-between; gap: 12px; }
.report-head p { margin: 3px 0; }
.date-filter { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 5px 10px; border: 1px solid var(--bd); border-radius: 12px; background: var(--card); }
.date-filter label { margin: 0; color: var(--mu); font-size: 11px; white-space: nowrap; }
.date-filter input[type="date"] { width: 180px; min-width: 150px; min-height: 38px; padding: 6px 9px; border-radius: 9px; }
.data-tools, .export-form, .form-actions, .table-actions { display: inline-flex; align-items: center; gap: 8px; }
.export-form { margin: 0; }
.export-form select { display: none; }
.import-picker-form { display: none; }
.action-menu { position: relative; }
.action-menu > summary { list-style: none; cursor: pointer; }
.action-menu > summary::-webkit-details-marker { display: none; }
.action-menu-panel { position: absolute; z-index: 70; top: calc(100% + 6px); right: 0; min-width: 190px; padding: 6px; border: 1px solid var(--bd); border-radius: 10px; background: var(--card); box-shadow: 0 12px 30px rgba(25, 28, 55, .16); }
.table-action-menu[open] .action-menu-panel { position: fixed; top: auto; right: auto; }
.table-action-menu > summary { min-width: 34px; min-height: 34px; padding: 3px 8px; font-size: 20px; line-height: 1; }
.action-menu-panel form { display: grid; gap: 2px; }
.action-menu-item { display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--tx); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.action-menu-item:hover { background: var(--ac-soft); color: var(--ac); }
.action-menu-item.danger { color: var(--rd); }
.action-menu-item.disabled { color: var(--mu); cursor: default; }
.action-menu-item.disabled:hover { background: transparent; color: var(--mu); }
.action-menu-note { margin: 5px 8px; color: var(--mu); font-size: 10px; line-height: 1.4; }
.table-actions { white-space: nowrap; }
.data-table td.table-actions { display: table-cell; width: 1%; vertical-align: middle; white-space: nowrap; }
.table-actions form { display: inline-flex; margin: 0; }
.table-status { white-space: nowrap; }
.table-status form { display: inline-flex; margin: 0 0 0 6px; vertical-align: middle; }
.data-table td.table-actions .btn + .btn { margin-left: 6px; }
.table-actions .btn { min-height: 31px; padding: 6px 9px; }
.coa-bulk-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.coa-bulk-actions label { display: inline-flex; align-items: center; gap: 7px; margin: 0; }
.coa-bulk-actions input[type="checkbox"], .coa-select-cell input[type="checkbox"] { width: 16px; min-height: 16px; margin: 0; accent-color: var(--ac); }
.coa-select-cell { width: 38px; text-align: center !important; }
.coa-bulk-actions button:disabled { opacity: .5; }
.coa-bulk-delete-selected[hidden] { display: none; }
.modal-form-actions { justify-content: flex-end; margin-top: 10px; }
.btn.danger { border-color: color-mix(in srgb, var(--rd) 30%, var(--bd)); color: var(--rd); }
.import-card, .confirm-delete-card { width: min(760px, 100%); margin-inline: auto; }
.import-upload-form { display: grid; gap: 12px; }
.import-upload-form input[type="file"] { min-height: auto; padding: 12px; }
.import-summary { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.import-preview-dialog-content { padding: 22px; border: 1px solid var(--bd); border-radius: 16px; background: var(--card); color: var(--tx); box-shadow: var(--sh); }
.import-preview-form { display: grid; gap: 10px; }
.import-preview-heading { display: grid; gap: 3px; margin: 0 0 8px; }
.import-preview-heading h3 { margin: 0; font-size: 16px; }
.import-preview-heading .note { margin: 0; }
.import-preview-alert { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: start; gap: 11px; margin: 8px 0; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--rd) 28%, var(--bd)); border-left: 4px solid var(--rd); border-radius: 10px; background: color-mix(in srgb, var(--rd-soft) 55%, var(--card)); color: var(--tx); }
.import-preview-alert-icon { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: var(--rd-soft); color: var(--rd); font-size: 14px; font-weight: 850; }
.import-preview-alert strong { display: block; margin: 1px 0 3px; color: var(--rd); font-size: 12px; }
.import-preview-alert p { margin: 0; color: var(--tx); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.import-preview-alert p b { font-weight: 750; }
.import-preview-status { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.import-preview-status .tag { white-space: normal; }
.import-preview-status-actions { display: flex; flex: 0 0 auto; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.import-preview-status-actions .btn[hidden] { display: none; }
.import-bulk-remove[hidden] { display: none; }
.import-preview-table { max-height: 46vh; overflow: auto; }
.import-preview-table table { min-width: 840px; }
.import-preview-table table[data-show-readonly-only="true"] [data-import-editable-column] { display: none; }
.import-preview-table [data-import-readonly-column] .note { display: inline; font-size: 10px; text-transform: none; }
.import-preview-table select { min-width: 150px; min-height: 34px; padding: 6px 8px; }
.import-preview-table input { min-width: 130px; min-height: 34px; padding: 6px 8px; }
.import-account-picker { position: relative; min-width: 220px; }
.import-account-picker > input { width: 100%; padding-right: 34px; }
.import-account-toggle { position: absolute; top: 3px; right: 3px; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--mu); cursor: pointer; }
.import-account-toggle:hover, .import-account-toggle:focus { background: var(--ac-soft); color: var(--tx); outline: none; }
.import-account-picker > select[hidden], .import-account-suggestions[hidden] { display: none; }
.import-account-suggestions { position: absolute; z-index: 20; top: 100%; left: 0; right: 0; max-height: 240px; overflow-y: auto; border: 1px solid var(--bd); border-radius: 6px; background: var(--card); box-shadow: 0 8px 20px rgba(0,0,0,.16); }
.import-account-suggestion { display: block; width: 100%; padding: 8px 10px; border: 0; background: transparent; color: var(--tx); text-align: left; cursor: pointer; }
.import-account-suggestion:hover, .import-account-suggestion:focus { background: var(--ac-soft); outline: none; }
.import-account-source { display: block; min-width: 160px; margin-top: 4px; color: var(--mu); font-size: 10px; font-weight: 500; line-height: 1.35; text-transform: none; }
.import-preview-table td.import-issue { min-width: 220px; max-width: 300px; white-space: normal; overflow-wrap: anywhere; vertical-align: top; }
.import-source-label { color: var(--tx); }
.import-row-error th:first-child, .import-row-error td.import-issue { background: var(--rd-soft); }
.import-row-error small:not(.import-account-source) { display: block; max-width: 200px; color: var(--rd); font-size: 10px; font-weight: 500; text-transform: none; }
.import-actions { justify-content: flex-end; }
@media (max-width: 760px) {
  .import-preview-status-actions { width: 100%; }
  .import-preview-alert { padding: 11px; }
}
.confirm-delete-card h1 { margin-bottom: 10px; }
.confirm-delete-card .form-actions { margin-top: 18px; }
.record-dialog { width: min(560px, 94vw); max-width: none; max-height: 92vh; padding: 0; overflow: visible; border: 0; background: transparent; box-shadow: none; }
.record-dialog.wide { width: min(1100px, 96vw); }
.record-dialog::backdrop { background: rgba(10, 10, 30, .5); }
.record-dialog-content { max-height: 92vh; overflow: auto; border-radius: 16px; }
.record-dialog-content .form-card { width: 100%; max-width: none; max-height: none; }
.record-dialog-content .journal-entry-form { padding: 20px; border: 1px solid var(--bd); border-radius: 16px; background: var(--card); box-shadow: var(--sh); }
.journal-entry-form { display: grid; gap: 16px; }
.journal-entry-meta { min-width: 0; }
.journal-entry-form .journal-meta-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.journal-entry-form .journal-meta-fields > * { min-width: 0; }
.journal-entry-form .journal-meta-fields .field-wide { grid-column: 1 / -1; }
.journal-entry-form .journal-meta-fields input, .journal-entry-form .journal-meta-fields select, .journal-entry-form .journal-meta-fields textarea { width: 100%; max-width: 100%; box-sizing: border-box; }
.journal-lines-card { min-width: 0; }
.journal-entry-actions { justify-content: flex-end; }
@media (max-width: 700px) {
  .pos-sales-table th, .pos-sales-table td { padding: 6px; }
  .journal-entry-form .journal-meta-fields { grid-template-columns: minmax(0, 1fr); }
  .journal-entry-form .journal-meta-fields .field-wide { grid-column: auto; }
}
.settings-form { display: grid; gap: 14px; }
.settings-section { padding: clamp(16px, 2.5vw, 24px); }
.settings-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--bd); }
.settings-section-heading > div { display: flex; align-items: center; gap: 10px; }
.settings-section-heading h2 { margin: 0; font-size: 16px; }
.settings-section-heading p { margin: 0; color: var(--mu); font-size: 12px; }
.section-index { color: var(--ac); font-size: 11px; font-weight: 850; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.settings-grid .field-wide { grid-column: 1 / -1; }
.profile-page { display: grid; width: min(1180px, 100%); grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-inline: auto; align-items: stretch; }
.profile-page-heading { display: flex; grid-column: 1 / -1; align-items: center; gap: 16px; margin: 4px 0 8px; }
.profile-page-heading h1 { margin: 0; font-size: 22px; }
.profile-page-heading p { margin: 3px 0 0; color: var(--mu); }
.profile-page-icon { display: grid; width: 54px; height: 54px; flex: 0 0 54px; place-items: center; border-radius: 12px; background: var(--ac-soft); color: var(--ac); }
.profile-page-icon svg { width: 30px; height: 30px; stroke: currentColor; stroke-width: 1.8; }
.profile-page > .card { width: 100%; min-width: 0; padding: 20px; }
.profile-page .profile-backup { grid-column: 1 / -1; }
.profile-card-heading { display: flex; min-height: 64px; align-items: center; gap: 14px; padding-bottom: 16px; border-bottom: 1px solid var(--bd); }
.profile-card-icon { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; color: var(--ac); }
.profile-card-icon svg { width: 32px; height: 32px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.profile-card-title { min-width: 0; margin-right: auto; }
.profile-card-title h2 { margin: 0 0 3px; font-size: 16px; }
.profile-card-title p { margin: 0; color: var(--mu); font-size: 12px; }
.profile-panel-toggle { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 8px 12px; border-color: color-mix(in srgb, var(--ac) 32%, var(--bd)); background: var(--ac-soft); color: var(--tx); font-size: 11px; font-weight: 750; text-transform: uppercase; }
.profile-panel-toggle:hover { border-color: var(--ac); background: color-mix(in srgb, var(--ac) 21%, var(--card)); color: var(--tx); }
.profile-panel-toggle svg { width: 16px; height: 16px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.profile-personal-details { display: grid; grid-template-columns: 80px minmax(0, 1fr); align-items: center; gap: 20px; padding-top: 20px; }
.profile-avatar { display: grid; width: 72px; height: 72px; flex: 0 0 72px; place-items: center; border: 1px solid color-mix(in srgb, var(--ac) 18%, var(--bd)); border-radius: 50%; background: var(--ac-soft); color: var(--ac); font-size: 30px; font-weight: 750; }
.profile-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 22px; margin: 0; }
.profile-details div { min-width: 0; }
.profile-details dt { margin-bottom: 3px; color: var(--mu); font-size: 12px; }
.profile-details dd { margin: 0; color: var(--tx); font-weight: 600; overflow-wrap: anywhere; }
.profile-security-info { display: flex; min-height: 145px; align-items: center; gap: 22px; padding: 18px 8px 8px; }
.profile-security-icon { display: grid; width: 82px; height: 82px; flex: 0 0 82px; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--ac) 10%, var(--bg)); color: var(--ac); }
.profile-security-icon svg { width: 42px; height: 42px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.profile-security-info > div { padding-left: 22px; border-left: 1px solid var(--bd); }
.profile-security-info h3, .profile-backup-summary h3 { margin: 0 0 5px; color: var(--tx); font-size: 13px; }
.profile-security-info p, .profile-backup-summary p { margin: 0; color: var(--mu); font-size: 12px; }
.profile-backup-summary { display: flex; min-height: 78px; align-items: center; gap: 14px; padding-top: 14px; }
.profile-backup-calendar { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; color: var(--mu); }
.profile-backup-calendar svg { width: 28px; height: 28px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.profile-chevron { margin-left: auto; color: var(--mu); font-size: 28px; line-height: 1; }
.profile-panel { grid-column: 1 / -1; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--bd); }
.profile-panel[hidden] { display: none; }
.profile-panel > h3 { margin: 0 0 5px; }
.profile-panel > .note { margin: 0 0 14px; }
.field-checkbox { display: flex; align-items: center; gap: 10px; }
.field-checkbox label { margin: 0; }
.field-checkbox input { order: 2; width: 18px; min-height: 18px; accent-color: var(--ac); }
.settings-actions { display: flex; justify-content: flex-end; }

.paper { width: 100%; padding: clamp(18px, 4vw, 34px); color: var(--tx); }
.paper .report-head, .rh { margin-bottom: 18px; text-align: center; }
.paper .report-head h2, .rh h2 { margin: 0; font-size: 20px; text-transform: uppercase; }
.paper .report-head p, .rh p { margin: 4px 0; color: var(--mu); font-size: 12px; }
.paper th, .paper td { border-color: var(--bd); }
.paper .sig { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 50px; text-align: center; }
.paper .sig div { padding-top: 7px; border-top: 1px solid var(--tx); }
.financial-report { max-width: none; margin: 0 auto 28px; padding: 30px 34px; border-radius: 8px; background: var(--card); }
.financial-report .report-head { margin-bottom: 26px; }
.financial-report .report-head p { overflow-wrap: anywhere; }
.financial-report .report-head h3 { margin: 8px 0 2px; font-size: 16px; }
.financial-report .report-period { margin-top: 10px; color: var(--tx); font-weight: 650; }
.statement-table { width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
.statement-table th, .statement-table td { padding: 8px 10px; border-bottom: 1px solid var(--bd); text-align: left; vertical-align: top; }
.statement-table thead th { border-bottom: 2px solid var(--tx); color: var(--tx); font-size: 11px; }
.statement-table .amount { text-align: right; white-space: nowrap; }
.statement-table .statement-section th { padding-top: 17px; border-bottom: 1px solid var(--tx); color: var(--tx); font-size: 12px; text-transform: uppercase; }
.statement-table .statement-section td { color: #111; background: #f1f1f6; font-weight: 700; }
.statement-table .statement-subtotal th, .statement-table .statement-subtotal td { border-top: 1px solid var(--bd); font-weight: 700; }
.statement-table .statement-total th, .statement-table .statement-total td { border-top: 2px solid var(--tx); border-bottom: 3px double var(--tx); font-weight: 800; }
.statement-table .report-empty { padding: 20px 10px; color: var(--mu); text-align: center; }
.report-signatures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin: 56px 0 10px; text-align: center; break-inside: avoid; }
.report-signatures div { display: grid; min-height: 64px; grid-template-rows: auto 1fr auto; font-size: 13px; }
.report-signatures b { display: block; min-height: 22px; color: #111; }
.report-signatures .signature-line { align-self: end; border-top: 1px solid #111; }
.report-signatures small { color: #555; }
@media (max-width: 720px) { .financial-report { padding: 22px 14px; } .statement-table { min-width: 680px; } .report-signatures { grid-template-columns: 1fr; gap: 24px; margin-top: 36px; } }
@media (max-width: 720px) { .report-page-heading { align-items: flex-start; flex-direction: column; } .report-filter-row { justify-content: stretch; } .report-filter-row .date-filter { width: 100%; flex-wrap: wrap; } .report-filter-row .date-filter input[type="date"] { flex: 1 1 140px; min-width: 0; } }
@media print {
  @page { margin: 14mm; }
  .report-page-heading, .report-filter-row, .page-head, .sidebar, .topbar { display: none !important; }
  .financial-report { max-width: none; margin: 0; padding: 0; overflow: visible; border: 0; box-shadow: none; }
  .statement-table { min-width: 0; }
  .statement-table thead { display: table-header-group; }
  .statement-table tr { break-inside: avoid; }
  .report-signatures { margin-top: 42px; }
}

.auth { display: grid; min-height: min(680px, calc(100vh - 48px)); place-items: center; width: min(430px, 94vw); }
.auth > .card, .auth-card { width: 100%; padding: 28px; border-radius: 16px; }
.auth-brand { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; background: linear-gradient(90deg, var(--ac), var(--ok)); background-clip: text; color: transparent; font-size: 19px; font-weight: 800; text-decoration: none; -webkit-background-clip: text; }
.auth-brand .icon-symbol { flex-basis: auto; color: var(--ac); }
.auth-heading { margin: 0 0 8px; font-size: 19px; }
.auth-subtitle { margin: 0 0 16px; font-size: 13px; }
.auth .login-form .field { margin-bottom: 12px; }
.auth .login-form .field label { margin: 0 0 4px; }
.auth .login-form input { width: 100%; }
.login-options { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 14px; }
.remember-me { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 7px; margin: 0; color: var(--mu); font-size: 11px; font-weight: 600; white-space: nowrap; }
.remember-me input { width: 15px; min-height: 15px; margin: 0; accent-color: var(--ac); }
.login-options .btn.text-button { white-space: nowrap; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 46px; }
.eye-btn { position: absolute; top: 50%; right: 6px; display: grid; width: 38px; height: 38px; place-items: center; padding: 0; transform: translateY(-50%); border: 0; background: transparent; color: var(--mu); cursor: pointer; font-size: 18px; }
.eye-btn:hover { color: var(--ac); }
.auth-errors, .auth-feedback { min-height: 0; margin: 0 0 10px; color: var(--rd); font-size: 12px; }
.auth-feedback:empty { display: none; }
.auth-submit { width: 100%; min-height: 40px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 15px 0 10px; color: var(--mu); font-size: 11px; }
.auth-divider::before, .auth-divider::after { height: 1px; flex: 1; background: var(--bd); content: ""; }
.auth-actions { display: grid; gap: 8px; }
.auth-provider { width: 100%; justify-content: center; }
.auth-note { margin: 13px 0 0; text-align: center; font-size: 11px; }
.auth-note a { color: var(--ac); font-weight: 700; }
.auth-note .btn.text-button { min-height: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--ac); font-size: inherit; font-weight: 700; }
.auth-note .btn.text-button:hover { border: 0; background: transparent; color: var(--ac); text-decoration: underline; }
.auth-dialog { width: min(420px, 92vw); max-height: 90vh; padding: 22px; border: 0; border-radius: 18px; background: var(--card); color: var(--tx); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.signup-dialog { width: min(560px, 94vw); }
.auth-dialog::backdrop { background: rgba(10, 10, 30, .5); }
.auth-dialog h2 { margin: 0 0 8px; font-size: 19px; }
.auth-dialog p { margin: 0 0 14px; }
.signup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.signup-grid .field:first-child, .signup-grid .field:last-child { grid-column: 1 / -1; }
.auth-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.quiet-button { color: var(--mu); }
.auth h1, .auth h2 { margin: 0 0 8px; }
.auth .brand { color: var(--ac); }
.auth form p { margin: 0 0 14px; }
.auth form p label { display: block; margin-bottom: 5px; }
.auth form p input { width: 100%; }
.auth a { color: var(--ac); font-weight: 700; }
.auth .error { margin: 8px 0; }
.social-error-icon { display: grid; width: 48px; height: 48px; place-items: center; margin: 2px 0 14px; border: 1px solid color-mix(in srgb, var(--rd) 32%, var(--bd)); border-radius: 14px; background: var(--rd-soft); color: var(--rd); font-size: 25px; font-weight: 800; }
.social-error-title { margin: 0 0 8px; font-size: 21px; }
.social-error-message { margin: 0 0 18px; }
.social-error-help { padding: 14px; border: 1px solid var(--bd); border-radius: 10px; background: color-mix(in srgb, var(--bg) 65%, var(--card)); }
.social-error-help h2 { margin: 0 0 6px; font-size: 13px; }
.social-error-help p { margin: 0 0 10px; color: var(--mu); font-size: 12px; }
.social-error-help code { display: block; padding: 9px; border-radius: 7px; background: var(--card); color: var(--tx); font-size: 11px; overflow-wrap: anywhere; }
.social-error-actions { display: flex; justify-content: flex-end; margin-top: 16px; }

#scrim { display: none; }
.inline { display: inline-flex; }
.grow { flex: 1; }
.hide { display: none !important; }

@media (max-width: 760px) {
  .topbar { min-height: 58px; gap: 9px; padding: 8px 12px; }
  .theme-toggle { width: 36px; min-width: 36px; height: 36px; }
  .topbar-brand { font-size: 14px; }
  .topbar-brand span { display: none; }
  .branch-switcher { min-width: 0; }
  .branch-switcher select { width: min(43vw, 220px); min-height: 38px; padding: 7px 25px 7px 9px; font-size: 11px; }
  .account-menu { display: none; }
  .main-content { padding: 18px 14px 34px; }
  .public-shell { padding: 18px 14px; }
  .grid.two { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .kpi { min-height: 86px; padding: 12px; }
  .kpi b { font-size: 19px; }
  .chart { height: 210px; }
  .form-card form { grid-template-columns: minmax(0, 1fr); }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .profile-details { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .profile-personal-details { grid-template-columns: 64px minmax(0, 1fr); gap: 14px; }
  .profile-avatar { width: 60px; height: 60px; font-size: 25px; }
  .profile-security-info { min-height: 110px; }
  .profile-page > .card { padding: 16px; }
  .profile-card-heading { flex-wrap: wrap; gap: 10px; }
  .profile-card-title { flex: 1 1 calc(100% - 52px); }
  .profile-panel-toggle { margin-left: auto; }
  .profile-page .profile-backup { grid-column: auto; }
  .profile-page { grid-template-columns: minmax(0, 1fr); }
  .profile-page-heading { grid-column: auto; }
  .signup-grid { grid-template-columns: minmax(0, 1fr); }
  .signup-grid .field:first-child, .signup-grid .field:last-child { grid-column: auto; }
  .settings-grid .field-wide { grid-column: auto; }
  .settings-section-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
  .toolbar { align-items: flex-start; flex-direction: column; gap: 10px; }
  .toolbar-left { width: 100%; }
  .toolbar-left .searchbar { width: min(230px, 60vw); }
  .record-dialog { width: 96vw; }
  .toolbar-right { width: 100%; align-items: stretch; flex-direction: column; margin-left: 0; }
  .toolbar-right > .date-filter { width: 100%; justify-content: space-between; flex-wrap: wrap; }
  .pos-month-post-control { align-items: flex-start; }
  .date-filter input[type="date"] { width: min(180px, 36vw); min-width: 125px; }
  .page-head-actions { flex-wrap: wrap; justify-content: flex-end; }
  .form-card form > p, .form-card form > button, .form-card form > .form-errors, .form-card form > .non-field-errors { grid-column: auto; }
  .page-head { align-items: flex-start; flex-wrap: wrap; }
  .page-head .btn, .page-head .button { margin-left: auto; }
  .card { padding: 14px; }
  .data-table th, .data-table td, th, td { padding: 9px 10px; }
}

@media (max-width: 420px) {
  .topbar { gap: 7px; }
  .menu-toggle { width: 36px; height: 36px; padding: 9px; }
  .topbar-brand { font-size: 13px; }
  .branch-switcher select { width: 39vw; font-size: 10px; }
  .signout-button { width: 34px; height: 34px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-head h1 { font-size: 21px; }
  .auth > .card, .auth-card { padding: 24px; }
}

@media print {
  :root { color-scheme: light; --bg: #fff; --card: #fff; --tx: #111; --mu: #555; --bd: #ddd; }
  .topbar, .sidebar, .nav-scrim, .page-head, .toolbar, .searchbar, .btn, button { display: none !important; }
  .main-content { max-width: none; padding: 0; }
  .paper, .card { border: 0; box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Multi-line cash receipt and disbursement */
.cash-document-card { width: 100%; container: cash-document / inline-size; }
.form-card .cash-document-form { grid-template-columns: minmax(0, 1fr); align-items: start; }
.cash-document-form .form-grid { display: grid; grid-column: 1; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; min-width: 0; }
.cash-document-form .form-grid > * { min-width: 0; }
.cash-detail-card { grid-column: 1; min-width: 0; margin: 8px 0 14px; padding: 16px; border: 1px solid var(--bd); border-radius: 10px; }
.cash-detail-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.cash-detail-heading h2 { margin: 0; font-size: 15px; }
.cash-detail-heading p { margin: 4px 0 0; }
.cash-detail-table { width: 100%; min-width: 640px; table-layout: fixed; border-collapse: collapse; }
.cash-detail-table th, .cash-detail-table td { padding: 8px; border-bottom: 1px solid var(--bd); text-align: left; }
.cash-detail-table th:first-child { width: 30%; }
.cash-detail-table th:nth-child(2) { width: 38%; }
.cash-detail-table th.amount { width: 23%; text-align: right; }
.cash-detail-table th:last-child { width: 9%; }
.cash-detail-table input, .cash-detail-table select { width: 100%; min-width: 0; padding: 9px; border: 1px solid var(--bd); border-radius: 6px; background: var(--card); color: inherit; }
.cash-detail-table td:last-child { text-align: center; }
.cash-detail-total { display: flex; justify-content: flex-end; align-items: center; gap: 18px; padding: 14px 4px 2px; }
.cash-detail-total strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.cash-document-form .cash-posting-preview[hidden] { display: none; }
.cash-document-form .cash-posting-preview:not([hidden]) { grid-column: 1 / -1; grid-row: auto; min-width: 0; margin: 0 0 14px; }
.cash-document-form.cash-preview-only .form-grid, .cash-document-form.cash-preview-only .cash-detail-card { display: none; }
.cash-posting-table { table-layout: fixed; }
.cash-posting-table th:first-child { width: 52%; }
.cash-posting-table .amount { width: 24%; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cash-document-form .form-actions { display: flex; grid-column: 1 / -1; justify-content: flex-end; flex-wrap: wrap; margin-top: 14px; }
.cash-document-form .errorlist { color: var(--danger, #b42318); }
@media (max-width: 980px) {
  .form-card .cash-document-form { grid-template-columns: minmax(0, 1fr); }
  .cash-document-form .form-grid, .cash-document-form .cash-detail-card, .cash-document-form .cash-posting-preview { grid-column: 1; grid-row: auto; }
}
@media (max-width: 700px) {
  .pos-entry-form .pos-entry-section { grid-template-columns: minmax(0, 1fr); }
  .cash-document-form .form-grid { grid-template-columns: minmax(0, 1fr); }
  .cash-detail-heading { flex-direction: column; }
  .cash-posting-preview-heading { flex-direction: column; }
}
@container cash-document (max-width: 600px) {
  .form-card .cash-document-form { grid-template-columns: minmax(0, 1fr); }
  .cash-document-form .form-grid, .cash-document-form .cash-detail-card, .cash-document-form .cash-posting-preview { grid-column: 1; grid-row: auto; }
}
