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

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --primary-bg: #eef2ff;
  --success: #10b981;
  --success-bg: #d1fae5;
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --info: #3b82f6;
  --info-bg: #dbeafe;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.05);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --sidebar-w: 260px;
  --topbar-h: 64px;
  --bottom-nav-h: 64px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #334155;
  --border: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --primary-bg: #312e81;
  --success-bg: #064e3b;
  --danger-bg: #7f1d1d;
  --warning-bg: #78350f;
  --info-bg: #1e3a8a;
}

html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }

#app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.3s;
}

.sidebar-header { padding: 20px 24px; border-bottom: 1px solid var(--border); }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  box-shadow: var(--shadow);
}
.logo-text {
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: var(--radius);
  color: var(--text-muted); font-weight: 500;
  margin-bottom: 2px; transition: all 0.15s;
  cursor: pointer; font-size: 14px;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--primary-bg); color: var(--primary); font-weight: 600; }
.nav-item .nav-icon { font-size: 18px; width: 20px; text-align: center; }
.nav-section {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  color: var(--text-subtle); padding: 12px 14px 6px; letter-spacing: 0.5px;
}

.sidebar-footer { padding: 16px; border-top: 1px solid var(--border); }
.user-info { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius); }
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.user-info-text { flex: 1; min-width: 0; }
.user-info-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info-role { font-size: 11px; color: var(--text-muted); text-transform: capitalize; }

.main-content { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px; gap: 16px;
  position: sticky; top: 0; z-index: 50;
}
.topbar-left { flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.select-arisan {
  padding: 8px 14px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface-2);
  color: var(--text); font-weight: 600; cursor: pointer;
}

.icon-btn {
  width: 40px; height: 40px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; position: relative; transition: background 0.15s;
}
.icon-btn:hover { background: var(--surface-2); }

.badge-dot {
  position: absolute; top: 8px; right: 8px;
  width: 8px; height: 8px; background: var(--danger);
  border-radius: 50%; border: 2px solid var(--surface);
}

.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 4px; border-radius: 100px;
  background: var(--surface-2); cursor: pointer;
}
.user-chip .user-avatar { width: 32px; height: 32px; font-size: 12px; }
.user-chip-name { font-weight: 600; font-size: 13px; }

.page-content { flex: 1; padding: 24px; max-width: 1400px; width: 100%; margin: 0 auto; }

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.page-title { font-size: 24px; font-weight: 700; letter-spacing: -0.5px; }
.page-subtitle { color: var(--text-muted); font-size: 14px; margin-top: 2px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius);
  font-weight: 600; font-size: 14px; transition: all 0.15s;
  border: 1px solid transparent; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-secondary { background: var(--surface-2); color: var(--text); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: var(--danger); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.card {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 20px; box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-size: 16px; font-weight: 700; }

.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  position: relative; overflow: hidden; transition: all 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-icon {
  width: 44px; height: 44px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 12px;
}
.stat-icon.primary { background: var(--primary-bg); color: var(--primary); }
.stat-icon.success { background: var(--success-bg); color: var(--success); }
.stat-icon.danger { background: var(--danger-bg); color: var(--danger); }
.stat-icon.warning { background: var(--warning-bg); color: var(--warning); }
.stat-icon.info { background: var(--info-bg); color: var(--info); }

.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-bottom: 4px; }
.stat-value { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; }

.table-wrapper { background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden; }
.table-toolbar { display: flex; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.search-input {
  flex: 1; min-width: 200px; padding: 8px 14px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2); color: var(--text);
}
.search-input:focus { outline: 2px solid var(--primary); outline-offset: -1px; }

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead { background: var(--surface-2); }
th {
  text-align: left; padding: 12px 16px; font-weight: 600;
  color: var(--text-muted); font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.5px; white-space: nowrap;
}
td { padding: 14px 16px; border-top: 1px solid var(--border); vertical-align: middle; }
tbody tr { transition: background 0.1s; }
tbody tr:hover { background: var(--surface-2); }

.member-cell { display: flex; align-items: center; gap: 10px; }
.member-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: white; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.member-name { font-weight: 600; }
.member-sub { font-size: 11px; color: var(--text-muted); }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 100px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-neutral { background: var(--surface-2); color: var(--text-muted); }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); transition: border 0.15s;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }
.form-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.checkbox { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px; animation: fadeIn 0.2s;
}
.modal {
  background: var(--surface); border-radius: var(--radius-xl);
  max-width: 500px; width: 100%; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg); animation: slideUp 0.25s;
}
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 18px; font-weight: 700; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }
.modal-close { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--text-muted); }
.modal-close:hover { background: var(--surface-2); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.toast-root { position: fixed; top: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--primary); border-radius: var(--radius);
  padding: 12px 16px; box-shadow: var(--shadow-lg);
  min-width: 280px; max-width: 400px; pointer-events: auto;
  animation: slideIn 0.3s; display: flex; align-items: center; gap: 10px;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast-icon { font-size: 20px; }
.toast-message { flex: 1; font-size: 13px; font-weight: 500; }
@keyframes slideIn { from { opacity: 0; transform: translateX(100%); } to { opacity: 1; transform: translateX(0); } }

.progress { height: 8px; background: var(--surface-2); border-radius: 100px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-light)); border-radius: 100px; transition: width 0.5s; }

.chart-container { position: relative; height: 280px; padding: 16px 0; }
.chart-bar-group { display: flex; align-items: flex-end; justify-content: space-around; height: 100%; gap: 8px; padding: 0 8px; }
.chart-bar-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: 60px; }
.chart-bar { width: 100%; background: linear-gradient(180deg, var(--primary-light), var(--primary)); border-radius: 6px 6px 0 0; min-height: 4px; transition: height 0.6s; }
.chart-bar-label { font-size: 11px; color: var(--text-muted); font-weight: 500; }

.draw-container { text-align: center; padding: 40px 20px; }
.draw-display {
  background: linear-gradient(135deg, var(--primary-bg), var(--surface));
  border: 2px solid var(--primary); border-radius: var(--radius-xl);
  padding: 48px 24px; margin: 32px auto; max-width: 500px; min-height: 200px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.draw-display.rolling .draw-name { animation: rollName 0.1s infinite; }
.draw-name { font-size: 48px; font-weight: 800; letter-spacing: -1px; margin: 16px 0; }
.draw-amount { font-size: 24px; font-weight: 700; color: var(--primary); }
.draw-period { color: var(--text-muted); font-size: 14px; }
@keyframes rollName { 0% { transform: translateY(-10px); opacity: 0.5; } 50% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(10px); opacity: 0.5; } }

.btn-draw {
  padding: 20px 48px; font-size: 20px; font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white; border-radius: 100px;
  box-shadow: 0 10px 30px -5px rgba(99, 102, 241, 0.5);
  transition: all 0.2s; margin-top: 24px;
}
.btn-draw:hover { transform: translateY(-2px); }

.timeline { position: relative; padding-left: 32px; }
.timeline::before { content: ''; position: absolute; left: 12px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 20px; }
.timeline-dot { position: absolute; left: -26px; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 3px solid var(--primary); }
.timeline-item.done .timeline-dot { background: var(--success); border-color: var(--success); }
.timeline-item.current .timeline-dot { background: var(--primary); border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-bg); }
.timeline-content { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; }
.timeline-title { font-weight: 600; }
.timeline-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 24px; }
.quick-action {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px; text-align: center;
  cursor: pointer; transition: all 0.2s;
}
.quick-action:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--primary); }
.quick-action-icon { font-size: 28px; margin-bottom: 8px; }
.quick-action-label { font-size: 13px; font-weight: 600; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state-icon { font-size: 64px; margin-bottom: 16px; opacity: 0.5; }
.empty-state-title { font-size: 18px; font-weight: 600; margin-bottom: 4px; color: var(--text); }

.loading { display: flex; align-items: center; justify-content: center; padding: 60px; }
.spinner { width: 40px; height: 40px; border: 3px solid var(--surface-2); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.auth-page { min-height: 100vh; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-container { width: 100%; max-width: 420px; }
.auth-card { background: var(--surface); border-radius: var(--radius-xl); padding: 40px 32px; box-shadow: var(--shadow-lg); }
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo .logo-icon { margin: 0 auto 12px; }
.auth-logo h1 { font-size: 28px; font-weight: 800; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.tagline { color: var(--text-muted); font-size: 14px; margin-top: 4px; }
.auth-footer { text-align: center; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-muted); }
.auth-footer code { background: var(--surface-2); padding: 2px 6px; border-radius: 4px; font-size: 11px; }

.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; height: var(--bottom-nav-h); background: var(--surface); border-top: 1px solid var(--border); display: flex; justify-content: space-around; align-items: center; z-index: 90; }
.bottom-nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px; color: var(--text-muted); font-size: 10px; font-weight: 600; }
.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-item .nav-icon { font-size: 22px; }

.fab { position: fixed; bottom: calc(var(--bottom-nav-h) + 16px); right: 16px; width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: white; font-size: 24px; box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.5); z-index: 80; display: flex; align-items: center; justify-content: center; }

.mobile-only { display: none !important; }
@media (max-width: 768px) {
  .mobile-only { display: flex !important; }
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .page-content { padding: 16px; padding-bottom: calc(var(--bottom-nav-h) + 24px); }
  .topbar { padding: 0 16px; }
  .page-title { font-size: 20px; }
  .stat-value { font-size: 18px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .draw-name { font-size: 32px; }
  .user-chip-name { display: none; }
}

.hidden { display: none !important; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.font-mono { font-family: 'SF Mono', Monaco, monospace; font-size: 12px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }
/* ============ TOMBOL KELUAR (TOPBAR) ============ */
.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius);
  background: var(--danger-bg);
  color: var(--danger);
  font-weight: 600;
  font-size: 13px;
  transition: all 0.15s;
  margin-left: 4px;
  border: 1px solid transparent;
}
.btn-logout:hover {
  background: var(--danger);
  color: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
@media (max-width: 768px) {
  .btn-logout { padding: 8px 10px; }
  .btn-logout .logout-text { display: none; }
}
/* ============ LOGO IMAGE ============ */
.logo-img { width: 40px; height: 40px; border-radius: var(--radius); object-fit: contain; }
.auth-logo-img { width: 92px; height: 92px; margin: 0 auto 12px; object-fit: contain; border-radius: 22px; box-shadow: var(--shadow-lg); }

/* ============ GLASSMORPHISM PREMIUM GOLD v5 ============ */
:root {
  --gold: #d4af37;
  --gold-light: #f5d78a;
  --gold-dark: #a8842c;
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-border-grad: linear-gradient(135deg, rgba(212,175,55,0.9), rgba(245,215,138,0.35) 45%, rgba(212,175,55,0.9));
}
[data-theme="dark"] {
  --glass-bg: rgba(18, 26, 45, 0.55);
}

/* ---- Latar berwarna (berbeda dari card) ---- */
body {
  background:
    radial-gradient(1100px 550px at 8% -10%, rgba(99,102,241,0.20), transparent 60%),
    radial-gradient(900px 480px at 92% 8%, rgba(212,175,55,0.18), transparent 60%),
    radial-gradient(1000px 600px at 50% 115%, rgba(16,185,129,0.14), transparent 60%),
    linear-gradient(160deg, #eef1ff 0%, #f6f3ff 50%, #eaf4ff 100%);
  background-attachment: fixed;
}
[data-theme="dark"] body {
  background:
    radial-gradient(1100px 550px at 8% -10%, rgba(99,102,241,0.30), transparent 60%),
    radial-gradient(900px 480px at 92% 8%, rgba(212,175,55,0.15), transparent 60%),
    radial-gradient(1000px 600px at 50% 115%, rgba(16,185,129,0.10), transparent 60%),
    linear-gradient(160deg, #0b1020 0%, #101a33 55%, #0d1526 100%);
  background-attachment: fixed;
}

/* ---- Card kaca + tepi emas premium ---- */
.card, .stat-card, .table-wrapper, .quick-action, .modal, .auth-card, .toast, .timeline-content {
  border: 1px solid transparent;
  background:
    linear-gradient(var(--glass-bg), var(--glass-bg)) padding-box,
    var(--glass-border-grad) border-box;
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  box-shadow: 0 8px 32px rgba(31,38,135,0.10), 0 0 16px rgba(212,175,55,0.10);
}
.stat-card:hover, .quick-action:hover, .card:hover {
  box-shadow: 0 12px 40px rgba(31,38,135,0.16), 0 0 24px rgba(212,175,55,0.25);
}

/* ---- Sidebar / Topbar / BottomNav kaca ---- */
.sidebar, .topbar, .bottom-nav {
  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}
[data-theme="dark"] .sidebar, [data-theme="dark"] .topbar, [data-theme="dark"] .bottom-nav {
  background: rgba(13,20,38,0.72);
}
.topbar { border-bottom: 1px solid rgba(212,175,55,0.35); }
.sidebar { border-right: 1px solid rgba(212,175,55,0.35); }
.bottom-nav { border-top: 1px solid rgba(212,175,55,0.35); }

/* ---- Aksen emas ---- */
.logo-text {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold-light) 50%, var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
thead { background: rgba(212,175,55,0.10); }
.member-avatar { box-shadow: 0 0 0 2px rgba(212,175,55,0.45); }
.progress-bar { background: linear-gradient(90deg, var(--gold-dark), var(--gold-light)); }
.stat-icon { box-shadow: inset 0 0 0 1px rgba(212,175,55,0.35); }

.btn-primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border: 1px solid rgba(212,175,55,0.6);
  box-shadow: 0 4px 14px rgba(79,70,229,0.35), 0 0 10px rgba(212,175,55,0.18);
}

/* ---- Input kaca ---- */
.form-control, .search-input, .select-arisan {
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(212,175,55,0.35);
}
[data-theme="dark"] .form-control, [data-theme="dark"] .search-input, [data-theme="dark"] .select-arisan {
  background: rgba(13,20,38,0.5);
}

/* ---- Halaman login mewah ---- */
.auth-page {
  background:
    radial-gradient(900px 500px at 15% 20%, rgba(212,175,55,0.25), transparent 60%),
    radial-gradient(900px 500px at 85% 80%, rgba(99,102,241,0.35), transparent 60%),
    linear-gradient(135deg, #312e81 0%, #4c1d95 50%, #1e3a8a 100%);
}

/* ---- Undian: display kaca emas ---- */
.draw-display {
  border: 2px solid transparent;
  background:
    linear-gradient(rgba(255,255,255,0.5), rgba(255,255,255,0.5)) padding-box,
    var(--glass-border-grad) border-box;
  backdrop-filter: blur(16px);
}
[data-theme="dark"] .draw-display {
  background:
    linear-gradient(rgba(18,26,45,0.5), rgba(18,26,45,0.5)) padding-box,
    var(--glass-border-grad) border-box;
}
.eligible-card {
  border: 1px solid transparent !important;
  background:
    linear-gradient(var(--glass-bg), var(--glass-bg)) padding-box,
    var(--glass-border-grad) border-box !important;
  backdrop-filter: blur(12px);
}
.eligible-card.highlight {
  transform: scale(1.05);
  box-shadow: 0 0 0 2px var(--gold), 0 8px 24px rgba(212,175,55,0.35) !important;
}

/* ---- Toast: pertahankan aksen kiri ---- */
.toast { border-left: 4px solid var(--gold); }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

/* ============ RESPONSIVE PRO v7 ============ */
html { -webkit-text-size-adjust: 100%; }
@media (min-width: 769px) and (max-width: 1024px) {
  :root { --sidebar-w: 220px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: stretch; }
}
@media (max-width: 480px) {
  .page-content { padding: 12px; }
  .page-title { font-size: 18px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 12px; }
  .stat-value { font-size: 15px; }
  .stat-label { font-size: 10px; }
  .stat-icon { width: 32px; height: 32px; font-size: 16px; margin-bottom: 6px; }
  .quick-actions { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .quick-action { padding: 10px 6px; }
  .quick-action-icon { font-size: 20px; margin-bottom: 4px; }
  .quick-action-label { font-size: 11px; }
  .btn { padding: 9px 14px; font-size: 13px; }
  .btn-lg { padding: 12px 18px; font-size: 15px; }
  .table-toolbar { flex-direction: column; align-items: stretch; }
  .table-toolbar .form-control, .table-toolbar .search-input { width: 100%; }
  table { font-size: 12px; }
  th, td { padding: 10px 8px; }
  .modal { max-width: 100%; border-radius: 16px; }
  .modal-overlay { padding: 10px; }
  .draw-name { font-size: 26px; }
  .draw-amount { font-size: 16px; }
  .btn-draw { padding: 14px 28px; font-size: 16px; }
  .topbar { padding: 0 10px; gap: 8px; }
  .select-arisan { max-width: 120px; font-size: 11px; padding: 6px 8px; }
  .user-chip-name { display: none; }
  .toast-root { left: 12px; right: 12px; top: 12px; }
  .toast { min-width: 0; width: 100%; max-width: 100%; }
  .timeline { padding-left: 26px; }
  .auth-card { padding: 28px 20px; }
}
@media (max-width: 360px) {
  .stats-grid { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
}
@media (max-height: 480px) and (orientation: landscape) {
  .bottom-nav { display: none !important; }
  .page-content { padding-bottom: 24px; }
  .fab { bottom: 16px; }
}
@media (min-width: 1600px) { .page-content { max-width: 1500px; } }
.table-scroll { -webkit-overflow-scrolling: touch; }
.bottom-nav { padding-bottom: env(safe-area-inset-bottom); }
.fab { bottom: calc(var(--bottom-nav-h) + 16px + env(safe-area-inset-bottom)); }

/* ============ SYNC BADGE ============ */
.sync-chip { padding: 4px 10px; border-radius: 100px; background: var(--warning-bg); color: var(--warning); font-size: 11px; font-weight: 700; animation: pulseSync 1.2s infinite; }
@keyframes pulseSync { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }

/* ============ GLASSMORPHISM BLUE v9 ============ */
:root {
  --gold: #38bdf8;
  --gold-light: #7dd3fc;
  --gold-dark: #0284c7;
  --glass-bg: rgba(255, 255, 255, 0.45);
  --glass-border-grad: linear-gradient(135deg, rgba(56,189,248,0.9), rgba(125,211,252,0.30) 45%, rgba(59,130,246,0.9));
}
[data-theme="dark"] {
  --glass-bg: rgba(10, 28, 58, 0.45);
}

/* ---- Latar gradasi biru ---- */
body {
  background:
    radial-gradient(1100px 550px at 8% -10%, rgba(59,130,246,0.18), transparent 60%),
    radial-gradient(900px 480px at 92% 8%, rgba(56,189,248,0.16), transparent 60%),
    radial-gradient(1000px 600px at 50% 115%, rgba(99,102,241,0.12), transparent 60%),
    linear-gradient(160deg, #eef6ff 0%, #f0f9ff 50%, #e8f1ff 100%);
  background-attachment: fixed;
}
[data-theme="dark"] body {
  background:
    radial-gradient(1100px 550px at 8% -10%, rgba(56,189,248,0.22), transparent 60%),
    radial-gradient(900px 480px at 92% 8%, rgba(59,130,246,0.18), transparent 60%),
    radial-gradient(1000px 600px at 50% 115%, rgba(14,165,233,0.10), transparent 60%),
    linear-gradient(160deg, #081120 0%, #0b1a33 55%, #081627 100%);
  background-attachment: fixed;
}

/* ---- Card kaca biru + tepi biru menyala ---- */
.card, .stat-card, .table-wrapper, .quick-action, .modal, .auth-card, .toast, .timeline-content {
  background:
    linear-gradient(var(--glass-bg), var(--glass-bg)) padding-box,
    var(--glass-border-grad) border-box;
  box-shadow: 0 8px 32px rgba(30,64,175,0.10), 0 0 16px rgba(56,189,248,0.12);
}
.stat-card:hover, .quick-action:hover, .card:hover {
  box-shadow: 0 12px 40px rgba(30,64,175,0.16), 0 0 24px rgba(56,189,248,0.28);
}

/* ---- Sidebar / Topbar / BottomNav kaca biru ---- */
.sidebar, .topbar, .bottom-nav { background: rgba(240,249,255,0.65); }
[data-theme="dark"] .sidebar, [data-theme="dark"] .topbar, [data-theme="dark"] .bottom-nav { background: rgba(8,17,32,0.72); }
.topbar { border-bottom: 1px solid rgba(56,189,248,0.35); }
.sidebar { border-right: 1px solid rgba(56,189,248,0.35); }
.bottom-nav { border-top: 1px solid rgba(56,189,248,0.35); }

/* ---- Aksen biru menggantikan emas ---- */
thead { background: rgba(56,189,248,0.10); }
.member-avatar { box-shadow: 0 0 0 2px rgba(56,189,248,0.45); }
.stat-icon { box-shadow: inset 0 0 0 1px rgba(56,189,248,0.35); }
.btn-primary {
  border: 1px solid rgba(56,189,248,0.6);
  box-shadow: 0 4px 14px rgba(79,70,229,0.35), 0 0 10px rgba(56,189,248,0.25);
}
.form-control, .search-input, .select-arisan { border: 1px solid rgba(56,189,248,0.35); }

/* ---- Halaman login biru ---- */
.auth-page {
  background:
    radial-gradient(900px 500px at 15% 20%, rgba(56,189,248,0.25), transparent 60%),
    radial-gradient(900px 500px at 85% 80%, rgba(59,130,246,0.35), transparent 60%),
    linear-gradient(135deg, #1e3a8a 0%, #0c4a6e 50%, #1e40af 100%);
}

/* ---- Undian: highlight biru ---- */
.eligible-card.highlight {
  box-shadow: 0 0 0 2px var(--gold), 0 8px 24px rgba(56,189,248,0.35) !important;
}

/* ============ SIDEBAR BACKDROP v10 ============ */
.sidebar-backdrop {
  position: fixed; inset: 0;
  background: rgba(2, 8, 23, 0.55);
  backdrop-filter: blur(2px);
  z-index: 99;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.sidebar-backdrop.show { opacity: 1; pointer-events: auto; }


/* ============ LISENSI TRIAL 7 HARI + UNLOCK FULL ============ */
.license-sidebar-card {
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.license-sidebar-status {
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 4px;
}
.license-sidebar-status.trial { color: var(--warning); }
.license-sidebar-status.active { color: var(--success); }
.license-sidebar-status.expired { color: var(--danger); }
.license-sidebar-detail {
  color: var(--text-muted);
  font-size: 11px;
  margin-bottom: 9px;
}
.license-sidebar-card .btn { font-size: 11px; padding: 7px 10px; }

.license-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.2s;
}
.license-modal {
  width: min(500px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.25s;
}
.license-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.license-kicker {
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .6px;
  font-size: 10px;
  font-weight: 800;
  margin-bottom: 3px;
}
.license-modal-header h2 {
  font-size: 20px;
  font-weight: 800;
}
.license-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 24px;
  color: var(--text-muted);
}
.license-close:hover { background: var(--surface-2); }
.license-modal-body { padding: 24px; }
.license-device-box,
.license-status-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.license-device-box {
  padding: 14px 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.license-device-box span,
.license-label {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}
.license-device-box strong {
  font-family: 'SF Mono', Monaco, monospace;
  letter-spacing: 2px;
  font-size: 18px;
}
.license-status-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
}
.license-status-box strong {
  display: block;
  margin-top: 3px;
  font-size: 13px;
}
.license-expired-notice {
  padding: 12px 14px;
  margin-bottom: 16px;
  border-radius: var(--radius);
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
}
.license-code-group { margin-bottom: 14px; }
.license-code-input {
  text-align: center;
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 22px !important;
  font-weight: 800;
  letter-spacing: 6px;
}
.license-message {
  min-height: 22px;
  margin-top: 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}
.license-message.error { color: var(--danger); }
.license-message.success { color: var(--success); }
.license-help {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
}
@media (max-width: 640px) {
  .license-modal-overlay { padding: 12px; }
  .license-modal-header { padding: 18px; }
  .license-modal-body { padding: 18px; }
  .license-status-box { grid-template-columns: 1fr; }
  .license-device-box { align-items: flex-start; flex-direction: column; }
  .license-code-input { font-size: 20px !important; }
}
