:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-strong: #f9fafb;
  --ink: #182230;
  --muted: #637083;
  --line: #dfe5ec;
  --primary: #1f6f78;
  --primary-strong: #15565e;
  --navy: #152238;
  --success: #2f8f5b;
  --warning: #b98117;
  --danger: #b94a48;
  --info: #366da1;
  --shadow: 0 16px 40px rgba(24, 34, 48, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  font-size: 16px;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 18px;
  color: #eaf1f4;
  background: var(--navy);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
}

.brand:hover {
  color: #fff;
}

.brand-mark {
  display: inline-block;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  background: url("../images/aqaros-mark.svg") center / contain no-repeat;
}

.sidebar .brand-mark { background-color: white; border-radius: 9px; background-size: 90%; }

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1rem;
}

.brand small {
  color: #aebdca;
  font-size: 0.78rem;
}

.side-nav {
  display: grid;
  gap: 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 9px 10px;
  color: #cfd9e2;
  border-radius: 8px;
  text-decoration: none;
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.nav-glyph {
  position: relative;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.nav-glyph::before,
.nav-glyph::after {
  position: absolute;
  content: "";
}

.nav-glyph.dashboard::before {
  inset: 2px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.nav-glyph.dashboard::after {
  left: 5px;
  right: 5px;
  bottom: 5px;
  height: 5px;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

.nav-glyph.tenants::before {
  top: 2px;
  left: 6px;
  width: 6px;
  height: 6px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.nav-glyph.tenants::after {
  left: 3px;
  bottom: 2px;
  width: 12px;
  height: 7px;
  border: 2px solid currentColor;
  border-radius: 9px 9px 3px 3px;
}

.nav-glyph.units::before {
  inset: 2px 3px;
  border: 2px solid currentColor;
  border-radius: 2px;
}

.nav-glyph.units::after {
  left: 8px;
  top: 4px;
  bottom: 4px;
  border-left: 2px solid currentColor;
}

.nav-glyph.receipts::before {
  inset: 2px 4px;
  border: 2px solid currentColor;
  border-radius: 2px;
}

.nav-glyph.receipts::after {
  left: 7px;
  right: 7px;
  top: 7px;
  border-top: 2px solid currentColor;
  box-shadow: 0 4px 0 currentColor;
}

.nav-glyph.expenses::before {
  left: 3px;
  top: 4px;
  width: 12px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.nav-glyph.expenses::after {
  left: 6px;
  top: 2px;
  width: 6px;
  border-top: 2px solid currentColor;
}

.nav-glyph.income::before {
  inset: 2px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.nav-glyph.income::after {
  left: 8px;
  top: 5px;
  width: 5px;
  height: 5px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
}

.nav-glyph.banking::before {
  inset: 3px 2px;
  border: 2px solid currentColor;
  border-radius: 2px;
}

.nav-glyph.banking::after {
  left: 5px;
  right: 5px;
  top: 7px;
  border-top: 2px solid currentColor;
  box-shadow: 0 4px 0 currentColor;
}

.nav-glyph.reports::before {
  left: 3px;
  bottom: 2px;
  width: 3px;
  height: 8px;
  background: currentColor;
  box-shadow: 6px -4px 0 currentColor, 12px -8px 0 currentColor;
}

.sidebar-note {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-note span,
.sidebar-note strong {
  display: block;
}

.sidebar-note span {
  color: #aebdca;
  font-size: 0.78rem;
}

.sidebar-note strong {
  margin-top: 4px;
  color: #fff;
}

.main-shell {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 74px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 246, 248, 0.94);
  backdrop-filter: blur(10px);
}

.global-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(520px, 100%);
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.global-search span {
  position: relative;
  width: 15px;
  height: 15px;
  border: 2px solid var(--muted);
  border-radius: 50%;
}

.global-search span::after {
  position: absolute;
  right: -5px;
  bottom: -4px;
  width: 7px;
  border-top: 2px solid var(--muted);
  transform: rotate(45deg);
  content: "";
}

.global-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.topbar-actions,
.heading-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.prototype-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  color: var(--primary-strong);
  border: 1px solid #b7d8d2;
  border-radius: 999px;
  background: #e9f6f2;
  font-size: 0.82rem;
  font-weight: 700;
}

.workspace-badge {
  display: inline-grid;
  gap: 1px;
  min-height: 38px;
  padding: 5px 12px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-decoration: none;
}

.workspace-badge:hover {
  color: var(--primary-strong);
}

.workspace-badge strong,
.workspace-badge span {
  display: block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-badge strong {
  font-size: 0.86rem;
}

.workspace-badge span {
  color: var(--muted);
  font-size: 0.72rem;
}

.user-chip {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #fff;
  border-radius: 50%;
  background: var(--primary);
  font-size: 0.88rem;
  font-weight: 700;
}

.logout-form {
  margin: 0;
}

.logout-button {
  min-height: 38px;
  padding: 7px 10px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-weight: 700;
}

.logout-button:hover {
  color: var(--danger);
}

.content-area {
  max-width: 1480px;
  margin: 0 auto;
  padding: 28px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.page-heading h1 {
  margin: 0;
  color: var(--ink);
  font-size: 2rem;
  line-height: 1.15;
}

.eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.btn {
  border-radius: 8px;
  font-weight: 700;
}

.btn-compact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  white-space: nowrap;
}

.btn-primary {
  border-color: var(--primary);
  background: var(--primary);
}

.btn-primary:hover,
.btn-primary:focus {
  border-color: var(--primary-strong);
  background: var(--primary-strong);
}

.btn-danger {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover,
.btn-danger:focus {
  border-color: #963c3a;
  background: #963c3a;
  color: #fff;
}

.btn-light {
  border: 1px solid var(--line);
  background: var(--surface);
}

.btn-dark {
  border-color: var(--navy);
  background: var(--navy);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric,
.panel,
.unit-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric {
  position: relative;
  min-height: 132px;
  padding: 18px;
  overflow: hidden;
}

.metric::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  content: "";
}

.metric-success::before,
.bar-fill.success {
  background: var(--success);
}

.metric-danger::before,
.bar-fill.danger {
  background: var(--danger);
}

.metric-info::before,
.bar-fill.info {
  background: var(--info);
}

.metric-warning::before,
.bar-fill.warning {
  background: var(--warning);
}

.metric span,
.metric small {
  display: block;
  color: var(--muted);
}

.metric strong {
  display: block;
  margin: 10px 0 8px;
  font-size: 1.65rem;
  line-height: 1.15;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.lower-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.panel {
  min-width: 0;
  padding: 18px;
}

.panel-wide {
  min-width: 0;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.panel-header h2 {
  margin: 0;
  font-size: 1rem;
}

.panel-header p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.text-link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.text-link:hover {
  color: var(--primary-strong);
}

.table-shell {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.data-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.compact-table {
  min-width: 460px;
}

.data-table th {
  padding: 10px 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: var(--surface-strong);
  font-size: 0.78rem;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table td strong,
.data-table td span {
  display: block;
}

.data-table td span {
  color: var(--muted);
  font-size: 0.86rem;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-active,
.status-paid,
.status-approved,
.status-occupied {
  color: #1f5f3d;
  background: #e4f4eb;
}

.status-due,
.status-pending,
.status-waiting,
.status-partial,
.status-ending,
.status-maintenance {
  color: #7a5211;
  background: #fff2d8;
}

.status-overdue,
.status-cancelled {
  color: #913735;
  background: #fde7e5;
}

.status-vacant {
  color: #255783;
  background: #e5f0fb;
}

.status-reconciled,
.status-cleared {
  color: #1f5f3d;
  background: #e4f4eb;
}

.status-unreconciled,
.status-not-ready,
.status-returned {
  color: #913735;
  background: #fde7e5;
}

.filter-bar.filter-bar-receipts {
  grid-template-columns: minmax(230px, 1.5fr) repeat(4, minmax(130px, 0.7fr)) auto auto;
}

.filter-bar.filter-bar-expenses {
  grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(125px, 0.7fr)) repeat(2, minmax(135px, 0.7fr)) auto auto;
}

.filter-bar.filter-bar-income {
  grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(125px, 0.7fr)) repeat(2, minmax(135px, 0.7fr)) auto auto;
}

.table-cell-wrap {
  min-width: 180px;
  white-space: normal;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.pager > div {
  display: flex;
  gap: 8px;
}

.pager .disabled {
  pointer-events: none;
  opacity: 0.45;
}

.audit-list {
  display: grid;
  gap: 0;
}

.audit-list > div {
  position: relative;
  display: grid;
  grid-template-columns: 14px minmax(180px, 0.7fr) minmax(220px, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.audit-list p {
  grid-column: 2 / -1;
  margin: -4px 0 0;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .filter-bar.filter-bar-receipts,
  .filter-bar.filter-bar-expenses,
  .filter-bar.filter-bar-income {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .filter-bar.filter-bar-receipts,
  .filter-bar.filter-bar-expenses,
  .filter-bar.filter-bar-income {
    grid-template-columns: minmax(0, 1fr);
  }

  .pager,
  .audit-list > div {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .pager {
    flex-direction: column;
  }

  .audit-list p {
    grid-column: 1;
  }
}

.nav-glyph.users::before {
  top: 2px;
  left: 3px;
  width: 5px;
  height: 5px;
  border: 2px solid currentColor;
  border-radius: 50%;
  box-shadow: 7px 1px 0 -1px var(--navy), 7px 1px 0 1px currentColor;
}

.nav-link:hover .nav-glyph.users::before,
.nav-link.active .nav-glyph.users::before {
  box-shadow: 7px 1px 0 -1px rgba(255, 255, 255, 0.1), 7px 1px 0 1px currentColor;
}

.nav-glyph.users::after {
  left: 1px;
  bottom: 2px;
  width: 16px;
  height: 7px;
  border: 2px solid currentColor;
  border-radius: 8px 8px 3px 3px;
}

.access-metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.access-metric-grid article {
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.access-metric-grid article:nth-child(2) {
  border-left-color: var(--danger);
}

.access-metric-grid article:nth-child(3) {
  border-left-color: var(--warning);
}

.access-metric-grid span,
.access-metric-grid strong {
  display: block;
}

.access-metric-grid span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.access-metric-grid strong {
  margin-top: 5px;
  color: var(--ink);
  font-size: 1.55rem;
}

.access-members-panel,
.access-pending-panel,
.access-roles-panel {
  margin-top: 18px;
}

.access-panel-header {
  gap: 16px;
}

.compact-search input {
  width: min(300px, 38vw);
  min-height: 40px;
  padding: 8px 12px;
}

.access-table {
  min-width: 820px;
}

.member-identity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.member-avatar {
  display: inline-grid !important;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  color: #fff !important;
  border-radius: 50%;
  background: var(--primary);
  font-size: 0.72rem !important;
  font-weight: 800;
}

.member-identity small {
  display: block;
  max-width: 300px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}

.table-actions form {
  margin: 0;
}

.status-suspended {
  color: #913735;
  background: #fde7e5;
}

.access-role-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.access-role-list > div {
  min-width: 0;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
}

.access-role-list > div:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.access-role-list > div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.access-role-list strong,
.access-role-list span {
  display: block;
}

.access-role-list span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.selection-summary {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-strong);
}

.selection-summary span,
.selection-summary strong,
.selection-summary small {
  display: block;
}

.selection-summary span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.selection-summary strong {
  margin-top: 4px;
}

.selection-summary small,
.field-note {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.access-manage-body {
  display: grid;
  gap: 18px;
}

.access-action-form {
  display: grid;
  gap: 10px;
}

.access-action-form .btn {
  justify-self: end;
}

.access-status-form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.access-status-form strong,
.access-status-form span {
  display: block;
}

.access-status-form span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.8rem;
}

@media (max-width: 700px) {
  .access-metric-grid,
  .access-role-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .access-role-list > div,
  .access-role-list > div:nth-child(odd),
  .access-role-list > div:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .access-role-list > div:last-child {
    border-bottom: 0;
  }

  .access-panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .compact-search input {
    width: 100%;
  }

  .access-status-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .access-action-form .btn,
  .access-status-form .btn {
    width: 100%;
    justify-self: stretch;
  }
}

.workspace-tabs {
  display: flex;
  gap: 4px;
  margin: -6px 0 18px;
  padding-bottom: 1px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.workspace-tabs a {
  min-height: 40px;
  padding: 9px 14px;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.workspace-tabs a:hover,
.workspace-tabs a.active {
  color: var(--primary-strong);
  border-bottom-color: var(--primary);
}

.account-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.account-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.account-item > div span,
.account-item > div strong,
.account-item > div small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-item > div span,
.account-item > div small,
.account-balance span {
  color: var(--muted);
  font-size: 0.75rem;
}

.account-item > div strong {
  margin: 3px 0;
}

.account-item .btn {
  grid-column: 1 / -1;
  justify-self: start;
}

.account-item.is-archived {
  opacity: 0.68;
}

.account-balance {
  text-align: right;
}

.account-balance strong {
  font-size: 1rem;
}

.filter-bar.filter-bar-banking {
  grid-template-columns: minmax(200px, 1.4fr) repeat(4, minmax(115px, 0.7fr));
}

.filter-bar.filter-bar-reconciliation {
  grid-template-columns: minmax(140px, 0.6fr) minmax(220px, 1fr) repeat(2, minmax(135px, 0.7fr)) auto auto;
}

.filter-bar.filter-bar-cheques {
  grid-template-columns: minmax(160px, 240px) auto auto;
  justify-content: start;
}

.banking-table {
  min-width: 1120px;
}

.direction {
  display: inline-flex !important;
  min-height: 28px;
  align-items: center;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 0.78rem !important;
  font-weight: 800;
}

.direction-d {
  color: #1f5f3d !important;
  background: #e4f4eb;
}

.direction-w {
  color: #7a5211 !important;
  background: #fff2d8;
}

.direction-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin: 20px 0 14px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.direction-control label {
  position: relative;
  display: block;
  margin: 0;
}

.direction-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.direction-control span {
  display: grid;
  min-height: 38px;
  place-items: center;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
}

.direction-control input:checked + span {
  color: var(--ink);
  border-color: var(--line);
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(24, 34, 48, 0.08);
}

.form-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-span-2 {
  grid-column: 1 / -1;
}

.bank-cheque-fields {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.banking-autofill {
  margin-bottom: 14px;
}

.bank-avatar {
  font-size: 1.5rem;
}

.detail-list-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 24px;
}

@media (max-width: 1180px) {
  .filter-bar.filter-bar-banking,
  .filter-bar.filter-bar-reconciliation {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .filter-bar.filter-bar-banking,
  .filter-bar.filter-bar-reconciliation,
  .filter-bar.filter-bar-cheques,
  .account-strip,
  .form-grid-2,
  .detail-list-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-span-2 {
    grid-column: auto;
  }

  .account-item {
    grid-template-columns: minmax(0, 1fr);
  }

  .account-balance {
    text-align: left;
  }
}

.stacked-form,
.filter-bar {
  display: grid;
  gap: 12px;
}

.filter-bar {
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) auto;
  align-items: end;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  outline: 0;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 111, 120, 0.12);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.check-row,
.switch-list label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-row input,
.switch-list input {
  width: 18px;
  height: 18px;
  min-height: 18px;
}

.switch-list {
  display: grid;
  gap: 8px;
}

.activity-list {
  display: grid;
  gap: 12px;
}

.activity-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.activity-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.activity-row strong,
.activity-row span {
  display: block;
}

.activity-row span,
.activity-row time {
  color: var(--muted);
  font-size: 0.84rem;
}

.activity-dot {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--info);
}

.activity-dot.success {
  background: var(--success);
}

.activity-dot.warning {
  background: var(--warning);
}

.activity-dot.danger {
  background: var(--danger);
}

.unit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.unit-card {
  display: grid;
  gap: 14px;
  min-height: 248px;
  padding: 16px;
  box-shadow: none;
}

.unit-card h2 {
  margin: 10px 0 3px;
  font-size: 1.25rem;
}

.unit-card p {
  margin: 0;
  color: var(--muted);
}

.unit-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.unit-card dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.unit-card dd {
  margin: 2px 0 0;
  font-weight: 700;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
}

.chip-on {
  color: var(--primary-strong);
  border-color: #b7d8d2;
  background: #e9f6f2;
}

.bar-list {
  display: grid;
  gap: 18px;
}

.bar-row {
  display: grid;
  gap: 8px;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.bar-label span {
  color: var(--muted);
  font-weight: 700;
}

.bar-track {
  width: 100%;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf2;
}

.bar-fill {
  display: block;
  height: 100%;
  min-width: 3px;
  border-radius: inherit;
}

.auth-card,
.auth-panel {
  max-width: 680px;
  margin: 48px auto;
}

.auth-card {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-card h1,
.auth-heading h1 {
  margin: 0 0 10px;
}

.auth-card p {
  margin: 0 0 20px;
  color: var(--muted);
}

.auth-panel {
  padding: 22px;
}

.auth-heading {
  max-width: 680px;
  margin: 34px auto 0;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.choice-card,
.workspace-option {
  display: grid;
  gap: 8px;
  padding: 14px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  cursor: pointer;
}

.choice-card {
  grid-template-columns: 20px minmax(0, 1fr);
}

.choice-card input {
  grid-row: span 2;
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin-top: 2px;
}

.choice-card strong,
.choice-card span {
  display: block;
}

.choice-card span,
.workspace-option small {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
}

.workspace-list {
  display: grid;
  gap: 10px;
}

.workspace-option {
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
}

.workspace-option input {
  width: 18px;
  height: 18px;
  min-height: 18px;
}

.workspace-option strong,
.workspace-option small {
  display: block;
}

.validation-message {
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 700;
}

.heading-actions,
.record-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.record-actions {
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.btn-small {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 0.82rem;
  white-space: nowrap;
}

.unit-grid-wide {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.unit-card-actions {
  align-self: end;
  justify-content: flex-start;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.modal-backdrop.show {
  opacity: 0.46;
}

.modal {
  height: 100dvh;
}

.modal-dialog {
  height: calc(100% - var(--bs-modal-margin) * 2);
  padding: 12px;
}

.modal-content {
  max-height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(21, 34, 56, 0.24);
}

/* Let the body shrink inside forms that wrap the header and footer. */
.modal-content > .modal-form {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.modal-header {
  align-items: flex-start;
  gap: 18px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 1.35rem;
}

.modal-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.modal-kicker {
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.modal-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: 0 22px;
}

.modal-footer {
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: var(--surface-strong);
}

.modal-footer-note {
  margin-right: auto;
  color: var(--muted);
  font-size: 0.78rem;
}

.form-section {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.form-section:last-child {
  border-bottom: 0;
}

.form-section-heading {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.form-section-heading > span {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: #fff;
  border-radius: 50%;
  background: var(--navy);
  font-size: 0.76rem;
  font-weight: 800;
}

.form-section-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: 0.98rem;
}

.form-section-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.form-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-span-two {
  grid-column: 1 / -1;
}

.modal-form input[readonly],
.modal-form input:disabled,
.modal-form select:disabled,
.modal-form textarea:disabled {
  color: #4f5d6d;
  border-color: #e3e7eb;
  background: #f1f4f6;
  cursor: not-allowed;
}

.form-check-line {
  margin-top: 14px;
  color: var(--ink);
}

.confirmation-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin-top: 14px;
  padding: 12px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
}

.confirmation-row input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
}

.confirmation-row strong,
.confirmation-row small {
  display: block;
}

.confirmation-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.switch-list-inline {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.autofill-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.autofill-summary > div {
  min-width: 0;
  padding: 11px 12px;
  background: #f6faf9;
}

.autofill-summary span,
.autofill-summary strong {
  display: block;
}

.autofill-summary span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.autofill-summary strong {
  margin-top: 3px;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
}

.inline-alert {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
}

.inline-alert-danger {
  color: #873b38;
  border-color: #efc2be;
  background: #fff1ef;
}

.inline-alert-success {
  border-color: #b7ddc7;
  background: #edf8f1;
  color: #236f46;
}

.inline-alert-warning {
  color: #6f4a0f;
  border-color: #ecd39e;
  background: #fff8e8;
}

.report-review-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.report-review-alert strong,
.report-review-alert span {
  display: block;
}

.report-review-alert span {
  margin-top: 3px;
  font-weight: 500;
}

.allocation-review-table {
  position: relative;
  margin-top: 12px;
}

.detail-list {
  display: grid;
  gap: 0;
  margin: 0;
}

.detail-list > div {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1.2fr);
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.detail-list > div:last-child {
  border-bottom: 0;
}

.detail-list dt {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-weight: 700;
}

.breadcrumb-row {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.84rem;
}

.breadcrumb-row a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.profile-avatar {
  display: inline-grid;
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  place-items: center;
  color: #fff;
  border-radius: 8px;
  background: var(--primary);
  font-size: 1.08rem;
  font-weight: 800;
}

.profile-avatar-building {
  color: var(--navy);
  border: 2px solid var(--navy);
  background: transparent;
}

.profile-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-title-row h1 {
  margin: 0;
  font-size: 1.8rem;
  line-height: 1.15;
}

.profile-identity p,
.profile-identity > div > span {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.profile-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.profile-metrics > div {
  min-width: 0;
  padding: 16px 18px;
  border-right: 1px solid var(--line);
}

.profile-metrics > div:last-child {
  border-right: 0;
}

.profile-metrics span,
.profile-metrics strong {
  display: block;
}

.profile-metrics span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.profile-metrics strong {
  margin-top: 6px;
  overflow-wrap: anywhere;
  font-size: 1.08rem;
}

.profile-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.profile-nav a {
  flex: 0 0 auto;
  padding: 10px 12px;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
}

.profile-nav a:hover,
.profile-nav a:focus {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.profile-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.profile-section {
  margin-top: 18px;
  scroll-margin-top: 24px;
}

.empty-state {
  margin: 0;
  padding: 20px 0;
  color: var(--muted);
  text-align: center;
}

.text-danger {
  color: var(--danger) !important;
}

.toast-region {
  position: fixed;
  z-index: 1090;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
}

.prototype-toast {
  padding: 13px 15px;
  color: #fff;
  border-radius: 8px;
  background: var(--navy);
  box-shadow: 0 14px 36px rgba(21, 34, 56, 0.28);
}

.prototype-toast strong,
.prototype-toast span {
  display: block;
}

.prototype-toast span {
  margin-top: 2px;
  color: #c7d3dd;
  font-size: 0.82rem;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .unit-grid-wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 14px;
  }

  .brand {
    margin-bottom: 4px;
  }

  .side-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sidebar-note {
    display: none;
  }

  .topbar {
    position: static;
    align-items: stretch;
    flex-direction: column;
    padding: 14px;
  }

  .topbar-actions {
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .content-area {
    padding: 18px 14px 28px;
  }

  .page-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .heading-actions {
    justify-content: stretch;
  }

  .heading-actions .btn {
    flex: 1;
  }

  .filter-bar {
    grid-template-columns: 1fr;
  }

  .unit-grid,
  .lower-grid,
  .form-row,
  .choice-grid,
  .form-grid-two,
  .profile-columns {
    grid-template-columns: 1fr;
  }

  .form-span-two {
    grid-column: auto;
  }

  .profile-header {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-metrics > div:nth-child(2) {
    border-right: 0;
  }

  .profile-metrics > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 520px) {
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .side-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav-link {
    min-height: 38px;
  }

  .page-heading h1 {
    font-size: 1.65rem;
  }

  .unit-grid-wide,
  .autofill-summary,
  .profile-metrics,
  .switch-list-inline {
    grid-template-columns: 1fr;
  }

  .autofill-summary > div,
  .profile-metrics > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .autofill-summary > div:last-child,
  .profile-metrics > div:last-child {
    border-bottom: 0;
  }

  .modal {
    --bs-modal-margin: 0px;
  }

  .modal-dialog {
    margin: 0;
    padding: 8px;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding-right: 16px;
    padding-left: 16px;
  }

  .modal-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .modal-footer-note {
    margin-right: 0;
  }

  .modal-footer .btn {
    width: 100%;
  }

  .detail-list > div {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .profile-identity {
    align-items: flex-start;
  }

  .profile-title-row h1 {
    font-size: 1.45rem;
  }
}

/* Short windows and on-screen keyboards need room for the entire dialog. */
@media (max-height: 450px) {
  .modal .modal-content {
    overflow-y: auto;
    overscroll-behavior-y: contain;
  }

  .modal-content > .modal-form {
    flex: 0 0 auto;
    overflow: visible;
  }

  .modal .modal-body {
    flex: 0 0 auto;
    overflow: visible;
  }
}

.heading-note {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.activity-link {
  color: inherit;
  text-decoration: none;
}

.activity-link:hover strong,
.activity-link:focus strong {
  color: var(--primary);
}

.queue-list,
.ranked-list,
.compact-record-list {
  display: grid;
}

.queue-list a,
.ranked-list a,
.compact-record-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.queue-list a:hover,
.ranked-list a:hover,
.compact-record-list a:hover {
  color: var(--primary);
}

.queue-list a:last-child,
.ranked-list a:last-child,
.compact-record-list a:last-child {
  border-bottom: 0;
}

.queue-list a > strong,
.panel-total {
  font-size: 1.1rem;
}

.ranked-list span,
.compact-record-list span,
.ranked-list small,
.compact-record-list small {
  display: block;
}

.ranked-list small,
.compact-record-list small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.availability-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
  border-top: 1px solid var(--line);
}

.availability-strip div {
  padding: 16px 12px 0;
  text-align: center;
}

.availability-strip div + div {
  border-left: 1px solid var(--line);
}

.availability-strip span,
.availability-strip strong {
  display: block;
}

.availability-strip span {
  color: var(--muted);
  font-size: 0.78rem;
}

.availability-strip strong {
  margin-top: 4px;
  font-size: 1.25rem;
}

.filter-bar.filter-bar-reports {
  grid-template-columns: minmax(145px, 0.7fr) minmax(145px, 0.7fr) minmax(240px, 1.5fr) auto auto;
}

.report-filter-panel {
  margin-bottom: 14px;
}

.report-output-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.report-output-bar strong,
.report-output-bar span {
  display: block;
}

.report-output-bar span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.8rem;
}

.report-nav {
  display: flex;
  gap: 4px;
  margin: 0 0 14px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.report-nav a {
  flex: 0 0 auto;
  padding: 10px 12px;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.report-nav a:hover,
.report-nav a:focus {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.report-metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.report-metric-grid article {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--info);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.report-metric-grid article:nth-child(1),
.report-metric-grid article:nth-child(2),
.report-metric-grid article:nth-child(3),
.report-metric-grid article.positive {
  border-top-color: var(--success);
}

.report-metric-grid article:nth-child(4) {
  border-top-color: var(--warning);
}

.report-metric-grid article.negative {
  border-top-color: var(--danger);
}

.report-metric-grid span,
.report-metric-grid small,
.report-metric-grid strong {
  display: block;
}

.report-metric-grid span,
.report-metric-grid small {
  color: var(--muted);
}

.report-metric-grid span {
  font-size: 0.8rem;
  font-weight: 700;
}

.report-metric-grid strong {
  margin: 8px 0 5px;
  font-size: 1.2rem;
}

.report-metric-grid small {
  font-size: 0.76rem;
}

.report-section {
  margin-top: 18px;
  scroll-margin-top: 18px;
}

.report-section-pair {
  margin-top: 18px;
}

.panel-total {
  color: var(--ink);
  font-weight: 800;
  white-space: nowrap;
}

.monthly-report-list {
  display: grid;
  gap: 16px;
}

.monthly-report-row {
  display: grid;
  grid-template-columns: 120px minmax(200px, 1fr) minmax(260px, auto);
  gap: 14px;
  align-items: center;
}

.monthly-label strong,
.monthly-label span,
.monthly-values span {
  display: block;
}

.monthly-label span,
.monthly-values {
  color: var(--muted);
  font-size: 0.78rem;
}

.monthly-bars {
  display: grid;
  gap: 4px;
}

.monthly-bars span {
  display: block;
  min-width: 2px;
  height: 8px;
  border-radius: 3px;
}

.monthly-bars .income {
  background: var(--success);
}

.monthly-bars .expense {
  background: var(--warning);
}

.monthly-values {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .filter-bar.filter-bar-reports {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .filter-bar.filter-bar-reports,
  .report-metric-grid,
  .monthly-report-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .monthly-report-row {
    gap: 7px;
  }

  .monthly-values {
    justify-content: space-between;
    white-space: normal;
  }

  .report-output-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .report-review-alert {
    align-items: stretch;
    flex-direction: column;
  }
}
