:root {
  --bg: #f1f5f9;
  --bg-elevated: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-dim: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --sidebar-w: 274px;
  --radius: 10px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
  /* Dark sidebar (main app stays light) */
  --sidebar-bg: #0f172a;
  --sidebar-bg-bottom: #111c33;
  --sidebar-border: rgba(148, 163, 184, 0.14);
  --sidebar-text: #e8eef4;
  --sidebar-muted: #94a3b8;
  --sidebar-hover: rgba(59, 130, 246, 0.14);
  --sidebar-active-bg: rgba(59, 130, 246, 0.22);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-bottom) 100%);
  border-right: 1px solid var(--sidebar-border);
  padding: 1.15rem 0 1.5rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  box-shadow: 4px 0 24px rgba(15, 23, 42, 0.12);
}

.sidebar-brand {
  padding: 0 1.1rem 1rem;
  border-bottom: 1px solid var(--sidebar-border);
  margin-bottom: 0.75rem;
}

.brand-title {
  display: block;
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: 0.14em;
  color: #fff;
}

.sidebar-brand small {
  display: block;
  font-weight: 500;
  color: var(--sidebar-muted);
  font-size: 0.72rem;
  margin-top: 0.35rem;
  letter-spacing: 0.02em;
  line-height: 1.35;
}

.nav-section {
  padding: 0.5rem 1rem;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--sidebar-muted);
  font-weight: 600;
}

.nav-section-spaced {
  margin-top: 0.85rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.52rem 1rem 0.52rem 1.15rem;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.895rem;
  font-weight: 500;
  border-left: 3px solid transparent;
}
.nav-link .nav-ico {
  flex-shrink: 0;
  color: var(--sidebar-muted);
}
.nav-link:hover {
  background: var(--sidebar-hover);
  text-decoration: none;
  color: #fff;
}
.nav-link:hover .nav-ico {
  color: #93c5fd;
}
.nav-link.active {
  border-left-color: #3b82f6;
  background: var(--sidebar-active-bg);
  color: #fff;
}
.nav-link.active .nav-ico {
  color: #60a5fa;
}

.nav-link-sub {
  padding-left: 2.15rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--sidebar-muted);
}
.nav-link-sub .nav-ico {
  width: 18px;
  height: 18px;
}
.nav-link-sub:hover {
  color: var(--sidebar-text);
}
.nav-link-sub.active {
  color: var(--sidebar-text);
  font-weight: 600;
}

.nav-link-muted {
  color: var(--sidebar-muted);
}
.nav-link-muted:hover {
  color: var(--sidebar-text);
}
.nav-link-muted .nav-ico {
  color: var(--sidebar-muted);
}
.nav-link-muted:hover .nav-ico {
  color: #cbd5e1;
}

.signout-open-btn.nav-link {
  width: 100%;
  border: none;
  background: none;
  cursor: pointer;
  font: inherit;
  font-family: inherit;
  text-align: left;
}

.signout-open-btn.nav-link:focus-visible {
  outline: 2px solid rgba(96, 165, 250, 0.85);
  outline-offset: -2px;
}

.signout-modal[hidden] {
  display: none !important;
}

.signout-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  box-sizing: border-box;
}

.signout-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
}

.signout-modal__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 22rem;
  padding: 1.35rem 1.45rem 1.25rem;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 22px 55px rgba(15, 23, 42, 0.22);
  border: 1px solid #e2e8f0;
}

.signout-modal__title {
  margin: 0 0 0.45rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
}

.signout-modal__hint {
  margin: 0 0 1.1rem;
  font-size: 0.9rem;
  color: #64748b;
  line-height: 1.45;
}

.signout-modal__actions {
  display: flex;
  gap: 0.55rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* Finance — tabs in main content (not sidebar submenu) */
.page-finance-app .content {
  max-width: 1280px;
}

.finance-app {
  padding-bottom: 2rem;
}

.finance-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 1.25rem;
  padding: 0.4rem;
  background: linear-gradient(180deg, #fafbfc 0%, #f4f6f8 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 14px rgba(15, 23, 42, 0.04);
}

.finance-tab {
  padding: 0.55rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.finance-tab:hover {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}

.finance-tab--active {
  color: #fff;
  background: linear-gradient(135deg, #5d4037 0%, #4e342e 100%);
  border-color: #4e342e;
  box-shadow: 0 2px 8px rgba(78, 52, 46, 0.25);
}

.finance-app__panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.35rem 1.5rem 1.65rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05), 0 8px 24px rgba(15, 23, 42, 0.06);
}

/* Expense form — clean stacked fields */
.expense-form {
  max-width: 440px;
}
.expense-form__field {
  margin-bottom: 1.05rem;
}
.expense-form__grid {
  display: grid;
  gap: 0 1rem;
}
.expense-form__grid--2 {
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 560px) {
  .expense-form__grid--2 {
    grid-template-columns: 1fr;
  }
}
.money-input {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.expense-form__label {
  display: block;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.38rem;
}
.expense-form__control {
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  font: inherit;
  font-size: 0.9rem;
  background: var(--surface);
  color: var(--text);
}
.expense-form__control:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}
.expense-form__select {
  cursor: pointer;
}
.expense-form__err {
  margin: 0.3rem 0 0;
  font-size: 0.78rem;
  color: var(--danger);
}
.expense-form__actions {
  margin-top: 1.35rem;
}
.expense-form__submit {
  padding: 0.55rem 1.35rem;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  font-family: inherit;
}
.expense-form__submit:hover {
  background: var(--accent-dim);
}

/* Stock item form — card layout, quantity + unit grid */
.stock-form {
  max-width: 560px;
}
.stock-form__lead {
  margin: 0 0 1.1rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--muted);
  max-width: 48rem;
}
.stock-form__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem 1.5rem;
  box-shadow: var(--shadow-sm);
}
.stock-form__grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (min-width: 520px) {
  .stock-form__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
}
.stock-form__field {
  margin-bottom: 1rem;
}
.stock-form__field--full {
  margin-bottom: 1rem;
}
.stock-form__label {
  display: block;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.38rem;
}
.stock-form__control {
  display: block;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  font: inherit;
  font-size: 0.9rem;
  background: var(--surface);
  color: var(--text);
}
.stock-form__control:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}
.stock-form__textarea {
  min-height: 5.5rem;
  resize: vertical;
  line-height: 1.45;
}
.stock-form__hint {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}
.stock-form__err {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--danger);
}
.stock-form__actions {
  margin-top: 0.25rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}
.stock-form__submit {
  min-width: 8rem;
}

.store-section-title {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.store-section-hint {
  margin: 0 0 0.5rem;
  max-width: 52rem;
  line-height: 1.45;
}

/* User create / edit — match stock form polish */
.user-form {
  max-width: 520px;
}
.user-form__lead {
  margin: 0 0 1.1rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--muted);
  max-width: 40rem;
}
.user-form__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem 1.5rem;
  box-shadow: var(--shadow-sm);
}
.user-form__field {
  margin-bottom: 1rem;
}
.user-form__field--full {
  margin-bottom: 1rem;
}
.user-form__label {
  display: block;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.38rem;
}
.user-form__control,
.user-form__select {
  display: block;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  font: inherit;
  font-size: 0.9rem;
  background: var(--surface);
  color: var(--text);
}
.user-form__control:focus,
.user-form__select:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}
.user-form__select {
  cursor: pointer;
}
.user-form__hint {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}
.user-form__err {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--danger);
}
.user-form__actions {
  margin-top: 0.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.user-form__submit {
  min-width: 8.5rem;
}

.toolbar__actions {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.txn-detail-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.65rem;
}
.txn-detail-head__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.txn-detail-dl {
  display: grid;
  grid-template-columns: minmax(6rem, 9rem) 1fr;
  gap: 0.55rem 1rem;
  max-width: 640px;
  margin: 1rem 0 0;
  font-size: 0.9rem;
}
.txn-detail-dl dt {
  margin: 0;
  font-weight: 600;
  color: var(--muted);
}
.txn-detail-dl dd {
  margin: 0;
}

.table-actions__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.table-actions__btns .btn-sm {
  white-space: nowrap;
}

.page-finance-app .txn-table th,
.page-finance-app .txn-table td {
  vertical-align: middle;
}
.page-finance-app .txn-table .txn-table__th--amount,
.page-finance-app .txn-table .txn-table__td--amount,
.page-finance-app .txn-table .txn-table__th--actions,
.page-finance-app .txn-table .txn-table__td--actions {
  text-align: right;
}
.page-finance-app .txn-table .txn-table__th--when,
.page-finance-app .txn-table .txn-table__td--when {
  width: 130px;
}
.page-finance-app .txn-table .txn-table__th--desc,
.page-finance-app .txn-table .txn-table__td--desc {
  min-width: 9rem;
  max-width: 15rem;
}
.page-finance-app .txn-table .txn-desc {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: help;
  color: var(--text);
}
.page-finance-app .txn-table .txn-desc--long {
  border-bottom: 1px dotted rgba(100, 116, 139, 0.45);
}
.page-finance-app .txn-table .txn-table__th--actions,
.page-finance-app .txn-table .txn-table__td--actions {
  width: 150px;
}
.page-finance-app .txn-table .txn-amount {
  margin-left: auto;
}

.page-finance-app .table-wrap .data tbody tr.txn-row--in td {
  background: linear-gradient(90deg, rgba(5, 150, 105, 0.03), transparent 55%);
}
.page-finance-app .table-wrap .data tbody tr.txn-row--out td {
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.03), transparent 55%);
}

.txn-amount {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 90px;
  padding: 0.2rem 0.48rem;
  border-radius: 999px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.txn-amount--in {
  color: #047857;
  background: rgba(5, 150, 105, 0.12);
  border: 1px solid rgba(5, 150, 105, 0.24);
}
.txn-amount--out {
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.22);
}

/* Manual transaction — payment-style ledger form */
.txn-form {
  max-width: 720px;
}
.txn-form--pro {
  max-width: 980px;
}
.txn-form__title {
  margin: 0 0 1.15rem;
  font-size: 1.22rem;
  font-weight: 700;
}
.txn-form__sub {
  margin: -0.55rem 0 1rem;
  color: var(--muted);
  font-size: 0.86rem;
}
.txn-form__card {
  background: linear-gradient(180deg, #fbfdff 0%, #ffffff 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1rem 1.1rem;
  box-shadow: var(--shadow-sm);
}
.txn-form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
  align-items: start;
}
@media (max-width: 640px) {
  .txn-form__grid {
    grid-template-columns: 1fr;
  }
}
.txn-form__field--full {
  grid-column: 1 / -1;
}
.txn-form__field--dir {
  min-width: 0;
}
.txn-form__label {
  display: block;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.38rem;
}
.txn-form__control {
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  font: inherit;
  font-size: 0.9rem;
  background: var(--surface);
  color: var(--text);
}
.txn-form__control:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}
.txn-form__control--readonly {
  background: var(--surface-2);
  color: var(--muted);
  cursor: default;
}
.txn-form__select {
  cursor: pointer;
}
.txn-form__textarea {
  min-height: 6rem;
  resize: vertical;
}
.txn-form__dir-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  padding: 0.45rem 0 0;
}
.txn-form__dir-opt {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  margin: 0;
}
.txn-form__radio {
  width: 1rem;
  height: 1rem;
  accent-color: currentColor;
  cursor: pointer;
}
.txn-form__dir-opt--in span:last-child {
  color: var(--success);
}
.txn-form__dir-opt--out span:last-child {
  color: var(--danger);
}
.txn-form__hint {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}
.txn-form__err {
  margin: 0.3rem 0 0;
  font-size: 0.78rem;
  color: var(--danger);
}
.txn-form__actions {
  margin-top: 1.35rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: flex-end;
}

.nav-label {
  flex: 1;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg) 280px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.topbar-heading h1 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.topbar-kicker {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 0.08rem;
}

.user-pill {
  font-size: 0.8rem;
  color: var(--muted);
  flex-shrink: 0;
}
.user-pill strong {
  color: var(--text);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}
.btn:hover {
  border-color: #cbd5e1;
  background: var(--surface-2);
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dim) 100%);
  border-color: transparent;
  color: #fff;
}
.btn-primary:hover {
  filter: brightness(1.03);
}
.btn-danger {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.35);
  color: #b91c1c;
}
.btn-danger:hover {
  background: rgba(220, 38, 38, 0.12);
}
.btn-sm {
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
}

.content {
  padding: 1.5rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* —— Dashboard (professional overview) —— */
.dashboard-page {
  padding-bottom: 2rem;
}

.dashboard-hero {
  position: relative;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 52%, #f1f5f9 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem 1.65rem 1.45rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 28px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}
.dashboard-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #1e3a5f 0%, var(--accent) 45%, #0f766e 100%);
  border-radius: 12px 12px 0 0;
}

.dashboard-hero__top {
  margin-bottom: 0.5rem;
}

.dashboard-hero__badge {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-dim);
  background: rgba(37, 99, 235, 0.09);
  border: 1px solid rgba(37, 99, 235, 0.18);
  padding: 0.28rem 0.55rem;
  border-radius: 6px;
}

.dashboard-hero__title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #0f172a;
  line-height: 1.2;
}

.dashboard-hero__lead {
  margin: 0.5rem 0 0;
  max-width: 52ch;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.55;
  font-weight: 450;
}

.dashboard-kpi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.dashboard-wallet-grid {
  display: grid;
  gap: 0.75rem;
}
.dashboard-wallet-grid--split {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.dashboard-wallet-grid--cash-only {
  grid-template-columns: minmax(200px, 320px);
}
.dashboard-wallet-card__title {
  font-size: 0.85rem;
  margin: 0 0 0.5rem;
  color: var(--muted);
}
.dashboard-wallet-row {
  margin: 0.25rem 0;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}
.dashboard-wallet-card__note {
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
}

.stat-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.2rem 1.25rem 1.15rem 1.2rem;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--stat-accent, #cbd5e1);
}

.stat-card--orders {
  --stat-accent: #3b82f6;
}
.stat-card--customers {
  --stat-accent: #7c3aed;
}
.stat-card--ksh {
  --stat-accent: #059669;
}
.stat-card--usd {
  --stat-accent: #2563eb;
}
.stat-card--liabilities {
  --stat-accent: #b45309;
}
.stat-card__value--stacked {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: clamp(1.1rem, 2.5vw, 1.45rem);
  line-height: 1.25;
}
.stat-card__value-sub {
  font-size: 0.82em;
  font-weight: 600;
  opacity: 0.92;
}
.stat-card--pending {
  --stat-accent: #d97706;
}

.stat-card__label {
  margin: 0 0 0.4rem;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 700;
}

.stat-card__value {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.15;
}

.stat-card__value--currency {
  font-size: 1.55rem;
}

.stat-card__hint {
  margin: 0.45rem 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.4;
}

.stat-card__split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.stat-card__split dt {
  margin: 0;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}
.stat-card__split dd {
  margin: 0.2rem 0 0;
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.dashboard-secondary {
  display: grid;
  grid-template-columns: minmax(280px, 1.2fr) minmax(240px, 0.9fr);
  gap: 1rem;
  margin-bottom: 1.75rem;
  align-items: stretch;
}

@media (max-width: 860px) {
  .dashboard-secondary {
    grid-template-columns: 1fr;
  }
}

.dashboard-secondary__wide {
  min-height: 100%;
}

.dashboard-actions {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.2rem 1.25rem;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid #64748b;
  display: flex;
  flex-direction: column;
}

.dashboard-actions__desc {
  margin: 0 0 0.85rem;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.4;
}

.dashboard-actions__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.dashboard-actions__admin {
  margin-top: auto;
  padding-top: 0.85rem;
  font-size: 0.8125rem;
  font-weight: 600;
}

.btn-outline {
  background: transparent;
  border-color: #cbd5e1;
  color: var(--text);
  box-shadow: none;
}
.btn-outline:hover {
  background: var(--surface-2);
  border-color: #94a3b8;
  color: var(--text);
}

.dashboard-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.dashboard-panel__head {
  padding: 1.1rem 1.35rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fafbfc 0%, var(--surface) 100%);
}

.dashboard-panel__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.dashboard-panel__subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

.dashboard-panel__table {
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.dashboard-panel .table-wrap {
  border: none;
  border-radius: 0;
}

table.data td.table-empty {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Dashboard charts (Chart.js) */
.dashboard-chart-board {
  margin-bottom: 1.75rem;
}

.dashboard-chart-board__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-bottom: 1rem;
}

.dashboard-chart-board__heading {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.dashboard-chart-board__sub {
  margin: 0.35rem 0 0;
  font-size: 0.828rem;
  color: var(--muted);
  line-height: 1.45;
  max-width: 54ch;
}

.dashboard-year-form label {
  display: block;
}

.dashboard-year-form__lbl {
  display: block;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.dashboard-year-form__select {
  min-width: 128px;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font: inherit;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.dashboard-chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 1rem;
}

.dashboard-chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.dashboard-chart-card__head {
  padding: 1rem 1.2rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fafbfc 0%, var(--surface) 100%);
}

.dashboard-chart-card__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
}

.dashboard-chart-card__meta {
  margin: 0.4rem 0 0;
  font-size: 0.744rem;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.dashboard-chart-card__canvas {
  position: relative;
  height: 300px;
  padding: 0.65rem 0.85rem 1.1rem;
}

.flash {
  padding: 0.65rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.flash-success {
  background: rgba(5, 150, 105, 0.1);
  border: 1px solid rgba(5, 150, 105, 0.28);
  color: #065f46;
}
.flash-danger {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.28);
  color: #991b1b;
}
.flash-warning {
  background: rgba(217, 119, 6, 0.1);
  border: 1px solid rgba(217, 119, 6, 0.3);
  color: #92400e;
}
.flash-info {
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.25);
  color: #1e40af;
}

/* AJAX delete: floating toasts + row exit (see ajax_delete.js) */
.toast-stack {
  position: fixed;
  bottom: 1.35rem;
  right: 1.25rem;
  z-index: 1300;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  align-items: flex-end;
  pointer-events: none;
  max-width: min(380px, calc(100vw - 2rem));
}

.toast-item {
  pointer-events: auto;
  padding: 0.72rem 1.05rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.16);
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition: opacity 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.toast-item--show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast-item--hide {
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
}

.toast-item--success {
  background: linear-gradient(145deg, rgba(5, 150, 105, 0.16), rgba(5, 150, 105, 0.07));
  border: 1px solid rgba(5, 150, 105, 0.4);
  color: #065f46;
}

.toast-item--danger {
  background: linear-gradient(145deg, rgba(220, 38, 38, 0.14), rgba(220, 38, 38, 0.07));
  border: 1px solid rgba(220, 38, 38, 0.38);
  color: #991b1b;
}

.toast-item--warning {
  background: linear-gradient(145deg, rgba(217, 119, 6, 0.18), rgba(217, 119, 6, 0.08));
  border: 1px solid rgba(217, 119, 6, 0.45);
  color: #92400e;
}

[data-delete-row] {
  transition: opacity 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

[data-delete-row].is-delete-leaving {
  opacity: 0;
  transform: translateX(-14px);
}

.btn-spinner {
  display: inline-block;
  width: 0.95rem;
  height: 0.95rem;
  margin-right: 0.35rem;
  vertical-align: -0.15em;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
}

.btn:not(.btn-danger) .btn-spinner {
  border-color: rgba(0, 0, 0, 0.12);
  border-top-color: rgba(0, 0, 0, 0.55);
}

.customers-action--delete .btn-spinner {
  border-color: rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
}

@keyframes btn-spin {
  to {
    transform: rotate(360deg);
  }
}

.btn--delete-busy {
  cursor: wait;
  opacity: 0.9;
}

.grid {
  display: grid;
  gap: 1rem;
}
.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow-sm);
}
.card h3 {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  font-weight: 700;
}
.stat-value {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}
.stat-sub {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
table.data th,
table.data td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
table.data th {
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
table.data tr:last-child td {
  border-bottom: none;
}
table.data tbody tr:hover td {
  background: rgba(241, 245, 249, 0.65);
}

form.stacked label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
  font-weight: 500;
}
form.stacked .field {
  margin-bottom: 1rem;
}
input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
input[type="date"],
select,
textarea {
  width: 100%;
  max-width: 420px;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
textarea {
  min-height: 100px;
  max-width: 100%;
}
.field-error {
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

/* --- Login: unified admin card + tailor background --- */
body.page-login {
  margin: 0;
  min-height: 100vh;
  background: #0f172a;
}

.login-outer {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 2rem);
  box-sizing: border-box;
}

.login-outer::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background-color: #1e293b;
  background-image: url("../images/login-tailor-bg.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.login-outer::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse 75% 60% at 50% 42%, rgba(253, 224, 71, 0.055), transparent 58%),
    linear-gradient(
      165deg,
      rgba(15, 23, 42, 0.82) 0%,
      rgba(15, 23, 42, 0.58) 48%,
      rgba(15, 23, 42, 0.78) 100%
    );
  pointer-events: none;
}

.login-unified {
  position: relative;
  z-index: 2;
  display: flex;
  width: 100%;
  max-width: 560px;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(248, 250, 252, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.38);
  box-shadow:
    0 2px 4px rgba(15, 23, 42, 0.06),
    0 20px 50px rgba(0, 0, 0, 0.32),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.login-unified__brand {
  flex: 0 0 42%;
  min-width: 0;
  background:
    radial-gradient(ellipse 120% 90% at 10% 90%, rgba(253, 224, 71, 0.1), transparent 52%),
    linear-gradient(
      168deg,
      #1a2332 0%,
      #243044 26%,
      #2c3a4d 52%,
      #263548 78%,
      #1a2230 100%
    );
  color: #f1f5f9;
  padding: clamp(1.25rem, 4vw, 1.85rem) clamp(1rem, 3vw, 1.35rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.4rem;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.login-unified__logo-ring {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.35rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.login-unified__logo-img {
  width: 40px;
  height: auto;
  max-height: 40px;
  object-fit: contain;
}

.login-unified__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.login-unified__subtitle {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.92;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.login-unified__badge {
  margin: 0.65rem 0 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.22);
  color: rgba(248, 250, 252, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.login-unified__badge-ico {
  flex-shrink: 0;
  opacity: 0.95;
}

.login-unified__form {
  flex: 1;
  min-width: 0;
  padding: clamp(1.25rem, 3.5vw, 1.75rem) clamp(1.1rem, 3vw, 1.5rem) clamp(1.15rem, 3vw, 1.5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: rgba(255, 255, 255, 0.72);
}

.login-unified__fields {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.login-flash {
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  margin-bottom: 0.85rem;
  font-size: 0.8rem;
  border: 1px solid transparent;
}

.login-flash--success {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.login-flash--danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.login-flash--warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.login-flash--info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

.login-unified__login-mode-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.login-unified__mode {
  display: flex;
  gap: 0;
  margin-bottom: 0.85rem;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background: rgba(241, 245, 249, 0.9);
  padding: 2px;
}

.login-unified__mode-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.48rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}

.login-unified__mode-btn--active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.login-unified__mode-btn:focus-visible {
  outline: 2px solid #64748b;
  outline-offset: 1px;
}

.login-unified__field-group--hidden {
  display: none !important;
}

.login-unified__forgot-row--hidden {
  display: none !important;
}

.login-unified__input {
  display: flex;
  align-items: center;
  margin-bottom: 0.65rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  padding: 0 0.55rem 0 0.65rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.login-unified__input:focus-within {
  border-color: #64748b;
  box-shadow: 0 0 0 2px rgba(100, 116, 139, 0.2);
  background: #fff;
}

.login-unified__input--pw {
  padding-right: 0.25rem;
}

.login-unified__input-ico {
  flex-shrink: 0;
  color: #94a3b8;
  display: flex;
}

.login-unified__field {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 0.62rem 0.45rem;
  font: inherit;
  font-size: 0.88rem;
  color: #0f172a;
}

.login-unified__field::placeholder {
  color: #94a3b8;
}

.login-unified__field:focus {
  outline: none;
}

.login-unified__field--pw {
  padding-right: 0.25rem;
}

.login-unified__eye {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s ease, background 0.15s ease;
}

.login-unified__eye:hover {
  color: #475569;
  background: rgba(51, 65, 85, 0.1);
}

.login-unified__eye:focus-visible {
  outline: 2px solid #64748b;
  outline-offset: 1px;
}

.login-unified__forgot-row {
  display: flex;
  justify-content: flex-end;
  margin: -0.35rem 0 0.85rem;
}

.login-unified__forgot {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.15s ease, text-decoration 0.15s ease;
}

.login-unified__forgot:hover {
  color: #334155;
  text-decoration: underline;
}

.login-unified__forgot--back {
  display: inline-block;
  margin-top: 0.5rem;
}

.login-unified__submit {
  width: 100%;
  margin-top: 0.15rem;
  border: none;
  border-radius: 10px;
  padding: 0.72rem 1rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  color: #f8fafc;
  background: linear-gradient(168deg, #2a3a4f 0%, #3d5268 38%, #354a5e 72%, #2a3848 100%);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.25);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.login-unified__submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.28);
  filter: brightness(1.05);
}

.login-unified__submit:active {
  transform: translateY(0);
}

.login-unified__submit--narrow {
  margin-top: 0.75rem;
}

.login-field-error {
  margin: -0.45rem 0 0.5rem;
  font-size: 0.72rem;
  color: #dc2626;
}

/* Minimal card for standalone pages (403, etc.) */
.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: transparent;
  box-sizing: border-box;
}

.login-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 400px;
  padding: 1.35rem 1.25rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: #fff;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
  color: #1e293b;
}

.login-card--glass {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    0 2px 4px rgba(15, 23, 42, 0.06),
    0 20px 44px rgba(0, 0, 0, 0.26);
}

.login-forgot-form__label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.35rem;
}

.login-forgot-form__input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font: inherit;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.login-forgot-form__input:focus {
  outline: none;
  border-color: #94a3b8;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(100, 116, 139, 0.15);
}

.login-card h1 {
  margin: 0 0 0.65rem;
  font-size: 1.15rem;
}

.login-card p {
  margin: 0 0 0.85rem;
  color: #64748b;
  font-size: 0.875rem;
}

.login-card .btn {
  margin-top: 0.15rem;
}

.login-hint {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: #64748b !important;
}

@media (max-width: 900px), (prefers-reduced-motion: reduce) {
  .login-outer::before {
    background-attachment: scroll;
  }
}

@media (max-width: 560px) {
  .login-unified {
    flex-direction: column;
    max-width: min(400px, 100%);
  }

  .login-unified__brand {
    flex: none;
    padding: 1.15rem 1rem;
  }

  .login-unified__form {
    padding: 1.1rem 1rem 1.25rem;
  }
}

.badge {
  display: inline-block;
  padding: 0.18rem 0.48rem;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-ksh {
  background: rgba(5, 150, 105, 0.12);
  color: var(--success);
}
.badge-usd {
  background: rgba(37, 99, 235, 0.12);
  color: var(--accent-dim);
}
.badge-pending {
  background: rgba(217, 119, 6, 0.12);
  color: var(--warning);
}
.badge-ok {
  background: rgba(5, 150, 105, 0.12);
  color: var(--success);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}
.search-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.search-form input {
  max-width: 220px;
}

.mobile-toggle {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.section-title {
  margin: 1.5rem 0 0.65rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

/* —— Customer management (directory) —— */
body.page-customers .content {
  max-width: 1280px;
}

.customers-shell {
  padding-bottom: 2rem;
}

.customers-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.customers-hero__title {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.05rem);
  font-weight: 850;
  letter-spacing: -0.03em;
  background: linear-gradient(105deg, #2563eb 0%, #4f46e5 52%, #7c3aed 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.customers-hero__subtitle {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 450;
}

.customers-btn-add {
  align-self: center;
  background: linear-gradient(180deg, #10b981 0%, #059669 100%) !important;
  border-color: transparent !important;
  color: #fff !important;
  font-weight: 600;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
}
.customers-btn-add:hover {
  filter: brightness(1.06);
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(5, 150, 105, 0.4);
}
.customers-btn-add__plus {
  font-weight: 800;
  margin-right: 0.15rem;
}

.customers-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.customers-kpi {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow-sm);
}

.customers-kpi__label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
}

.customers-kpi__value {
  margin: 0.2rem 0 0;
  font-size: 1.85rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.customers-kpi__value--blue {
  color: #2563eb;
}
.customers-kpi__value--green {
  color: #059669;
}
.customers-kpi__value--purple {
  color: #7c3aed;
}

.customers-kpi__icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.customers-kpi__icon--blue {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
}
.customers-kpi__icon--green {
  background: rgba(5, 150, 105, 0.12);
  color: #059669;
}
.customers-kpi__icon--purple {
  background: rgba(124, 58, 237, 0.12);
  color: #7c3aed;
}

.customers-directory {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.customers-directory__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  padding: 1.25rem 1.35rem 1rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fafbfc 0%, var(--surface) 100%);
}

.customers-directory__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
}

.customers-directory__lead {
  margin: 0.3rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.customers-directory__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem 1rem;
}

.customers-filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem;
}

.customers-filter-form__label {
  display: none;
}

.customers-filter-form__input {
  min-width: 220px;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  font: inherit;
  background: var(--surface);
}

.customers-col-wrap {
  position: relative;
}

.customers-col-panel {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 50;
  min-width: 200px;
  padding: 0.75rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.12);
}
.customers-col-panel.is-open {
  display: block;
}

.customers-col-panel__title {
  margin: 0 0 0.5rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
}

.customers-col-panel__row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.855rem;
  margin: 0.35rem 0;
  cursor: pointer;
}

.customers-table-wrap {
  overflow-x: auto;
}

.customers-table {
  margin: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.customers-table thead th {
  background: #f8fafc;
  font-size: 0.72rem;
  white-space: nowrap;
}

.customers-th__inner {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.customers-th__ico {
  flex-shrink: 0;
  opacity: 0.55;
}

.customers-th--sort .customers-th__sortlink {
  color: inherit;
  text-decoration: none;
  font-weight: inherit;
}
.customers-th--sort .customers-th__sortlink:hover {
  color: var(--accent);
}
.customers-th__hint {
  font-size: 0.65rem;
  opacity: 0.65;
}

.customers-td {
  vertical-align: middle;
}
.customers-td--name strong {
  font-weight: 700;
}
.customers-td--muted {
  color: var(--muted);
  font-size: 0.875rem;
}

.customers-pill {
  display: inline-block;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.customers-pill--ok {
  background: rgba(16, 185, 129, 0.15);
  color: #047857;
}
.customers-pill--missing {
  background: rgba(100, 116, 139, 0.15);
  color: #475569;
}

.customers-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.customers-action {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.32rem 0.55rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  background: none;
  font-family: inherit;
}
.customers-action svg {
  flex-shrink: 0;
  opacity: 0.85;
}

.customers-action--view {
  color: var(--accent);
  border-color: transparent;
}
.customers-action--view:hover {
  text-decoration: underline;
}

.customers-action--edit {
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.55);
  background: rgba(251, 191, 36, 0.08);
}
.customers-action--edit:hover {
  background: rgba(251, 191, 36, 0.16);
  text-decoration: none;
}

.customers-action--delete {
  color: #fff;
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  border-color: transparent;
}
.customers-action--delete:hover {
  filter: brightness(1.05);
}

.customers-action-form {
  display: inline;
  margin: 0;
  padding: 0;
}

.customers-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem 1rem;
  border-top: 1px solid var(--border);
  background: #fafbfc;
  font-size: 0.82rem;
}

.customers-pager__per select {
  margin-left: 0.35rem;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  font: inherit;
  background: var(--surface);
}

.customers-pager__status {
  color: var(--muted);
  font-weight: 500;
}

.customers-pager__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.customers-pager__link {
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.78rem;
}
.customers-pager__link:hover:not(.is-disabled) {
  border-color: var(--accent);
  color: var(--accent);
}
.customers-pager__link.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* —— Customer detail (profile + measurement grid) —— */
body.page-customer-detail .main {
  background: linear-gradient(180deg, #f3f4f8 0%, #eef1f8 420px, var(--bg) 780px);
}
body.page-customer-detail .content {
  max-width: 1180px;
}

.customer-detail-shell {
  padding-bottom: 2.5rem;
}

.customer-detail-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.customer-detail-back {
  display: inline-block;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 0.5rem;
}
.customer-detail-back:hover {
  color: var(--accent);
}

.customer-detail-title {
  margin: 0;
  font-size: clamp(1.5rem, 2.8vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(105deg, #4f46e5 0%, #7c3aed 42%, #a855f7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.customer-detail-subtitle {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 450;
}

.btn-customer-accent {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
  background: linear-gradient(135deg, #ea580c 0%, #f97316 55%, #fb923c 100%);
  color: #fff !important;
  border: none;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.38);
  text-decoration: none;
}
.btn-customer-accent:hover {
  filter: brightness(1.05);
}

.customer-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.customer-detail-layout {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 960px) {
  .customer-detail-layout {
    grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
    align-items: start;
  }
}

.customer-panel {
  background: #fff;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.07), 0 1px 3px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.customer-panel__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.05rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
}
.customer-panel__head-icon {
  font-size: 1rem;
  opacity: 0.9;
}
.customer-panel__head--gradient {
  background: linear-gradient(120deg, #2563eb 0%, #6366f1 45%, #8b5cf6 95%);
}
.customer-panel__head--muted {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.74rem;
  border-bottom: 1px solid var(--border);
}
.customer-panel__head--green {
  background: linear-gradient(115deg, #059669 0%, #10b981 52%, #34d399 100%);
}

.customer-panel__body {
  padding: 1.05rem 1.15rem 1.2rem;
}
.customer-panel__body--notes {
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.55;
  min-height: 3rem;
}

.customer-panel--notes {
  margin-top: 1rem;
}

.customer-info-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.58rem 0;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}
.customer-info-row:last-child {
  border-bottom: none;
}
.customer-info-row__icon {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.92rem;
  flex-shrink: 0;
}
.customer-info-row__label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
}
.customer-info-row__value {
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--text);
}

.customer-badge-available {
  display: inline-block;
  margin-top: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}
.customer-badge-empty {
  display: inline-block;
  margin-top: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 650;
  background: rgba(148, 163, 184, 0.2);
  color: var(--muted);
}

.customer-panel__subhead {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 1.05rem;
  font-size: 0.82rem;
  color: var(--muted);
  background: #f8fafc;
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
}

.customer-meas-chip {
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

.customer-meas-subhead {
  grid-column: 1 / -1;
  margin: 0.5rem 0 0.15rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}
.customer-meas-subhead:first-child {
  margin-top: 0;
}

.customer-meas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.85rem;
  padding: 1rem 1.05rem 1.25rem;
}

.customer-meas-tile {
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 10px;
  padding: 0.65rem 0.72rem 0.75rem;
  min-height: 96px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.customer-meas-tile__unit {
  position: absolute;
  top: 0.45rem;
  right: 0.5rem;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #94a3b8;
}
.customer-meas-tile__label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.customer-meas-tile__value {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}
.customer-meas-tile__value--empty {
  color: #cbd5e1;
  font-weight: 700;
}

.customer-panel__footer {
  padding: 0 1.05rem 1.05rem;
  display: flex;
  justify-content: flex-end;
}

.customer-detail-section {
  margin-top: 2rem;
}
.customer-detail-section__title {
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
}

.customer-detail-table-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
  overflow: hidden;
}
.customer-detail-table-card .table-wrap {
  margin: 0;
}

/* Add customer — reference layout */
.page-add-customer .content {
  max-width: 960px;
  margin: 0 auto;
}

.add-customer-shell {
  padding-bottom: 2rem;
}

.add-customer-pagehead {
  margin-bottom: 1.5rem;
}

.add-customer-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.75rem;
  text-decoration: none;
}
.add-customer-back:hover {
  color: var(--text);
}
.add-customer-back__arrow {
  font-size: 1rem;
  line-height: 1;
}

.add-customer-pagehead__title {
  margin: 0 0 0.35rem;
  font-size: 1.65rem;
  font-weight: 800;
  color: #0c1e3f;
  letter-spacing: -0.02em;
}

.add-customer-pagehead__subtitle {
  margin: 0;
  font-size: 0.93rem;
  color: var(--muted);
}

.add-customer-card {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.add-customer-card__ribbon {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1.15rem;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
}

.add-customer-card__ribbon--purple {
  background: linear-gradient(90deg, #7c3aed 0%, #8b5cf6 50%, #8a4af3 100%);
}

.add-customer-card__ribbon--green {
  background: linear-gradient(90deg, #059669 0%, #10a352 85%);
}

.add-customer-card__ribbon-ico {
  display: flex;
  opacity: 0.95;
}

.add-customer-card__ribbon-title {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}

.add-customer-card__body {
  padding: 1.35rem 1.25rem 1.45rem;
}

.add-customer-seg {
  display: flex;
  width: 100%;
  padding: 0.2rem;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  gap: 0.25rem;
  margin-bottom: 1.25rem;
}

.add-customer-seg__opt {
  flex: 1;
  text-align: center;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.52rem 0.65rem;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}
.add-customer-seg__opt input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
  margin: 0;
}

.add-customer-seg__opt.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.add-customer-panel {
  margin-top: 0.25rem;
}

.add-customer-stack-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.add-customer-inline-ico {
  display: inline-flex;
  color: var(--muted);
}

.add-customer-select {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  font: inherit;
  background: var(--surface);
  color: var(--text);
}

.add-customer-help {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.add-customer-new-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.95rem;
}

@media (max-width: 640px) {
  .add-customer-new-grid {
    grid-template-columns: 1fr;
  }
}

.add-customer-field--full {
  grid-column: 1 / -1;
}

.add-customer-field__label-row {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text);
  margin-bottom: 0.38rem;
}

.add-customer-req {
  color: var(--danger);
  font-weight: 700;
}

.add-customer-input,
.add-customer-textarea {
  width: 100%;
  padding: 0.5rem 0.62rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  font: inherit;
  font-size: 0.9rem;
  background: var(--surface);
  color: var(--text);
}
.add-customer-input:focus,
.add-customer-textarea:focus {
  outline: 2px solid rgba(124, 58, 237, 0.35);
  border-color: rgba(124, 58, 237, 0.45);
}

.add-customer-textarea {
  resize: vertical;
  min-height: 3.25rem;
}

.add-customer-ico {
  display: inline-flex;
  color: #64748b;
  flex-shrink: 0;
}

.add-customer-meas-subhead {
  grid-column: 1 / -1;
  margin: 0.35rem 0 0.1rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}
.add-customer-meas-subhead:first-child {
  margin-top: 0;
}

.add-customer-meas-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem 1.25rem;
}

@media (max-width: 900px) {
  .add-customer-meas-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 520px) {
  .add-customer-meas-grid {
    grid-template-columns: 1fr;
  }
}

.add-customer-field__hint {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.74rem;
  color: var(--muted);
  line-height: 1.35;
}

.add-customer-field--wide {
  grid-column: 1 / -1;
  max-width: 100%;
}

.add-customer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
  align-items: center;
  padding-top: 0.35rem;
}

.add-customer-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.62rem 1.15rem;
  border-radius: 9px;
  font-weight: 600;
  font-size: 0.88rem;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}

.add-customer-btn--ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.add-customer-btn--ghost:hover {
  border-color: #94a3b8;
  background: var(--surface-2);
}

.add-customer-btn--primary {
  background: linear-gradient(180deg, #12b862 0%, #10a352 48%, #0d8f47 100%);
  color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 2px 8px rgba(16, 163, 82, 0.28);
}
.add-customer-btn--primary:hover {
  filter: brightness(1.04);
}

.add-customer-btn--danger {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.add-customer-btn--danger:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

.add-customer-field-error {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: #b91c1c;
}

.page-edit-customer .edit-customer-delete {
  margin-top: 1.25rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

@media (max-width: 900px) {
  .mobile-toggle {
    display: inline-flex;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.35);
  }
  body.sidebar-open .sidebar {
    transform: translateX(0);
  }
  .layout {
    flex-direction: column;
  }
}

/* Tailor orders — list (monochrome reference) */
.page-orders-tailor .content {
  max-width: 1120px;
  margin: 0 auto;
}

.to-shell {
  padding-bottom: 2rem;
}

.to-head {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 1rem;
}

.to-btn-black {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 1rem;
  background: #0a0a0a;
  color: #fff;
  font-weight: 600;
  font-size: 0.82rem;
  border-radius: 6px;
  text-decoration: none;
  border: 1px solid #0a0a0a;
}
.to-btn-black:hover {
  background: #262626;
  color: #fff;
}

.to-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.to-filter-input {
  min-width: 220px;
  max-width: 100%;
  padding: 0.45rem 0.65rem;
  border: 1px solid #d4d4d4;
  border-radius: 6px;
  font: inherit;
  font-size: 0.88rem;
  background: #fff;
  color: #0a0a0a;
}
.to-filter-input:focus {
  outline: 2px solid rgba(10, 10, 10, 0.12);
}

.to-tools-right {
  display: flex;
  align-items: center;
}

.to-col-wrap {
  position: relative;
}

.to-col-btn {
  padding: 0.45rem 0.85rem;
  border: 1px solid #d4d4d4;
  border-radius: 6px;
  background: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 0.82rem;
  color: #0a0a0a;
  cursor: pointer;
}
.to-col-btn:hover {
  border-color: #a3a3a3;
}

.to-col-panel {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 200px;
  padding: 0.65rem 0.85rem;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
  z-index: 30;
}

.to-col-panel.is-open {
  display: block;
}

.to-col-panel__title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #737373;
  margin-bottom: 0.35rem;
}

.to-col-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  margin: 0.25rem 0;
  cursor: pointer;
  color: #171717;
}

.to-table-wrap {
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.to-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  color: #0a0a0a;
}

.to-table thead th {
  background: #f5f5f5;
  text-align: left;
  font-weight: 600;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid #e5e5e5;
  color: #171717;
  white-space: nowrap;
}

.to-th-inner {
  display: inline-block;
}

.to-td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}
.to-table tbody tr:last-child .to-td {
  border-bottom: none;
}

.to-td--muted {
  color: #737373;
}

.to-status {
  text-transform: capitalize;
}

.to-link {
  color: #0a0a0a;
  font-weight: 600;
  text-decoration: underline;
}
.to-link:hover {
  color: #404040;
}

.to-action {
  display: inline-block;
  margin-right: 0.55rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #0a0a0a;
  text-decoration: none;
}
.to-action:hover {
  text-decoration: underline;
}

.to-empty {
  text-align: center;
  color: #a3a3a3;
  padding: 2.5rem 1rem !important;
  font-size: 0.9rem;
}

.to-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-top: 0.85rem;
  padding: 0.5rem 0;
  font-size: 0.82rem;
  color: #525252;
}

.to-pager__label {
  margin-right: 0.35rem;
}

.to-pager__select {
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px solid #d4d4d4;
  font: inherit;
  background: #fff;
  color: #0a0a0a;
}

.to-pager__navwrap {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.to-pager__icons {
  display: flex;
  gap: 0.25rem;
}

.to-pager__ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  border-radius: 6px;
  border: 1px solid #e5e5e5;
  background: #fafafa;
  color: #0a0a0a;
  text-decoration: none;
  font-size: 0.95rem;
  line-height: 1;
}

.to-pager__ico:hover:not(.is-disabled) {
  border-color: #d4d4d4;
  background: #f5f5f5;
}

.to-pager__ico.is-disabled {
  opacity: 0.38;
  pointer-events: none;
  cursor: not-allowed;
}

/* Create tailor order — fills main column (not a narrow centered strip) */
.page-order-create .content {
  max-width: 1280px;
}

.order-create-shell {
  width: 100%;
  max-width: 100%;
  padding: 1.5rem 1.5rem 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

.order-create-head__title {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: #0a0a0a;
}

.order-create-head__lead {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  color: #737373;
}

.order-create-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.order-create-stack {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.order-create-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.95rem;
}
@media (max-width: 560px) {
  .order-create-row2 {
    grid-template-columns: 1fr;
  }
}

.order-create-label {
  display: block;
  font-weight: 600;
  font-size: 0.82rem;
  color: #171717;
  margin-bottom: 0.38rem;
}

.order-create-req {
  color: #dc2626;
  font-weight: 700;
}

.order-create-input,
.order-create-select {
  width: 100%;
  padding: 0.5rem 0.62rem;
  border-radius: 6px;
  border: 1px solid #d4d4d4;
  font: inherit;
  font-size: 0.9rem;
  background: #fff;
  color: #0a0a0a;
  box-sizing: border-box;
}
.order-create-input:focus,
.order-create-select:focus {
  outline: 2px solid rgba(10, 10, 10, 0.12);
  border-color: #a3a3a3;
}

.order-create-textarea {
  min-height: 5rem;
  resize: vertical;
}

.order-create-error {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  color: #b91c1c;
}

.order-create-measurements {
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 1rem 1.05rem;
  background: #fafafa;
}

.order-create-measurements__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.order-create-measurements__ttl {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: #0a0a0a;
}

.order-create-measurements__hint {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  color: #737373;
}

.order-create-mini-btn {
  padding: 0.42rem 0.72rem;
  border-radius: 6px;
  border: 1px solid #d4d4d4;
  background: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 0.78rem;
  color: #0a0a0a;
  cursor: pointer;
}
.order-create-mini-btn:hover {
  border-color: #a3a3a3;
}

.order-meas-set {
  margin: 0 0 0.95rem;
  padding: 0.85rem 0.72rem;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e5e5e5;
}

.order-meas-set__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
}

.order-meas-set__title {
  font-size: 0.86rem;
  color: #0a0a0a;
}

.order-meas-set__rm {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.45rem;
  border: 1px solid #e5e5e5;
  background: #fafafa;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  color: #525252;
}
.order-meas-set__rm:hover {
  border-color: #d4d4d4;
  color: #0a0a0a;
}

.order-meas-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

@media (max-width: 700px) {
  .order-meas-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 460px) {
  .order-meas-grid {
    grid-template-columns: 1fr;
  }
}

.order-meas-custom {
  margin-top: 0.65rem;
}

.order-create-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.order-create-cancel {
  padding: 0.52rem 1rem;
  border-radius: 6px;
  border: 1px solid #d4d4d4;
  background: #fff;
  font-weight: 600;
  font-size: 0.82rem;
  color: #0a0a0a;
  text-decoration: none;
}
.order-create-cancel:hover {
  border-color: #a3a3a3;
  background: #fafafa;
}

.order-create-submit {
  padding: 0.52rem 1.1rem;
  border-radius: 6px;
  border: 1px solid #0a0a0a;
  background: #0a0a0a;
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
}
.order-create-submit:hover {
  background: #262626;
}

.order-create-opt {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.78rem;
}

.order-fabric-preview {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}

.order-fabric-preview__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.order-fabric-preview__tab {
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  color: var(--text);
}

.order-fabric-preview__tab.is-active {
  border-color: #5d4037;
  background: #efebe9;
  font-weight: 600;
  color: #4e342e;
}

.order-fabric-preview__panel {
  margin-bottom: 0.75rem;
}

.order-fabric-preview__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

@media (max-width: 640px) {
  .order-fabric-preview__meta {
    grid-template-columns: 1fr;
  }
}

.order-fabric-preview__catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.65rem;
}

.order-fabric-preview__pick {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0.35rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

.order-fabric-preview__pick img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

.order-fabric-preview__pick-label {
  font-size: 0.72rem;
  margin-top: 0.35rem;
  color: var(--muted);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-fabric-preview__pick.is-selected {
  border-color: #5d4037;
  box-shadow: 0 0 0 1px #5d4037;
}

.order-fabric-preview__frame {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1rem;
}

.order-fabric-preview__img {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.order-fabric-preview__actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.order-detail-fabric {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: flex-start;
}

.order-detail-fabric__img {
  width: 200px;
  max-width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.order-detail-fabric__meta p {
  margin: 0 0 0.35rem;
}

/* —— Income reports (professional summary) —— */
.page-reports .content {
  max-width: 960px;
}

.reports-page {
  padding-bottom: 2rem;
}

.reports-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-bottom: 1.5rem;
}

.reports-toolbar__segment {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}

.reports-segment {
  padding: 0.42rem 1.05rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.reports-segment:hover {
  color: var(--text);
  text-decoration: none;
  background: var(--surface-2);
}

.reports-segment.is-active {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dim) 100%);
  color: #fff;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.25);
}

.reports-segment.is-active:hover {
  color: #fff;
  filter: brightness(1.02);
}

.reports-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.reports-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.reports-summary__head {
  padding: 1.35rem 1.5rem 0.25rem;
}

.reports-summary__kicker {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
}

.reports-summary__kicker-tag {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  letter-spacing: 0.05em;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
}

.reports-summary__body {
  padding: 0.75rem 1.5rem 0.25rem;
}

.reports-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.reports-table thead th {
  padding: 0.65rem 0.75rem 0.85rem 0;
  text-align: left;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: var(--muted);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.reports-table thead th.reports-table__num {
  text-align: right;
}

.reports-table tbody td {
  padding: 1.05rem 0.75rem 1.05rem 0;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.reports-table tbody tr:last-child td {
  border-bottom: none;
}

.reports-table__num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.reports-table tbody .reports-table__num {
  letter-spacing: -0.02em;
}

.reports-table__net--negative {
  color: var(--danger);
  font-weight: 700;
}

.reports-currency {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.38rem 0.82rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.reports-currency--ksh {
  background: rgba(5, 150, 105, 0.14);
  color: var(--success);
}

.reports-currency--usd {
  background: rgba(37, 99, 235, 0.12);
  color: var(--accent-dim);
}

.reports-summary__note {
  margin: 0;
  padding: 0.9rem 1.5rem 1.2rem;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--surface) 100%);
}

@media (max-width: 720px) {
  .reports-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .reports-toolbar__segment {
    justify-content: center;
  }

  .reports-toolbar__actions {
    flex-direction: column;
  }

  .reports-toolbar__actions .btn {
    justify-content: center;
  }

  .reports-table thead th:nth-child(n + 2),
  .reports-table tbody td:nth-child(n + 2) {
    padding-left: 0.35rem;
  }
}

.only-print {
  display: none !important;
}

/* —— Balance sheet (finance) —— */
.page-balance-sheet .finance-app__panel {
  padding-bottom: 2rem;
}

.balance-sheet-hero {
  margin-bottom: 1.35rem;
  padding: 1.35rem 1.5rem 1.25rem;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.balance-sheet-hero__kicker {
  margin: 0 0 0.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.balance-sheet-hero__lead {
  margin: 0 0 0.65rem;
  font-size: 0.94rem;
  line-height: 1.55;
  color: var(--text);
  max-width: 52rem;
}

.balance-sheet-hero__lead strong {
  font-weight: 700;
  color: var(--accent-dim);
}

.balance-sheet-hero__meta {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.balance-sheet-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 1100px) {
  .balance-sheet-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .balance-sheet-grid {
    grid-template-columns: 1fr;
  }
}

.balance-sheet-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.15rem 1.2rem 1.05rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.balance-sheet-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 12px 0 0 12px;
}

.balance-sheet-card--ksh::before {
  background: linear-gradient(180deg, #10b981, #059669);
}
.balance-sheet-card--usd::before {
  background: linear-gradient(180deg, #3b82f6, #1d4ed8);
}
.balance-sheet-card--ar::before {
  background: linear-gradient(180deg, #a855f7, #7c3aed);
}
.balance-sheet-card--exp::before {
  background: linear-gradient(180deg, #f97316, #ea580c);
}

.balance-sheet-card__label {
  margin: 0 0 0.5rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.balance-sheet-card__value {
  margin: 0 0 0.35rem;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.balance-sheet-card__dual {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
}

.balance-sheet-card__dual > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.balance-sheet-card__ccy {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.balance-sheet-card__subvalue {
  font-size: 1.2rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.balance-sheet-card__hint {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
}

.balance-sheet-table-wrap {
  margin-bottom: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.balance-sheet-table-title {
  margin: 0;
  padding: 0.85rem 1.15rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.balance-sheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.balance-sheet-table th {
  padding: 0.7rem 1.15rem;
  text-align: left;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.balance-sheet-table th.balance-sheet-table__num {
  text-align: right;
}

.balance-sheet-table td {
  padding: 0.95rem 1.15rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.balance-sheet-table tbody tr:last-child td {
  border-bottom: none;
}

.balance-sheet-table__line {
  display: block;
  font-weight: 600;
  color: var(--text);
}

.balance-sheet-table__desc {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.35;
}

.balance-sheet-table__num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.balance-sheet-actions {
  flex-wrap: wrap;
  gap: 0.5rem;
}

@media print {
  .only-print {
    display: block !important;
  }

  .page-balance-sheet .finance-tabs {
    display: none !important;
  }

  .page-balance-sheet .finance-app__panel {
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
  }

  .balance-sheet-print-doc {
    max-width: 100%;
    padding: 0;
  }

  .balance-sheet-print-doc__header {
    border-bottom: 2px solid #0f172a;
    padding-bottom: 12pt;
    margin-bottom: 14pt;
  }

  .balance-sheet-print-doc__brand {
    margin: 0 0 6pt;
    font-size: 9pt;
    letter-spacing: 0.2em;
    font-weight: 700;
    color: #64748b;
  }

  .balance-sheet-print-doc__title {
    margin: 0 0 6pt;
    font-size: 16pt;
    font-weight: 700;
  }

  .balance-sheet-print-doc__meta {
    margin: 0;
    font-size: 9pt;
    color: #64748b;
  }

  .balance-sheet-print-doc__lead {
    margin: 0 0 14pt;
    font-size: 9.5pt;
    color: #475569;
    line-height: 1.45;
  }

  .balance-sheet-print-doc__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10pt;
  }

  .balance-sheet-print-doc__table th,
  .balance-sheet-print-doc__table td {
    padding: 8pt 10pt 8pt 0;
    border-bottom: 1pt solid #e2e8f0;
    text-align: left;
    vertical-align: top;
  }

  .balance-sheet-print-doc__r {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
  }

  .balance-sheet-print-doc__table thead th {
    font-size: 8pt;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
  }

  .balance-sheet-print-doc__foot {
    margin-top: 16pt;
    padding-top: 10pt;
    border-top: 1pt solid #e2e8f0;
    font-size: 8.5pt;
    color: #64748b;
  }

  .sidebar,
  .topbar,
  .mobile-toggle,
  .no-print,
  .toolbar {
    display: none !important;
  }
  .layout,
  .main {
    display: block;
  }
  body {
    background: #fff;
    color: #000;
  }
  .card,
  table.data th {
    background: #f5f5f5;
    color: #000;
  }
  .page-reports .reports-summary {
    border: 1px solid #ccc;
    box-shadow: none;
    break-inside: avoid;
  }
  .page-reports .reports-summary__note {
    background: #fafafa;
    color: #444;
    border-top-color: #ddd;
  }
  .page-reports .reports-table__net--negative {
    color: #991b1b;
  }
}

/* ---- Account settings (sidebar: Session → Settings) ---- */
body.page-settings .settings-page__intro {
  max-width: 52rem;
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

body.page-settings .settings-grid {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
  max-width: 56rem;
}

@media (max-width: 900px) {
  body.page-settings .settings-grid {
    grid-template-columns: 1fr;
  }
}

body.page-settings .settings-profile-card {
  padding: 1.15rem 1.25rem;
}

body.page-settings .settings-form-card {
  padding: 1.25rem 1.35rem;
}

body.page-settings .settings-card__title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

body.page-settings .settings-card__hint {
  margin: 0 0 1.1rem;
}

body.page-settings .settings-profile-dl {
  margin: 0.75rem 0 0;
  display: grid;
  gap: 0.65rem 0;
}

body.page-settings .settings-profile-dl dt {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

body.page-settings .settings-profile-dl dd {
  margin: 0.1rem 0 0.35rem;
  font-size: 0.95rem;
  color: var(--text);
}

body.page-settings .settings-label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.35rem;
  color: var(--text);
}

body.page-settings .settings-input {
  width: 100%;
  max-width: 22rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  background: var(--surface);
}

body.page-settings .settings-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

body.page-settings .settings-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0 1rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

body.page-settings .settings-divider::before,
body.page-settings .settings-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

body.page-settings .settings-form__actions {
  margin-top: 1.25rem;
  padding-top: 0.25rem;
}

/* —— Finance: premium money display + WhatsApp —— */
.page-finance-app .stat-value {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.finance-lead {
  margin: 0 0 1.25rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 52rem;
}

.finance-section {
  margin-bottom: 1.75rem;
}

.finance-section__title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.finance-section__hint {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.finance-toolbar {
  margin-bottom: 1rem;
  gap: 0.5rem;
}

.finance-money {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--text);
}

.finance-money--lg .finance-money__num {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.finance-money__ccy {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.finance-money--has-ccy .finance-money__num {
  font-size: 1.1rem;
}

.finance-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.finance-stat-grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 640px) {
  .finance-stat-grid--2 {
    grid-template-columns: 1fr;
  }
}

.finance-stat-card {
  background: linear-gradient(165deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.15rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 6px 16px rgba(15, 23, 42, 0.05);
  position: relative;
  overflow: hidden;
}

.finance-stat-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 12px 0 0 12px;
  background: var(--border);
}

.finance-stat-card--ksh::before {
  background: linear-gradient(180deg, #10b981, #059669);
}

.finance-stat-card--usd::before {
  background: linear-gradient(180deg, #3b82f6, #1d4ed8);
}

.finance-stat-card__label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.finance-stat-card__hint {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.finance-table-wrap {
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.page-finance-app .finance-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: #f8fafc;
}

.page-finance-app .finance-table td.r,
.page-finance-app .finance-table th.r {
  text-align: right;
}

.finance-table__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.finance-table__admin {
  white-space: nowrap;
}

.finance-inline-form {
  display: inline;
  margin-left: 0.25rem;
}

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #25d366 !important;
  border-color: #1da851 !important;
  color: #fff !important;
  font-weight: 600;
}

.btn-whatsapp:hover {
  background: #1ebe57 !important;
  border-color: #128c3a !important;
  color: #fff !important;
}

.btn-whatsapp--share {
  box-shadow: 0 2px 10px rgba(37, 211, 102, 0.28);
}

.btn-whatsapp--share:hover {
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
}

.btn-whatsapp--missing {
  opacity: 0.88 !important;
  filter: grayscale(0.22);
  cursor: pointer;
  box-shadow: none !important;
}

.btn-whatsapp--missing:hover {
  background: #22c55e !important;
  filter: grayscale(0.1);
}

.btn-whatsapp__icon {
  flex-shrink: 0;
}

.whatsapp-share {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.whatsapp-share--direct {
  vertical-align: middle;
}

.page-balance-sheet .balance-sheet-card__value,
.page-balance-sheet .balance-sheet-card__subvalue {
  font-variant-numeric: tabular-nums;
}

/* Mobile QR photo upload */
.mobile-upload-page {
  margin: 0;
  min-height: 100dvh;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 42%, #f8fafc 42%);
  color: #0f172a;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.mobile-upload-header {
  padding: 1.25rem 1rem 2.5rem;
  color: #f8fafc;
  text-align: center;
}

.mobile-upload-brand {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
}

.mobile-upload-title {
  margin: 0.35rem 0 0;
  font-size: 1.65rem;
  font-weight: 700;
}

.mobile-upload-sub {
  margin: 0.35rem 0 0;
  font-size: 1.05rem;
  opacity: 0.92;
}

.mobile-upload-main {
  margin: -1.5rem auto 2rem;
  max-width: 28rem;
  padding: 0 1rem 2rem;
}

.mobile-upload-flash {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.92rem;
}

.mobile-upload-flash--success {
  background: #dcfce7;
  color: #166534;
}

.mobile-upload-flash--danger {
  background: #fee2e2;
  color: #991b1b;
}

.mobile-upload-hint {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: #475569;
  text-align: center;
}

.mobile-upload-form {
  background: #fff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.mobile-upload-label {
  display: block;
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
}

.mobile-upload-select {
  width: 100%;
  margin-bottom: 1rem;
  padding: 0.55rem 0.65rem;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
}

.mobile-upload-drop {
  position: relative;
  margin-bottom: 1rem;
  padding: 1.25rem 0.75rem;
  border: 2px dashed #94a3b8;
  border-radius: 10px;
  text-align: center;
  background: #f8fafc;
}

.mobile-upload-file {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.mobile-upload-drop__text {
  margin: 0;
  font-weight: 600;
  font-size: 1rem;
  pointer-events: none;
}

.mobile-upload-drop__sub {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: #64748b;
  pointer-events: none;
}

.mobile-upload-preview-list {
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.mobile-upload-preview-list__item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.5rem;
  background: #f1f5f9;
  border-radius: 8px;
  font-size: 0.78rem;
  max-width: 100%;
}

.mobile-upload-preview-list__thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
}

.mobile-upload-submit {
  width: 100%;
  padding: 0.85rem;
  font-size: 1.05rem;
}

.mobile-upload-gallery {
  margin-top: 1.25rem;
}

.mobile-upload-gallery__title {
  margin: 0 0 0.65rem;
  font-size: 1rem;
}

.mobile-upload-gallery__grid {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: 0.65rem;
}

.mobile-upload-gallery__item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.mobile-upload-gallery__kind {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.72rem;
  color: #64748b;
  text-align: center;
}

.order-mobile-upload-dialog {
  max-width: 22rem;
}

.order-mobile-upload-qr-wrap {
  display: flex;
  justify-content: center;
  margin: 0.5rem 0 0.75rem;
}

.order-mobile-upload-qr {
  width: 220px;
  height: 220px;
  image-rendering: pixelated;
}

.order-mobile-upload-meta {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
}

.order-mobile-upload-url-row {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.order-mobile-photos-panel {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border, #e2e8f0);
}

.order-mobile-photos-panel__title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.order-mobile-upload-url {
  flex: 1 1 12rem;
  min-width: 0;
  padding: 0.45rem 0.55rem;
  font-size: 0.78rem;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.order-photo-gallery {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.order-photo-gallery__item {
  width: 8.75rem;
  text-align: center;
}

.order-photo-gallery__item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.order-photo-gallery__kind {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: #64748b;
}
