/* ===================================================================
   WALLHACK DNS — Apple-Style Dark Design System
   Version 3.0 — Full Mobile Responsive
   =================================================================== */

/* Google Fonts được load async từ HTML — fallback system fonts để không block render */

/* ── CSS Variables ─────────────────────────────────────────────── */
:root {
  --bg-base:       #000000;
  --bg-surface:    #09090b;
  --bg-card:       #121212;
  --bg-card-hover: #1c1c1e;
  --bg-input:      #0a0a0a;

  --primary:       #ffffff;
  --primary-glow:  rgba(255, 255, 255, 0.15);
  --primary-dim:   rgba(255, 255, 255, 0.05);
  --secondary:     #a1a1aa;
  --accent:        #e4e4e7;

  --success:       #e4e4e7;
  --success-dim:   rgba(255, 255, 255, 0.06);
  --warning:       #a1a1aa;
  --warning-dim:   rgba(255, 255, 255, 0.06);
  --danger:        #ff453a;
  --danger-dim:    rgba(255, 69, 58, 0.12);

  --text-primary:    #ffffff;
  --text-secondary:  #a1a1aa;
  --text-muted:      #52525b;
  --text-disabled:   #27272a;

  --border:        rgba(255, 255, 255, 0.06);
  --border-active: rgba(255, 255, 255, 0.25);
  --border-card:   rgba(255, 255, 255, 0.06);

  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  18px;
  --radius-xl:  24px;

  --shadow-card: 0 4px 24px rgba(0,0,0,0.4), 0 0 0 1px rgba(0,212,255,0.06);
  --shadow-glow: 0 0 24px rgba(0,212,255,0.2);

  --sidebar-width: 240px;
  --header-h:      64px;
  --mobile-bar-h:  60px;

  --transition: 0.2s ease;
}

/* ── Theme Presets ─────────────────────────────────────────────── */
body.theme-apple-premium, html.theme-apple-premium {
  --bg-base:       #000000;
  --bg-surface:    #09090b;
  --bg-card:       rgba(22, 22, 26, 0.45);
  --bg-card-hover: rgba(255, 255, 255, 0.05);
  --bg-input:      #0a0a0a;
  --primary:       #ffffff;
  --primary-glow:  rgba(255, 255, 255, 0.15);
  --primary-dim:   rgba(255, 255, 255, 0.05);
  --secondary:     #a1a1aa;
  --accent:        #e4e4e7;
  --success:       #30d158;
  --border:        rgba(255, 255, 255, 0.08);
}
body.theme-cyberpunk, html.theme-cyberpunk {
  --bg-base:       #05000a;
  --bg-surface:    #0f011d;
  --bg-card:       #15002b;
  --bg-card-hover: #26004d;
  --bg-input:      #080014;
  --primary:       #00f2fe;
  --primary-glow:  rgba(0, 242, 254, 0.4);
  --primary-dim:   rgba(0, 242, 254, 0.1);
  --secondary:     #d946ef;
  --accent:        #a855f7;
  --success:       #10b981;
  --border:        rgba(0, 242, 254, 0.2);
}
body.theme-tesla-ui, html.theme-tesla-ui {
  --bg-base:       #0a0a0a;
  --bg-surface:    #111111;
  --bg-card:       #181818;
  --bg-card-hover: #222222;
  --bg-input:      #050505;
  --primary:       #e82127;
  --primary-glow:  rgba(232, 33, 39, 0.35);
  --primary-dim:   rgba(232, 33, 39, 0.1);
  --secondary:     #8e8e93;
  --accent:        #ae1f23;
  --success:       #e82127;
  --border:        rgba(232, 33, 39, 0.15);
}
body.theme-apple-liquid-glass, html.theme-apple-liquid-glass {
  --bg-base:       #080d1a;
  --bg-surface:    rgba(15, 23, 42, 0.6);
  --bg-card:       rgba(30, 41, 59, 0.4);
  --bg-card-hover: rgba(51, 65, 85, 0.5);
  --bg-input:      rgba(15, 23, 42, 0.8);
  --primary:       #0072ff;
  --primary-glow:  rgba(0, 114, 255, 0.3);
  --primary-dim:   rgba(0, 114, 255, 0.1);
  --secondary:     #38bdf8;
  --accent:        #0284c7;
  --success:       #06b6d4;
  --border:        rgba(0, 114, 255, 0.2);
}
body.theme-hacker-pro, html.theme-hacker-pro {
  --bg-base:       #010502;
  --bg-surface:    #020b04;
  --bg-card:       #031206;
  --bg-card-hover: #05220c;
  --bg-input:      #010703;
  --primary:       #39ff14;
  --primary-glow:  rgba(57, 255, 20, 0.4);
  --primary-dim:   rgba(57, 255, 20, 0.1);
  --secondary:     #00ff66;
  --accent:        #00cc44;
  --success:       #39ff14;
  --border:        rgba(57, 255, 20, 0.25);
}
body.theme-space-x, html.theme-space-x {
  --bg-base:       #020205;
  --bg-surface:    #070714;
  --bg-card:       #0c0d22;
  --bg-card-hover: #151636;
  --bg-input:      #03030a;
  --primary:       #8b5cf6;
  --primary-glow:  rgba(139, 92, 246, 0.4);
  --primary-dim:   rgba(139, 92, 246, 0.1);
  --secondary:     #a78bfa;
  --accent:        #6d28d9;
  --success:       #34d399;
  --border:        rgba(139, 92, 246, 0.2);
}
body.theme-luxury-gold, html.theme-luxury-gold {
  --bg-base:       #0a0907;
  --bg-surface:    #14120e;
  --bg-card:       #1e1b15;
  --bg-card-hover: #2d2920;
  --bg-input:      #070604;
  --primary:       #d4af37;
  --primary-glow:  rgba(212, 175, 55, 0.4);
  --primary-dim:   rgba(212, 175, 55, 0.1);
  --secondary:     #f3e5ab;
  --accent:        #aa7c11;
  --success:       #c5a059;
  --border:        rgba(212, 175, 55, 0.25);
}
body.theme-neon-future, html.theme-neon-future {
  --bg-base:       #000808;
  --bg-surface:    #001414;
  --bg-card:       #002020;
  --bg-card-hover: #003333;
  --bg-input:      #000505;
  --primary:       #00ffcc;
  --primary-glow:  rgba(0, 255, 204, 0.4);
  --primary-dim:   rgba(0, 255, 204, 0.1);
  --secondary:     #2dd4bf;
  --accent:        #0f766e;
  --success:       #14b8a6;
  --border:        rgba(0, 255, 204, 0.25);
}
body.theme-gaming-rgb, html.theme-gaming-rgb {
  --bg-base:       #080808;
  --bg-surface:    #101010;
  --bg-card:       #181818;
  --bg-card-hover: #282828;
  --bg-input:      #040404;
  --primary:       #f43f5e;
  --primary-glow:  rgba(244, 63, 94, 0.4);
  --primary-dim:   rgba(244, 63, 94, 0.1);
  --secondary:     #ec4899;
  --accent:        #d946ef;
  --success:       #10b981;
  --border:        rgba(244, 63, 94, 0.2);
}
body.theme-wallhack-ultra, html.theme-wallhack-ultra {
  --bg-base:       #02040a;
  --bg-surface:    #050a18;
  --bg-card:       #0a122c;
  --bg-card-hover: #142048;
  --bg-input:      #010307;
  --primary:       #38bdf8;
  --primary-glow:  rgba(56, 189, 248, 0.4);
  --primary-dim:   rgba(56, 189, 248, 0.1);
  --secondary:     #0ea5e9;
  --accent:        #0284c7;
  --success:       #10b981;
  --border:        rgba(56, 189, 248, 0.25);
}


/* ── Reset & Base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; display: block; }

input, textarea, select, button { font-family: inherit; font-size: inherit; }

/* ── Typography ───────────────────────────────────────────────── */
h1 { font-size: clamp(1.4rem, 4vw, 2rem); font-weight: 700; letter-spacing: -0.5px; }
h2 { font-size: clamp(1.1rem, 3vw, 1.4rem); font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }
.mono { font-family: 'JetBrains Mono', monospace; }
.text-primary   { color: var(--primary) !important; }
.text-success   { color: var(--success) !important; }
.text-danger    { color: var(--danger) !important; }
.text-warning   { color: var(--warning) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }

/* ── Typography Utilities ─────────────────────────────────────── */
.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.text-nowrap {
  white-space: nowrap;
}
.text-wrap {
  white-space: normal;
}
.word-break-all {
  word-break: break-all;
}
.font-semibold { font-weight: 600 !important; }
.font-bold { font-weight: 700 !important; }
.font-extrabold { font-weight: 800 !important; }
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;  
  overflow: hidden;
}

/* ── Layout ───────────────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ── Sidebar ──────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: transform var(--transition);
  overflow-y: auto;
}

.sidebar-brand {
  padding: 20px 20px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 8px;
}

.brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1rem; color: var(--bg-base);
  flex-shrink: 0;
}

.brand-name {
  font-weight: 700; font-size: 1rem;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.brand-status {
  font-size: 0.65rem;
  color: var(--success);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* MAC traffic lights */
.mac-dots {
  display: flex; gap: 6px;
  padding: 14px 16px 0;
}
.mac-dot {
  width: 11px; height: 11px;
  border-radius: 50%;
}
.mac-dot.red    { background: #ff5f57; }
.mac-dot.yellow { background: #ffbd2e; }
.mac-dot.green  { background: #28ca41; }

.sidebar-nav {
  flex: 1;
  padding: 8px 12px;
}

.nav-section-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 12px 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  margin-bottom: 2px;
  white-space: nowrap;
}

.nav-item span:not(.nav-icon):not(.nav-badge) {
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item:hover {
  background: var(--primary-dim);
  color: var(--primary);
}

.nav-item.active {
  background: var(--primary-dim);
  color: var(--primary);
  border: 1px solid var(--border-active);
}

.nav-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
}

.logout-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--danger);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
  background: none;
  width: 100%;
}

.logout-btn:hover {
  background: var(--danger-dim);
  border-color: var(--danger);
}

/* ── Main Content ─────────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--header-h);
  background: rgba(13, 21, 38, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-title { flex: 1; }
.topbar-title h1 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}
.topbar-title p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.topbar-user {
  display: flex; align-items: center; gap: 10px;
}

.user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem;
  color: var(--bg-base);
  flex-shrink: 0;
}

.user-info { display: flex; flex-direction: column; }
.user-name { font-size: 0.85rem; font-weight: 600; }
.user-role { font-size: 0.7rem; color: var(--text-muted); }

.hamburger-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px;
}

/* ── Page Body ────────────────────────────────────────────────── */
.page-body {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

/* ── Cards ────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.card-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-header h2, .card-header h3 {
  display: flex; align-items: center; gap: 8px;
}

.card-body { padding: 20px; }
.card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.15);
}

/* ── Stat Cards ───────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--transition);
}

.stat-card:hover {
  border-color: var(--border);
  transform: translateY(-2px);
}

.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-icon.cyan   { background: var(--primary-dim); }
.stat-icon.green  { background: var(--success-dim); }
.stat-icon.purple { background: rgba(99,102,241,0.12); }
.stat-icon.orange { background: var(--warning-dim); }

.stat-info { flex: 1; min-width: 0; }
.stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.stat-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn:disabled, .btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--bg-base);
  border-color: var(--primary);
}
.btn-primary:hover { background: #33ddff; box-shadow: var(--shadow-glow); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--border-active);
}
.btn-outline:hover { background: var(--primary-dim); }

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover { background: #f87171; }

.btn-ghost {
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
  border-color: var(--border-card);
}
.btn-ghost:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }

.btn-success {
  background: var(--success);
  color: white;
}

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 16px 28px; font-size: 1.05rem; min-height: 54px; touch-action: manipulation; }
.btn-block { width: 100%; display: block; text-align: center; }
.btn-icon { padding: 10px; width: 40px; height: 40px; }

/* ── Forms ────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all var(--transition);
  outline: none;
  -webkit-appearance: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-control::placeholder { color: var(--text-muted); }
.form-control:read-only { opacity: 0.7; cursor: not-allowed; }

.input-group {
  display: flex;
  gap: 8px;
}

.input-group .form-control { flex: 1; }

/* ── Tables ───────────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: 480px;
}

.data-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text-secondary);
  vertical-align: middle;
}

.data-table tr:hover td { background: rgba(0,212,255,0.03); }
.data-table tr:last-child td { border-bottom: none; }

/* ── Badges ───────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.badge-active  { background: var(--success-dim); color: var(--success); }
.badge-pending { background: var(--warning-dim); color: var(--warning); }
.badge-expired { background: rgba(255,255,255,0.05); color: var(--text-muted); }
.badge-locked  { background: var(--danger-dim); color: var(--danger); }
.badge-info    { background: var(--primary-dim); color: var(--primary); }

/* ── Alert / Info Boxes ───────────────────────────────────────── */
.alert {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}
.alert-info    { background: var(--primary-dim); border: 1px solid rgba(0,212,255,0.2); color: var(--primary); }
.alert-success { background: var(--success-dim); border: 1px solid rgba(16,185,129,0.2); color: var(--success); }
.alert-warning { background: var(--warning-dim); border: 1px solid rgba(245,158,11,0.2); color: var(--warning); }
.alert-danger  { background: var(--danger-dim); border: 1px solid rgba(239,68,68,0.2); color: var(--danger); }

/* ── Step Indicator ───────────────────────────────────────────── */
.steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 24px;
  overflow-x: auto;
}

.step {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.step.active { color: var(--primary); background: var(--primary-dim); }
.step.done   { color: var(--success); }

.step-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1.5px solid currentColor;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem;
  flex-shrink: 0;
}

.step-divider {
  height: 1px;
  flex: 1;
  background: var(--border);
  min-width: 20px;
}

/* ── Terminal / Loading Overlay ───────────────────────────────── */
.terminal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 11, 20, 0.97);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.terminal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.terminal-window {
  width: 100%;
  max-width: 560px;
  background: #0a0f1a;
  border: 1px solid rgba(0,212,255,0.2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 0 60px rgba(0,212,255,0.1);
}

.terminal-titlebar {
  background: #111825;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(0,212,255,0.1);
}

.t-dots { display: flex; gap: 6px; }
.t-dot { width: 10px; height: 10px; border-radius: 50%; }
.t-dot.r { background: #ff5f57; }
.t-dot.y { background: #ffbd2e; }
.t-dot.g { background: #28ca41; }
.t-title {
  flex: 1; text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.terminal-body {
  padding: 20px;
  min-height: 220px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: #00ff88;
  line-height: 1.8;
  overflow-y: auto;
  max-height: 320px;
}

.terminal-line { display: flex; align-items: flex-start; gap: 8px; }
.terminal-prompt { color: var(--primary); flex-shrink: 0; }
.terminal-cursor {
  display: inline-block;
  width: 8px; height: 15px;
  background: var(--primary);
  animation: blink 0.7s step-end infinite;
  vertical-align: middle;
  margin-left: 4px;
}
@keyframes blink { 50% { opacity: 0; } }

.terminal-status {
  padding: 10px 20px;
  border-top: 1px solid rgba(0,212,255,0.1);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot-pulse {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary);
  animation: pulse-dot 1s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

/* ── Mobile Overlay / Drawer ─────────────────────────────────── */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 190;
}

/* ── Bottom Nav (Mobile only) ────────────────────────────────── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--mobile-bar-h);
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  z-index: 200;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex: 1;
  padding: 8px 4px;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  border-radius: var(--radius-sm);
}

.bottom-nav-item.active {
  color: var(--primary);
}

.bottom-nav-item span:first-child { font-size: 1.2rem; }
.bottom-nav-item span:last-child  { font-size: 0.6rem; font-weight: 600; }

/* ── Login Page ───────────────────────────────────────────────── */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(0,212,255,0.08) 0%, transparent 70%),
    var(--bg-base);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(0,212,255,0.08);
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo {
  width: 60px; height: 60px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 900; color: var(--bg-base);
  margin: 0 auto 16px;
  box-shadow: 0 8px 24px var(--primary-glow);
}

.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.login-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.tab-switcher {
  display: flex;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 24px;
}

.tab-btn {
  flex: 1;
  padding: 8px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  transition: all var(--transition);
}

.tab-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: 0 1px 6px rgba(0,0,0,0.3);
}

/* ── Divider ──────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
  position: relative;
}

/* ── Pagination ───────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 16px 20px;
}

.page-btn {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); color: var(--bg-base); border-color: var(--primary); }

/* ── Notification Toast ───────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 0.85rem;
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-card);
  animation: slideIn 0.3s ease;
  pointer-events: all;
}
.toast.success { border-color: var(--success); }
.toast.error   { border-color: var(--danger); }
.toast.info    { border-color: var(--primary); }

@keyframes slideIn {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
  from { transform: translateX(0); opacity: 1; }
  to   { transform: translateX(120%); opacity: 0; }
}

/* ── QR Section ───────────────────────────────────────────────── */
.qr-container {
  text-align: center;
  padding: 20px;
}

.qr-image {
  width: 200px; height: 200px;
  border-radius: var(--radius-md);
  border: 3px solid var(--primary);
  margin: 0 auto;
  box-shadow: 0 0 20px var(--primary-glow);
}

/* ── UDID Box ─────────────────────────────────────────────────── */
.udid-box {
  background: var(--bg-input);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
}

.udid-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 3px; }
.udid-value { font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; color: var(--primary); word-break: break-all; }

/* ── Responsive Breakpoints ───────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-width: 260px; }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 40px rgba(0,0,0,0.5);
  }

  .sidebar-backdrop.open { display: block; }

  .main-content { margin-left: 0; }

  .hamburger-btn { display: flex; }

  .topbar-user .user-info { display: none; }

  .page-body {
    padding: 16px;
    padding-bottom: calc(var(--mobile-bar-h) + 30px);
  }

  .bottom-nav { display: flex; }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .stat-card { padding: 14px; }
  .stat-value { font-size: 1.3rem; }

  .login-card { padding: 28px 20px; }

  .data-table { font-size: 0.8rem; }
  .data-table th, .data-table td { padding: 10px 10px; }

  h1 { font-size: 1.2rem; }
}

@media (max-width: 420px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .login-card { padding: 24px 16px; }
  .btn { padding: 9px 16px; }
  .page-body { padding: 12px; padding-bottom: calc(var(--mobile-bar-h) + 80px + env(safe-area-inset-bottom)) !important; }
}

/* ── Utility Classes ──────────────────────────────────────────── */
.flex   { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2  { gap: 8px; }
.gap-3  { gap: 12px; }
.gap-4  { gap: 16px; }
.mt-2   { margin-top: 8px; }
.mt-3   { margin-top: 12px; }
.mt-4   { margin-top: 16px; }
.mt-6   { margin-top: 24px; }
.mb-2   { margin-bottom: 8px; }
.mb-3   { margin-bottom: 12px; }
.mb-4   { margin-bottom: 16px; }
.mb-6   { margin-bottom: 24px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.flex-1 { flex: 1; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-disabled); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }


/* Responsive Admin */
@media (max-width: 900px) {
  .app-shell { position: relative; }
  .sidebar {
    position: absolute; top: 0; bottom: 0; left: 0;
    transform: translateX(-100%);
  }
  .sidebar.show { transform: translateX(0); box-shadow: 10px 0 30px rgba(0,0,0,0.5); }
  .sidebar-backdrop.show { opacity: 1; pointer-events: auto; }
  .hamburger-btn { display: block; margin-right: 12px; }
  .topbar-title { display: flex; align-items: center; flex-direction: row; gap: 10px;}
  .topbar-title p { display: none; }
  .user-info { display: none; }
  .page-body { padding: 16px; }
}

@media (max-width: 500px) {
  .stats-grid { grid-template-columns: 1fr; gap: 12px; }
}

/* ════════════════════════════════════════════════════════════════
   ══ LOADING OVERLAY & 5 PREMIUM STYLES ══
   ════════════════════════════════════════════════════════════════ */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: #06060c;
  z-index: 9999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), visibility 0.4s;
}

.loading-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* --- Mẫu 1: Luxury Walnut Glow --- */
.luxury-glow-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.luxury-glow-circle {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 3px solid rgba(245, 158, 11, 0.1);
  border-top-color: #f59e0b;
  border-right-color: #f59e0b;
  position: relative;
  animation: spin 1s linear infinite;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.15), inset 0 0 15px rgba(245, 158, 11, 0.05);
}
.luxury-glow-circle::after {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 2px solid rgba(217, 119, 6, 0.15);
  border-bottom-color: #d97706;
  border-left-color: #d97706;
  animation: spin-reverse 1.5s linear infinite;
}
.luxury-glow-inner {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  color: #f59e0b;
  text-shadow: 0 0 12px rgba(245, 158, 11, 0.5);
  animation: pulse-glow 1.5s ease-in-out infinite alternate;
}
.luxury-glow-text {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 3px;
  color: #f59e0b;
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
}

/* --- Mẫu 2: Cyberpunk Glitch --- */
.cyber-glitch-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2.2rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: 4px;
  position: relative;
  text-shadow: 0.05em 0 0 #00fffc, -0.03em -0.04em 0 #fc00ff, 0.025em 0.04em 0 #fffc00;
  animation: glitch-anim 1s infinite;
}
.cyber-glitch-text::before, .cyber-glitch-text::after {
  content: 'WALLHACK DNS';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
}
.cyber-glitch-text::before {
  animation: glitch-anim-2 0.75s infinite;
  clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
  text-shadow: -0.05em -0.025em 0 #00fffc, 0.025em 0.025em 0 #fc00ff;
  opacity: 0.8;
}
.cyber-glitch-text::after {
  animation: glitch-anim-2 0.5s infinite;
  clip-path: polygon(0 67%, 100% 67%, 100% 100%, 0 100%);
  text-shadow: 0.025em 0.05em 0 #00fffc, -0.05em -0.05em 0 #fc00ff;
  opacity: 0.8;
}
.cyber-subtitle {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: #00fffc;
  letter-spacing: 5px;
  margin-top: 10px;
  text-shadow: 0 0 5px rgba(0,255,252,0.5);
  animation: blink 1s step-end infinite;
}

/* --- Mẫu 3: Minimalist Skeleton --- */
.skeleton-loader-container {
  width: 100%;
  max-width: 400px;
  padding: 24px;
  background: #0d0d15;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.skeleton-line {
  height: 12px;
  width: 100%;
  background: linear-gradient(90deg, #161622 25%, #232335 50%, #161622 75%);
  background-size: 200% 100%;
  border-radius: 6px;
  animation: shimmer-swipe 1.5s infinite linear;
}
.skeleton-line.header {
  height: 24px;
  width: 60%;
  margin-bottom: 8px;
}
.skeleton-line.short {
  width: 40%;
}
.skeleton-flex-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.skeleton-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(90deg, #161622 25%, #232335 50%, #161622 75%);
  background-size: 200% 100%;
  animation: shimmer-swipe 1.5s infinite linear;
  flex-shrink: 0;
}
.skeleton-text {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  letter-spacing: 1px;
}

/* --- Mẫu 4: Quantum Particle Loop --- */
.quantum-wrapper {
  position: relative;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.quantum-nucleus {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #ef4444, #6366f1);
  border-radius: 50%;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.6);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  font-family: 'Inter', sans-serif;
}
.quantum-orbit {
  position: absolute;
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 50%;
}
.quantum-orbit.o1 {
  width: 80px; height: 32px;
  transform: rotate(45deg);
}
.quantum-orbit.o2 {
  width: 80px; height: 32px;
  transform: rotate(-45deg);
}
.quantum-orbit.o3 {
  width: 80px; height: 80px;
  border: 1px dashed rgba(239, 68, 68, 0.25);
  animation: spin 6s linear infinite;
}
.quantum-electron {
  position: absolute;
  width: 8px; height: 8px;
  background: #6366f1;
  border-radius: 50%;
  box-shadow: 0 0 8px #6366f1;
}
.quantum-orbit.o1 .quantum-electron {
  animation: orbit-1 2s linear infinite;
}
.quantum-orbit.o2 .quantum-electron {
  animation: orbit-2 2s linear infinite;
}
.quantum-text {
  margin-top: 16px;
  font-size: 0.8rem;
  color: #94a3b8;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 2px;
}

/* --- Mẫu 5: Dynamic Progress Bar --- */
.progress-bar-overlay {
  background: rgba(6, 6, 12, 0.95);
}
.progress-bar-container {
  width: 250px;
  height: 6px;
  background: rgba(255,255,255,0.05);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6366f1, #d946ef, #ef4444);
  border-radius: 3px;
  box-shadow: 0 0 10px rgba(217, 70, 239, 0.5);
  transition: width 0.3s ease;
}
.progress-bar-text {
  margin-top: 12px;
  font-size: 0.8rem;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
}

/* --- KEYFRAMES --- */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes spin-reverse {
  0% { transform: rotate(360deg); }
  100% { transform: rotate(0deg); }
}
@keyframes pulse-glow {
  0% { opacity: 0.7; text-shadow: 0 0 8px rgba(245,158,11,0.3); }
  100% { opacity: 1; text-shadow: 0 0 18px rgba(245,158,11,0.7); }
}
@keyframes blink {
  50% { opacity: 0; }
}
@keyframes shimmer-swipe {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@keyframes orbit-1 {
  0% { transform: translate(-50%, -50%) rotate(0deg) translate(40px) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg) translate(40px) rotate(-360deg); }
}
@keyframes orbit-2 {
  0% { transform: translate(-50%, -50%) rotate(360deg) translate(40px) rotate(-360deg); }
  100% { transform: translate(-50%, -50%) rotate(0deg) translate(40px) rotate(0deg); }
}
@keyframes glitch-anim {
  0% { text-shadow: 0.05em 0 0 #00fffc, -0.03em -0.04em 0 #fc00ff, 0.025em 0.04em 0 #fffc00; }
  15% { text-shadow: 0.05em 0 0 #00fffc, -0.03em -0.04em 0 #fc00ff, 0.025em 0.04em 0 #fffc00; }
  16% { text-shadow: -0.05em -0.025em 0 #00fffc, 0.025em 0.025em 0 #fc00ff, -0.05em -0.05em 0 #fffc00; }
  49% { text-shadow: -0.05em -0.025em 0 #00fffc, 0.025em 0.025em 0 #fc00ff, -0.05em -0.05em 0 #fffc00; }
  50% { text-shadow: 0.025em 0.05em 0 #00fffc, -0.05em -0.05em 0 #fc00ff, 0.025em -0.05em 0 #fffc00; }
  99% { text-shadow: 0.025em 0.05em 0 #00fffc, -0.05em -0.05em 0 #fc00ff, 0.025em -0.05em 0 #fffc00; }
  100% { text-shadow: -0.025em 0 0 #00fffc, -0.025em -0.025em 0 #fc00ff, -0.025em -0.05em 0 #fffc00; }
}
@keyframes glitch-anim-2 {
  0% { transform: translate(0); }
  20% { transform: translate(-2px, 2px); }
  40% { transform: translate(-2px, -2px); }
  60% { transform: translate(2px, 2px); }
  80% { transform: translate(2px, -2px); }
  100% { transform: translate(0); }
}

/* Enforce bottom padding on mobile for layout compatibility with bottom fixed navigation bar */
@media (max-width: 900px) {
  .page-body {
    padding: 16px;
    padding-bottom: calc(var(--mobile-bar-h) + 24px + env(safe-area-inset-bottom)) !important;
  }
}

/* ===================================================================
   MOBILE RESPONSIVE & MOBILE SAFARI PERFORMANCE OPTIMIZATIONS
   =================================================================== */

/* Hardware GPU Acceleration & Smooth Scrolling */
.app-shell, .main-content, .page-body, .sidebar, .table-wrapper, .modal {
  -webkit-overflow-scrolling: touch; /* Safari physics scroll */
}

/* Auto-Performance Mode: Toggled via JavaScript when low device specs or manual trigger */
.low-perf *, .low-perf {
  animation: none !important;
  transition: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

/* Compact Vietnam Clock Layout and styling */
.topbar-clock {
  will-change: transform;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  :root {
    --header-h: 56px;
    --radius-lg: 10px;
    --radius-xl: 14px;
  }

  .topbar {
    padding: 0 10px !important; /* Compact padding matching page margin */
    gap: 6px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Compact topbar title - Enforce single line and perfect alignment */
  .topbar-title {
    flex: 1 !important;
    min-width: 0 !important;
    max-width: 110px !important; /* Prevent title from pushing clock/avatar offscreen */
    display: block !important; /* Force block to prevent flex wrap issues on iOS */
  }
  .topbar-title h1, #pageTitle {
    font-size: 0.82rem !important; /* Extremely neat, professional and native size */
    font-weight: 800 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important; /* Fits within the parent topbar-title container */
    display: block !important;
    min-width: 0 !important;
    letter-spacing: -0.2px;
    background: linear-gradient(90deg, #fff, var(--text-secondary)) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    margin: 0 !important;
  }
  .topbar-title p {
    display: none !important; /* Hide sub-title on mobile header to look clean */
  }

  /* Glow Hamburger button */
  .hamburger-btn {
    font-size: 1.15rem !important;
    padding: 6px !important;
    width: 32px;
    height: 32px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: rgba(0, 242, 254, 0.04) !important;
    border: 1px solid rgba(0, 242, 254, 0.15) !important;
    border-radius: 8px;
    color: var(--primary) !important;
    box-shadow: 0 0 8px rgba(0, 242, 254, 0.1);
    transition: all 0.2s ease;
  }
  .hamburger-btn:active {
    background: rgba(0, 242, 254, 0.15) !important;
    box-shadow: 0 0 14px rgba(0, 242, 254, 0.25);
    transform: scale(0.93);
  }

  .topbar-clock {
    padding: 4px 8px !important;
    font-size: 0.64rem !important;
    font-weight: 700 !important;
    background: rgba(0, 242, 254, 0.05) !important;
    border: 1px solid rgba(0, 242, 254, 0.22) !important;
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.1) !important;
    border-radius: 8px !important;
    margin-right: 4px !important;
    letter-spacing: 0.2px;
    margin-left: auto !important;
    flex-shrink: 0 !important;
  }
  .clock-date {
    display: inline !important;
  }

  /* Compact User Avatar */
  .topbar-user {
    gap: 4px !important;
  }
  .user-avatar {
    width: 28px !important;
    height: 28px !important;
    font-size: 0.72rem !important;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.05);
  }

  /* Spacing improvements to cards on mobile screen */
  .main-content {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
  .page-body {
    padding: 12px 10px 92px 10px !important; /* Compact lề và chừa khoảng trống cho thanh Bottom Nav nổi */
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  .stats-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    margin-bottom: 16px !important;
  }

  .stat-card {
    padding: 14px 16px !important;
    gap: 16px !important;
    border-radius: 16px !important; /* Soft premium iOS rounding */
    border: 1px solid rgba(255, 255, 255, 0.07) !important; /* Fine soft border */
    background: linear-gradient(135deg, rgba(20, 24, 38, 0.78) 0%, rgba(10, 12, 22, 0.95) 100%) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    display: flex !important;
    align-items: center !important;
  }

  .stat-icon {
    width: 40px !important;
    height: 40px !important;
    font-size: 1.15rem !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
  }
  .stat-icon.cyan   { background: rgba(0, 242, 254, 0.1) !important; border: 1px solid rgba(0, 242, 254, 0.2) !important; color: #00f2fe !important; }
  .stat-icon.green  { background: rgba(16, 185, 129, 0.1) !important; border: 1px solid rgba(16, 185, 129, 0.2) !important; color: #10b981 !important; }
  .stat-icon.purple { background: rgba(124, 58, 237, 0.1) !important; border: 1px solid rgba(124, 58, 237, 0.2) !important; color: #8b5cf6 !important; }
  .stat-icon.orange { background: rgba(245, 158, 11, 0.1) !important; border: 1px solid rgba(245, 158, 11, 0.2) !important; color: #f59e0b !important; }

  .stat-value {
    font-size: 1.35rem !important;
    font-weight: 900 !important;
    color: #ffffff !important;
    letter-spacing: -0.5px;
    margin-top: 2px !important;
  }
  .stat-label {
    font-size: 0.65rem !important;
    color: var(--text-secondary) !important;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 700 !important;
    margin-bottom: 2px !important;
  }
  .stat-sub {
    font-size: 0.7rem !important;
    color: var(--text-muted) !important;
    margin-top: 2px !important;
  }
  .stat-sub .btn {
    padding: 4px 8px !important;
    font-size: 0.65rem !important;
    margin-top: 6px !important;
    min-height: 24px !important;
    border-radius: 6px !important;
  }

  .card {
    background: linear-gradient(135deg, rgba(20, 24, 38, 0.75) 0%, rgba(10, 12, 22, 0.9) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 16px !important;
    margin-bottom: 16px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
  }
  .card-header {
    padding: 12px 16px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
  }
  .card-header h2, .card-header h3 {
    font-size: 0.82rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.5px;
    color: #ffffff !important;
    text-transform: uppercase;
  }
  .card-body {
    padding: 16px !important;
  }

  /* Quick actions grid stack vertically on mobile */
  .quick-actions-grid {
    flex-direction: column !important;
    gap: 8px !important;
  }
  .quick-actions-grid .btn {
    width: 100% !important;
    min-height: 40px !important;
    justify-content: center !important;
    font-size: 0.8rem !important;
    border-radius: 10px !important;
  }

  /* Support actions grid stack vertically on mobile */
  .support-actions-grid {
    flex-direction: column !important;
    gap: 8px !important;
  }
  .support-actions-grid a {
    width: 100% !important;
    min-height: 40px !important;
    justify-content: center !important;
    font-size: 0.8rem !important;
    padding: 10px !important;
    box-sizing: border-box !important;
    border-radius: 10px !important;
  }

  /* Modern table scrolling & prevention of text squeeze */
  .data-table th, .data-table td {
    white-space: nowrap !important;
  }

  /* Compact Packages Cards on mobile */
  #packageCards {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
  }
  .pkg-card {
    padding: 10px 4px !important;
    min-height: 80px !important;
    border-radius: 8px !important;
  }
  .pkg-card div:first-child {
    font-size: 1.2rem !important;
  }
  .pkg-card div:nth-child(2) {
    font-size: 0.7rem !important;
    margin: 2px 0 !important;
  }
  .pkg-card div:nth-child(3) {
    font-size: 0.62rem !important;
  }
  .pkg-card div:last-child {
    font-size: 0.85rem !important;
  }

  /* Compact Buy button */
  #buyBtn {
    min-height: 44px !important;
    font-size: 0.85rem !important;
    padding: 10px !important;
    margin-top: 10px !important;
    margin-bottom: 10px !important;
  }

  /* Expiry Countdown layout compact */
  #expiryCountdown div {
    gap: 6px !important;
  }
  #expiryCountdown div > div > div:first-child {
    font-size: 1.15rem !important;
  }
  #expiryCountdown div > div > div:last-child {
    font-size: 0.55rem !important;
    letter-spacing: 0px !important;
  }
  #expiryCountdown div > div[style*="padding-top"] {
    font-size: 1rem !important;
    padding-top: 0px !important;
  }

  /* Alert compact box */
  .alert {
    padding: 10px 12px !important;
    font-size: 0.78rem !important;
    margin-bottom: 12px !important;
    border-radius: 8px !important;
  }

  /* User Dropdown Position Mobile adjustment */
  #userDropdown {
    top: 50px !important;
    right: 8px !important;
    min-width: 160px !important;
  }
  #userDropdown div {
    padding: 6px 8px !important;
  }
  #userDropdown button {
    padding: 7px 10px !important;
    font-size: 0.8rem !important;
  }

  /* Bottom Nav floating pill capsule style */
  .bottom-nav {
    display: flex !important;
    position: fixed !important;
    bottom: 14px !important; /* Float above the bottom edge */
    left: 10px !important;
    right: 10px !important;
    height: 54px !important;
    background: rgba(13, 21, 38, 0.88) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 27px !important; /* Perfectly rounded pill */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
    z-index: 9999 !important;
    padding: 0 6px !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 4px !important;
  }
  
  .bottom-nav-item {
    display: flex !important;
    flex-direction: row !important; /* Icon and label side-by-side inside capsule */
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    flex: unset !important;
    padding: 6px 10px !important;
    border-radius: 20px !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    color: var(--text-muted) !important;
    background: none !important;
    height: 38px !important;
    border: none !important;
  }

  .bottom-nav-item span:first-child {
    font-size: 1.15rem !important;
    transition: transform 0.2s ease !important;
  }

  /* Hide labels of inactive tabs to preserve spaciousness */
  .bottom-nav-item span:last-child {
    display: none !important;
    font-size: 0.68rem !important;
    font-weight: 800 !important;
    color: #ffffff !important;
  }

  /* Active purple capsule effect matching modern fintech app */
  .bottom-nav-item.active {
    background: linear-gradient(135deg, #6366f1, #4f46e5) !important; /* Royal indigo capsule */
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3) !important;
    padding: 6px 14px !important;
  }

  /* Show labels ONLY for active tab */
  .bottom-nav-item.active span:last-child {
    display: inline-block !important;
  }
  
  .bottom-nav-item.active span:first-child {
    transform: scale(1.05) !important;
  }

  /* Prevent text overlapping and horizontal overflow in tables */
  .data-table th, .data-table td {
    padding: 8px 6px !important;
    font-size: 0.72rem !important;
  }

  .reseller-plans-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .dns-key-card {
    padding: 12px !important;
    border: 1px solid rgba(0, 242, 254, 0.2) !important;
    background: rgba(10, 16, 32, 0.45) !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.35) !important;
  }
  .dns-key-card-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }
  .dns-key-card-actions {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }
  .dns-key-card-actions .btn, .dns-key-card-actions a {
    flex: 1 !important;
    min-width: 110px !important;
    padding: 10px 8px !important;
    font-size: 0.8rem !important;
    text-align: center !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .dns-key-card-actions .badge {
    padding: 6px 10px !important;
    font-size: 0.72rem !important;
    text-align: center !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 6px !important;
    height: 34px !important;
  }

  /* Premium Responsive grids for quick actions and support */
  .quick-actions-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
  }
  .quick-actions-grid .btn, .quick-actions-grid button {
    font-size: 0.78rem !important;
    padding: 10px 8px !important;
    border-radius: 8px !important;
    width: 100% !important;
    margin: 0 !important;
    height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
  }
  .quick-actions-grid .btn:last-child, .quick-actions-grid button:last-child {
    grid-column: span 2 !important; /* Stretch Nap Tien to 100% width on second row! */
  }

  .support-actions-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
  }
  .support-actions-grid a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.78rem !important;
    padding: 10px 8px !important;
    border-radius: 8px !important;
    margin: 0 !important;
    width: 100% !important;
    height: 40px !important;
    white-space: nowrap !important;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  .quick-actions-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  .quick-actions-grid .btn:last-child, .quick-actions-grid button:last-child {
    grid-column: span 1 !important;
  }
  .support-actions-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  .topbar-clock {
    display: inline-flex !important;
  }
}

