:root {
  --ink: #161b24;
  --muted: #687387;
  --line: #d9e1eb;
  --page: #eef2f6;
  --panel: #ffffff;
  --nav: #111111;
  --nav-soft: #333333;
  --green: #222222;
  --green-dark: #000000;
  --gold: #f4c75b;
  --danger: #b84a4a;
  --shadow: 0 12px 34px rgba(32, 49, 68, 0.08);
  --app-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --base-font-size: 16px;
  --title-font-size: 34px;
  --receipt-font-size: 12px;
}

.presentation-conclusion-row td {
  background: #fff7df;
  color: #7a5200;
  line-height: 1.45;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--page);
  font-family: var(--app-font);
  font-size: var(--base-font-size);
  display: grid;
  grid-template-columns: 280px 1fr;
}

body.auth-page {
  display: block;
  background: #e9eef3;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-shell .login-card {
  border-top: 5px solid var(--green);
}

.auth-eyebrow {
  margin: 0 0 5px;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.auth-copy {
  margin-top: 7px !important;
  color: var(--muted);
  line-height: 1.5;
}

.auth-brand-logo {
  width: min(330px, 100%);
  height: 238px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111111;
  border-radius: 10px;
}

.auth-brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.auth-error {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #e1abab;
  border-radius: 6px;
  background: #fff1f1;
  color: #8f2929;
  font-weight: 800;
}

body.locked .sidebar,
body.locked .app {
  filter: blur(2px);
  pointer-events: none;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(238, 242, 246, 0.92);
  padding: 20px;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.login-card h1,
.login-card p {
  margin: 0;
}

.login-card small {
  color: var(--muted);
  font-weight: 750;
}

.recovery-banner {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px solid #f0c36b;
  border-radius: 8px;
  background: #fff8e6;
  color: #5c4300;
  font-weight: 800;
}

.recovery-banner a {
  margin-left: auto;
  color: #23394b;
}

.logout-dialog {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  background: rgba(20, 32, 44, 0.42);
  padding: 18px;
}

.logout-card {
  width: min(460px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.logout-card h3,
.logout-card p {
  margin-top: 0;
}

.password-field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.password-field input {
  min-width: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

input,
select,
textarea {
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(67, 142, 93, 0.14);
}

button {
  cursor: pointer;
}

.sidebar {
  min-height: 100vh;
  background: var(--nav);
  color: #f7fbff;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: #ffffff;
  color: #111111;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 21px;
}

.brand-mark img,
.receipt-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: inherit;
}

.brand-logo {
  width: 280px;
  height: 154px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111111;
  border-radius: 10px;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.brand h1 {
  margin: 0;
  font-size: 25px;
  line-height: 1.05;
}

.brand p {
  margin: 7px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 16px;
}

.mobile-menu-toggle {
  display: none;
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  min-height: 40px;
  padding: 0 14px;
  font-weight: 850;
}

.nav {
  display: grid;
  gap: 10px;
}

.nav-spacer {
  height: 10px;
}

.nav-item {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  text-align: left;
  padding: 15px 16px;
  font-size: 18px;
  font-weight: 700;
  transition: background-color 140ms ease, color 140ms ease;
  text-decoration: none;
  cursor: pointer;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-item.is-active {
  background: var(--nav-soft);
  color: #fff;
}

.nav-item.nav-green {
  background: var(--green);
  color: #fff;
}

.nav-item.nav-green.is-active {
  background: var(--green-dark);
}

.nav-item.nav-master {
  background: #f4bd3f;
  color: #1d2630;
  font-weight: 900;
}

.nav-item.nav-master.is-active {
  background: #d99b18;
  color: #111820;
}

.nav-item.nav-expense,
.nav-item.nav-expense.is-active,
.button.expense-action {
  background: #b42318;
  color: #fff;
}

.nav-item.nav-expense:hover,
.button.expense-action:hover {
  background: #912018;
  color: #fff;
}

.nav-item.nav-withdrawal,
.nav-item.nav-withdrawal.is-active,
.button.withdrawal-action {
  background: #6941c6;
  color: #fff;
}

.nav-item.nav-withdrawal:hover,
.button.withdrawal-action:hover {
  background: #53389e;
  color: #fff;
}

.nav-group {
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  padding: 6px;
}

.nav-group summary {
  cursor: pointer;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 900;
  padding: 10px;
}

.nav-group .nav-item {
  margin-top: 4px;
  font-size: 16px;
  padding: 12px;
}

.sidebar-actions {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.button,
.text-button {
  border: 0;
  border-radius: 8px;
  min-height: 48px;
  padding: 0 18px;
  font-weight: 850;
}

.button.success {
  background: var(--green);
  color: #fff;
}

.button.success:hover {
  background: var(--green-dark);
}

.button.light {
  background: #fff;
  color: var(--ink);
}

/* Compact controls keep the existing actions without crowding the filter row. */
.icon-only-label {
  width: 48px;
  min-width: 48px;
  padding: 0;
  font-size: 0;
}

.icon-only-label::before {
  font-size: 21px;
  line-height: 1;
}

#applyTransactionSort::before { content: "\2195"; }
#refreshTransactions::before { content: "\21BB"; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.button.dark {
  background: var(--nav);
  color: #fff;
}

.button.warning {
  background: var(--gold);
  color: #23394b;
}

.button.danger {
  background: var(--danger);
  color: #fff;
}

.text-button {
  background: transparent;
  color: var(--ink);
}

.file-button {
  display: grid;
  place-items: center;
}

.file-button input {
  display: none;
}

.save-status {
  display: block;
  grid-column: 1 / -1;
  color: rgba(255, 255, 255, 0.76);
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
}

.save-status.is-saved {
  color: #b8f2ca;
}

.app {
  min-width: 0;
  padding: 36px 34px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.topbar h2 {
  margin: 0;
  font-size: var(--title-font-size);
  line-height: 1;
}

.topbar p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 17px;
  font-weight: 650;
}

.topbar-meta {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.topbar-tools {
  display: grid;
  gap: 8px;
  min-width: 140px;
}

.active-user-card {
  min-width: 190px;
  border: 1px solid var(--line);
  background: #fff8df;
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: var(--shadow);
}

.active-user-card span,
.active-user-card small {
  display: block;
  color: var(--muted);
  font-weight: 700;
}

.active-user-card strong {
  display: block;
  margin: 3px 0;
  color: var(--ink);
  font-size: 18px;
}

.logout-save-status {
  display: block;
  margin: 10px 0 16px;
  color: var(--muted);
  font-weight: 700;
}

.logout-save-status.is-saved {
  color: var(--green);
}

.order-card {
  min-width: 210px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  padding: 14px 18px;
  box-shadow: var(--shadow);
}

.order-card span {
  color: var(--muted);
  font-weight: 750;
}

.order-card strong {
  display: block;
  font-size: 30px;
  line-height: 1.05;
}

.view {
  display: none;
}

.view.is-visible {
  display: block;
}

.transaction-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) 430px;
  gap: 22px;
}

.receivable-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  margin-bottom: 18px;
}

.prospect-layout {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.form-panel {
  padding: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  min-height: 44px;
  padding: 9px 12px;
  font-weight: 760;
  outline: none;
}

textarea {
  resize: vertical;
}

.form-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.checkbox-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.checkbox-panel legend {
  padding: 0 6px;
  color: var(--muted);
  font-weight: 900;
}

.checkbox-panel label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
}

.checkbox-panel input {
  width: auto;
  min-height: auto;
}

.password-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.password-inline .small-button {
  min-height: 44px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(67, 142, 93, 0.16);
}

.span-2 {
  grid-column: 1 / -1;
}

.product-actions {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
}

.package-picker {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf3;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.package-picker-head,
.package-picker-search {
  display: flex;
  align-items: center;
  gap: 10px;
}

.package-picker-head {
  justify-content: space-between;
}

.package-picker-search input {
  width: 100%;
}

.small-action {
  min-height: 40px;
  padding: 0 12px;
  font-size: 13px;
}

.product-list {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line);
  background: #fff3bd;
  border: 1px solid #f1cf63;
  border-radius: 8px;
  padding: 12px;
}

.product-chip {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fafc;
  font-weight: 800;
}

.qty-mini {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  font-size: 12px;
}

.qty-mini input {
  width: 68px;
  min-height: 34px;
  padding: 6px 8px;
}

.section-toggle {
  margin-top: 18px;
}

.today-schedule {
  margin-bottom: 18px;
  padding: 16px;
  border-left: 5px solid var(--green);
}

.today-schedule-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.today-schedule-head strong,
.today-schedule-head span {
  display: block;
}

.today-schedule-head span {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
}

.today-schedule-list {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  overflow: hidden;
}

.today-schedule-item {
  min-width: 100%;
  display: grid;
  grid-template-columns: 76px 1fr 1.2fr;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  animation: scheduleSlide 18s infinite;
}

.today-schedule-item small {
  color: var(--muted);
  font-weight: 800;
}

.schedule-receivable {
  color: #c0392b;
  font-weight: 950;
}

.transaction-paid-row {
  color: #227a45;
  background: #f0fbf4;
}

.transaction-paid-row .money,
.transaction-paid-row td {
  color: #227a45;
}

.member-name-button {
  color: #1f6f43;
  font-weight: 900;
  padding: 0;
}

.member-broadcast-panel {
  margin: 14px 0;
  background: #f8fbf6;
  border-color: #d7e8d5;
}

.member-broadcast-panel .detail-head {
  margin-bottom: 12px;
}

.member-broadcast-check {
  width: 20px;
  height: 20px;
  accent-color: var(--green);
}

.broadcast-queue {
  margin-top: 14px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.broadcast-queue-list {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
}

.broadcast-queue-item {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(120px, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  text-align: left;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.broadcast-queue-item.is-opened {
  background: #f0fbf4;
  border-color: #acd9bd;
}

.broadcast-queue-item small {
  color: var(--muted);
  font-weight: 800;
}

.today-schedule.is-minimized .today-schedule-list {
  display: none;
}

@keyframes scheduleSlide {
  0%, 26% { transform: translateX(0); }
  33%, 59% { transform: translateX(calc(-100% - 8px)); }
  66%, 92% { transform: translateX(calc(-200% - 16px)); }
  100% { transform: translateX(0); }
}

.is-hidden {
  display: none !important;
}

.presentation-debt-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: 8px;
}

.presentation-debt-fields span small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 700;
}

.presentation-debt-fields.is-disabled {
  opacity: .68;
}

@media (max-width: 720px) {
  .presentation-debt-fields { grid-template-columns: 1fr; }
}

.form-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.summary-panel {
  padding: 28px;
  align-self: start;
}

.summary-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.summary-head h3 {
  margin: 0;
  font-size: 28px;
}

.summary-head strong {
  font-size: 20px;
}

.summary-list {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
}

.summary-list div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.summary-list dt {
  color: var(--muted);
  font-size: 19px;
  font-weight: 760;
}

.summary-list dd {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  text-align: right;
}

.note-line {
  grid-template-columns: 1fr;
}

.note-line dd {
  max-width: 285px;
  text-align: left;
  color: var(--muted);
  font-weight: 720;
  overflow-wrap: anywhere;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  background: #fff0c9;
  color: #866210;
  font-weight: 950;
}

.status-pill.lunas {
  background: #dff2e5;
  color: #28623f;
}

.status-pill.overrun {
  background: #ffe0e0;
  color: #a52626;
}

.status-pill.empty {
  background: #edf1f5;
  color: var(--muted);
}

.panel-toolbar {
  padding: 18px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.panel-toolbar input {
  max-width: 460px;
}

.wrap-toolbar {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.wrap-toolbar input,
.wrap-toolbar select {
  max-width: 220px;
}

.shift-status-bar {
  margin-bottom: 14px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.shift-status-bar > div:first-child {
  display: grid;
  gap: 3px;
}

.shift-eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.shift-status-bar small {
  color: var(--muted);
}

.shift-dialog-card {
  width: min(920px, calc(100vw - 32px));
  max-width: none;
}

.transaction-action-card {
  width: min(620px, calc(100vw - 32px));
  max-width: none;
}

.transaction-action-grid {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.report-section {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.report-section > summary {
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 900;
}

.recap-panel {
  margin-top: 18px;
}

.recap-simple-head {
  padding: 16px 18px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.recap-simple-head h3 {
  margin: 0 0 3px;
}

.recap-simple-head small {
  color: var(--muted);
}

.recap-simple-head select {
  width: min(260px, 100%);
}

.table-wrap {
  overflow: auto;
  width: 100%;
  resize: horizontal;
  min-width: 300px;
  max-width: 100%;
}

.master-legacy-modal-field {
  display: none;
}

#view-data .table-wrap {
  resize: none;
}

#view-data table,
#view-data tbody,
#view-data tbody tr,
#view-data tbody td {
  height: auto !important;
  min-height: 0 !important;
}

#view-data tbody td {
  padding: 8px 10px;
  line-height: 1.25;
  vertical-align: top;
}

#view-data tbody tr {
  max-height: none;
}

table {
  width: 100%;
  min-width: 1280px;
  border-collapse: collapse;
  background: #fff;
}

.compact-table table {
  min-width: 0;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 14px;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0;
  background: #f8fafc;
  white-space: nowrap;
  resize: horizontal;
  overflow: auto;
  min-width: 92px;
  position: sticky;
  top: 0;
  z-index: 1;
}

td {
  font-weight: 650;
}

tbody tr:hover td {
  background: #fbfcfd;
}

.money,
.right {
  text-align: right;
  white-space: nowrap;
}

.danger-money {
  color: var(--danger);
  font-weight: 950;
}

tr.source-expense-row > td {
  background: #fff1f2;
  color: #9f1d16;
  border-color: #fecdd3;
}

tr.source-expense-row > td.money {
  color: #b42318;
  font-weight: 950;
}

#savingsBody tr.saving-row-in > td {
  background: #f0fdf4;
}

#savingsBody tr.saving-row-out > td {
  background: #fff7ed;
}

#savingsBody .saving-money-in {
  color: #157347;
  font-weight: 900;
}

#savingsBody .saving-money-out {
  color: #b42318;
  font-weight: 900;
}

tr.source-withdrawal-row > td {
  background: #f5f0ff;
  color: #53389e;
  border-color: #d9d6fe;
}

tr.source-withdrawal-row > td.money,
.withdrawal-money {
  color: #6941c6 !important;
  font-weight: 950;
}

@media print {
  tr.source-expense-row > td {
    background: #fff1f2 !important;
    color: #9f1d16 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  tr.source-withdrawal-row > td {
    background: #f5f0ff !important;
    color: #53389e !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

.table-actions {
  display: flex;
  gap: 8px;
}

.small-button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  min-height: 34px;
  padding: 0 10px;
  font-weight: 850;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

.small-button:hover {
  border-color: #aebbc8;
  background: #f3f6f8;
}

.small-button.danger {
  color: var(--danger);
}

.kpi-row,
.dashboard-grid {
  display: grid;
  gap: 16px;
}

.kpi-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 18px;
}

.kpi-row div,
.metric {
  padding: 18px;
}

.kpi-row span,
.metric span {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.kpi-row strong,
.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
}

.metric-button {
  width: 100%;
  border: 1px solid var(--line);
  text-align: left;
  cursor: pointer;
}

.metric-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: #f3f7fb;
}

.highlight-metric {
  border-color: rgba(67, 142, 93, 0.45);
  background: #f1fbf5;
}

.danger-soft {
  border-color: rgba(210, 80, 80, 0.45);
  background: #fff1f1;
}

.warning-soft {
  border-color: rgba(210, 139, 35, 0.45);
  background: #fff7e8;
}

.detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.dashboard-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
  margin-bottom: 18px;
}

.filter-actions {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.calendar-list {
  display: grid;
  gap: 16px;
  padding: 20px 22px 28px;
}

.calendar-minimized .calendar-list,
.calendar-minimized #calendarHistory {
  display: none;
}

.calendar-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(132px, 1fr));
  gap: 8px;
  align-items: stretch;
}

.calendar-weekday {
  padding: 14px 10px 10px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.calendar-month-cell {
  min-height: 132px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 0 rgba(20, 34, 50, .03);
}

.calendar-month-cell.is-empty {
  background: transparent;
  border-color: transparent;
}

.calendar-month-cell.is-today {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green);
}

.calendar-month-cell > strong {
  display: block;
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 16px;
}

.calendar-month-items {
  display: grid;
  gap: 6px;
}

.calendar-month-item {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #d8e1ea;
  border-radius: 6px;
  background: #f8fafc;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-month-item:hover {
  background: #eef5ef;
  border-color: #b7d6bd;
}

.calendar-day {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.calendar-day summary {
  margin: 0;
  padding: 10px 14px;
  background: #f8fafc;
  font-size: 14px;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
}

.calendar-day summary span {
  display: block;
  color: var(--ink);
  font-size: 13px;
  margin-bottom: 2px;
}

.calendar-items {
  display: grid;
}

.calendar-item {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 8px 14px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  cursor: pointer;
}

.calendar-item:hover {
  background: #f8fafc;
}

.calendar-item small {
  grid-column: 2;
  color: var(--muted);
  font-weight: 750;
}

.empty-state {
  padding: 24px;
  color: var(--muted);
  font-weight: 800;
}

.history-box {
  margin: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.history-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}

.history-head strong,
.history-head span {
  display: block;
}

.history-head span {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
}

.compact-history table {
  min-width: 640px;
}

.chart-panel {
  grid-column: span 2;
  padding: 20px;
}

.chart-panel h3 {
  margin: 0 0 16px;
}

.bar-list {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: 130px 1fr 110px;
  align-items: center;
  gap: 12px;
  font-weight: 800;
}

.bar-track {
  height: 14px;
  background: #edf1f5;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  min-width: 3px;
  background: var(--green);
}

.graph-main-panel {
  grid-column: 1 / -1;
}

.graph-main-panel canvas,
.mini-graph canvas {
  width: 100%;
  height: 340px;
  display: block;
  background: #fffef8;
  border: 1px solid #cfd8d2;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.72);
}

.mini-graph {
  grid-column: span 1;
}

.expense-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 18px;
}

.expense-form {
  padding: 18px;
  display: grid;
  gap: 14px;
  align-self: start;
}

.expense-form label.checkbox-field,
label.checkbox-field {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.expense-form label.checkbox-field input[type="checkbox"],
label.checkbox-field input[type="checkbox"] {
  width: auto;
}

.modal-page {
  display: grid;
  gap: 16px;
}

.modal-summary-panel {
  display: grid;
  gap: 8px;
}

.modal-header-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.modal-metric-stack {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.modal-metric-stack #modalTargetTotals,
.modal-metric-stack #modalTopTotals {
  display: contents;
}

.modal-target-totals { padding: 0; }

.modal-target-totals .fund-card:nth-child(1) { grid-column: 1 / span 2; grid-row: 1; }
.modal-target-totals .fund-card:nth-child(2) { grid-column: 1; grid-row: 2; }
.modal-target-totals .fund-card:nth-child(3) { grid-column: 2; grid-row: 2; }
.modal-target-totals .fund-card:nth-child(4) { grid-column: 1 / span 2; grid-row: 3; }
.modal-target-totals .fund-card:nth-child(5) { grid-column: 1 / span 2; grid-row: 4; }
.modal-target-totals .fund-card:nth-child(6) { grid-column: 3 / span 2; grid-row: 1; }
.modal-target-totals .fund-card:nth-child(7) { grid-column: 3 / span 2; grid-row: 2; }

.modal-target-totals .fund-card {
  background: #effbf1;
  border-color: #8fdda0;
}

.modal-target-totals .fund-card:first-child {
  background: #fff7e0;
  border-color: #efcc73;
}

.modal-target-totals .fund-card:nth-child(5),
.modal-target-totals .fund-card:nth-child(6),
.modal-target-totals .fund-card:nth-child(7) {
  background: #effbf1;
}

.modal-target-totals .fund-card span em {
  font-size: 0.78em;
  font-weight: 650;
}

.modal-metric-stack #modalTopTotals .fund-card:nth-child(1) { grid-column: 3; grid-row: 3; }
.modal-metric-stack #modalTopTotals .fund-card:nth-child(2) { grid-column: 4; grid-row: 3; }
.modal-metric-stack #modalTopTotals .fund-card:nth-child(3) { grid-column: 5 / span 2; grid-row: 1; }
.modal-metric-stack #modalTopTotals .fund-card:nth-child(4) { grid-column: 5 / span 2; grid-row: 2; }

.target-budget-panel {
  display: grid;
  gap: 10px;
}

.target-budget-panel h3,
.target-budget-panel p {
  margin: 0;
}

.target-budget-panel .compact-form {
  margin-top: 2px;
}

.small-note {
  font-size: 12px;
}

.modal-header-grid h3 {
  margin: 0 0 12px;
}

.modal-top-totals {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-top: 0;
}

.modal-summary-panel .fund-cards {
  padding: 0;
}

#view-modal #modalTotals {
  grid-template-columns: repeat(8, minmax(140px, 1fr));
  align-items: stretch;
}

#view-modal #modalTotals .modal-card-green {
  grid-column: 7 / span 2;
  grid-row: 1;
}

#view-modal #modalCategoryTotals {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.modal-section-title {
  justify-self: center;
  min-width: min(520px, 100%);
  background: #b8b8b8;
  color: #fff;
  text-align: center;
  font-weight: 950;
  padding: 10px 16px;
  margin-top: 4px;
}

.modal-card-blue { background: #f2f2f2; border-color: #999999; }
.modal-card-yellow { background: #fff8df; border-color: #f3cf74; }
.modal-card-red { background: #ffe5e8; border-color: #f59aa6; }
.modal-card-pink { background: #ffe6fb; border-color: #f08add; }
.modal-card-orange { background: #fff0e8; border-color: #f2a78d; }
.modal-card-green { background: #e4ffe9; border-color: #55e58a; }

.modal-workspace {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

#modalPaymentForm {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

#modalPaymentForm h3,
.modal-report-panel h3 {
  margin: 0;
}

#modalPaymentForm .span-2 {
  grid-column: auto;
}

.modal-report-panel {
  min-width: 0;
}

.modal-report-panel .table-wrap {
  margin-top: 8px;
}

#modalCategoryDetailPanel {
  margin: 0;
}

.detail-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.fund-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 18px 0;
}

.fund-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fafc;
}

button.fund-card {
  appearance: none;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

button.fund-card:hover {
  border-color: var(--green);
  box-shadow: 0 4px 12px rgba(38, 70, 83, 0.12);
}

.fund-card span {
  display: block;
  color: var(--muted);
  font-weight: 850;
}

.fund-card strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.compact-total {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.total-card {
  background: #fff8e4;
  border-color: #f1d48a;
}

.total-toggle {
  margin: 10px 18px 0;
}

.recap-table-head {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}

.recap-table-head h3 {
  margin: 0;
  font-size: 15px;
}

.recap-table-head .total-toggle {
  margin: 0;
}

.activity-live-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #f7fbf8;
}

.activity-live-strip strong,
.activity-live-strip span {
  display: block;
}

.activity-live-strip div > span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.evaluation-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(520px, 1.7fr);
  gap: 16px;
  align-items: start;
}

.compact-dashboard {
  gap: 10px;
}

.compact-dashboard .metric {
  padding: 12px;
}

.compact-dashboard .metric small {
  font-size: 11px;
}

.presentation-summary-layout {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-areas:
    "rev rev rev pay pay pay gap exp exp exp bal bal"
    "pc pc pb pb ec ec eb eb cash cash bank bank"
    "mt mt mt mt mt mt rt rt rt rt rt rt"
    "modal modal modal bill bill bill margin margin margin margin margin margin"
    "remain remain remain wd wd wd margin margin margin margin margin margin"
    "input input input bridge bridge bridge mbank mbank mbank mcash mcash mcash"
    "next next next rec rec rec profit profit profit profit profit profit"
    ". . . . . . pcash pcash pcash pbank pbank pbank";
  align-items: stretch;
}

.presentation-summary-layout .present-card {
  min-height: 82px;
}

.presentation-summary-layout .present-card strong {
  font-size: 24px;
}

.presentation-summary-layout .presentation-section-title {
  border-radius: 0;
  background: #c9c9c9;
  color: #111827;
  font-size: 20px;
  font-style: italic;
  font-weight: 900;
  line-height: 1;
  padding: 10px 14px;
  text-align: center;
}

.present-revenue { grid-area: rev; }
.present-payment { grid-area: pay; }
.present-expense-total { grid-area: exp; }
.present-balance { grid-area: bal; }
.present-payment-cash { grid-area: pc; }
.present-payment-bank { grid-area: pb; }
.present-expense-cash { grid-area: ec; }
.present-expense-bank { grid-area: eb; }
.present-cash { grid-area: cash; }
.present-bank { grid-area: bank; }
.present-modal-title { grid-area: mt; }
.present-margin-title { grid-area: rt; }
.present-modal { grid-area: modal; background: #d7fbff; border-color: #b8eff6; }
.present-modal-bill { grid-area: bill; }
.present-modal-remaining { grid-area: remain; }
.present-withdrawal { grid-area: wd; }
.present-card.present-withdrawal {
  background: #f3e8ff;
  border-color: #9333ea;
}
.present-card.present-withdrawal span,
.present-card.present-withdrawal strong,
.present-card.present-withdrawal small {
  color: #581c87;
}
.present-bill-total { grid-area: input; }
.present-bridge { grid-area: bridge; }
.present-next-bill { grid-area: next; background: #ffe2ef; border-color: #ffc5dc; }
.present-receivable { grid-area: rec; }
.present-margin {
  grid-area: margin;
  align-content: center;
  background: #fffde5;
  border-color: #efe7a8;
  min-height: 210px;
  padding: 28px;
}
.present-margin span,
.present-margin strong {
  color: #53533f;
}
.present-margin strong {
  font-size: 44px;
}
.present-margin small {
  color: #202018;
  font-size: 15px;
  font-style: italic;
  font-weight: 900;
}
.present-margin-bank { grid-area: mbank; }
.present-margin-cash { grid-area: mcash; }
.present-profit { grid-area: profit; background: #dcffd9; border-color: #b9f4b4; }
.present-profit-cash { grid-area: pcash; }
.present-profit-bank { grid-area: pbank; }

.finance-summary-layout {
  grid-template-columns: minmax(260px, 1fr) minmax(360px, 2fr) minmax(260px, 1fr) minmax(260px, 1fr);
  align-items: stretch;
  grid-auto-flow: row dense;
}

.finance-card-revenue { grid-column: 1; grid-row: 1; }
.finance-card-payment { grid-column: 1; grid-row: 2; }
.finance-card-expense { grid-column: 1; grid-row: 3; }
.finance-card-receivable { grid-column: 1; grid-row: 4; }
.finance-card-estimate { grid-column: 1; grid-row: 6; background: #f3fff2; border-color: #c7efc4; }
.finance-card-profit { grid-column: 1; grid-row: 7; background: #fff0dc; border-color: #f2cf9c; }
.finance-card-discount { grid-column: 4; grid-row: 4; background: #fff7ed; border-color: #f3c08c; }

.finance-card-cash { grid-column: 2; grid-row: 1; }
.finance-card-noncash { grid-column: 2; grid-row: 2; }
.finance-card-before { grid-column: 2; grid-row: 3; }

.finance-card-modal { grid-column: 3; grid-row: 1; }
.finance-card-modal-left { grid-column: 4; grid-row: 1; }

.finance-drink-title {
  grid-column: 3 / 5;
  grid-row: 2;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 6px;
  background: #5f8ec5;
  color: #fff;
  font-weight: 900;
  letter-spacing: 0;
  text-align: center;
}

.finance-profit-title {
  grid-column: 1;
  grid-row: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border-radius: 0;
  background: #8bcf94;
  color: #fff;
  font-weight: 950;
  font-size: 16px;
}

.finance-card-beverage { grid-column: 3; grid-row: 3; }
.finance-card-beverage-hpp { grid-column: 4; grid-row: 3; }
.finance-card-beverage-profit { grid-column: 1; grid-row: 8; align-self: stretch; background: #eef8ff; border-color: #a7cdeb; }

.finance-total-table-panel {
  grid-column: 2 / 4;
  grid-row: 4 / span 5;
}

.finance-modal-breakdown-panel {
  grid-column: 2;
  grid-row: 9;
}

.modal-info-table {
  margin: 0;
  border-radius: 6px;
  background: #fff;
}

.modal-info-table table {
  min-width: 0;
}

.modal-info-table th,
.modal-info-table td {
  padding: 12px 14px;
  font-size: 13px;
}

.modal-info-table .money {
  white-space: nowrap;
}

.fund-transfer {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
  align-items: end;
}

.settings-panel {
  padding: 22px;
}

.settings-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin-top: 14px;
  background: #fff;
}

.settings-group summary {
  cursor: pointer;
  font-weight: 950;
  color: var(--ink);
}

.settings-group[open] summary {
  margin-bottom: 14px;
}

.settings-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}

.settings-head h3 {
  margin: 0;
  font-size: 24px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.guide-editor {
  width: 100%;
  min-height: 460px;
  resize: vertical;
  line-height: 1.55;
}

.debt-overdue {
  border-left: 4px solid #c0392b;
  background: #fff2f0;
  padding: 10px;
}

.debt-overdue > strong {
  color: #a93226;
}

.settings-preview {
  margin-top: 22px;
  padding: 22px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.employee-panel {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.employee-grid,
.permission-grid {
  display: grid;
  gap: 12px;
}

.employee-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.employee-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.permission-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 14px 0;
}

.permission-heading {
  grid-column: 1 / -1;
  margin-top: 6px;
  color: var(--ink);
  font-size: 13px;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
}

.check-line input {
  width: auto;
  min-height: auto;
}

.preview-receipt {
  background: #fff;
  border: 1px solid var(--line);
  padding: 18px;
}

.receipt-logo {
  width: 54px;
  height: 54px;
  margin: 0 auto 8px;
  border-radius: 10px;
  background: #111111;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 20px;
}

.receipt h2,
.receipt p {
  text-align: center;
  margin: 0;
}

.receipt hr {
  border: 0;
  border-top: 1px dashed currentColor;
  margin: 10px 0;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 5px 0;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: var(--ink);
  color: #fff;
  padding: 13px 16px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: 0.2s ease;
  font-weight: 800;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

#printArea {
  display: none;
}

/* Compact polish: keeps the existing layout while improving rhythm and scanability. */
.view.is-visible {
  display: block;
}

.view.is-visible > * + * {
  margin-top: 14px;
}

.view > .panel,
.view > form.panel,
.view > section.panel {
  min-width: 0;
}

.panel {
  box-shadow: 0 7px 22px rgba(32, 49, 68, 0.065);
}

.panel h3,
.panel h4 {
  line-height: 1.25;
}

.panel-toolbar {
  align-items: center;
  gap: 10px;
}

.panel-toolbar .button,
.panel-toolbar .small-button,
.table-actions .small-button {
  white-space: nowrap;
}

.table-actions {
  flex-wrap: wrap;
  align-items: center;
}

th,
td {
  padding: 11px 12px;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.fund-card {
  min-width: 0;
}

.fund-card strong,
.fund-card small,
.fund-card span {
  overflow-wrap: anywhere;
}

.report-section {
  overflow: hidden;
}

.report-section > summary {
  background: #f8fafc;
  color: var(--ink);
}

.report-section[open] > summary {
  border-bottom: 1px solid var(--line);
}

.payment-history-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 7px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.compact-action {
  min-height: 30px;
  padding: 4px 9px;
}

.activity-panel {
  overflow: hidden;
}

.activity-json {
  max-height: 520px;
  overflow: auto;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101820;
  color: #e8eef5;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

#view-hutang .expense-layout {
  align-items: start;
}

#view-hutang .report-section {
  margin: 10px 18px 0;
}

#view-hutang .report-section:last-of-type {
  margin-bottom: 18px;
}

@media (max-width: 1100px) {
  .calendar-month-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .calendar-weekday {
    display: none;
  }
}

@media (max-width: 720px) {
  .calendar-month-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }

  .transaction-grid,
  .receivable-layout,
  .prospect-layout,
  .expense-layout,
  .modal-workspace {
    grid-template-columns: 1fr;
  }

  .evaluation-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
  }

  .nav,
  .sidebar-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .nav-item {
    text-align: center;
    padding: 12px 8px;
    font-size: 14px;
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finance-summary-layout > * {
    grid-column: auto;
    grid-row: auto;
  }

  .presentation-summary-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: none;
  }

  .presentation-summary-layout > * {
    grid-area: auto;
  }

  .presentation-summary-layout .present-margin {
    min-height: auto;
    padding: 18px;
  }

  .presentation-summary-layout .present-margin strong {
    font-size: 28px;
  }

  .finance-drink-title {
    grid-column: 1 / -1;
  }

  .fund-transfer,
  .fund-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modal-target-totals {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modal-target-totals .fund-card {
    grid-column: auto !important;
    grid-row: auto !important;
  }

  .modal-metric-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modal-metric-stack #modalTopTotals .fund-card {
    grid-column: auto !important;
    grid-row: auto !important;
  }
}

@media (max-width: 720px) {
  .app,
  .sidebar {
    padding: 20px;
  }

  .modal-metric-stack {
    grid-template-columns: 1fr;
  }

  .topbar,
  .topbar-meta,
  .form-actions,
  .panel-toolbar,
  .shift-status-bar,
  .recap-simple-head {
    display: grid;
  }

  .order-card,
  .panel-toolbar input {
    max-width: none;
    width: 100%;
  }

  .form-grid,
  .checkbox-panel,
  #modalPaymentForm,
  .kpi-row,
  .dashboard-grid,
  .dashboard-filters,
  .settings-grid,
  .employee-grid,
  .permission-grid,
  .fund-cards,
  .fund-transfer {
    grid-template-columns: 1fr;
  }

  .brand {
    align-items: center;
  }

  .brand h1 {
    font-size: 19px;
  }

  .brand-logo {
    width: min(340px, 100%);
    height: 190px;
  }

  .brand p {
    margin-top: 4px;
    font-size: 13px;
  }

  .brand-mark {
    width: 46px;
    height: 46px;
  }

  .mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .sidebar {
    max-height: 100dvh;
    overflow-y: auto;
    gap: 16px;
    padding: 14px 16px;
  }

  .sidebar:not(.is-mobile-open) .nav,
  .sidebar:not(.is-mobile-open) .sidebar-actions {
    display: none;
  }

  .sidebar.is-mobile-open .nav,
  .sidebar.is-mobile-open .sidebar-actions {
    display: grid;
  }

  .nav,
  .sidebar-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-chip,
  .history-head {
    display: grid;
  }

  table {
    min-width: 960px;
  }

  .chart-panel {
    grid-column: auto;
  }
}

@media print {
  body {
    display: block;
    background: #fff;
  }

  .sidebar,
  .app,
  .toast {
    display: none !important;
  }

  #printArea {
    display: block;
    padding: 20px;
    color: #000;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  }

  .receipt {
    max-width: 320px;
    margin: 0 auto;
    font-size: var(--receipt-font-size);
  }

  .receipt-logo {
    width: 54px;
    height: 54px;
    margin: 0 auto 8px;
    border-radius: 10px;
    background: var(--green);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 20px;
  }

  .receipt h2,
  .receipt p {
    text-align: center;
    margin: 0;
  }

  .receipt h2 {
    font-size: 18px;
  }

  .receipt p {
    font-size: 12px;
  }

  .receipt hr {
    border: 0;
    border-top: 1px dashed #000;
    margin: 10px 0;
  }

  .receipt-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin: 5px 0;
  }

  .receipt-note {
    font-size: var(--receipt-font-size);
    white-space: pre-wrap;
  }

  .dashboard-print {
    font-family: var(--app-font);
    font-size: 11px;
  }

  .dashboard-print h2,
  .dashboard-print p {
    text-align: center;
    margin: 0;
  }

  .print-table {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
  }

  .print-table th,
  .print-table td {
    border: 1px solid #000;
    padding: 5px;
    font-size: 10px;
  }

  .presentation-print {
    font-size: 11px;
  }

  .presentation-print h2 {
    margin: 0 0 10px;
    font-size: 20px;
  }

  .presentation-print h3 {
    margin: 42px 0 14px;
    font-size: 14px;
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: 0;
  }

  .presentation-print h4 {
    margin: 26px 0 12px;
    font-size: 12px;
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: 0;
  }

  .presentation-print table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 44px;
    page-break-inside: auto;
  }

  .presentation-print th,
  .presentation-print td {
    border-bottom: 1px solid #d7dde6;
    padding: 9px 12px;
    vertical-align: top;
  }

  .presentation-print th {
    background: #f4f6f9;
    color: #647084;
    text-transform: uppercase;
  }

  .presentation-print-section td {
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
  }

  .presentation-print-spacer td {
    height: 26px;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .presentation-print-section.blue-soft td { background: #eeeeee; }
  .presentation-print-section.pink-soft td { background: #ffe2ef; }
  .presentation-print-section.yellow-soft td { background: #fff5df; }
  .presentation-print-section.cyan-soft td { background: #dff6ff; }
  .presentation-print-section.green-soft td { background: #e8fae6; }
  .presentation-print-section.orange-soft td { background: #fff0dd; }
  .presentation-print-section.purple-soft td { background: #e9e7ff; }
}
