/* ============================================================
   CATATAN TOKO — Premium Design System
   Font: Inter (Google Fonts)
   Theme: Deep Dark Navy + Indigo/Violet Accent
   ============================================================ */

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

/* ── CSS Custom Properties ─────────────────────────────── */
:root {
  /* Core Colors */
  --bg-base:        #0a0c14;
  --bg-surface:     #0f1220;
  --bg-card:        #141928;
  --bg-card-hover:  #1a2035;
  --bg-elevated:    #1e2640;
  --border:         rgba(99, 120, 255, 0.12);
  --border-strong:  rgba(99, 120, 255, 0.25);

  /* Accent */
  --accent:         #6366f1;
  --accent-light:   #818cf8;
  --accent-dim:     rgba(99, 102, 241, 0.15);
  --accent-glow:    rgba(99, 102, 241, 0.35);

  /* Status Colors */
  --success:        #22d3a0;
  --success-dim:    rgba(34, 211, 160, 0.12);
  --danger:         #f87171;
  --danger-dim:     rgba(248, 113, 113, 0.12);
  --warning:        #fbbf24;
  --warning-dim:    rgba(251, 191, 36, 0.12);
  --info:           #38bdf8;
  --info-dim:       rgba(56, 189, 248, 0.12);

  /* Text */
  --text-primary:   #e8eaf6;
  --text-secondary: #8892b0;
  --text-muted:     #4a5568;
  --text-inverse:   #0a0c14;

  /* Typography */
  --font:           'Inter', -apple-system, sans-serif;
  --font-mono:      'JetBrains Mono', 'Fira Code', monospace;

  /* Sizing */
  --radius-sm:      6px;
  --radius:         10px;
  --radius-lg:      16px;
  --radius-xl:      24px;
  --radius-full:    9999px;

  /* Shadows */
  --shadow-sm:      0 1px 3px rgba(0,0,0,0.4);
  --shadow:         0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg:      0 8px 32px rgba(0,0,0,0.5);
  --shadow-accent:  0 4px 20px var(--accent-glow);
  --shadow-glow:    0 0 40px rgba(99, 102, 241, 0.2);

  /* Transitions */
  --ease:           cubic-bezier(0.4, 0, 0.2, 1);
  --duration:       200ms;
  --duration-slow:  350ms;

  /* Glassmorphism */
  --glass-bg:       rgba(20, 25, 40, 0.7);
  --glass-border:   rgba(255, 255, 255, 0.06);
  --glass-blur:     blur(20px);
}

/* ── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 14px; }

body {
  font-family: var(--font);
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── Utility Classes ───────────────────────────────────── */
.hidden { display: none !important; }
.sr-only { position: absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.w-full { width: 100%; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }

/* ── Background Pattern ────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(99,102,241,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 90%, rgba(139,92,246,0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ── LOGIN PAGE ─────────────────────────────────────────── */
#login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  position: relative;
  z-index: 1;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  animation: fadeInUp 0.5s var(--ease) both;
}

.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 36px;
}

.login-logo .logo-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-accent);
}

.login-logo h1 {
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-logo p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 4px;
}

/* ── FORMS ─────────────────────────────────────────────── */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.input-wrapper {
  position: relative;
}

.input-wrapper .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
  transition: color var(--duration) var(--ease);
}

.form-control {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.9rem;
  padding: 12px 14px 12px 42px;
  outline: none;
  transition: all var(--duration) var(--ease);
}

.form-control:not(.no-icon) { padding-left: 42px; }
.form-control.no-icon { padding-left: 14px; }

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

.form-control:focus {
  border-color: var(--accent);
  background: rgba(99,102,241,0.06);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-control:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
  color: var(--accent-light);
}

select.form-control {
  appearance: none;
  cursor: pointer;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%238892b0' d='M5.29 7.29a1 1 0 011.42 0L10 10.58l3.29-3.29a1 1 0 011.42 1.42l-4 4a1 1 0 01-1.42 0l-4-4a1 1 0 010-1.42z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
}

select.form-control option {
  background: var(--bg-card);
  color: var(--text-primary);
}

.input-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  transition: color var(--duration) var(--ease);
}

.input-toggle:hover { color: var(--text-secondary); }

/* ── BUTTONS ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--duration) var(--ease);
}

.btn:hover::after { background: rgba(255,255,255,0.06); }
.btn:active::after { background: rgba(255,255,255,0.1); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:disabled::after { display: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #fff;
  box-shadow: var(--shadow-accent);
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 24px var(--accent-glow); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover { border-color: var(--border-strong); background: var(--bg-card-hover); }

.btn-success {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  box-shadow: 0 4px 16px rgba(16,185,129,0.3);
}

.btn-danger {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: #fff;
  box-shadow: 0 4px 16px rgba(239,68,68,0.3);
}

.btn-warning {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  color: #fff;
  box-shadow: 0 4px 16px rgba(245,158,11,0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover { color: var(--text-primary); background: var(--bg-card); }

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
}

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; width: 100%; }

/* ── SPINNER ───────────────────────────────────────────── */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ── ALERTS ────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  animation: fadeIn 0.2s var(--ease);
}

.alert-error { background: var(--danger-dim); border: 1px solid rgba(248,113,113,0.3); color: #fca5a5; }
.alert-success { background: var(--success-dim); border: 1px solid rgba(34,211,160,0.3); color: #6ee7b7; }
.alert-info { background: var(--info-dim); border: 1px solid rgba(56,189,248,0.3); color: #7dd3fc; }
.alert-warning { background: var(--warning-dim); border: 1px solid rgba(251,191,36,0.3); color: #fde68a; }

/* ── MAIN LAYOUT ───────────────────────────────────────── */
#app-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,12,20,0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.topbar-brand span {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
}

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

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 5px 12px 5px 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #fff;
  font-weight: 700;
}

/* Tabs Navigation */
.tabs-nav {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs-nav::-webkit-scrollbar { display: none; }

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all var(--duration) var(--ease);
  position: relative;
}

.tab-btn:hover { color: var(--text-secondary); }

.tab-btn.active {
  color: var(--accent-light);
  border-bottom-color: var(--accent);
}

.tab-badge {
  background: var(--accent-dim);
  color: var(--accent-light);
  border-radius: var(--radius-full);
  padding: 1px 7px;
  font-size: 0.7rem;
  font-weight: 700;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* ── CARDS ─────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color var(--duration) var(--ease);
}

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

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title .icon { color: var(--accent-light); }

/* ── STAT CARDS (Wallet Balances) ──────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  position: relative;
  overflow: hidden;
  transition: all var(--duration) var(--ease);
  cursor: default;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), #8b5cf6);
  opacity: 0;
  transition: opacity var(--duration) var(--ease);
}

.stat-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.stat-card:hover::before { opacity: 1; }

.stat-card.physical-wallet::before {
  background: linear-gradient(90deg, var(--success), #059669);
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.stat-code {
  display: inline-block;
  background: var(--accent-dim);
  color: var(--accent-light);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.65rem;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}

.stat-card.physical-wallet .stat-code {
  background: var(--success-dim);
  color: var(--success);
}

.stat-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.stat-value.negative { color: var(--danger); }
.stat-value.profit-positive { color: var(--success); }
.stat-value.profit-negative { color: var(--danger); }

/* Profit summary section */
.profit-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

@media (max-width: 640px) {
  .profit-stats {
    grid-template-columns: 1fr;
  }
}

.profit-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--duration) var(--ease);
}

.profit-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--success), #059669);
}

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

.profit-card .profit-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.profit-card .profit-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--success);
  font-variant-numeric: tabular-nums;
}

.profit-card .profit-value.negative { color: var(--danger); }

/* ── SECTION HEADER ────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}

.badge-accent { background: var(--accent-dim); color: var(--accent-light); }
.badge-success { background: var(--success-dim); color: var(--success); }
.badge-danger { background: var(--danger-dim); color: var(--danger); }
.badge-warning { background: var(--warning-dim); color: var(--warning); }

/* ── TRANSAKSI SPLIT LAYOUT (2-col on desktop) ─────────── */
.transaksi-split {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 24px;
}

@media (min-width: 960px) {
  .transaksi-split {
    flex-direction: row;
    align-items: flex-start;
  }
  .transaksi-split .tx-form-card {
    flex: 0 0 380px;
    margin-bottom: 0;
    position: sticky;
    top: 16px;
  }
  .transaksi-split .queue-area {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
  }
}

/* ── TRANSACTION FORM ──────────────────────────────────── */
.tx-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 0;
}

.mode-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  background: var(--bg-surface);
  padding: 4px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.mode-tab {
  flex: 1;
  padding: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 7px;
  transition: all var(--duration) var(--ease);
  text-align: center;
}

.mode-tab:hover { color: var(--text-secondary); background: var(--bg-card); }

.mode-tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.mode-tab.active.topup { background: linear-gradient(135deg, #059669, #10b981); box-shadow: 0 2px 8px rgba(16,185,129,0.3); }
.mode-tab.active.pengeluaran { background: linear-gradient(135deg, #dc2626, #ef4444); box-shadow: 0 2px 8px rgba(239,68,68,0.3); }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.form-col-wide { grid-column: span 2; }

/* Potong Fisik Toggle */
.toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}

.toggle-wrapper:hover { border-color: var(--border-strong); }

.toggle {
  width: 40px;
  height: 22px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  position: relative;
  transition: background var(--duration) var(--ease);
  flex-shrink: 0;
}

.toggle::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--text-muted);
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: all var(--duration) var(--ease);
}

.toggle.active { background: var(--accent); }
.toggle.active::after { left: 21px; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.3); }

.toggle-label { font-size: 0.85rem; color: var(--text-secondary); }

/* Date Row */
.date-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.date-toggle-btn {
  font-size: 0.78rem;
  padding: 5px 12px;
}

/* ── QUEUE TABLE ───────────────────────────────────────── */
.queue-area {
  margin-bottom: 0;
}

/* Queue reorder buttons */
.btn-reorder {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 4px;
  font-size: 0.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.reorder-btns {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.queue-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.data-table thead tr {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.data-table th {
  padding: 10px 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-align: left;
  white-space: nowrap;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr {
  background: var(--bg-card);
  transition: background var(--duration) var(--ease);
}

.data-table tbody tr:hover { background: var(--bg-card-hover); }

/* Row types */
.data-table tbody tr.row-topup td:first-child { border-left: 2px solid var(--success); }
.data-table tbody tr.row-pengeluaran td:first-child { border-left: 2px solid var(--danger); }
.data-table tbody tr.row-normal td:first-child { border-left: 2px solid var(--accent); }

/* Expand row */
.expand-row {
  background: var(--bg-surface) !important;
  cursor: pointer;
}

.expand-content {
  display: none;
  padding: 12px 16px;
  background: var(--bg-surface);
}

.expand-content.open { display: block; }

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.meta-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.meta-value.positive { color: var(--success); }
.meta-value.negative { color: var(--danger); }

/* ── PAGINATION ────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  flex-wrap: wrap;
  gap: 10px;
}

.pagination-info { font-size: 0.8rem; color: var(--text-muted); }

.pagination-btns {
  display: flex;
  gap: 4px;
}

.page-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-family: var(--font);
  transition: all var(--duration) var(--ease);
}

.page-btn:hover { border-color: var(--accent); color: var(--accent-light); }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── FILTER BAR ────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.filter-bar input,
.filter-bar select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-family: var(--font);
  font-size: 0.82rem;
  outline: none;
  transition: border-color var(--duration) var(--ease);
}

.filter-bar input:focus,
.filter-bar select:focus { border-color: var(--accent); }

.filter-bar select option { background: var(--bg-card); }

/* ── CHARTS ────────────────────────────────────────────── */
.chart-wrapper {
  position: relative;
  height: 260px;
}

/* ── CALCULATOR ─────────────────────────────────────────── */
.calc-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.calc-display {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  font-size: 1.8rem;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
  min-height: 64px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calc-display .calc-expr {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
  text-align: right;
  height: 16px;
  overflow: hidden;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.calc-btn {
  padding: 14px 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  text-align: center;
}

.calc-btn:hover { background: var(--bg-card-hover); border-color: var(--border-strong); }
.calc-btn:active { transform: scale(0.96); }
.calc-btn.op { color: var(--accent-light); background: var(--accent-dim); }
.calc-btn.eq { background: linear-gradient(135deg, var(--accent), #7c3aed); color: #fff; border: none; }
.calc-btn.clear { color: var(--danger); }
.calc-btn.span-2 { grid-column: span 2; }

/* ── 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;
  padding: 24px;
  animation: fadeIn 0.2s var(--ease);
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  animation: fadeInUp 0.25s var(--ease);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration) var(--ease);
}

.modal-close:hover { background: var(--bg-elevated); color: var(--text-primary); }

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* ── TOAST ─────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 76px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  max-width: 320px;
  animation: slideIn 0.3s var(--ease);
  position: relative;
}

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

.toast-exit {
  animation: slideOut 0.3s var(--ease) forwards;
}

/* ── EMPTY STATE ───────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.4; }
.empty-text { font-size: 0.9rem; margin-bottom: 8px; color: var(--text-secondary); }
.empty-sub { font-size: 0.8rem; }

/* ── LOADING SKELETON ──────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-card-hover) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ── WALLET MANAGER ────────────────────────────────────── */
.wallet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.wallet-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--duration) var(--ease);
}

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

.wallet-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wallet-code-badge {
  background: var(--accent-dim);
  color: var(--accent-light);
  border-radius: 4px;
  padding: 1px 8px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  display: inline-block;
}

.wallet-name { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); }
.wallet-balance { font-size: 1rem; font-weight: 700; color: var(--text-primary); margin-top: 4px; }
.wallet-actions { display: flex; gap: 6px; }

/* ── QRIS CALCULATOR ───────────────────────────────────── */
.qris-result {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 16px;
}

.qris-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

.qris-row:last-child { border-bottom: none; }
.qris-row-label { color: var(--text-secondary); }
.qris-row-value { font-weight: 700; color: var(--text-primary); }
.qris-row-value.highlight { color: var(--accent-light); font-size: 1.05rem; }

/* ── NUMBER FORMAT ─────────────────────────────────────── */
.amount {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.amount.positive { color: var(--success); }
.amount.negative { color: var(--danger); }

/* ── QUEUE CONTROLS ────────────────────────────────────── */
.queue-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ── LOADING OVERLAY ───────────────────────────────────── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,12,20,0.85);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ── ANIMATIONS ────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(20px); }
}

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

@keyframes shimmer {
  to { background-position: -200% 0; }
}

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .main-content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .tabs-nav { padding: 0 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-col-wide { grid-column: span 1; }
  .calc-container { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .login-card { padding: 32px 24px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .tabs-nav { gap: 0; }
  .tab-btn { padding: 12px 12px; font-size: 0.8rem; }
}
