@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ===== CSS VARIABLES ===== */
:root {
  --primary: #6c63ff;
  --primary-dark: #5a52e0;
  --primary-light: #8b85ff;
  --secondary: #00d4aa;
  --danger: #ff4757;
  --warning: #ffa502;
  --success: #2ed573;
  --info: #1e90ff;

  --bg: #0f0f1a;
  --bg-card: rgba(255,255,255,0.05);
  --bg-card-hover: rgba(255,255,255,0.08);
  --bg-sidebar: rgba(255,255,255,0.04);
  --bg-topbar: rgba(15,15,26,0.8);
  --bg-strong: rgba(22, 22, 42, 0.95);
  --bg-soft: rgba(255,255,255,0.04);
  --bg-soft-2: rgba(255,255,255,0.03);
  --modal-bg: #1a1a2e;
  --table-head-bg: rgba(22, 22, 42, 0.98);
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(108,99,255,0.4);
  --text: #e8e8f0;
  --text-muted: #8b8ba0;
  --text-light: #ffffff;
  --page-glow-a: rgba(108,99,255,0.08);
  --page-glow-b: rgba(0,212,170,0.05);

  --sidebar-width: 260px;
  --topbar-height: 64px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-card: 0 4px 24px rgba(0,0,0,0.3);
  --transition: all 0.2s ease;

  --gradient-primary: linear-gradient(135deg, #6c63ff, #5a52e0);
  --gradient-success: linear-gradient(135deg, #2ed573, #00c4a7);
  --gradient-danger: linear-gradient(135deg, #ff4757, #ff6b81);
  --gradient-warning: linear-gradient(135deg, #ffa502, #ff7f50);
  --gradient-info: linear-gradient(135deg, #1e90ff, #00c6ff);
  --gradient-purple: linear-gradient(135deg, #a855f7, #6c63ff);
}

[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-card: rgba(255,255,255,0.92);
  --bg-card-hover: rgba(108,99,255,0.08);
  --bg-sidebar: rgba(255,255,255,0.96);
  --bg-topbar: rgba(255,255,255,0.94);
  --bg-strong: rgba(255,255,255,0.98);
  --bg-soft: rgba(99,102,241,0.08);
  --bg-soft-2: rgba(99,102,241,0.06);
  --modal-bg: #ffffff;
  --table-head-bg: rgba(255,255,255,0.98);
  --border: rgba(30, 41, 59, 0.12);
  --border-hover: rgba(108,99,255,0.35);
  --text: #1f2937;
  --text-muted: #6b7280;
  --text-light: #0f172a;
  --shadow: 0 8px 28px rgba(15, 23, 42, 0.12);
  --shadow-card: 0 4px 16px rgba(15, 23, 42, 0.08);
  --page-glow-a: rgba(108,99,255,0.12);
  --page-glow-b: rgba(0,212,170,0.10);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
}

body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 20% 20%, var(--page-glow-a) 0%, transparent 50%),
              radial-gradient(ellipse at 80% 80%, var(--page-glow-b) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

a { color: var(--primary-light); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--text-light); }

/* ===== LAYOUT ===== */
.app-layout {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  z-index: 1;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo .logo-icon {
  width: 40px; height: 40px;
  background: var(--gradient-primary);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(108,99,255,0.4);
}

.sidebar-logo .logo-icon.logo-mark {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: #fff;
}

.sidebar-logo .logo-text {
  flex: 1;
  min-width: 0;
}

.sidebar-logo .logo-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-logo .logo-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.nav-group { margin-bottom: 8px; }

.nav-group-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 8px 12px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  margin-bottom: 2px;
  white-space: nowrap;
}

.nav-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-light);
  transform: translateX(4px);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(108,99,255,0.2), rgba(90,82,224,0.1));
  color: var(--primary-light);
  border: 1px solid rgba(108,99,255,0.3);
}

.nav-item .nav-icon {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}

.user-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 14px 12px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.user-card__top {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 10px 12px;
  align-items: start;
}

.user-avatar {
  width: 40px;
  height: 40px;
  background: var(--gradient-purple);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: white;
  flex-shrink: 0;
}

.user-card__headline {
  min-width: 0;
  padding-top: 1px;
}

.user-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.3;
}

.user-card__logout-form {
  margin: 0;
  padding: 0;
  align-self: start;
}

.user-card__tenant {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.user-tenant-line {
  font-size: 11px;
  color: var(--text-light);
  line-height: 1.4;
  word-break: break-word;
}

.user-tenant-line--sub {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.user-tenant-line--stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin-top: 2px;
}

.user-tenant-stat {
  font-variant-numeric: tabular-nums;
}

.user-tenant-stat-sep {
  opacity: 0.35;
  user-select: none;
}

.user-tenant-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  border: 1px solid transparent;
}
.user-tenant-pill--basic {
  background: rgba(255,165,2,0.12);
  color: var(--warning);
  border-color: rgba(255,165,2,0.25);
}
.user-tenant-pill--pro {
  background: rgba(108,99,255,0.15);
  color: var(--primary-light);
  border-color: rgba(108,99,255,0.25);
}
.user-tenant-pill--ent {
  background: rgba(46,213,115,0.12);
  color: var(--success);
  border-color: rgba(46,213,115,0.22);
}
.user-tenant-warn {
  color: var(--danger);
  font-weight: 600;
}

/* ----- Riwayat transaksi (toolbar modern) ----- */
.tx-history-page {
  max-width: 1120px;
  margin: 0 auto;
}
.tx-toolbar {
  border-radius: 20px;
  padding: 22px 24px;
  margin-bottom: 20px;
  background: linear-gradient(
    155deg,
    rgba(108, 99, 255, 0.14) 0%,
    rgba(22, 22, 42, 0.92) 42%,
    rgba(15, 15, 26, 0.98) 100%
  );
  border: 1px solid rgba(108, 99, 255, 0.22);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
}
.tx-toolbar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.tx-toolbar-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.tx-toolbar-metrics--3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  flex: 1;
  min-width: 0;
  max-width: min(100%, 720px);
}
@media (max-width: 640px) {
  .tx-toolbar-metrics--3 {
    grid-template-columns: 1fr;
    max-width: none;
  }
}
.tx-metric {
  min-width: 120px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.tx-metric--accent {
  border-color: rgba(108, 99, 255, 0.25);
  background: rgba(108, 99, 255, 0.08);
}
.tx-metric-value {
  display: block;
  font-size: 20px;
  font-weight: 800;
  color: var(--text-light);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.tx-metric-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
  display: block;
}
.tx-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: var(--transition);
}
.tx-export-btn:hover {
  background: rgba(108, 99, 255, 0.2);
  border-color: rgba(108, 99, 255, 0.35);
  color: #fff;
}
.tx-export-icon { font-size: 14px; opacity: 0.9; }

.tx-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 20px;
}
.tx-chip {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: var(--transition);
}
.tx-chip:hover {
  color: var(--text-light);
  border-color: rgba(108, 99, 255, 0.4);
  background: rgba(108, 99, 255, 0.1);
}
.tx-chip.is-active {
  color: #fff;
  background: var(--gradient-primary);
  border-color: transparent;
  box-shadow: 0 4px 20px rgba(108, 99, 255, 0.35);
}

.tx-filter-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.55fr) minmax(0, 1fr) auto;
  gap: 14px 16px;
  align-items: end;
}
.tx-filter-grid--admin {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.75fr) minmax(0, 0.55fr) minmax(0, 1fr) auto;
}
.tx-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.tx-label--spacer {
  visibility: hidden;
  margin-bottom: 8px;
}
.tx-date-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.tx-date-row .tx-control {
  flex: 1 1 130px;
  min-width: 0;
}
.tx-date-arrow {
  color: var(--text-muted);
  font-size: 13px;
  flex-shrink: 0;
}
.tx-control {
  border-radius: 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: rgba(0, 0, 0, 0.2) !important;
}
.tx-field--search .tx-control {
  width: 100%;
}
.tx-submit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.tx-apply {
  border-radius: 12px !important;
  padding-left: 22px !important;
  padding-right: 22px !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 16px rgba(108, 99, 255, 0.35);
}
.tx-reset {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
}
.tx-reset:hover {
  color: var(--primary-light);
}

/* Daftar transaksi: satu kartu + tabel */
.tx-list-section {
  margin-top: 8px;
}
.tx-list-table-card {
  padding: 0;
  overflow: hidden;
}
.tx-list-table-card .tx-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.tx-list-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-light);
  letter-spacing: -0.02em;
}
.tx-list-meta {
  font-size: 12px;
  color: var(--text-muted);
}
.tx-table-wrap {
  border-radius: 0;
}
.tx-table-wrap .table {
  margin-bottom: 0;
}
.tx-num {
  font-family: ui-monospace, monospace;
  font-weight: 700;
  font-size: 13px;
  color: var(--primary-light);
  word-break: break-all;
}
.tx-time {
  font-size: 12px;
  white-space: nowrap;
}
.tx-total {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.tx-row-actions {
  flex-wrap: wrap;
  gap: 6px;
}

.tx-pager {
  margin-top: 0;
  padding: 16px !important;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: 0;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(22, 22, 42, 0.35);
}
.tx-pager:not(.tx-pager--in-card) {
  margin-top: 20px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(22, 22, 42, 0.5);
}
.tx-pager-info { font-size: 13px; }
.tx-pager .page-btn {
  min-height: 44px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
}

@media (max-width: 900px) {
  .tx-filter-grid,
  .tx-filter-grid--admin {
    grid-template-columns: 1fr 1fr;
  }
  .tx-field--search {
    grid-column: 1 / -1;
  }
  .tx-field--submit {
    grid-column: 1 / -1;
  }
  .tx-submit-row {
    width: 100%;
    justify-content: stretch;
  }
  .tx-apply {
    flex: 1;
    justify-content: center;
  }
}
@media (max-width: 520px) {
  .tx-filter-grid,
  .tx-filter-grid--admin {
    grid-template-columns: 1fr;
  }
  .tx-toolbar {
    padding: 18px 16px;
    border-radius: 16px;
  }
  .tx-metric-value {
    font-size: 18px;
  }
}

/* ===== Transactions Revamp v2 ===== */
.tx2-page {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.tx2-shell {
  border-radius: 22px;
  padding: 20px;
  background:
    radial-gradient(1200px 200px at -10% -25%, rgba(108,99,255,0.24) 0%, rgba(108,99,255,0) 60%),
    linear-gradient(165deg, rgba(18,18,34,0.98), rgba(12,12,24,0.96));
  border: 1px solid rgba(108,99,255,0.24);
  box-shadow: 0 12px 38px rgba(0,0,0,0.28);
}

[data-theme="light"] .tx2-shell {
  background:
    radial-gradient(1200px 220px at -10% -25%, rgba(108,99,255,0.2) 0%, rgba(108,99,255,0) 62%),
    linear-gradient(165deg, rgba(255,255,255,0.98), rgba(246,248,255,0.96));
  border: 1px solid rgba(108,99,255,0.2);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.tx2-top {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.tx2-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.tx2-stats.tx2-stats--rich {
  grid-template-columns: repeat(auto-fit, minmax(172px, 1fr));
  gap: 14px;
}

.tx2-stat {
  position: relative;
  border-radius: 16px;
  padding: 16px 16px 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 8px 28px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.tx2-stat::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 16px 0 0 16px;
  background: rgba(148, 163, 184, 0.55);
  opacity: 0.9;
}

.tx2-stat:hover {
  transform: translateY(-2px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 14px 36px rgba(0, 0, 0, 0.22);
  border-color: rgba(255, 255, 255, 0.12);
}

[data-theme="light"] .tx2-stat {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(99, 102, 241, 0.12);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .tx2-stat:hover {
  border-color: rgba(99, 102, 241, 0.22);
  box-shadow: 0 10px 32px rgba(99, 102, 241, 0.12);
}

.tx2-stat--accent-slate::before { background: linear-gradient(180deg, #94a3b8, #64748b); }
.tx2-stat--accent-violet::before { background: linear-gradient(180deg, #a78bfa, #6366f1); }
.tx2-stat--accent-amber::before { background: linear-gradient(180deg, #fbbf24, #d97706); }
.tx2-stat--accent-mint::before { background: linear-gradient(180deg, #34d399, #059669); }
.tx2-stat--accent-sky::before { background: linear-gradient(180deg, #38bdf8, #0ea5e9); }

.tx2-stat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.tx2-stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 16px;
  line-height: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .tx2-stat-icon {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.15);
}

.tx2-stat--wide { min-width: 0; }

.tx2-stat-value {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-light);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Riwayat transaksi: angka panjang tidak dipotong */
.tx2-stats.tx2-stats--rich .tx2-stat-value {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: break-word;
  font-size: clamp(18px, 2.35vw, 27px);
  font-variant-numeric: tabular-nums;
  line-height: 1.22;
  margin: 0;
}

.tx2-stat-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  line-height: 1.3;
}

.tx2-stat-hint {
  margin: 10px 0 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-muted);
  opacity: 0.92;
}

[data-theme="light"] .tx2-stat-hint {
  color: var(--text-muted);
  opacity: 1;
}

.tx2-export {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 14px;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  background: var(--gradient-primary);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 6px 22px rgba(99, 102, 241, 0.38);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.tx2-export-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
  font-size: 14px;
}

[data-theme="light"] .tx2-export {
  color: #fff;
  box-shadow: 0 6px 22px rgba(99, 102, 241, 0.35);
}

.tx2-export:hover {
  color: #fff;
  filter: brightness(1.06);
  box-shadow: 0 10px 28px rgba(99, 102, 241, 0.45);
  transform: translateY(-1px);
}

.tx2-chips {
  margin-top: 20px;
}

.tx2-chips-track {
  display: inline-flex;
  flex-wrap: wrap;
  padding: 5px;
  gap: 4px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .tx2-chips-track {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.14);
}

.tx2-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 9px 18px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.tx2-chip:hover:not(.is-active) {
  color: var(--text-light);
  background: rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .tx2-chip:hover:not(.is-active) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.65);
}

.tx2-chip.is-active {
  color: #fff;
  background: var(--gradient-primary);
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(108, 99, 255, 0.35);
}

.tx2-form { margin-top: 16px; }

.tx2-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.25fr) auto;
  gap: 12px 14px;
  align-items: end;
}

/* Periode baris penuh — hindari dua tanggal menabrak kolom lain */
.tx2-grid:not(.tx2-grid--admin) .tx2-field--period {
  grid-column: 1 / -1;
}

.tx2-grid--admin {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.15fr) auto;
}

.tx2-grid--admin .tx2-field--period {
  grid-column: 1 / -1;
}

.tx2-field label {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.tx2-control {
  border-radius: 12px !important;
  background: var(--bg-soft) !important;
  border: 1px solid var(--border) !important;
}

.tx2-period {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  max-width: 100%;
}

.tx2-period .tx2-control {
  flex: 1 1 140px;
  min-width: 0;
}

.tx2-period-sep {
  color: var(--text-muted);
  font-size: 13px;
}

.tx2-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.tx2-apply {
  min-width: 112px;
  border-radius: 12px !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 16px rgba(108,99,255,0.35);
}

.tx2-reset {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
}

.tx2-reset:hover { color: var(--primary-light); }

.tx2-card {
  padding: 0;
  overflow: hidden;
}

.tx2-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
}

.tx2-head h3 {
  margin: 0;
  font-size: 17px;
  color: var(--text-light);
  font-weight: 700;
}

.tx2-head span {
  font-size: 12px;
  color: var(--text-muted);
}

.tx2-table-wrap { border-radius: 0; }

.tx2-num {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-light);
}

.tx2-time {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}

.tx2-total {
  font-weight: 800;
  white-space: normal;
  font-variant-numeric: tabular-nums;
  min-width: 7rem;
}

.tx2-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tx2-mobile-list { display: none; }

.tx2-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
}

@media (max-width: 1060px) {
  .tx2-stats {
    grid-template-columns: 1fr;
  }
  .tx2-stat-value { font-size: 26px; }
  .tx2-stats.tx2-stats--rich .tx2-stat-value {
    font-size: clamp(20px, 5vw, 26px);
  }
  .tx2-grid,
  .tx2-grid--admin {
    grid-template-columns: 1fr 1fr;
  }
  .tx2-grid .tx2-field--period,
  .tx2-grid--admin .tx2-field--period {
    grid-column: 1 / -1;
  }
  .tx2-field--search,
  .tx2-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .tx2-chips-track {
    display: flex;
    width: 100%;
    justify-content: stretch;
  }
  .tx2-chip {
    flex: 1;
    text-align: center;
  }
  .tx2-shell {
    padding: 16px;
    border-radius: 16px;
  }
  .tx2-grid,
  .tx2-grid--admin {
    grid-template-columns: 1fr;
  }
  .tx2-period { flex-wrap: wrap; }
  .tx2-period-sep { display: none; }
  .tx2-actions { width: 100%; }
  .tx2-apply { flex: 1; }
}

@media (max-width: 860px) {
  .tx2-table-wrap { display: none; }
  .tx2-mobile-list {
    display: grid;
    gap: 10px;
    padding: 12px;
  }
  .tx2-mobile-item {
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-soft-2);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .tx2-mobile-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: flex-start;
  }
  .tx2-mobile-total {
    font-weight: 800;
    color: var(--text-light);
    font-size: 14px;
    white-space: nowrap;
  }
  .tx2-mobile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
  }
  .tx2-mobile-line {
    font-size: 12px;
    color: var(--text-muted);
    width: 100%;
  }
}

.btn-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  background: rgba(255, 71, 87, 0.14);
  color: #ff8a94;
  border: 1px solid rgba(255, 71, 87, 0.28);
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  font-size: 18px;
  line-height: 1;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.btn-logout:hover {
  background: rgba(255, 71, 87, 0.28);
  color: var(--text-light);
  border-color: rgba(255, 71, 87, 0.45);
}

.btn-logout:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  min-width: 0;
}

/* ===== TOPBAR ===== */
.topbar {
  min-height: var(--topbar-height);
  background: var(--bg-topbar);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  padding: 8px 20px;
  gap: 10px 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: max(8px, env(safe-area-inset-top, 8px));
}

.topbar-left { flex: 1; min-width: 0; }
.topbar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-light);
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.topbar-sub { font-size: 12px; color: var(--text-muted); overflow-wrap: anywhere; }

.topbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  border-radius: 999px;
  min-height: 34px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.theme-toggle:hover {
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.branch-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  color: var(--text-muted);
}

.branch-badge span { color: var(--primary-light); font-weight: 600; }

/* ===== PAGE CONTENT ===== */
.page-content {
  flex: 1;
  padding: 24px;
  padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
  max-width: 100%;
  min-width: 0;
}

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: var(--transition);
}

.card:hover { border-color: var(--border-hover); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.card-title { font-size: 16px; font-weight: 700; color: var(--text-light); }
.card-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ===== STAT CARDS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

/* Laporan penjualan: 6 KPI = grid 3×2 (seimbang), bukan auto-fit 5+1 */
.report-filter-card {
  border-color: rgba(108, 99, 255, 0.14);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
}

.report-filter-form.filter-bar-inline {
  gap: 14px 16px;
  align-items: flex-end;
}

.report-kpi-board {
  background: linear-gradient(165deg, rgba(108, 99, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 42%, rgba(15, 15, 26, 0.4) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 20px 18px;
  margin-bottom: 24px;
  box-shadow: 0 4px 28px rgba(0, 0, 0, 0.2);
}

.stats-grid.report-sales-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 16px;
  max-width: none;
  width: 100%;
  margin-bottom: 0;
  align-items: stretch;
}

.stats-grid.report-sales-stats .stat-card {
  height: 100%;
  margin: 0;
  align-items: flex-start;
  padding: 16px 18px;
  min-height: 108px;
}

.stats-grid.report-sales-stats .stat-icon {
  margin-top: 2px;
}

.stats-grid.report-sales-stats .stat-value {
  font-size: clamp(16px, 2.2vw, 18px);
  word-break: break-word;
}

.stat-card.stat-card--diskon {
  border-color: var(--border);
  border-left: 3px solid rgba(255, 165, 2, 0.5);
}

.stat-card.stat-card--diskon::before {
  background: var(--warning);
  opacity: 0.1;
}

.stat-icon.stat-icon--diskon {
  background: linear-gradient(135deg, rgba(255, 165, 2, 0.28), rgba(255, 127, 80, 0.16));
  color: var(--warning);
}

.stat-card.stat-card--count {
  border-left: 3px solid rgba(108, 99, 255, 0.45);
}

.stat-card.stat-card--count::before {
  background: var(--primary);
}

@media (max-width: 900px) {
  .stats-grid.report-sales-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.stat-sublabel {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.35;
  font-weight: 400;
}

.report-sales-hint {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
  max-width: none;
  margin: 16px 0 0;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.18);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* ----- Halaman terpusat & laporan / biaya ----- */
.page-shell {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.report-page .report-kpi-board {
  width: 100%;
}

.report-layout-split {
  width: 100%;
  gap: clamp(14px, 2vw, 22px);
}

.report-layout-split > .card {
  min-width: 0;
}

.report-table-wrap {
  -webkit-overflow-scrolling: touch;
}

.report-table-wrap .table {
  min-width: 560px;
}

/* Laporan stok (/reports/stok) */
.ls-page .tx2-shell {
  gap: 16px;
}

.ls-overview {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft-2);
}

.ls-overview strong {
  color: var(--text);
  font-weight: 600;
}

.ls-overview-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: 4px;
  vertical-align: middle;
}

.ls-ob {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(251, 191, 36, 0.15);
  color: #d97706;
}

[data-theme="light"] .ls-ob {
  color: #b45309;
}

.ls-ob--ok {
  background: rgba(52, 211, 153, 0.15);
  color: #059669;
}

[data-theme="light"] .ls-ob--ok {
  color: #047857;
}

.ls-filter-card {
  border-color: rgba(108, 99, 255, 0.14);
  margin: 0;
}

.ls-filter-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ls-filter-heading {
  font-size: 15px;
  margin: 0 0 4px;
}

.ls-filter-grid {
  display: grid;
  gap: 12px;
  align-items: end;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.ls-filter-grid .form-group {
  margin: 0;
}

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

.ls-cat-card,
.ls-table-card {
  margin: 0;
}

.ls-cat-wrap {
  max-height: 280px;
  overflow: auto;
}

.ls-cat-table th,
.ls-cat-table td {
  padding-top: 8px;
  padding-bottom: 8px;
  font-size: 13px;
}

.ls-table-wrap {
  max-height: min(70vh, 640px);
  overflow: auto;
}

.ls-col-product {
  font-weight: 600;
  min-width: 140px;
}

.ls-empty {
  text-align: center;
  padding: 28px;
  color: var(--text-muted);
}

@media (max-width: 1100px) {
  .ls-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .ls-filter-grid {
    grid-template-columns: 1fr;
  }

  .ls-filter-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

.report-top-produk-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.report-top-produk-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  min-width: 0;
}

.report-top-produk-rank {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-light);
}

.report-top-produk-meta {
  flex: 1;
  min-width: 0;
}

.report-top-produk-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-top-produk-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.report-top-produk-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-light);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.report-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.report-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--text-muted);
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
  border: 1px solid transparent;
}

.report-tab:hover {
  color: var(--text-light);
  background: rgba(255, 255, 255, 0.04);
}

.report-tab.active {
  color: var(--text-light);
  border-color: rgba(108, 99, 255, 0.35);
  background: linear-gradient(135deg, rgba(108, 99, 255, 0.18), rgba(0, 212, 170, 0.1));
  box-shadow: 0 6px 16px rgba(108, 99, 255, 0.18);
}

.report-tab-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.report-breakdown-filter .form-group {
  min-width: min(100%, 150px);
}

.report-breakdown-filter {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.report-breakdown-filter .btn {
  min-height: 44px;
}

.report-alert-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.report-alert-card {
  padding: 14px 16px;
}

.report-alert-card.warn {
  border-left: 3px solid rgba(255, 100, 100, 0.8);
}

.report-alert-card.ok {
  border-left: 3px solid rgba(0, 212, 170, 0.75);
}

.report-alert-value {
  margin: 6px 0 2px;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-light);
}

.report-alert-meta {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.report-mini-filter-card {
  padding: 14px 16px;
}

.report-mini-filter {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.report-chart-card {
  padding-bottom: 14px;
}

.report-chart-wrap {
  position: relative;
  width: 100%;
  min-height: 280px;
}

.report-row-clickable {
  cursor: pointer;
}

.report-row-clickable:hover {
  background: rgba(255, 255, 255, 0.03);
}

.report-drill-link {
  color: var(--primary-light);
  font-weight: 700;
  text-decoration: none;
}

.report-drill-link:hover {
  text-decoration: underline;
}

.stats-grid.report-breakdown-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 16px;
  margin-bottom: 0;
}

.stats-grid.report-breakdown-stats .stat-card {
  margin: 0;
  min-height: 106px;
}

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

.report-insight-card {
  padding: 16px 18px;
}

.report-insight-card .card-title {
  font-size: 13px;
  margin-bottom: 8px;
}

.report-insight-name {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-light);
}

.report-insight-meta {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

@media (max-width: 900px) {
  .stats-grid.report-breakdown-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .report-breakdown-filter .btn {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .report-insights-grid {
    grid-template-columns: 1fr;
  }

  .report-mini-filter {
    grid-template-columns: 1fr;
  }

  .report-alert-grid {
    grid-template-columns: 1fr;
  }

  .report-chart-wrap {
    min-height: 220px;
  }

  .report-filter-card {
    padding: 14px;
  }

  .report-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-tab {
    justify-content: center;
    min-height: 44px;
    padding: 10px 8px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .stats-grid.report-breakdown-stats {
    grid-template-columns: 1fr;
  }

  .report-breakdown-filter {
    grid-template-columns: 1fr;
  }

  .report-breakdown-filter .btn {
    grid-column: auto;
  }

  .report-mini-filter-card {
    padding: 12px;
  }

  .report-alert-card {
    padding: 12px;
  }

  .report-alert-value {
    font-size: 20px;
  }
}

/* Biaya operasional */
.opex-filter-card {
  border-color: rgba(108, 99, 255, 0.12);
}

.opex-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 14px;
  align-items: flex-end;
}

.opex-toolbar .form-group {
  margin-bottom: 0;
  flex: 1 1 auto;
  min-width: min(100%, 148px);
  max-width: 100%;
}

.opex-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  flex: 1 1 100%;
  padding-top: 4px;
  margin-top: 2px;
  border-top: 1px solid var(--border);
}

@media (min-width: 720px) {
  .opex-toolbar-actions {
    flex: 1 1 auto;
    justify-content: flex-end;
    margin-left: auto;
    padding-top: 0;
    margin-top: 0;
    border-top: none;
    min-width: min(100%, 280px);
  }
}

.opex-summary-card {
  border-color: rgba(108, 99, 255, 0.14);
}

.opex-summary-card .stat-card {
  margin: 0;
  border: none;
  box-shadow: none;
  background: transparent;
  padding: 4px 0;
  min-height: 0;
}

.opex-summary-card .stat-card::before {
  display: none;
}

.opex-table-wrap {
  -webkit-overflow-scrolling: touch;
}

.opex-table-wrap .table {
  min-width: 640px;
}

.layout-opex-categories {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: clamp(16px, 2.5vw, 22px);
  align-items: start;
}

.layout-opex-categories > .card {
  min-width: 0;
}

.opex-category-form-card .card-header {
  margin-bottom: 0;
}

.opex-category-form-card form {
  padding-top: 4px;
}

.form-card-narrow {
  width: 100%;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.form-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}

@media (max-width: 768px) {
  .report-kpi-board {
    padding: 16px 14px 14px;
    border-radius: var(--radius-sm);
  }

  .stats-grid.report-sales-stats {
    gap: 10px 12px;
  }

  .stats-grid.report-sales-stats .stat-card {
    padding: 14px;
    min-height: 100px;
  }

  .stats-grid.report-sales-stats .stat-icon {
    width: 46px;
    height: 46px;
    font-size: 19px;
    border-radius: 12px;
  }
}

@media (max-width: 480px) {
  .stats-grid.report-sales-stats .stat-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    min-height: 0;
  }

  .stats-grid.report-sales-stats .stat-icon {
    margin-top: 0;
  }

  .report-sales-hint {
    font-size: 11px;
    padding: 10px 12px;
  }
}

@media (max-width: 1024px) {
  .layout-opex-categories {
    grid-template-columns: 1fr;
  }

  .layout-opex-categories .opex-category-form-card {
    max-width: 480px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 50%;
  opacity: 0.08;
  transform: translate(20px, -20px);
}

.stat-card.primary::before { background: var(--primary); }
.stat-card.success::before { background: var(--secondary); }
.stat-card.warning::before { background: var(--warning); }
.stat-card.danger::before { background: var(--danger); }

.stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.stat-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-icon.primary { background: linear-gradient(135deg, rgba(108,99,255,0.2), rgba(108,99,255,0.1)); color: var(--primary-light); }
.stat-icon.success { background: linear-gradient(135deg, rgba(0,212,170,0.2), rgba(0,212,170,0.1)); color: var(--secondary); }
.stat-icon.warning { background: linear-gradient(135deg, rgba(255,165,2,0.2), rgba(255,165,2,0.1)); color: var(--warning); }
.stat-icon.danger { background: linear-gradient(135deg, rgba(255,71,87,0.2), rgba(255,71,87,0.1)); color: var(--danger); }

.stat-info { flex: 1; }
.stat-value { font-size: 22px; font-weight: 800; color: var(--text-light); line-height: 1.2; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--gradient-primary); color: white; box-shadow: 0 4px 16px rgba(108,99,255,0.35); }
.btn-primary:hover { box-shadow: 0 6px 20px rgba(108,99,255,0.5); color: white; }

.btn-success { background: var(--gradient-success); color: white; box-shadow: 0 4px 16px rgba(46,213,115,0.3); }
.btn-success:hover { box-shadow: 0 6px 20px rgba(46,213,115,0.45); color: white; }

.btn-danger { background: var(--gradient-danger); color: white; box-shadow: 0 4px 16px rgba(255,71,87,0.3); }
.btn-danger:hover { box-shadow: 0 6px 20px rgba(255,71,87,0.45); color: white; }

.btn-warning { background: var(--gradient-warning); color: white; }
.btn-warning:hover { color: white; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.btn-outline:hover { border-color: var(--primary-light); color: var(--primary-light); background: rgba(108,99,255,0.1); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; justify-content: center; }

/* ===== FORM INPUTS ===== */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  background: rgba(108,99,255,0.05);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.15);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control { cursor: pointer; }
select.form-control option { background: var(--modal-bg); color: var(--text); }

.input-group {
  display: flex;
  gap: 0;
}

.input-group .form-control { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* ===== TABLES ===== */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-sm);
}

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

.table th, .table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.table th {
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 11px;
  background: rgba(255,255,255,0.02);
}

.table tbody tr:hover { background: var(--bg-card-hover); }
.table tbody tr:last-child td { border-bottom: none; }

.table-row-self {
  background: rgba(108, 99, 255, 0.07);
}
.table-row-self:hover { background: rgba(108, 99, 255, 0.1); }

.table-sticky {
  max-height: min(70vh, 720px);
  overflow: auto;
  position: relative;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.table-sticky .table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--table-head-bg);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 var(--border);
}
.th-actions { min-width: 200px; }

.product-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.product-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.product-stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 6px; }
.product-stat-value { font-size: 22px; font-weight: 700; color: var(--text-light); }
.product-stat-warning .product-stat-value { color: var(--warning); }
.product-stat-danger .product-stat-value { color: var(--danger); }
.product-stat-info .product-stat-value { color: var(--info); }

.product-filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: 1;
  align-items: center;
  min-width: 0;
  width: 100%;
}
.product-filter-form .filter-select { width: auto; min-width: 120px; max-width: 220px; flex: 1 1 140px; }
.product-filter-form .search-bar { flex: 1 1 200px; min-width: 0; }
.product-filter-form > .btn { flex-shrink: 0; }

.product-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.product-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  font-size: 18px;
  opacity: 0.5;
  border: 1px dashed var(--border);
  border-radius: 8px;
}
.product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.badge-success { background: rgba(46,213,115,0.15); color: var(--success); border: 1px solid rgba(46,213,115,0.2); }
.badge-danger { background: rgba(255,71,87,0.15); color: var(--danger); border: 1px solid rgba(255,71,87,0.2); }
.badge-warning { background: rgba(255,165,2,0.15); color: var(--warning); border: 1px solid rgba(255,165,2,0.2); }
.badge-primary { background: rgba(108,99,255,0.15); color: var(--primary-light); border: 1px solid rgba(108,99,255,0.2); }
.badge-info { background: rgba(30,144,255,0.15); color: var(--info); border: 1px solid rgba(30,144,255,0.2); }

/* ===== ALERTS ===== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.alert-success { background: rgba(46,213,115,0.1); border: 1px solid rgba(46,213,115,0.2); color: var(--success); }
.alert-danger { background: rgba(255,71,87,0.1); border: 1px solid rgba(255,71,87,0.2); color: var(--danger); }
.alert-warning { background: rgba(255,165,2,0.1); border: 1px solid rgba(255,165,2,0.2); color: var(--warning); }
.alert-info { background: rgba(30,144,255,0.1); border: 1px solid rgba(30,144,255,0.2); color: var(--info); }

.alert-close { margin-left: auto; cursor: pointer; background: none; border: none; color: inherit; font-size: 16px; padding: 0; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-overlay#successModal {
  z-index: 1010;
}

.modal {
  background: var(--modal-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9) translateY(20px);
  transition: all 0.2s ease;
  box-shadow: var(--shadow);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 20px; color: var(--text-light); }

/* Modal pembayaran POS */
.pos-pay-modal.modal {
  max-width: 440px;
  max-height: min(92dvh, 720px);
  padding: 22px 24px;
}

.pos-pay-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

.pos-pay-modal-title.modal-title {
  margin-bottom: 6px;
}

.pos-pay-modal-total-line {
  font-size: 13px;
  color: var(--text-muted);
}

.pos-pay-modal-total-line strong {
  color: var(--primary-light);
  font-size: 15px;
  font-weight: 800;
}

.pos-pay-modal-close {
  flex-shrink: 0;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 10px;
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.pos-pay-modal-close:hover {
  color: var(--text-light);
  border-color: var(--border-hover);
}

.pos-pay-modal-body.cart-payment {
  margin: 0;
}

.btn-checkout--open-pay {
  margin-top: 10px;
  flex-shrink: 0;
}

.method-btn.method-btn--danger {
  color: var(--danger);
  border-color: rgba(255, 71, 87, 0.45);
}

.method-btn.method-btn--danger.active {
  background: rgba(255, 71, 87, 0.12);
  border-color: var(--danger);
  color: #ff8a94;
}

/* ===== PAGINATION ===== */
.pagination { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 20px; }

.page-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.page-btn:hover, .page-btn.active {
  background: var(--gradient-primary);
  border-color: var(--primary);
  color: white;
}

/* ===== SEARCH BAR ===== */
.search-bar {
  position: relative;
}

.search-bar .search-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-bar .form-control {
  padding-left: 40px;
}

/* ===== SPINNER ===== */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  background: #1a1a2e;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.3s ease;
  min-width: 280px;
  max-width: 400px;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--info); }

/* ===== POS PAGE ===== */
.pos-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  height: calc(100dvh - var(--topbar-height) - 48px);
  height: calc(100vh - var(--topbar-height) - 48px);
}

/* POS: full bleed di area konten (mobile) */
.pos-page-bleed {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.page-content:has(.pos-page-bleed) {
  overflow-x: clip;
}

.pos-products {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
  min-width: 0;
}

.pos-products .search-bar .form-control {
  min-height: 44px;
}

.pos-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.pos-products-grid::-webkit-scrollbar { width: 4px; }
.pos-products-grid::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  position: relative;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.product-card:hover {
  border-color: var(--primary);
  background: rgba(108,99,255,0.08);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(108,99,255,0.2);
}

.product-card:active { transform: translateY(0); }

.product-card .product-emoji {
  font-size: 32px;
  margin-bottom: 8px;
  display: block;
}

.product-card .product-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.3;
}

.product-card .product-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-light);
}

.product-card .product-stock {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
}

.product-card .product-stock.low { color: var(--warning); }
.product-card .product-stock.out { color: var(--danger); }

.pos-product-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
}
.pos-cat-bar {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  padding-bottom: 6px;
  margin-bottom: -2px;
  scrollbar-width: thin;
}
.pos-cat-bar::-webkit-scrollbar { height: 4px; }
.pos-cat-bar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.pos-cat-chip {
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
  flex-shrink: 0;
  white-space: nowrap;
  min-height: 40px;
  -webkit-tap-highlight-color: transparent;
}
.pos-cat-chip:hover, .pos-cat-chip.active {
  border-color: var(--primary);
  color: var(--primary-light);
  background: rgba(108,99,255,0.12);
}
.pos-search-panel {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.2);
  display: none;
  -webkit-overflow-scrolling: touch;
}
.pos-search-panel.visible { display: block; }
.pos-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  min-height: 52px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  text-align: left;
  width: 100%;
  background: transparent;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  -webkit-tap-highlight-color: transparent;
}
.pos-search-row:hover { background: var(--bg-card-hover); }
.pos-search-row:last-child { border-bottom: none; }
.pos-search-row img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}
.pos-recent {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: rgba(255,255,255,0.02);
  max-height: 160px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
}
.pos-recent-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.pos-recent-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.pos-recent-item:last-child { border-bottom: none; }
.pos-recent-item a {
  color: var(--primary-light);
  font-weight: 600;
  font-family: monospace;
  font-size: 11px;
}
.cart-price-input {
  width: 100%;
  max-width: 108px;
  padding: 5px 8px;
  font-size: 13px;
  text-align: right;
  min-height: 32px;
  box-sizing: border-box;
  border-radius: 8px;
}

.pos-cart input.cart-price-input::-webkit-outer-spin-button,
.pos-cart input.cart-price-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.pos-cart input.cart-price-input {
  appearance: textfield;
  -moz-appearance: textfield;
}

/* ===== CART ===== */
.pos-cart {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.cart-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.cart-header-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pos-diskon-field {
  width: 120px;
  max-width: 100%;
  text-align: right;
  padding: 6px 10px;
  min-height: 40px;
  box-sizing: border-box;
}

.cart-row--diskon {
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.cart-row--diskon > span:last-child {
  flex: 1 1 auto;
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}

.cart-title { font-size: 15px; font-weight: 700; color: var(--text-light); }

.cart-items {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
}

.cart-items::-webkit-scrollbar { width: 4px; }
.cart-items::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.cart-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  transition: var(--transition);
}

.cart-item:hover { border-color: var(--border-hover); }

.cart-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px 12px;
}

.cart-item-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.cart-item-foot {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.cart-item-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.cart-item-price {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.3;
  margin: 0;
}

.cart-item-unit {
  font-weight: 500;
  opacity: 0.85;
}

.cart-price-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  max-width: 100%;
}

.cart-price-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.cart-item--override .cart-price-field {
  flex: 0 1 auto;
}

.cart-price-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
}

.cart-price-mode {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  margin: 0;
  width: 100%;
}

.cart-price-mode span {
  flex-shrink: 0;
}

.cart-price-mode-select {
  min-width: 132px;
  max-width: 180px;
  width: 100%;
  padding: 4px 6px;
  font-size: 11px;
  line-height: 1.2;
}

.cart-auto-label {
  font-size: 11px;
  color: var(--text-muted);
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.pos-cart .qty-btn {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
}

.qty-btn {
  width: 24px; height: 24px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  font-weight: 700;
  transition: var(--transition);
  flex-shrink: 0;
}

.qty-btn:hover { background: var(--primary); border-color: var(--primary); }
.qty-btn.remove:hover { background: var(--danger); border-color: var(--danger); }

.qty-display {
  min-width: 36px;
  padding: 0 4px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-light);
  background: transparent;
  border: none;
  color: var(--text);
}

.cart-item-subtotal {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-light);
  text-align: right;
  flex-shrink: 0;
  white-space: nowrap;
  line-height: 1.2;
  padding-top: 1px;
}

.pos-quick-cash {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.pos-quick-cash-btn {
  flex: 1 1 calc(50% - 4px);
  min-width: 76px;
  min-height: 44px;
  padding: 10px 12px;
  background: rgba(108, 99, 255, 0.14);
  border: 1px solid rgba(108, 99, 255, 0.28);
  border-radius: 8px;
  color: var(--primary-light);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.pos-quick-cash-btn:active {
  transform: scale(0.98);
}

.cart-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  gap: 8px;
  padding: 32px;
}

.cart-empty-icon { font-size: 48px; opacity: 0.4; }
.cart-empty-text { font-size: 13px; }

.cart-footer {
  border-top: 1px solid var(--border);
  padding: 16px 20px;
  padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
}

.cart-summary { margin-bottom: 16px; }

.cart-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
}

.cart-row span:first-child { color: var(--text-muted); }
.cart-row span:last-child { font-weight: 600; color: var(--text); }

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

.cart-total .total-label { font-size: 13px; color: var(--text-muted); }
.cart-total .total-value { font-size: 22px; font-weight: 800; color: var(--primary-light); }

.cart-payment { display: flex; flex-direction: column; gap: 10px; }

.payment-input {
  position: relative;
}

.payment-input .currency-prefix {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13px;
  pointer-events: none;
}

.payment-input .form-control {
  padding-left: 32px;
  font-size: 18px;
  font-weight: 700;
  text-align: right;
}

.change-display {
  background: rgba(46,213,115,0.08);
  border: 1px solid rgba(46,213,115,0.2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.change-display .change-label { font-size: 12px; color: var(--text-muted); }
.change-display .change-value { font-size: 18px; font-weight: 800; color: var(--success); }

.payment-methods { display: flex; gap: 6px; }

.method-btn {
  flex: 1;
  padding: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

.method-btn.active, .method-btn:hover {
  background: rgba(108,99,255,0.15);
  border-color: var(--primary);
  color: var(--primary-light);
}

.btn-checkout {
  background: var(--gradient-primary);
  color: white;
  border: none;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(108,99,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
}

.btn-checkout:hover { box-shadow: 0 6px 24px rgba(108,99,255,0.6); transform: translateY(-1px); }
.btn-checkout:active { transform: translateY(0); }
.btn-checkout:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ===== SUCCESS MODAL ===== */
.success-animation {
  text-align: center;
  padding: 20px 0;
}

.success-icon {
  font-size: 64px;
  animation: bounceIn 0.5s ease;
  display: block;
  margin-bottom: 16px;
}

@keyframes bounceIn {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

/* ===== UTILS ===== */
.text-muted { color: var(--text-muted); }
.text-light { color: var(--text-light); }
.text-primary { color: var(--primary-light); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.mt-4 { margin-top: 24px; }
.mt-3 { margin-top: 16px; }
.mt-2 { margin-top: 8px; }
.mb-4 { margin-bottom: 24px; }
.mb-3 { margin-bottom: 16px; }
.mb-2 { margin-bottom: 8px; }
.me-2 { margin-right: 8px; }
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

/* ----- Multi-column page layouts (stack on narrow screens) ----- */
.layout-two-col {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
}
.layout-two-col--wide {
  grid-template-columns: 1fr 360px;
}
.layout-split-2-1 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  align-items: start;
}
.layout-split-equal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}
.stats-inline-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 800px;
  margin-bottom: 20px;
}
.stats-inline-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 500px;
}

.product-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}
.product-toolbar .product-filter-form { flex: 1; min-width: min(100%, 280px); }
.product-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.flash-messages-wrap {
  padding: 0 24px;
  position: relative;
  z-index: 10;
}

.filter-bar-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.filter-bar-inline .form-group { margin-bottom: 0; }

.page-list-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.page-list-toolbar--end {
  justify-content: flex-end;
}
.page-list-search {
  display: flex;
  gap: 12px;
  flex: 1;
  min-width: 0;
  max-width: 440px;
  align-items: center;
}

.table-responsive-min {
  min-width: 680px;
}

/* ----- Admin /users: filter + stacked tables on narrow screens ----- */
.admin-users-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  width: 100%;
}
.admin-users-filter__field {
  margin: 0;
  flex: 1 1 140px;
  min-width: 120px;
}
.admin-users-filter__field .form-control {
  width: 100%;
}
.admin-users-filter__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.user-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.admin-users-add-form .btn-block {
  margin-top: 4px;
}

.perm-fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 0 0 12px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
}
.perm-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  margin: 0;
}
.perm-check input {
  margin-top: 3px;
  flex-shrink: 0;
}

.text-right { text-align: right; }
.w-100 { width: 100%; }

/* ===== FORMAT CURRENCY ===== */
.rupiah { font-variant-numeric: tabular-nums; }

/* ===== LOGIN PAGE ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
}

.login-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 40%, rgba(108,99,255,0.15) 0%, transparent 50%),
              radial-gradient(ellipse at 70% 60%, rgba(0,212,170,0.08) 0%, transparent 50%);
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: rgba(26,26,46,0.9);
  backdrop-filter: blur(30px);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px;
  box-shadow: var(--shadow);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo .logo-circle {
  width: 64px; height: 64px;
  background: var(--gradient-primary);
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 12px;
  box-shadow: 0 8px 32px rgba(108,99,255,0.4);
  animation: float 3s ease-in-out infinite;
}

.login-logo .logo-circle.logo-mark {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: #fff;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.login-logo h1 { font-size: 22px; font-weight: 800; color: var(--text-light); }
.login-logo p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ===== HAMBURGER ===== */
.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: var(--transition);
}

.hamburger:hover { background: var(--bg-card); }

/* ===== OVERLAY (mobile) ===== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
  -webkit-tap-highlight-color: transparent;
}
.sidebar-overlay.active { display: block; }

/* ===== RESPONSIVE & MOBILE ===== */
@media (max-width: 1200px) {
  .pos-layout {
    grid-template-columns: 1fr min(360px, 34vw);
    gap: 16px;
    height: calc(100dvh - var(--topbar-height) - 48px);
    height: calc(100vh - var(--topbar-height) - 48px);
  }
}

@media (max-width: 1024px) {
  .pos-page-bleed {
    margin-left: -24px;
    margin-right: -24px;
    width: calc(100% + 48px);
    max-width: none;
    box-sizing: border-box;
  }
  .pos-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: auto;
    min-height: calc(100dvh - var(--topbar-height) - 32px);
    min-height: calc(100vh - var(--topbar-height) - 32px);
    gap: 12px;
  }
  .pos-products { min-height: 0; }
  .pos-products-grid {
    grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
    max-height: min(30dvh, 280px);
    -webkit-overflow-scrolling: touch;
  }
  .pos-cart {
    min-height: min(48dvh, 360px);
    max-height: none;
    align-self: stretch;
  }
  .pos-cart .cart-items {
    min-height: min(22dvh, 180px);
  }
  .pos-search-panel { max-height: min(36dvh, 260px); }
  .pos-recent { max-height: min(24dvh, 150px); }
  .cart-items { -webkit-overflow-scrolling: touch; }
  .layout-two-col,
  .layout-two-col--wide,
  .layout-split-2-1,
  .layout-split-equal {
    grid-template-columns: 1fr;
  }
  /* Admin /users: stack rows as cards when layout is single-column */
  .admin-users-list-card .admin-table-responsive.table-wrapper,
  .admin-users-audit-card .admin-table-responsive.table-wrapper {
    overflow-x: visible;
  }
  .admin-users-list-card .table-sticky.admin-table-responsive,
  .admin-table-responsive.table-sticky {
    max-height: none !important;
  }
  .admin-table-responsive .table thead {
    display: none;
  }
  .admin-table-responsive .table tbody tr {
    display: block;
    margin-bottom: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
  }
  .admin-table-responsive .table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    text-align: right;
    font-size: 13px;
  }
  .admin-table-responsive .table tbody td:last-child {
    border-bottom: none;
  }
  .admin-table-responsive .table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
    text-align: left;
    max-width: 40%;
    padding-top: 2px;
  }
  .admin-table-responsive .table tbody td.admin-table-empty {
    display: block;
    text-align: center;
    padding: 28px 16px;
    color: var(--text-muted);
    border-bottom: none;
  }
  .admin-table-responsive .table tbody td.admin-table-empty::before {
    content: none;
    display: none;
  }
  .admin-table-responsive .table tbody td[data-label="Aksi"] {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    text-align: left;
  }
  .admin-table-responsive .table tbody td[data-label="Aksi"]::before {
    max-width: none;
  }
  .admin-table-responsive .user-row-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }
  .admin-table-responsive .user-row-actions > a,
  .admin-table-responsive .user-row-actions > form {
    margin: 0;
  }
  .admin-table-responsive .user-row-actions .btn-sm {
    width: 100%;
    min-height: 44px;
    justify-content: center;
    box-sizing: border-box;
  }
  .admin-table-responsive .user-row-actions__force {
    grid-column: 1 / -1;
  }
  .admin-table-responsive--audit .table tbody td[data-label="Detail"] {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }
  .admin-table-responsive--audit .table tbody td[data-label="Detail"]::before {
    max-width: none;
  }
  .admin-audit-detail {
    max-width: none !important;
    word-break: break-word;
  }
  .admin-users-filter {
    flex-direction: column;
    align-items: stretch;
  }
  .admin-users-filter__field {
    flex: none;
    width: 100%;
    min-width: 0;
  }
  .admin-users-filter__actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .admin-users-filter__actions .btn {
    flex: 1 1 calc(50% - 5px);
    min-height: 44px;
    justify-content: center;
  }
  .branch-badge span { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (max-width: 768px) {
  .hamburger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    flex-shrink: 0;
  }
  :root { --sidebar-width: 0px; }
  .sidebar {
    transform: translateX(-100%);
    width: min(300px, 88vw);
    box-shadow: 8px 0 32px rgba(0,0,0,0.35);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-nav .nav-item {
    padding: 14px 18px;
    min-height: 48px;
    align-items: center;
  }
  .main-content { margin-left: 0; }
  .page-content { padding: 16px 14px; }
  .flash-messages-wrap { padding: 0 14px; }
  .topbar { padding-left: 12px; padding-right: 12px; }
  .topbar-title { font-size: 16px; }
  .theme-toggle {
    min-height: 32px;
    padding: 5px 10px;
    font-size: 11px;
  }
  .card { padding: 16px; }
  .card-header { flex-wrap: wrap; gap: 8px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stats-grid.report-sales-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 18px; }
  .pos-page-bleed {
    margin-left: -14px;
    margin-right: -14px;
    width: calc(100% + 28px);
  }
  .pos-products-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; max-height: min(28dvh, 260px); }
  .pos-cart {
    max-height: none;
    min-height: min(50dvh, 400px);
  }
  .pos-cart .cart-items {
    min-height: min(26dvh, 220px);
  }
  .pos-search-panel { max-height: min(38dvh, 280px); }
  .pos-cart .cart-header {
    flex-direction: column;
    align-items: stretch;
  }
  .pos-cart .cart-header-actions {
    width: 100%;
    justify-content: stretch;
    gap: 8px;
  }
  .pos-cart .cart-header-actions .btn-sm {
    flex: 1 1 calc(33.333% - 6px);
    min-height: 44px;
    justify-content: center;
  }
  .pos-cart .method-btn {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  .product-card { padding: 12px 10px; }
  .product-card .product-emoji { font-size: 28px; }
  .payment-methods { flex-wrap: wrap; }
  .method-btn {
    flex: 1 1 calc(50% - 4px);
    min-height: 44px;
    font-size: 12px;
  }
  .btn-checkout { min-height: 48px; font-size: 16px; }
  .pagination { flex-wrap: wrap; row-gap: 10px; padding-bottom: 8px; }
  .page-btn { min-width: 40px; min-height: 40px; }
  .toast-container {
    left: 12px;
    right: 12px;
    top: auto;
    bottom: max(16px, env(safe-area-inset-bottom, 16px));
    align-items: stretch;
  }
  .toast {
    min-width: 0;
    max-width: none;
    font-size: 14px;
  }
  .modal {
    width: calc(100% - 24px);
    max-height: calc(100dvh - 24px);
    padding: 20px;
    margin: auto;
  }
  .grid-2 { grid-template-columns: 1fr; }
  .stats-inline-3 { grid-template-columns: 1fr; max-width: none; }
  .stats-inline-2 { grid-template-columns: 1fr; max-width: none; }
  .product-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .product-toolbar .product-filter-form {
    flex-direction: column;
    align-items: stretch;
  }
  .product-toolbar .product-filter-form .filter-select,
  .product-toolbar .product-filter-form .search-bar {
    max-width: none;
    width: 100%;
    flex: none;
  }
  .product-toolbar-actions {
    justify-content: stretch;
  }
  .product-toolbar-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
    min-height: 44px;
  }
  .product-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-actions {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    gap: 8px;
    max-width: 100%;
  }
  .product-actions .btn-sm { flex-shrink: 0; }
  .table-sticky { max-height: min(55vh, 560px); }
  .table th, .table td { padding: 10px 12px; font-size: 12px; }

  .admin-users-filter {
    flex-direction: column;
    align-items: stretch;
  }
  .admin-users-filter__field {
    flex: none;
    width: 100%;
    min-width: 0;
  }
  .admin-users-filter__actions {
    flex-direction: column;
    align-items: stretch;
  }
  .admin-users-filter__actions .btn {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }
  .admin-users-pagination {
    padding: 12px 8px 16px !important;
  }
  .admin-users-pagination .page-btn {
    min-width: 44px;
    min-height: 44px;
  }
  .admin-users-add-form .btn-block {
    min-height: 48px;
    font-size: 15px;
  }

  .btn-sm {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 13px;
  }
  .qty-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
  }
  .pos-cart .qty-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
  }
  input.form-control,
  select.form-control,
  textarea.form-control {
    font-size: 16px;
  }
  .login-card { padding: 24px 20px; border-radius: 20px; }
  .login-logo h1 { font-size: 20px; }
  .filter-bar-inline {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-bar-inline .btn,
  .filter-bar-inline .form-control,
  .filter-bar-inline select {
    width: 100%;
    max-width: none;
  }
  .page-list-toolbar { align-items: stretch; }
  .page-list-search {
    max-width: none;
    width: 100%;
    flex-wrap: wrap;
  }
  .page-list-search .form-control { flex: 1; min-width: 0; }
  .page-list-toolbar > a.btn,
  .page-list-toolbar > .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stats-grid.report-sales-stats { grid-template-columns: 1fr; }
  .product-stats-grid { grid-template-columns: 1fr; }
  .topbar-right .clock-badge { display: none; }
  .theme-toggle { padding: 4px 9px; }
  .pos-products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: min(26dvh, 240px); }
  .pos-cart {
    max-height: none;
    min-height: min(52dvh, 440px);
  }
  .pos-cart .cart-items {
    min-height: min(28dvh, 240px);
  }
  .pos-cart .cart-header-actions .btn-sm {
    flex: 1 1 calc(50% - 4px);
  }
  .pos-cart .cart-item-foot {
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .pos-cart .cart-item-meta {
    flex: 1 1 calc(100% - 160px);
    min-width: 120px;
  }
  .cart-price-mode {
    flex-wrap: wrap;
    row-gap: 4px;
  }
  .cart-price-mode-select {
    max-width: 100%;
    min-width: 110px;
  }
  .pos-cart .cart-item-qty {
    margin-left: auto;
  }
  .cart-row--diskon {
    flex-direction: column;
    align-items: stretch;
  }
  .cart-row--diskon > span:last-child {
    justify-content: stretch;
  }
  .pos-diskon-field {
    width: 100%;
    max-width: none;
  }
  .pos-cart .cart-price-input {
    max-width: min(140px, 42vw);
  }
}

@media (max-width: 380px) {
  .method-btn { flex: 1 1 100%; }
  .page-btn { width: 40px; }
}

@media (hover: none) and (pointer: coarse) {
  .product-card:active {
    transform: scale(0.98);
    border-color: var(--primary);
  }
}

@media (hover: none) {
  .nav-item:hover { transform: none; }
  .stat-card:hover { transform: none; }
  .btn:hover { transform: none; }
}

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

.debts-page {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.debts-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding: 24px 26px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(108, 99, 255, 0.22) 0%, rgba(26, 26, 46, 0.95) 45%, rgba(15, 15, 26, 0.98) 100%);
  border: 1px solid rgba(108, 99, 255, 0.25);
  box-shadow: var(--shadow-card);
}

[data-theme="light"] .debts-hero {
  background: linear-gradient(135deg, rgba(108, 99, 255, 0.16) 0%, rgba(255, 255, 255, 0.96) 52%, rgba(245, 248, 255, 0.98) 100%);
  border-color: rgba(108, 99, 255, 0.2);
}

@media (min-width: 900px) {
  .debts-hero {
    grid-template-columns: minmax(260px, 380px) 1fr;
    align-items: center;
  }
}

.debts-hero__eyebrow {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.debts-hero__amount {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 800;
  color: var(--text-light);
  line-height: 1.15;
  margin: 6px 0 4px;
  font-variant-numeric: tabular-nums;
}

.debts-hero__hint {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.debts-hero__chips-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.debts-hero__chips-scroll {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 88px;
  overflow-y: auto;
  padding-bottom: 2px;
}

.debts-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-light);
  background: rgba(255, 165, 2, 0.12);
  border: 1px solid rgba(255, 165, 2, 0.28);
  transition: var(--transition);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.debts-chip:hover {
  background: rgba(255, 165, 2, 0.2);
  border-color: rgba(255, 165, 2, 0.45);
  color: var(--text-light);
}

.debts-toolbar.card {
  padding: 0;
  overflow: hidden;
}

.debts-toolbar__form {
  display: flex;
  flex-direction: column;
}

.debts-toolbar__row--search {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: stretch;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.debts-search {
  flex: 1;
  min-width: min(100%, 240px);
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.debts-search:focus-within {
  border-color: var(--border-hover);
}

.debts-search__icon {
  padding: 0 12px 0 14px;
  font-size: 14px;
  opacity: 0.7;
}

.debts-search__input {
  flex: 1;
  min-width: 0;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.debts-search__submit {
  border-radius: 0;
  padding-left: 18px;
  padding-right: 18px;
  flex-shrink: 0;
}

.debts-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.debts-btn-manual {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  background: var(--gradient-primary);
  border: none;
  color: #fff;
  box-shadow: 0 4px 20px rgba(108, 99, 255, 0.35);
}

.debts-btn-manual:hover {
  color: #fff;
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.debts-btn-manual__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.2);
  font-weight: 800;
  font-size: 16px;
  line-height: 1;
}

.debts-btn-export {
  font-weight: 500;
}

.debts-filter-details {
  border: none;
}

.debts-filter-details__summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  user-select: none;
  transition: var(--transition);
}

.debts-filter-details__summary::-webkit-details-marker {
  display: none;
}

.debts-filter-details__summary:hover {
  background: rgba(255, 255, 255, 0.03);
}

.debts-filter-details__chev {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  margin-right: 4px;
}

.debts-filter-details[open] .debts-filter-details__chev {
  transform: rotate(-135deg);
  margin-top: 4px;
}

.debts-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px 18px;
  padding: 0 20px 20px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.debts-filter-overdue {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.debts-filter-overdue__label {
  margin-bottom: 8px;
}

.debts-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  min-height: 42px;
}

.debts-checkbox input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.debts-filter-actions__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.debts-filter-actions__spacer {
  visibility: hidden;
  min-height: 1em;
}

.debts-list-card {
  overflow: hidden;
}

.debts-list-card__head {
  padding: 18px 20px 0;
}

.debts-list-card__title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-light);
  margin: 0 0 4px;
}

.debts-list-card__meta {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 14px;
}

.debts-table-wrap {
  border-top: 1px solid var(--border);
}

.debts-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom-color: var(--border);
}

.debts-table td {
  vertical-align: middle;
}

.debts-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.debts-num--sisa {
  font-weight: 700;
  color: var(--danger);
}

.debts-col-actions {
  width: 1%;
  white-space: nowrap;
}

.debts-cell-name {
  font-weight: 600;
  color: var(--text-light);
}

.debts-cell-note {
  font-size: 11px;
  color: var(--text-muted);
  max-width: 220px;
  margin-top: 4px;
  line-height: 1.35;
}

.debts-cell-mono {
  font-family: ui-monospace, monospace;
  font-size: 12px;
}

.debts-badge-manual {
  display: inline-block;
  margin-left: 6px;
  font-size: 9px;
  vertical-align: middle;
}

.debts-status-pill {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.debts-row--overdue td:first-child {
  box-shadow: inset 3px 0 0 var(--danger);
}

.debts-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.debts-act {
  font-weight: 600;
  border-radius: 10px;
}

.debts-act--pay {
  min-width: 72px;
}

.debts-empty {
  text-align: center;
  padding: 48px 24px !important;
  color: var(--text-muted);
}

.debts-empty__icon {
  font-size: 42px;
  margin-bottom: 12px;
  opacity: 0.85;
}

.debts-empty__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-light);
  margin: 0 0 6px;
}

.debts-empty__text {
  margin: 0;
  font-size: 13px;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.debts-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 16px 20px 18px;
  border-top: 1px solid var(--border);
}

.debts-pagination__info {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.debt-manual-modal.modal {
  max-width: 440px;
  padding: 0;
  overflow: hidden;
}

.debt-manual-modal__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(108, 99, 255, 0.06);
}

.debt-manual-modal__title {
  margin-bottom: 6px !important;
  font-size: 20px !important;
}

.debt-manual-modal__sub {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.45;
}

.debt-manual-form {
  padding: 20px 24px 24px;
}

.debt-manual-form__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.debt-manual-form__submit {
  min-width: 140px;
  font-weight: 600;
}

.debt-manual-empty {
  padding: 28px 24px 32px;
  text-align: center;
}

.debt-manual-empty p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 20px;
}

.debt-manual-empty .btn-primary {
  margin-bottom: 12px;
}

.debt-manual-empty__close {
  display: block;
  width: 100%;
  max-width: 200px;
  margin: 0 auto;
}

@media (max-width: 640px) {
  .debts-toolbar__row--search {
    flex-direction: column;
  }

  .debts-search {
    flex-direction: column;
    align-items: stretch;
  }

  .debts-search__icon {
    display: none;
  }

  .debts-search__input {
    border-bottom: 1px solid var(--border) !important;
    border-radius: 0 !important;
    padding: 12px 14px !important;
  }

  .debts-search__submit {
    width: 100%;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  }

  .debts-toolbar__actions {
    width: 100%;
  }

  .debts-toolbar__actions .btn {
    flex: 1;
    justify-content: center;
  }

  .debts-table {
    min-width: 720px;
  }
}

/* ===== DEBT DETAIL (/debts/<id>) ===== */
.debt-detail-page {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.debt-detail-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.debt-detail-breadcrumb__link {
  color: var(--primary-light);
  font-weight: 500;
}

.debt-detail-breadcrumb__link:hover {
  color: var(--text-light);
}

.debt-detail-breadcrumb__sep {
  opacity: 0.5;
}

.debt-detail-breadcrumb__current {
  color: var(--text);
}

.debt-detail-hero {
  padding: 22px 24px 24px;
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(108, 99, 255, 0.14) 0%, rgba(26, 26, 46, 0.92) 55%, rgba(15, 15, 26, 0.98) 100%);
  border: 1px solid rgba(108, 99, 255, 0.22);
  box-shadow: var(--shadow-card);
}

[data-theme="light"] .debt-detail-hero {
  background: linear-gradient(145deg, rgba(108, 99, 255, 0.12) 0%, rgba(255, 255, 255, 0.96) 58%, rgba(245, 248, 255, 0.98) 100%);
  border-color: rgba(108, 99, 255, 0.22);
}

[data-theme="light"] .debt-detail-hero--overdue {
  background: linear-gradient(145deg, rgba(255, 71, 87, 0.12) 0%, rgba(255, 255, 255, 0.97) 58%, rgba(255, 245, 247, 0.98) 100%);
}

[data-theme="light"] .debt-detail-hero--paid {
  background: linear-gradient(145deg, rgba(46, 213, 115, 0.12) 0%, rgba(255, 255, 255, 0.97) 58%, rgba(243, 255, 250, 0.98) 100%);
}

.debt-detail-hero--overdue {
  border-color: rgba(255, 71, 87, 0.45);
  background: linear-gradient(145deg, rgba(255, 71, 87, 0.12) 0%, rgba(26, 26, 46, 0.95) 50%, rgba(15, 15, 26, 0.98) 100%);
}

.debt-detail-hero--paid {
  border-color: rgba(46, 213, 115, 0.35);
  background: linear-gradient(145deg, rgba(46, 213, 115, 0.12) 0%, rgba(26, 26, 46, 0.95) 50%, rgba(15, 15, 26, 0.98) 100%);
}

.debt-detail-hero__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.debt-detail-hero__name {
  font-size: clamp(20px, 3.5vw, 26px);
  font-weight: 800;
  color: var(--text-light);
  margin: 0 0 8px;
  line-height: 1.2;
}

.debt-detail-hero__meta {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.debt-detail-meta-dot {
  opacity: 0.45;
}

.debt-detail-meta-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text);
}

.debt-detail-meta-pill--mono {
  font-family: ui-monospace, monospace;
  font-size: 11px;
}

.debt-detail-badge-manual {
  font-size: 10px;
  vertical-align: middle;
}

.debt-detail-hero__status-wrap {
  flex-shrink: 0;
}

.debt-detail-status {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.debt-detail-status--open {
  background: rgba(255, 71, 87, 0.15);
  color: var(--danger);
  border: 1px solid rgba(255, 71, 87, 0.35);
}

.debt-detail-status--ok {
  background: rgba(46, 213, 115, 0.15);
  color: var(--success);
  border: 1px solid rgba(46, 213, 115, 0.35);
}

.debt-detail-alert {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 18px;
  line-height: 1.45;
}

.debt-detail-alert strong {
  color: var(--text-light);
  font-weight: 600;
}

.debt-detail-alert--danger {
  background: rgba(255, 71, 87, 0.1);
  border: 1px solid rgba(255, 71, 87, 0.25);
  color: var(--text-muted);
}

.debt-detail-alert--info {
  background: rgba(30, 144, 255, 0.1);
  border: 1px solid rgba(30, 144, 255, 0.22);
  color: var(--text-muted);
}

.debt-detail-alert--muted {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.debt-detail-amounts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 18px;
}

@media (min-width: 640px) {
  .debt-detail-amounts {
    grid-template-columns: 1.2fr 1fr;
    align-items: end;
  }
}

.debt-detail-amounts__label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.debt-detail-amounts__value {
  margin: 0;
  font-size: clamp(26px, 5vw, 34px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text-light);
  line-height: 1.1;
}

.debt-detail-amounts__value--due {
  color: var(--danger);
}

.debt-detail-amounts__side {
  margin: 0;
  padding: 14px 16px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.debt-detail-kv {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 13px;
}

.debt-detail-kv dt {
  margin: 0;
  color: var(--text-muted);
  font-weight: 500;
}

.debt-detail-kv dd {
  margin: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-light);
  text-align: right;
}

.debt-detail-kv--ok {
  color: var(--success) !important;
}

.debt-detail-progress__track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  border: 1px solid var(--border);
}

.debt-detail-progress__fill {
  height: 100%;
  border-radius: 999px;
  background: var(--gradient-success);
  min-width: 0;
  transition: width 0.35s ease;
}

.debt-detail-hero--overdue .debt-detail-progress__fill {
  background: linear-gradient(90deg, var(--warning), var(--danger));
}

.debt-detail-progress__legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.debt-detail-progress__remain {
  font-weight: 600;
  color: var(--text);
}

.debt-detail-progress__remain--done {
  color: var(--success);
}

.debt-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 900px) {
  .debt-detail-grid {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: start;
  }
}

.debt-detail-panel {
  padding: 0;
  overflow: hidden;
}

.debt-detail-panel__head {
  padding: 18px 20px 0;
}

.debt-detail-panel__title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-light);
  margin: 0 0 6px;
}

.debt-detail-panel__hint {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
}

.debt-pay-form {
  padding: 0 20px 20px;
}

.debt-field-help {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.debt-pay-form__input {
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.debt-quick-pay {
  margin-bottom: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.debt-quick-pay__label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.debt-quick-pay__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.debt-quick-btn {
  min-width: 64px;
  font-weight: 600;
}

.debt-pay-submit {
  padding: 14px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  margin-top: 4px;
}

.debt-detail-paid-celebrate {
  padding: 32px 20px 36px;
  text-align: center;
}

.debt-detail-paid-celebrate__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: rgba(46, 213, 115, 0.15);
  border: 2px solid rgba(46, 213, 115, 0.4);
  color: var(--success);
  font-size: 28px;
  font-weight: 800;
  line-height: 52px;
}

.debt-detail-paid-celebrate__title {
  font-size: 17px;
  font-weight: 700;
  color: var(--success);
  margin: 0 0 8px;
}

.debt-detail-paid-celebrate__text {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

.debt-detail-panel--aside .debt-detail-panel__head {
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
  margin-bottom: 0;
}

.debt-detail-note {
  margin: 16px 20px 0;
  padding: 12px 14px;
  background: rgba(108, 99, 255, 0.08);
  border: 1px solid rgba(108, 99, 255, 0.2);
  border-radius: var(--radius-sm);
}

.debt-detail-note__label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary-light);
  margin-bottom: 6px;
}

.debt-detail-note__text {
  margin: 0;
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
}

.debt-detail-dl {
  margin: 0;
  padding: 16px 20px;
}

.debt-detail-dl__row {
  display: grid;
  grid-template-columns: minmax(120px, 38%) 1fr;
  gap: 10px 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  align-items: start;
}

.debt-detail-dl__row:last-child {
  border-bottom: none;
}

.debt-detail-dl__row dt {
  margin: 0;
  color: var(--text-muted);
  font-weight: 500;
}

.debt-detail-dl__row dd {
  margin: 0;
  color: var(--text-light);
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}

.debt-detail-dl__num {
  font-variant-numeric: tabular-nums;
}

.debt-detail-dl__num--ok {
  color: var(--success);
}

.debt-detail-dl__num--due {
  color: var(--danger);
}

.debt-detail-dl__mono {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  font-weight: 500 !important;
}

.debt-detail-links {
  padding: 0 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.debt-detail-timeline {
  padding: 18px 20px 22px;
}

.debt-detail-timeline__title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-light);
  margin: 0 0 6px;
}

.debt-detail-timeline__sub {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
}

.debt-timeline-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.debt-timeline-item {
  position: relative;
  padding-left: 22px;
  margin-bottom: 0;
  border-left: 2px solid var(--border);
  padding-bottom: 18px;
  margin-left: 7px;
}

.debt-timeline-item:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}

.debt-timeline-item__marker {
  position: absolute;
  left: -9px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gradient-primary);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 2px rgba(108, 99, 255, 0.35);
}

.debt-timeline-item__body {
  padding-left: 12px;
}

.debt-timeline-item__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.debt-timeline-item__amount {
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text-light);
}

.debt-timeline-item__badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.debt-timeline-item__time {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
}

.debt-timeline-item__recorder {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.debt-timeline-item__note {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--text);
  font-style: italic;
  line-height: 1.4;
}

.debt-timeline-empty {
  list-style: none;
  text-align: center;
  padding: 28px 16px;
  color: var(--text-muted);
  font-size: 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

/* ===== NUMBER INPUT STYLING ===== */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { opacity: 0.5; }
