/* =========================================================
   PAYMENT GATEWAY PORTAL - MASTER OWNER THEME & AUTORDER LOGIN
   ========================================================= */

:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --muted: #64748b;
  --text: #0f172a;
  --line: #e2e8f0;
  --border: #e2e8f0;
  --primary: #0ea5e9;
  --primary-hover: #0284c7;
  --primary-dark: #0284c7;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --sidebar-bg: #ffffff;
  --input-bg: #f8fafc;
  --btn-bg: #f1f5f9;
  --btn-hover: #e2e8f0;
  --ok-text: #059669;
  --blue: #2563eb;
  --green: #10b981;
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --card: #1e293b;
  --muted: #94a3b8;
  --text: #f8fafc;
  --line: #334155;
  --border: #334155;
  --primary: #38bdf8;
  --primary-hover: #0ea5e9;
  --primary-dark: #0284c7;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --sidebar-bg: rgba(15, 23, 42, 0.98);
  --input-bg: #0f172a;
  --btn-bg: #1e293b;
  --btn-hover: #334155;
  --ok-text: #34d399;
  --blue: #38bdf8;
  --green: #10b981;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-hover); }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.error {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.12);
  border-left: 4px solid var(--danger);
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  margin-top: 12px;
  font-size: 0.875rem;
}
.hidden { display: none !important; }
.center { text-align: center; }
.row { display: flex; flex-wrap: wrap; align-items: center; }
.gap { gap: 10px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* =========================================================
   LOGIN & REGISTER (AutoOrder-(Telegram&Web) Portal Style)
   ========================================================= */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background-color: #0d1117;
  background-image: radial-gradient(circle at 50% 15%, rgba(14, 165, 233, 0.15), transparent 70%);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: #161b22;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 34px 28px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  position: relative;
}

.auth-card:hover {
  border-color: rgba(14, 165, 233, 0.35);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 25px rgba(14, 165, 233, 0.1);
}

.brand-center { text-align: center; margin-bottom: 24px; }
.login-icon-box {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(14, 165, 233, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 1.6rem;
  color: #38bdf8;
  box-shadow: 0 4px 15px rgba(14, 165, 233, 0.15);
}

.auth-heading {
  margin: 6px 0 4px;
  font-size: 1.35rem;
  font-weight: 700;
  color: #f0f6fc;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  color: #8b949e;
  font-size: 0.85rem;
  margin: 0;
}

.logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo-wrap.dark {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 16px;
  margin: 0 auto 12px;
  width: fit-content;
  max-width: 100%;
}
.brand-logo.auth {
  height: 54px;
  max-width: 220px;
  object-fit: contain;
}

/* Tabs Switcher */
.auth-tabs, .tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 22px;
  background: #0d1117;
  padding: 5px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.tab-btn {
  flex: 1;
  padding: 10px 14px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #8b949e;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.tab-btn:hover { color: #f0f6fc; }
.tab-btn.active {
  background: rgba(14, 165, 233, 0.18);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.4);
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(14, 165, 233, 0.15);
}

.auth-card label {
  display: block;
  margin: 14px 0 6px;
  color: #8b949e;
  font-size: 0.825rem;
  font-weight: 600;
}
.auth-card input, .auth-card textarea {
  width: 100%;
  border: 1px solid #30363d;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 0.95rem;
  background: #0d1117;
  color: #f0f6fc;
  transition: all 0.2s ease;
  outline: none;
}
.auth-card input:focus, .auth-card textarea:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

/* Password field */
.pw-field {
  position: relative;
  display: block;
}
.pw-field input {
  padding-right: 44px;
}
.pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 6px 10px;
  color: #8b949e;
  border-radius: 8px;
  transition: color 0.2s;
}
.pw-toggle:hover { color: #38bdf8; }
.pw-toggle.is-on { color: #38bdf8; }

/* Gradient button */
.btn-gradient {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: white;
  border: none;
  font-weight: 600;
  border-radius: 10px;
  padding: 12px 24px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(14, 165, 233, 0.35);
}
.btn-gradient:hover {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.45);
}
.btn.full, .btn-gradient.full { width: 100%; }

.alert {
  padding: 12px 16px;
  border-radius: 10px;
  margin-top: 14px;
  font-size: 0.875rem;
  line-height: 1.5;
}
.alert.warn {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fcd34d;
}
.alert.warn a { color: #38bdf8; font-weight: 600; }
.alert.ok {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}
.links a {
  color: #8b949e;
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.links a:hover { color: #38bdf8; }

/* =========================================================
   APP SHELL & SIDEBAR (Master Owner UI Style)
   ========================================================= */
.app-shell {
  display: flex;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
}

.sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  z-index: 50;
  flex-shrink: 0;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  position: relative;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.side-brand {
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: center;
  align-items: center;
}
.side-brand .brand-title {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.brand-logo.side {
  height: 50px;
  max-width: 210px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.menu-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 12px 0 6px 8px;
}

.nav-links, nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nav-item {
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.92rem;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  text-decoration: none;
  transition: all 0.2s ease;
  font-family: inherit;
}
.nav-item:hover {
  background: rgba(56, 189, 248, 0.1);
  color: var(--primary);
  transform: translateX(2px);
}
.nav-item.active {
  background: rgba(56, 189, 248, 0.15);
  color: var(--primary);
  font-weight: 700;
}

/* Nav Submenu */
.nav-feature { position: relative; }
.nav-lockable { justify-content: space-between; }
.nav-chevron { font-size: 0.8rem; transition: transform 0.2s ease; }
.nav-parent.open .nav-chevron { transform: rotate(90deg); }
.nav-sub {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-left: 14px;
  margin-top: 3px;
  margin-bottom: 6px;
  border-left: 2px solid var(--line);
  margin-left: 16px;
}
.nav-item.sub {
  padding: 7px 12px;
  font-size: 0.85rem;
  border-radius: 6px;
}

.nav-logout, .btn.danger.small {
  padding: 9px 14px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  font-family: inherit;
}
.nav-logout:hover, .btn.danger:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

/* =========================================================
   MAIN CONTENT & TOPBAR
   ========================================================= */
.main-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  position: relative;
}

.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(8px);
}
.top-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.top-left h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}
.menu-toggle {
  display: none;
  background: var(--btn-bg);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
}

.top-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.theme-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--btn-bg);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}
.theme-btn:hover {
  background: var(--btn-hover);
  color: var(--primary);
  transform: rotate(15deg);
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #0284c7);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.main {
  flex: 1;
  padding: 24px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* =========================================================
   CARDS & STATS (Signature Master Owner Look)
   ========================================================= */
.card, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  margin-bottom: 20px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cards-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}
.cards-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.stat-cards-row {
  margin-top: 14px;
  margin-bottom: 20px;
}

/* Stat Card with Master Owner Accent Border */
.card.stat, .panel .stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 2px 6px -2px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card.stat:hover, .panel .stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.1);
}

.card.stat .muted.small, .panel .stat span {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  display: block;
}
.card.stat h2, .panel .stat strong {
  margin: 6px 0 0 0;
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  display: block;
}

/* Banner Status */
.connected-hero {
  border-left: 4px solid var(--primary);
}
.connected-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.connected-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sp-badge {
  font-weight: 700;
  font-size: 0.95rem;
  padding: 4px 12px;
  border-radius: 8px;
  background: rgba(14, 165, 233, 0.12);
  color: var(--primary);
  border: 1px solid rgba(14, 165, 233, 0.25);
}
.sp-badge.binance {
  background: rgba(240, 185, 11, 0.15);
  color: #f0b90b;
  border-color: rgba(240, 185, 11, 0.35);
}
.btn.binance {
  background: #f0b90b;
  border-color: #f0b90b;
  color: #181a20;
  font-weight: 700;
}
.btn.binance:hover {
  background: #d9a507;
  color: #181a20;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge.ok {
  background: rgba(16, 185, 129, 0.12);
  color: var(--ok-text);
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.badge.bad {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  margin-top: 14px;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
th {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  background: var(--card);
}
td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
  color: var(--text);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(56, 189, 248, 0.03); }

/* Status Pills */
.pill, .status-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid transparent;
  line-height: 1.4;
}
.pill.ok, .status-pill.success, .status-pill.sukses, .status-pill.aktif, .status-pill.active, .status-pill.selesai, .status-pill.PAID {
  background: rgba(16, 185, 129, 0.12);
  color: var(--ok-text);
  border-color: rgba(16, 185, 129, 0.3);
}
.pill.bad, .status-pill.failed, .status-pill.gagal, .status-pill.tolak, .status-pill.ditolak, .status-pill.disabled, .status-pill.EXPIRED, .status-pill.FAILED {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.3);
}
.pill.warn, .status-pill.pending, .status-pill.proses, .status-pill.expired, .status-pill.menunggu, .status-pill.PENDING {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.3);
}

/* Forms & Inputs */
label {
  display: block;
  margin-top: 14px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}
input, textarea, select {
  width: 100%;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--text);
  font-size: 0.93rem;
  outline: none;
  font-family: inherit;
  transition: all 0.2s ease;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

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

/* Buttons */
.btn {
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--btn-bg);
  color: var(--text);
  font-weight: 500;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
}
.btn:hover {
  background: var(--btn-hover);
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }
.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}
.btn.primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}
.btn.danger {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--danger);
  color: var(--danger);
}
.btn.danger:hover {
  background: var(--danger);
  color: #fff;
}
.btn.orange {
  background: #f59e0b;
  border-color: #f59e0b;
  color: #fff;
  font-weight: 600;
}
.btn.orange:hover {
  background: #d97706;
  border-color: #d97706;
}
.btn.small, .btn.sm {
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: 6px;
}
.btn.lg {
  padding: 14px 28px;
  font-size: 1rem;
}

/* Key Box */
.key-box {
  background: var(--input-bg);
  border: 1px dashed var(--line);
  padding: 14px 16px;
  border-radius: 10px;
  font-family: monospace;
  font-size: 0.95rem;
  word-break: break-all;
  margin: 12px 0;
  color: var(--primary);
  font-weight: 600;
}

/* Feature grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.feature {
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
}
.feature b { display: block; color: var(--text); font-size: 0.92rem; margin-bottom: 4px; }
.feature span { font-size: 0.82rem; color: var(--muted); }

/* Code preview */
.code {
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: monospace;
  font-size: 0.88rem;
  color: var(--primary);
}

/* Countdown */
.countdown-wrap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 20px;
  margin-top: 16px;
}
.countdown-grid {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}
.cd-box {
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  text-align: center;
  min-width: 60px;
}
.cd-box strong { font-size: 1.3rem; display: block; color: var(--text); }
.cd-box span { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; }

/* Packages grid */
.pkg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.pkg-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.pkg-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.pkg-card.selected {
  border-color: var(--primary);
  background: rgba(56, 189, 248, 0.08);
  box-shadow: 0 0 0 2px var(--primary);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 20px;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 1000;
  animation: slideToast 0.3s ease;
}
@keyframes slideToast {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 999;
}
.modal-card {
  width: 100%;
  max-width: 480px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.icon-btn {
  border: none;
  background: transparent;
  font-size: 1.4rem;
  color: var(--muted);
  cursor: pointer;
}

/* Mobile Responsiveness */
.table-wrap {
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  .app-shell { flex-direction: column; height: auto; overflow: visible; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    transform: translateX(-100%);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.3);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 45;
  }
  body.sidebar-open .sidebar-backdrop { display: block; }
  .menu-toggle { display: block; }
  .main-wrap { height: auto; overflow: visible; }
  .main { padding: 16px; }
  .cards-4, .cards-2 { grid-template-columns: 1fr; }
}

@media (max-width: 500px) {
  #clock { display: none; }
  .topbar { padding: 12px 14px; }
  .auth-card { padding: 24px 18px; border-radius: 14px; }
  .auth-wrap { padding: 20px 12px; }
  .modal-card { padding: 18px 14px; }
  .main { padding: 12px 10px; }
  .card { padding: 16px 14px; border-radius: 12px; }
  .countdown-grid { flex-wrap: wrap; justify-content: center; }
  .pkg-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   ANALYTICS DASHBOARD (Modern Clean Dark Neon Style - Screenshot 2026-10-27 180558)
   ========================================================================== */

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

.analytics-title {
  font-size: 1.65rem;
  font-weight: 800;
  margin: 0;
  color: var(--text, #0f172a);
  letter-spacing: -0.02em;
}

.analytics-subtitle {
  margin: 4px 0 0;
  font-size: 0.88rem;
  color: var(--muted, #64748b);
}

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

.analytics-badge-gateway {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 242, 254, 0.08);
  color: var(--primary, #0ea5e9);
  border: 1px solid rgba(0, 242, 254, 0.35);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 700;
}

.analytics-btn-dark {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card, #ffffff);
  color: var(--text, #0f172a);
  border: 1px solid var(--border, #cbd5e1);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.analytics-btn-dark:hover {
  background: var(--btn-hover, #e2e8f0);
  color: var(--text, #0f172a);
  transform: translateY(-1px);
}

[data-theme="dark"] .analytics-btn-dark {
  background: #151e2e;
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.2);
}

[data-theme="dark"] .analytics-btn-dark:hover {
  background: #1e293b;
  color: #fff;
}

[data-theme="dark"] .analytics-badge-gateway {
  color: #00f2fe;
}

.analytics-btn-cyan {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #00f2fe;
  color: #090d16;
  border: none;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.35);
  transition: all 0.2s;
}

.analytics-btn-cyan:hover {
  background: #38bdf8;
  box-shadow: 0 0 25px rgba(0, 242, 254, 0.6);
  transform: translateY(-1px);
}

/* Analytics Hero Card */
.analytics-hero-card {
  background: radial-gradient(circle at 10% 20%, rgba(0, 242, 254, 0.05) 0%, rgba(15, 23, 42, 0.95) 70%);
  border: 1px solid rgba(0, 242, 254, 0.22);
  border-radius: 20px;
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
}

.analytics-hero-card::after {
  content: '';
  position: absolute;
  top: -60px;
  left: -60px;
  width: 140px;
  height: 140px;
  background: rgba(0, 242, 254, 0.12);
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
}

.hero-left {
  flex: 1;
  min-width: 250px;
}

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #00f2fe;
  margin-bottom: 8px;
}

.hero-balance {
  font-size: 2.5rem;
  font-weight: 900;
  color: #00f2fe;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 8px;
  text-shadow: 0 0 20px rgba(0, 242, 254, 0.25);
}

.hero-desc {
  font-size: 0.84rem;
  color: #94a3b8;
  max-width: 440px;
  line-height: 1.45;
}

.hero-mid {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 16px;
  border-left: 1px solid rgba(148, 163, 184, 0.15);
  border-right: 1px solid rgba(148, 163, 184, 0.15);
}

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

.hero-stat-label {
  font-size: 0.78rem;
  color: #94a3b8;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.hero-stat-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}

.hero-right {
  display: flex;
  align-items: center;
}

.hero-withdraw-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #00f2fe;
  color: #090d16;
  border: none;
  padding: 14px 24px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.4);
  transition: all 0.22s ease;
}

.hero-withdraw-btn:hover {
  background: #38bdf8;
  box-shadow: 0 0 30px rgba(0, 242, 254, 0.7);
  transform: translateY(-2px);
}

/* 5 Mini Cards Grid */
.analytics-grid-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.analytics-mini-card {
  background: var(--card, #ffffff);
  border: 1px solid var(--border, rgba(148, 163, 184, 0.15));
  border-radius: 16px;
  padding: 16px 18px;
  transition: all 0.2s ease;
  position: relative;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.analytics-mini-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 242, 254, 0.5);
}

.analytics-mini-card.active-card {
  border-color: var(--primary, #0ea5e9);
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.08) 0%, var(--card, #ffffff) 100%);
  box-shadow: 0 0 15px rgba(14, 165, 233, 0.12);
}

.mini-card-head {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted, #64748b);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mini-card-val {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text, #0f172a);
  letter-spacing: -0.02em;
}

.mini-card-val.highlight {
  color: var(--primary, #0ea5e9);
}

[data-theme="dark"] .analytics-mini-card {
  background: #111a2e;
  border-color: rgba(148, 163, 184, 0.12);
}

[data-theme="dark"] .analytics-mini-card.active-card {
  border-color: #00f2fe;
  background: linear-gradient(180deg, rgba(0, 242, 254, 0.08) 0%, #111a2e 100%);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.15);
}

[data-theme="dark"] .mini-card-val.highlight {
  color: #00f2fe;
}

@media (max-width: 1024px) {
  .analytics-grid-5 {
    grid-template-columns: repeat(3, 1fr);
  }
  .hero-mid {
    border: none;
    padding: 0;
  }
}

@media (max-width: 768px) {
  .analytics-grid-5 {
    grid-template-columns: repeat(2, 1fr);
  }
  .analytics-hero-card {
    padding: 20px 18px;
    flex-direction: column;
    align-items: flex-start;
  }
  .hero-mid {
    width: 100%;
    justify-content: space-between;
    padding: 12px 0;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  }
  .hero-right, .hero-withdraw-btn {
    width: 100%;
    justify-content: center;
  }
  .hero-balance {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .analytics-grid-5 {
    grid-template-columns: 1fr;
  }
}

/* Table Pagination */
.pagination-buttons {
  display: flex;
  gap: 4px;
  align-items: center;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.page-btn:hover:not(:disabled) {
  border-color: var(--primary, #00f2fe);
  color: var(--primary, #00f2fe);
}
.page-btn.active {
  background: var(--primary, #00f2fe);
  border-color: var(--primary, #00f2fe);
  color: #0b1120;
  font-weight: 700;
}
.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Topbar Notification Bell & Dropdown */
.notif-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: var(--text);
  border: 1px solid var(--border);
  background: var(--card);
  transition: all 0.2s ease;
}
.notif-btn:hover {
  background: var(--btn-hover);
  color: var(--primary);
}
.notif-badge-pill {
  animation: pulse-badge 2s infinite;
}
@keyframes pulse-badge {
  0% { transform: scale(1); }
  50% { transform: scale(1.18); }
  100% { transform: scale(1); }
}
.notif-dropdown-card {
  transition: all 0.2s ease;
}

/* Weekly Leaderboard (kartu kecil di bawah analitik) */
.leaderboard-card {
  padding: 18px 20px;
}
.leaderboard-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
.leaderboard-title {
  margin: 0;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.leaderboard-subtitle {
  margin: 4px 0 0;
}
.leaderboard-period {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.25);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.leaderboard-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.leaderboard-row {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--input-bg);
  transition: all 0.18s ease;
}
.leaderboard-row:hover {
  border-color: rgba(14, 165, 233, 0.35);
}
.leaderboard-row.is-me {
  border-color: var(--primary);
  background: rgba(14, 165, 233, 0.08);
}
.leaderboard-rank {
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}
.leaderboard-row.top-1 .leaderboard-rank,
.leaderboard-row.top-2 .leaderboard-rank,
.leaderboard-row.top-3 .leaderboard-rank {
  font-size: 1rem;
}
.leaderboard-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.leaderboard-you {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  background: rgba(14, 165, 233, 0.14);
}
.leaderboard-count {
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--text);
  white-space: nowrap;
}
.leaderboard-count small {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.7rem;
  margin-left: 3px;
}
.leaderboard-empty {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 14px 0;
}
.leaderboard-me {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 0.82rem;
  color: var(--muted);
}
.leaderboard-me strong {
  color: var(--text);
}
[data-theme="dark"] .leaderboard-period {
  color: #00f2fe;
  background: rgba(0, 242, 254, 0.08);
  border-color: rgba(0, 242, 254, 0.25);
}
[data-theme="dark"] .leaderboard-row {
  background: #0f172a;
}
[data-theme="dark"] .leaderboard-row.is-me {
  background: rgba(0, 242, 254, 0.07);
  border-color: #00f2fe;
}
[data-theme="dark"] .leaderboard-you {
  color: #00f2fe;
  background: rgba(0, 242, 254, 0.12);
}

/* =========================================================
   UI POLISH: live status, skeleton, payment toast, drawer
   ========================================================= */
.live-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
  flex-shrink: 0;
}
.live-status.is-online {
  color: #059669;
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
}
.live-status.is-online .live-dot {
  background: #10b981;
  animation: livePulse 2s infinite;
}
.live-status.is-connecting {
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
}
.live-status.is-connecting .live-dot {
  background: #f59e0b;
  animation: liveBlink 0.9s infinite;
}
.live-status.is-offline {
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
}
.live-status.is-offline .live-dot { background: #ef4444; }
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
@keyframes liveBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Skeleton loading */
.skeleton {
  position: relative;
  overflow: hidden;
  color: transparent !important;
  background: var(--input-bg);
  border-radius: 6px;
}
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: skeletonShimmer 1.3s infinite;
}
[data-theme="dark"] .skeleton::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
}
@keyframes skeletonShimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}
.skeleton-line { display: block; height: 12px; width: 100%; }
.skeleton-dot { display: block; width: 26px; height: 26px; border-radius: 50%; margin: 0 auto; }
.skeleton-pill { display: block; width: 54px; height: 14px; margin-left: auto; }
.tx-skeleton-row .skeleton-line { height: 15px; max-width: 460px; }
#tx-body.is-refreshing { opacity: 0.55; transition: opacity 0.2s ease; }

/* Balance highlight saat pembayaran masuk */
.balance-flash { animation: balanceFlash 1.5s ease; }
@keyframes balanceFlash {
  0% { color: #10b981; text-shadow: 0 0 22px rgba(16, 185, 129, 0.6); }
  100% { text-shadow: none; }
}

/* Payment toast (pojok kanan atas) */
.payment-toast-stack {
  position: fixed;
  top: 76px;
  right: 20px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(340px, calc(100vw - 32px));
  pointer-events: none;
}
.payment-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--card);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-left: 4px solid #10b981;
  border-radius: 14px;
  padding: 12px 12px 12px 14px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.25);
  animation: paymentToastIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.payment-toast.is-leaving {
  animation: paymentToastOut 0.2s ease forwards;
}
.payment-toast-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.payment-toast-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}
.payment-toast-body strong {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #059669;
}
.payment-toast-amount {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
}
.payment-toast-ref {
  font-size: 0.72rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.payment-toast-action {
  border: none;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.72rem;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
}
.payment-toast-action:hover { background: rgba(16, 185, 129, 0.2); }
.payment-toast-close {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
@keyframes paymentToastIn {
  from { transform: translateX(24px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes paymentToastOut {
  to { transform: translateX(24px); opacity: 0; }
}

/* Leaderboard controls */
.leaderboard-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.leaderboard-switch {
  display: inline-flex;
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px;
}
.leaderboard-switch-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.leaderboard-switch-btn.active {
  background: var(--card);
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}
[data-theme="dark"] .leaderboard-switch-btn.active {
  background: rgba(0, 242, 254, 0.12);
  color: #00f2fe;
}
.leaderboard-toggle {
  margin-top: 10px;
  width: 100%;
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--primary);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 7px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.18s ease;
}
.leaderboard-toggle:hover { background: rgba(14, 165, 233, 0.06); }
.leaderboard-updated {
  margin-top: 6px;
  font-size: 0.7rem;
  color: var(--muted);
  text-align: right;
}
.leaderboard-updated.is-error { color: #ef4444; }
.leaderboard-move { font-size: 0.68rem; margin-left: 4px; }
.leaderboard-row.rank-up .leaderboard-move { color: #10b981; }
.leaderboard-row.rank-down .leaderboard-move { color: #ef4444; }
.leaderboard-row.rank-moved { animation: rankFlash 1.4s ease; }
@keyframes rankFlash {
  0% { background: rgba(16, 185, 129, 0.18); }
  100% { background: var(--input-bg); }
}

/* Transaction detail drawer (desktop) / sheet (mobile) */
.tx-drawer {
  align-items: stretch;
  justify-content: flex-end;
  padding: 0;
}
.tx-drawer .modal-card {
  width: min(460px, 100%);
  max-width: 460px;
  height: 100dvh;
  max-height: 100dvh;
  overflow-y: auto;
  border-radius: 18px 0 0 18px;
  animation: txDrawerIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes txDrawerIn {
  from { transform: translateX(48px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@media (max-width: 720px) {
  .tx-drawer { align-items: flex-end; justify-content: center; padding: 10px; }
  .tx-drawer .modal-card {
    width: 100%;
    max-width: none;
    height: auto;
    max-height: 92dvh;
    border-radius: 18px;
    animation: txSheetIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .live-status { padding: 5px 7px; }
  .live-status #live-status-text { display: none; }
}
@keyframes txSheetIn {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton::after,
  .payment-toast,
  .payment-toast.is-leaving,
  .balance-flash,
  .live-status .live-dot,
  .leaderboard-row.rank-moved,
  .tx-drawer .modal-card {
    animation: none !important;
  }
  #tx-body.is-refreshing { transition: none; }
}
.skeleton { text-shadow: none !important; }
.leaderboard-row.rank-down.rank-moved { animation: rankFlashDown 1.4s ease; }
@keyframes rankFlashDown {
  0% { background: rgba(239, 68, 68, 0.16); }
  100% { background: var(--input-bg); }
}

/* =========================================================
   PARTICLE BACKGROUND (approved) + LIVING LOGO
   ========================================================= */
.portal-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  contain: strict;
}
.particle-field {
  position: absolute;
  inset: 0;
}
.particle {
  position: absolute;
  bottom: -14px;
  left: var(--x, 50%);
  width: var(--size, 2px);
  height: var(--size, 2px);
  border-radius: 50%;
  background: var(--pcolor, #7dd3fc);
  opacity: 0;
  box-shadow: 0 0 9px var(--pcolor, #7dd3fc), 0 0 22px rgba(56, 189, 248, 0.35);
  animation: particleRise var(--dur, 12s) linear infinite;
  animation-delay: var(--delay, 0s);
  will-change: transform, opacity;
}
[data-theme="light"] .particle {
  filter: brightness(0.55) saturate(1.25);
}
@keyframes particleRise {
  0% { transform: translate3d(0, 0, 0) scale(0.6); opacity: 0; }
  8% { opacity: var(--alpha, 0.6); }
  90% { opacity: var(--alpha, 0.6); }
  100% { transform: translate3d(var(--drift, 0px), calc(-100vh - 60px), 0) scale(1.1); opacity: 0; }
}
.cursor-glow {
  position: absolute;
  left: 0;
  top: 0;
  width: 560px;
  height: 560px;
  margin: -280px 0 0 -280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 242, 254, 0.18), rgba(99, 102, 241, 0.09) 44%, transparent 70%);
  filter: blur(28px);
  opacity: 0.8;
  transform: translate3d(50vw, 40vh, 0);
  transition: opacity 0.5s ease, transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
  pointer-events: none;
}
[data-theme="light"] .cursor-glow {
  background: radial-gradient(circle, rgba(14, 165, 233, 0.12), rgba(99, 102, 241, 0.07) 44%, transparent 70%);
}
@media (pointer: coarse) {
  .cursor-glow { display: none; }
}

body[data-bg="particles"] .app-shell,
body[data-bg="particles"] .auth-wrap {
  background: transparent;
}
body[data-bg="particles"] #view-auth,
body[data-bg="particles"] #view-app {
  position: relative;
  z-index: 1;
}
body[data-bg="particles"] .auth-card {
  background: rgba(22, 27, 34, 0.82);
  border-color: rgba(148, 163, 184, 0.16);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
}
[data-theme="dark"] body[data-bg="particles"] .topbar,
[data-theme="dark"] body[data-bg="particles"] .card,
[data-theme="dark"] body[data-bg="particles"] .panel,
[data-theme="dark"] body[data-bg="particles"] .modal-card {
  background: rgba(30, 41, 59, 0.76);
  border-color: rgba(148, 163, 184, 0.18);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
}
[data-theme="dark"] body[data-bg="particles"] .sidebar {
  background: rgba(15, 23, 42, 0.72);
  border-right-color: rgba(148, 163, 184, 0.18);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
}
[data-theme="light"] body[data-bg="particles"] .topbar,
[data-theme="light"] body[data-bg="particles"] .card,
[data-theme="light"] body[data-bg="particles"] .panel,
[data-theme="light"] body[data-bg="particles"] .modal-card {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(100, 116, 139, 0.18);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
}
[data-theme="light"] body[data-bg="particles"] .sidebar {
  background: rgba(255, 255, 255, 0.78);
  border-right-color: rgba(100, 116, 139, 0.2);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
}

.logo-live {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 6px;
  isolation: isolate;
  animation: logoFloat 5.2s ease-in-out infinite;
  transition: transform 0.3s ease;
}
.logo-live:hover {
  animation-play-state: paused;
  transform: translateY(-1px) scale(1.035);
}
.brand-center .logo-live {
  display: flex;
  margin: 0 auto 12px;
}
.logo-live .brand-logo {
  position: relative;
  z-index: 2;
}
.logo-aura {
  position: absolute;
  inset: -10% -5%;
  z-index: 0;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 30% 55%, rgba(34, 211, 238, 0.55), transparent 58%),
    radial-gradient(ellipse at 70% 45%, rgba(192, 132, 252, 0.5), transparent 60%),
    radial-gradient(ellipse at 50% 80%, rgba(59, 130, 246, 0.35), transparent 55%);
  filter: blur(16px);
  opacity: 0.55;
  pointer-events: none;
  animation: logoAura 4.4s ease-in-out infinite;
}
.logo-sheen {
  position: absolute;
  inset: 4px 6px;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(
    105deg,
    transparent 32%,
    rgba(255, 255, 255, 0.08) 42%,
    rgba(255, 255, 255, 0.72) 50%,
    rgba(255, 255, 255, 0.18) 56%,
    transparent 68%
  );
  background-size: 240% 100%;
  background-position: 160% 0;
  mix-blend-mode: screen;
  opacity: 0;
  -webkit-mask: url("/logoku.png") center / contain no-repeat;
  mask: url("/logoku.png") center / contain no-repeat;
  animation: logoSweep 5.6s ease-in-out infinite;
}
[data-theme="light"] .logo-aura {
  opacity: 0.3;
  filter: blur(20px);
}
[data-theme="light"] .logo-sheen {
  display: none;
}
@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
@keyframes logoAura {
  0%, 100% { opacity: 0.45; transform: scale(0.96); }
  50% { opacity: 0.8; transform: scale(1.06); }
}
@keyframes logoSweep {
  0%, 62% { background-position: 160% 0; opacity: 0; }
  66% { opacity: 0.85; }
  84% { background-position: -60% 0; opacity: 0; }
  100% { background-position: -60% 0; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .particle,
  .logo-live,
  .logo-aura,
  .logo-sheen {
    animation: none !important;
  }
  .logo-sheen,
  .cursor-glow {
    display: none;
  }
}
