*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --ink: #0f172a;
  --ink-mid: #1e293b;
  --ink-soft: #334155;
  --canvas: #eef2f7;
  --canvas-deep: #e2e8f0;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #d8e0ea;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #ea580c;
  --accent-hover: #c2410c;
  --accent-soft: #fff7ed;
  --success: #15803d;
  --success-soft: #dcfce7;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --purchase: #ea580c;
  --sale: #15803d;
  --received: #0f766e;
  --paid: #b91c1c;
  --sidebar-w: 16.25rem;
  --topbar-h: 3.5rem;
  --dock-h: 4.25rem;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.14);
  --font: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(1200px 500px at 100% -10%, rgba(234, 88, 12, 0.08), transparent 55%),
    radial-gradient(900px 420px at -5% 20%, rgba(15, 118, 110, 0.06), transparent 50%),
    var(--canvas);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.45;
  overflow-x: hidden;
}

.app,
.app-shell {
  max-width: 100%;
  overflow-x: hidden;
}

/* .page must stay overflow:visible — overflow-x:hidden forces overflow-y:auto
   and clips absolute .js-combo__menu on short pages (e.g. Account Ledger). */
.page {
  max-width: 100%;
}

::selection {
  background: rgba(234, 88, 12, 0.2);
  color: var(--text);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 100;
  padding: 0.55rem 0.85rem;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  top: 1rem;
}

/* —— App shell —— */
.app {
  min-height: 100dvh;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s var(--ease);
}

.sidebar-open {
  overflow: hidden;
}

.sidebar-open .sidebar-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
  width: min(var(--sidebar-w), 88vw);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--ink) 0%, #0b1220 100%);
  color: #e2e8f0;
  box-shadow: var(--shadow-lg);
  transform: translateX(-105%);
  transition: transform 0.28s var(--ease);
}

.sidebar-open .sidebar {
  transform: translateX(0);
}

.sidebar__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1rem 0.9rem 0.85rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.sidebar__mark,
.topbar__mark,
.sidebar__avatar {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--accent), #f97316);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 6px 16px rgba(234, 88, 12, 0.35);
}

.sidebar__brand-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.sidebar__brand-text strong {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.sidebar__brand-text em {
  font-style: normal;
  font-size: 0.72rem;
  color: #94a3b8;
  letter-spacing: 0.02em;
}

.sidebar__hide {
  display: none;
  align-items: center;
  gap: 0.25rem;
  min-height: 2.25rem;
  padding: 0 0.55rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: rgba(148, 163, 184, 0.12);
  color: #e2e8f0;
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  flex-shrink: 0;
}

.sidebar__hide:hover {
  background: rgba(148, 163, 184, 0.22);
}

.sidebar__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: rgba(148, 163, 184, 0.12);
  color: #e2e8f0;
  cursor: pointer;
}

.sidebar__close:hover {
  background: rgba(148, 163, 184, 0.22);
}

.topbar__menu--desktop {
  display: none;
}

.sidebar__scroll {
  flex: 1;
  overflow: auto;
  padding: 0.85rem 0.75rem 1rem;
  -webkit-overflow-scrolling: touch;
}

.sidebar__label {
  margin: 0.85rem 0.55rem 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}

.sidebar__label:first-child {
  margin-top: 0.15rem;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.sidebar__link {
  display: flex;
  align-items: center;
  min-height: 2.45rem;
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-sm);
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.sidebar__link:hover {
  background: rgba(148, 163, 184, 0.12);
  color: #fff;
}

.sidebar__link.is-active {
  background: rgba(234, 88, 12, 0.18);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--accent);
}

.sidebar__link--accent {
  color: #fdba74;
}

.sidebar__foot {
  padding: 0.85rem;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  display: grid;
  gap: 0.65rem;
}

.sidebar__user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.sidebar__avatar {
  width: 2rem;
  height: 2rem;
  font-size: 0.8rem;
  background: rgba(148, 163, 184, 0.2);
  box-shadow: none;
}

.sidebar__user-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.sidebar__user-meta strong {
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar__user-meta em {
  font-style: normal;
  font-size: 0.72rem;
  color: #94a3b8;
  text-transform: capitalize;
}

.sidebar__logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.4rem;
  border-radius: var(--radius-sm);
  background: rgba(148, 163, 184, 0.12);
  color: #e2e8f0;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
}

.sidebar__logout:hover {
  background: rgba(185, 28, 28, 0.35);
  color: #fff;
}

.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--dock-h) + env(safe-area-inset-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: var(--topbar-h);
  padding: 0.55rem 0.85rem;
  padding-left: max(0.85rem, env(safe-area-inset-left));
  padding-right: max(0.85rem, env(safe-area-inset-right));
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar__menu {
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  flex-shrink: 0;
}

.topbar__menu-icon,
.topbar__menu-icon::before,
.topbar__menu-icon::after {
  display: block;
  width: 1.05rem;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  position: relative;
}

.topbar__menu-icon::before,
.topbar__menu-icon::after {
  content: "";
  position: absolute;
  left: 0;
}

.topbar__menu-icon::before { top: -5px; }
.topbar__menu-icon::after { top: 5px; }

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  flex: 1;
}

.topbar__mark {
  width: 1.85rem;
  height: 1.85rem;
  font-size: 0.8rem;
  border-radius: 8px;
}

.topbar__name {
  font-weight: 700;
  font-size: 0.92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar__user {
  display: none;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.mobile-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 35;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.15rem;
  min-height: var(--dock-h);
  padding: 0.35rem 0.35rem calc(0.35rem + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 28px rgba(15, 23, 42, 0.06);
}

.mobile-dock__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-height: 3.15rem;
  padding: 0.25rem 0.2rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
}

.mobile-dock__item.is-active,
.mobile-dock__item:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.mobile-dock__icon {
  display: grid;
  place-items: center;
}

/* —— Page —— */
.page {
  width: 100%;
  max-width: 44rem;
  margin: 0 auto;
  padding: 1rem 1rem 1.5rem;
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
}

.page--wide {
  max-width: none;
  width: 100%;
}

.page--auth {
  max-width: 26rem;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-bottom: 2rem;
}

.page--entry {
  max-width: 48rem;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.page-header__text {
  min-width: 0;
  flex: 1 1 12rem;
}

.page-header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}

.page-header .subtitle {
  margin: 0;
}

.page-header__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.brand {
  margin: 0 0 0.35rem;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.subtitle {
  margin: 0 0 1.1rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.subtitle--muted {
  font-size: 0.82rem;
}

.dash-heading {
  margin: 0.2rem 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.dash-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.dash-section {
  margin-bottom: 1.25rem;
}

.dash-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
}

.dash-section__head .dash-heading {
  margin: 0;
}

.dash-section__hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.dash-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-bottom: 0.25rem;
}

.dash-kpi {
  display: block;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 0.85rem 0.9rem 0.75rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  border-top: 3px solid var(--border-strong);
  color: inherit;
  text-decoration: none;
  min-width: 0;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

a.dash-kpi:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.dash-kpi--purchase { border-top-color: var(--purchase); }
.dash-kpi--in { border-top-color: var(--sale); }
.dash-kpi--out { border-top-color: var(--received); }
.dash-kpi--cash { border-top-color: var(--ink); }

.dash-kpi span {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}

.dash-kpi strong {
  display: block;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  letter-spacing: -0.02em;
}

.dash-kpi em {
  display: block;
  margin-top: 0.2rem;
  font-style: normal;
  color: var(--muted);
  font-size: 0.75rem;
}

.dash-charts {
  display: grid;
  gap: 0.85rem;
}

.dash-chart {
  padding-bottom: 0.75rem;
  overflow: hidden;
}

.dash-chart .dash-panel__head {
  padding-bottom: 0.2rem;
}

.dash-chart .dash-panel__head h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.dash-chart__legend {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.dash-swatch {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 2px;
  margin-right: 0.15rem;
  vertical-align: -1px;
}

.dash-swatch--purchase { background: var(--purchase); }
.dash-swatch--sale { background: var(--sale); }
.dash-swatch--received { background: var(--received); }
.dash-swatch--paid { background: var(--paid); }

.dash-chart__body {
  position: relative;
  height: 14.5rem;
  padding: 0.25rem 0.85rem 0.5rem;
}

.dash-grid,
.dash-insights {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.dash-panel__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.95rem 1rem 0.4rem;
}

.dash-panel__head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.dash-panel__head a {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
}

.dash-panel__head a:hover {
  text-decoration: underline;
}

.dash-feed {
  list-style: none;
  margin: 0;
  padding: 0.15rem 0 0.35rem;
}

.dash-feed li {
  border-top: 1px solid var(--border);
}

.dash-feed__item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.7rem 1rem;
  color: inherit;
  text-decoration: none;
  transition: background 0.15s var(--ease);
}

.dash-feed__item:hover {
  background: var(--accent-soft);
}

.dash-feed__main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.dash-feed__main strong {
  font-size: 0.9rem;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-feed__main span {
  color: var(--muted);
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-feed__amt {
  flex-shrink: 0;
  margin: 0;
  font-style: normal;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  line-height: 1.25;
}

.dash-feed__sub {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}

.dash-split {
  display: grid;
  gap: 0.85rem;
  padding: 0 1rem 1rem;
}

.dash-rank {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.dash-rank li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.dash-rank__name {
  font-weight: 600;
  font-size: 0.88rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-rank__meta {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.history-panel .dash-panel__head span {
  color: var(--muted);
  font-size: 0.8rem;
}

.dash-in { color: var(--success); }
.dash-out { color: var(--danger); }

.page--dash .dash-panel .empty {
  padding: 0.85rem 1rem 1.1rem;
}

.page--dash .dash-panel .dash-split .empty {
  padding: 0.35rem 0 0;
}

.history-panel {
  margin-top: 1rem;
}

.voucher-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem 0.7rem;
  align-items: end;
  margin-bottom: 1rem;
}

.voucher-form .field {
  margin-bottom: 0;
}

.voucher-form__save .btn + .btn {
  margin-top: 0.4rem;
}

.voucher-form #Received {
  color: var(--success);
  font-weight: 700;
}

.voucher-form #Paid {
  color: var(--danger);
  font-weight: 700;
}

.saved-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.saved-banner p {
  margin: 0;
  font-weight: 600;
  color: var(--success);
}

.history-panel .dash-panel__head span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: right;
}

.dash-in { color: var(--success); }
.dash-out { color: var(--danger); }

/* legacy header/nav kept for any leftover markup */
.header--row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.nav .btn {
  min-height: 38px;
  padding: 0.4rem 0.75rem;
  font-size: 0.88rem;
  white-space: nowrap;
}

.search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: stretch;
  margin-bottom: 1rem;
  position: relative;
  z-index: 20;
  overflow: visible;
}

.search-bar input[type="search"] {
  flex: 1 1 12rem;
  min-width: 0;
}

.search-bar select {
  flex: 1 1 10rem;
  min-width: 0;
}

.search-bar .js-combo {
  flex: 1 1 10rem;
  min-width: 0;
}

.search-bar input[type="date"] {
  flex: 1 1 9rem;
  min-width: 0;
}

.search-bar .btn {
  flex: 0 0 auto;
}

.summary-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.summary-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.8rem;
  min-width: 0;
}

.summary-box span {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.summary-box strong {
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.table-wrap {
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
  padding: 0;
}

.card.table-wrap {
  padding: 0;
  overflow: hidden;
  max-width: 100%;
}

.data-table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.data-table th,
.data-table td {
  padding: 0.55rem 0.55rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  min-width: 0;
}

.data-table th {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--surface-2);
  position: sticky;
  top: 0;
  z-index: 1;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table td.cell-clip,
.data-table .cell-clip {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-table tbody tr:hover {
  background: var(--accent-soft);
}

.data-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-size: 0.8rem;
}

.data-table tfoot th {
  background: var(--surface-2);
  font-weight: 700;
  white-space: nowrap;
}

.data-table td.row-actions,
.data-table th.col-actions {
  overflow: visible;
  white-space: normal;
}

.row-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.45rem;
  align-items: center;
  justify-content: flex-end;
  white-space: nowrap;
}

.row-actions a,
.row-actions .link-danger,
.row-actions button {
  font-size: 0.78rem;
  flex: 0 0 auto;
}

.row-actions form {
  display: inline;
  margin: 0;
}

.amt-received,
.amt-paid {
  font-weight: 700;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.amt-received { color: var(--success); }
.amt-paid { color: var(--danger); }

.data-table a,
.account-card a,
.detail-list a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.account-cards {
  display: none;
}

.account-card {
  display: block;
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--border);
  color: inherit;
  text-decoration: none;
}

.account-card:last-child {
  border-bottom: none;
}

.account-card__top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}

.account-card__title {
  font-weight: 700;
  margin: 0 0 0.35rem;
  overflow-wrap: anywhere;
}

.account-card__id {
  color: var(--muted);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.account-card__meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.account-card__row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.65rem;
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
}

.empty {
  padding: 1rem 1.15rem 1.15rem;
}

.empty a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.detail-list {
  display: grid;
  grid-template-columns: minmax(7rem, 38%) 1fr;
  gap: 0.55rem 0.75rem;
  margin: 0;
}

.detail-list dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 1.15rem;
}

.field {
  margin-bottom: 1rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.field-row > .field[hidden] {
  display: none !important;
}

.form-section {
  margin: 0;
  padding: 0 0 1.15rem;
  min-width: 0;
  min-inline-size: 0;
  border: 0;
  border-bottom: 1px solid var(--border);
}

.form-section + .form-section {
  margin-top: 0.25rem;
}

.entry-form > .form-section:first-of-type legend {
  padding-top: 0;
}

.entry-form > .form-section:last-of-type {
  border-bottom: 0;
  padding-bottom: 0.15rem;
}

.form-section legend {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 0.85rem 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.form-section .field:last-child,
.form-section .field-row:last-child {
  margin-bottom: 0;
}

.hint--pair {
  margin: 0.2rem 0 0.85rem;
}

.entry-form .field {
  margin-bottom: 0.7rem;
}

.bill-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  margin: 0.15rem 0 0.85rem;
  padding: 0.7rem 0.85rem 0.55rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.bill-strip .field {
  margin-bottom: 0;
}

.bill-strip input:read-only {
  background: transparent;
  border-color: transparent;
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  padding-left: 0;
  min-height: 2.2rem;
}

.bill-strip input:read-only:focus {
  border-color: var(--accent);
}

.field--calc input:read-only {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.form-extras {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.form-extras summary {
  cursor: pointer;
  padding: 0.8rem 0.95rem;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.form-extras__body {
  padding: 0.35rem 0.95rem 0.85rem;
  border-top: 1px solid var(--border);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  align-items: center;
  white-space: normal;
}

label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

input,
button,
.btn {
  font-family: inherit;
}

input,
textarea {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 16px;
  min-height: 44px;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.18);
}

input:read-only,
textarea:read-only {
  background: var(--surface-2);
  color: var(--ink-soft);
}

textarea {
  min-height: 5.5rem;
  resize: vertical;
}

select {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 16px;
  min-height: 44px;
  background: var(--surface);
  font-family: inherit;
}

.js-combo {
  position: relative;
  width: 100%;
}

.js-combo select {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.js-combo__input {
  width: 100%;
  padding-right: 2.2rem;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 0.85rem center;
}

.js-combo.is-open .js-combo__input {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.18);
}

.js-combo__menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
  max-height: min(16rem, 50vh);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}

.js-combo__option {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  border-radius: 0;
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  min-height: 40px;
  padding: 0.55rem 0.85rem;
  cursor: pointer;
}

.js-combo__option:hover,
.js-combo__option.is-active {
  background: var(--accent-soft);
}

.js-combo__option.is-selected {
  color: var(--accent);
  font-weight: 700;
}

.js-combo__empty {
  padding: 0.75rem 0.85rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.combo-new {
  display: none;
  margin-top: 0.5rem;
}

.combo-new.is-open {
  display: block;
}

.hint {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.org-preview {
  margin: 0 0 0.5rem;
  color: var(--muted);
  line-height: 1.45;
}

.actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.1rem;
  min-height: 44px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.15s var(--ease), transform 0.15s var(--ease);
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px rgba(234, 88, 12, 0.28);
}

.btn--primary:hover {
  background: var(--accent-hover);
}

.btn--secondary {
  background: var(--canvas-deep);
  color: var(--text);
}

.btn--secondary:hover {
  background: #d0d9e6;
}

.btn--danger {
  background: var(--danger);
  color: #fff;
}

.btn--danger:hover {
  background: #991b1b;
}

.btn--block {
  width: 100%;
}

.actions form {
  margin: 0;
  flex: 1 1 100%;
}

.row-actions form {
  display: inline;
  margin: 0;
}

.link-danger {
  background: none;
  border: none;
  padding: 0;
  min-height: 0;
  font: inherit;
  font-weight: 600;
  color: var(--danger);
  cursor: pointer;
  text-decoration: none;
}

.btn--disabled,
.btn:disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}

.today-list {
  margin: 1.75rem 0 0;
}

.today-list .dash-heading {
  text-align: left;
  margin-bottom: 0.45rem;
}

.sheet-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.4rem;
  margin: 0 0 0.7rem;
}

.sheet-filter__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}

.sheet-filter__btn.is-on,
.sheet-filter__btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.sheet-filter__date {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem;
}

.sheet-filter__label {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.sheet-filter__date input[type="date"] {
  width: auto;
  min-height: 36px;
  padding: 0.25rem 0.5rem;
  font-size: 0.85rem;
}

.today-list .data-table {
  font-size: 0.74rem;
}

.today-list .data-table th,
.today-list .data-table td {
  padding: 0.35rem 0.4rem;
}

.today-list .data-table .num {
  font-size: 0.72rem;
}

.today-list .account-card {
  padding: 0.55rem 0.7rem;
}

.data-table tbody tr.is-current,
.account-card.is-current {
  background: var(--accent-soft);
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.pager__status {
  font-size: 0.9rem;
  color: var(--muted);
  min-width: 8rem;
  text-align: center;
}

.pager .btn {
  min-width: 6.5rem;
}

.messages {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.message {
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  border: 1px solid transparent;
}

.message--error {
  background: var(--danger-soft);
  color: #7f1d1d;
  border-color: #fecaca;
}

.message--success {
  background: var(--success-soft);
  color: #14532d;
  border-color: #bbf7d0;
}

/* Auth */
.auth-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background:
    radial-gradient(900px 420px at 10% 0%, rgba(234, 88, 12, 0.14), transparent 55%),
    radial-gradient(700px 380px at 100% 100%, rgba(15, 118, 110, 0.1), transparent 50%),
    var(--canvas);
}

.auth-card {
  width: 100%;
  max-width: 24rem;
}

.auth-card .brand {
  font-size: 0.8rem;
}

.auth-card h1 {
  margin: 0 0 0.25rem;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

/* Phones / tablets: cards instead of wide tables */
@media (max-width: 1099px) {
  .data-table {
    display: none;
  }

  .account-cards {
    display: block;
  }

  .table-wrap {
    overflow: visible;
  }

  .actions {
    justify-content: stretch;
  }

  .actions .btn {
    flex: 1 1 calc(50% - 0.25rem);
  }

  .search-bar .btn {
    flex: 1 1 calc(50% - 0.25rem);
  }
}

@media (max-width: 599px) {
  .page--auth,
  .auth-shell {
    align-items: flex-start;
    padding-top: 2rem;
  }

  .search-bar input[type="search"],
  .search-bar select,
  .search-bar input[type="date"],
  .search-bar .btn {
    flex: 1 1 100%;
  }

  .pager .btn {
    flex: 1 1 calc(50% - 0.25rem);
  }

  .page-header h1 {
    font-size: 1.35rem;
  }
}

@media (min-width: 600px) {
  .field-row {
    grid-template-columns: 1fr 1fr;
  }

  .field-row--3 {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .bill-strip {
    grid-template-columns: repeat(3, 1fr);
  }

  .voucher-form {
    grid-template-columns: 1fr 1fr;
  }

  .page {
    padding-top: 1.15rem;
    padding-bottom: 1.75rem;
  }
}

@media (min-width: 700px) {
  .summary-row,
  .dash-kpis {
    grid-template-columns: repeat(4, 1fr);
  }

  .dash-charts {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 840px) {
  .voucher-form {
    grid-template-columns: 8.5rem minmax(12rem, 1.5fr) minmax(9rem, 1.1fr) minmax(10rem, 1.2fr) 7.2rem 7.2rem auto;
  }

  .voucher-form__save-label {
    display: block;
    visibility: hidden;
  }

  .dash-grid {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .dash-insights {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .dash-split {
    grid-template-columns: 1fr 1fr;
  }

  .page--wide .data-table {
    font-size: 0.82rem;
  }

  .page--wide .data-table th,
  .page--wide .data-table td {
    padding: 0.55rem 0.5rem;
  }

  .page--wide .data-table .num {
    font-size: 0.8rem;
  }

  .actions {
    justify-content: flex-end;
  }
}

@media (min-width: 1100px) {
  .dash-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .dash-insights {
    grid-template-columns: 1.15fr 1fr 0.95fr;
  }
}

/* Desktop: fixed sidebar */
@media (min-width: 960px) {
  .sidebar {
    transform: none;
    width: var(--sidebar-w);
  }

  .sidebar__close,
  .topbar__menu--mobile,
  .mobile-dock,
  .sidebar-backdrop {
    display: none !important;
  }

  .sidebar__hide {
    display: inline-flex;
  }

  .topbar {
    display: none;
  }

  .app-shell {
    margin-left: var(--sidebar-w);
    padding-bottom: 0;
    transition: margin-left 0.28s var(--ease);
  }

  .page {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    padding-top: 1.5rem;
  }

  .topbar__user {
    display: block;
  }

  .sidebar-collapsed .sidebar {
    transform: translateX(-105%);
    pointer-events: none;
  }

  .sidebar-collapsed .app-shell {
    margin-left: 0;
  }

  .sidebar-collapsed .topbar {
    display: flex;
  }

  .sidebar-collapsed .topbar__menu--desktop {
    display: inline-flex;
  }
}

@media (min-width: 1100px) {
  .page,
  .page--wide,
  .page--entry {
    padding-left: 1.75rem;
    padding-right: 1.75rem;
  }
}

@page {
  size: A4 portrait;
  margin: 10mm;
}

.page--print {
  max-width: 210mm;
  background: #fff;
}

.page--print-landscape {
  max-width: 297mm;
}

.print-sheet {
  background: #fff;
  color: #111;
  padding: 8mm 10mm;
  border: 1px solid #c5cdd6;
  width: 100%;
  max-width: 190mm;
  font-size: 10pt;
}

.print-sheet--landscape {
  max-width: 277mm;
}

.print-head {
  text-align: center;
  border-bottom: 2px solid #1a2332;
  padding-bottom: 4mm;
  margin-bottom: 4mm;
}

.print-head h1 {
  margin: 0 0 1mm;
  font-size: 16pt;
  letter-spacing: 0.02em;
}

.print-head p {
  margin: 0.5mm 0;
  font-size: 9pt;
  color: #334155;
}

.print-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8mm;
  margin: 0 0 3mm;
}

.print-title h2 {
  margin: 0;
  font-size: 12pt;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.print-meta,
.print-party {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5mm 8mm;
  margin-bottom: 3mm;
  font-size: 9.5pt;
}

.print-party {
  border: 1px solid #d6dee8;
  padding: 2.5mm 3mm;
}

.print-item {
  margin: 0 0 3mm;
  font-size: 10pt;
}

.print-metrics {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin-bottom: 3mm;
}

.print-metrics th,
.print-metrics td {
  border: 1px solid #c5cdd6;
  padding: 2mm 2.5mm;
  font-size: 9pt;
  text-align: left;
  word-wrap: break-word;
}

.print-metrics th {
  background: #eef2f6;
  font-weight: 600;
  width: 25%;
}

.print-metrics td {
  font-variant-numeric: tabular-nums;
}

.print-a4-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 8pt;
}

.print-a4-table th,
.print-a4-table td {
  border: 1px solid #c5cdd6;
  padding: 1.4mm 1.6mm;
  text-align: left;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  vertical-align: top;
  min-width: 0;
}

.print-a4-table th {
  background: #eef2f6;
  font-weight: 600;
  position: static;
  text-transform: none;
  letter-spacing: 0;
  font-size: 7.5pt;
}

.print-a4-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.print-a4-table col.col-no { width: 8%; }
.print-a4-table col.col-date { width: 12%; }
.print-a4-table col.col-name { width: 18%; }
.print-a4-table col.col-item { width: 16%; }
.print-a4-table col.col-num { width: 9.2%; }

/* Purchase report: 11 columns — widths sum to 100% */
.print-a4-table--purchase {
  font-size: 7.5pt;
}

.print-a4-table--purchase th,
.print-a4-table--purchase td {
  padding: 1.1mm 1.2mm;
  line-height: 1.25;
}

.print-a4-table--purchase th {
  font-size: 7pt;
  white-space: nowrap;
}

.print-a4-table--purchase .num {
  white-space: nowrap;
  font-size: 7.25pt;
}

.print-a4-table--purchase col.col-no { width: 4%; }
.print-a4-table--purchase col.col-date { width: 8%; }
.print-a4-table--purchase col.col-name { width: 14%; }
.print-a4-table--purchase col.col-item { width: 12%; }
.print-a4-table--purchase col.col-qty { width: 9%; }
.print-a4-table--purchase col.col-rate { width: 7%; }
.print-a4-table--purchase col.col-net { width: 9%; }
.print-a4-table--purchase col.col-amt { width: 10%; }
.print-a4-table--purchase col.col-cash { width: 9%; }
.print-a4-table--purchase col.col-exp { width: 9%; }
.print-a4-table--purchase col.col-bal { width: 9%; }

.print-a4-table--sales {
  font-size: 7.5pt;
}

.print-a4-table--sales th,
.print-a4-table--sales td {
  padding: 1.1mm 1.2mm;
  line-height: 1.25;
}

.print-a4-table--sales th {
  font-size: 7pt;
  white-space: nowrap;
}

.print-a4-table--sales .num {
  white-space: nowrap;
  font-size: 7.25pt;
}

.print-a4-table--sales col.col-no { width: 4%; }
.print-a4-table--sales col.col-date { width: 8%; }
.print-a4-table--sales col.col-name { width: 13%; }
.print-a4-table--sales col.col-item { width: 11%; }
.print-a4-table--sales col.col-qty { width: 8%; }
.print-a4-table--sales col.col-rate { width: 7%; }
.print-a4-table--sales col.col-net { width: 8%; }
.print-a4-table--sales col.col-amt { width: 9%; }
.print-a4-table--sales col.col-tpt { width: 7%; }
.print-a4-table--sales col.col-labour { width: 8%; }
.print-a4-table--sales col.col-cash { width: 8%; }
.print-a4-table--sales col.col-bal { width: 9%; }

.print-totals {
  margin-top: 3mm;
  margin-left: auto;
  width: 70mm;
}

.print-totals div {
  display: flex;
  justify-content: space-between;
  padding: 1.2mm 0;
  border-bottom: 1px solid #e8eef5;
  font-size: 9.5pt;
}

.print-totals .print-totals__grand {
  font-weight: 700;
  border-bottom: 2px solid #1a2332;
}

.print-words {
  margin: 3mm 0 0;
  padding: 2.5mm 0;
  border-top: 2px solid #1a2332;
  border-bottom: 2px solid #1a2332;
  font-size: 10.5pt;
  font-weight: 700;
  color: #111;
  line-height: 1.35;
}

.print-signs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16mm;
  margin-top: 14mm;
}

.print-signs p {
  margin: 0;
  border-top: 1px solid #1a2332;
  padding-top: 1.5mm;
  text-align: center;
  font-size: 9pt;
}

.print-note {
  margin-top: 5mm;
  font-size: 8pt;
  color: #5a6b7d;
}

@media print {
  html,
  body {
    background: #fff;
  }

  .sidebar,
  .sidebar-backdrop,
  .topbar,
  .mobile-dock,
  .skip-link,
  .no-print {
    display: none !important;
  }

  .app-shell {
    margin: 0 !important;
    padding: 0 !important;
  }

  .page,
  .page--wide,
  .page--print {
    max-width: 210mm;
    margin: 0;
    padding: 0;
  }

  .page--print-landscape {
    max-width: none;
    width: 100%;
  }

  .print-sheet {
    border: none;
    padding: 0;
    max-width: none;
  }

  .print-sheet--landscape {
    max-width: none;
    width: 100%;
  }

  .data-table,
  .print-a4-table,
  .print-metrics {
    display: table !important;
  }

  .account-cards {
    display: none !important;
  }
}

/* Check management */
.check-alert {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem 1.25rem;
  margin: 0 0 1rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
}

.check-alert--danger {
  background: var(--danger-soft);
  border-color: #fecaca;
  color: #7f1d1d;
}

.check-alert--warn {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

.check-alert__title {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
}

.check-alert__text {
  display: grid;
  gap: 0.15rem;
  min-width: min(100%, 16rem);
}

.check-alert__text p,
.check-alert__text span {
  margin: 0;
  font-size: 0.88rem;
}

.check-alert__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: #e2e8f0;
  color: #334155;
  white-space: nowrap;
}

.pill--pending { background: #ffedd5; color: #9a3412; }
.pill--cleared { background: #dcfce7; color: #166534; }
.pill--bounced { background: #fee2e2; color: #991b1b; }
.pill--cancelled { background: #e2e8f0; color: #475569; }
.pill--danger { background: #fee2e2; color: #991b1b; margin-left: 0.35rem; }

.row--overdue td {
  background: rgba(254, 226, 226, 0.45);
}

.account-card--alert {
  border-color: #fecaca;
  box-shadow: inset 3px 0 0 var(--danger);
}

.sidebar__badge {
  margin-left: auto;
  min-width: 1.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: #fdba74;
  color: #7c2d12;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
}

.sidebar__badge--danger {
  background: #f87171;
  color: #7f1d1d;
}

.inline-form {
  display: inline;
  margin: 0;
}

.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.link-btn:hover {
  color: var(--accent);
}

.field-hint {
  font-weight: 500;
  color: var(--muted);
  font-size: 0.85em;
}

.field-note {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}
