:root {
  --bg-main: #06090e;
  --panel: rgba(15, 23, 42, 0.75);
  --panel-card: rgba(30, 41, 59, 0.55);
  --border: rgba(255, 215, 0, 0.2);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --gold: #f59e0b;
  --gold-light: #fde68a;
  --gold-gradient: linear-gradient(135deg, #ffd700 0%, #f59e0b 50%, #d97706 100%);
  --gold-btn: linear-gradient(135deg, #ffe066 0%, #f59e0b 100%);
  --green: #10b981;
  --green-bg: rgba(16, 185, 129, 0.15);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.15);
  --blue: #3b82f6;
  --blue-bg: rgba(59, 130, 246, 0.15);
  --purple: #a855f7;
  --purple-bg: rgba(168, 85, 247, 0.15);
  --text: #f8fafc;
  --text-muted: #94a3b8;
}
* { box-sizing: border-box; margin: 0; padding: 0; font-family: system-ui, "Segoe UI", sans-serif; }
body { background: var(--bg-main); color: var(--text); min-height: 100vh; padding: 20px 16px 80px; display: flex; flex-direction: column; align-items: center; }
.container { width: 100%; max-width: 1200px; }

/* HEADER */
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding: 18px 24px; background: var(--panel); border: 1px solid var(--border); border-radius: 20px; backdrop-filter: blur(20px); flex-wrap: wrap; gap: 14px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-icon { width: 46px; height: 46px; background: var(--gold-btn); border-radius: 14px; display: flex; align-items: center; justify-content: center; color: #000; font-size: 22px; box-shadow: 0 0 20px rgba(245, 158, 11, 0.4); }
.brand h1 { font-size: 20px; font-weight: 800; color: #ffd700; letter-spacing: -0.3px; }
.brand p { font-size: 12px; color: var(--text-muted); }
.header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mode-badge { font-size: 12px; padding: 6px 14px; border-radius: 10px; font-weight: 600; cursor: pointer; transition: 0.2s; display: inline-flex; align-items: center; gap: 6px; }
.mode-all { background: var(--green-bg); border: 1px solid rgba(16, 185, 129, 0.4); color: #34d399; }
.mode-white { background: var(--blue-bg); border: 1px solid rgba(59, 130, 246, 0.4); color: #60a5fa; }

/* STATS CARDS */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { background: var(--panel); border: 1px solid var(--border-subtle); border-radius: 16px; padding: 16px 20px; backdrop-filter: blur(15px); display: flex; align-items: center; gap: 16px; transition: transform 0.2s, border-color 0.2s; }
.stat-card:hover { transform: translateY(-2px); border-color: var(--border); }
.stat-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.stat-num { font-size: 22px; font-weight: 800; color: #fff; line-height: 1.2; }
.stat-lbl { font-size: 12px; color: var(--text-muted); }

/* TABS */
.tabs { display: flex; gap: 8px; margin-bottom: 22px; background: rgba(0,0,0,0.4); padding: 6px; border-radius: 14px; border: 1px solid rgba(255,255,255,0.06); overflow-x: auto; }
.tab-btn { flex: 1; min-width: 150px; padding: 12px 16px; border: none; background: transparent; color: var(--text-muted); font-size: 13px; font-weight: 700; border-radius: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: 0.2s; white-space: nowrap; }
.tab-btn:hover { color: #fff; background: rgba(255,255,255,0.04); }
.tab-btn.active { background: var(--gold-btn); color: #000; box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35); }
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeIn 0.25s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* CARDS */
.card { background: var(--panel); border: 1px solid var(--border-subtle); border-radius: 20px; padding: 24px; margin-bottom: 20px; backdrop-filter: blur(20px); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; flex-wrap: wrap; gap: 12px; }
.card-title { font-size: 17px; font-weight: 700; color: #ffd700; display: flex; align-items: center; gap: 10px; }

/* FORM CONTROLS */
.form-row { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
input, select, textarea { background: rgba(0,0,0,0.55); border: 1px solid rgba(255,255,255,0.12); color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 14px; outline: none; transition: 0.2s; flex: 1; min-width: 200px; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 10px rgba(245, 158, 11, 0.2); }
select option { background: #0f172a; color: #fff; }

.btn { background: var(--gold-btn); color: #000; border: none; font-weight: 700; padding: 12px 22px; border-radius: 12px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; transition: 0.2s; white-space: nowrap; text-decoration: none; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4); }
.btn-secondary { background: rgba(255,255,255,0.08); color: #fff; border: 1px solid rgba(255,255,255,0.15); }
.btn-secondary:hover { background: rgba(255,255,255,0.15); }
.btn-danger { background: var(--red-bg); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); }
.btn-danger:hover { background: #ef4444; color: #fff; }
.btn-success { background: var(--green-bg); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.btn-success:hover { background: #10b981; color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }

/* SEARCH & FILTER BAR */
.filter-bar { display: flex; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; align-items: center; }
.search-input-wrap { position: relative; flex: 1; min-width: 250px; }
.search-input-wrap i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.search-input-wrap input { padding-left: 40px; width: 100%; }

/* TABLE */
.table-responsive { width: 100%; overflow-x: auto; border-radius: 16px; border: 1px solid rgba(255,255,255,0.06); }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13.5px; }
thead tr { background: rgba(0,0,0,0.5); }
th { padding: 14px 16px; color: var(--text-muted); font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; }
td { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,0.05); vertical-align: middle; }
tbody tr:hover td { background: rgba(255,255,255,0.025); }

/* USER ROW COMPONENTS */
.user-cell { display: flex; align-items: center; gap: 12px; }
.avatar-img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); background: #1e293b; flex-shrink: 0; }
.user-name-title { font-weight: 700; color: #fff; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.user-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.uid-code { font-family: ui-monospace, Consolas, monospace; font-size: 11px; background: rgba(0,0,0,0.5); padding: 3px 8px; border-radius: 6px; color: #ffd700; border: 1px solid rgba(255,215,0,0.2); display: inline-flex; align-items: center; gap: 6px; }
.btn-copy { cursor: pointer; color: var(--text-muted); transition: 0.2s; }
.btn-copy:hover { color: #fff; }

/* BADGES */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.badge-active { background: var(--green-bg); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.badge-blocked { background: var(--red-bg); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); }
.badge-expired { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.badge-admin { background: rgba(245, 158, 11, 0.15); color: #ffd700; border: 1px solid rgba(255, 215, 0, 0.4); }
.badge-ctv { background: var(--blue-bg); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.4); }
.badge-pkg { background: rgba(255,255,255,0.06); color: #e2e8f0; border: 1px solid rgba(255,255,255,0.12); }
.badge-frame { background: var(--purple-bg); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.4); font-size: 10.5px; padding: 2px 6px; border-radius: 6px; }

/* RESULT BOX */
.result-box { margin-top: 16px; padding: 18px; border-radius: 14px; display: none; }
.result-success { background: var(--green-bg); border: 1px solid rgba(16, 185, 129, 0.4); color: #34d399; }
.result-error { background: var(--red-bg); border: 1px solid rgba(239, 68, 68, 0.4); color: #f87171; }

/* MODAL */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.75); backdrop-filter: blur(8px); display: none; align-items: center; justify-content: center; z-index: 9999; padding: 20px; }
.modal-card { background: #0f172a; border: 1px solid var(--border); border-radius: 22px; width: 100%; max-width: 520px; padding: 28px; box-shadow: 0 25px 60px rgba(0,0,0,0.6); position: relative; }
.modal-close { position: absolute; top: 20px; right: 20px; background: none; border: none; color: var(--text-muted); font-size: 20px; cursor: pointer; transition: 0.2s; }
.modal-close:hover { color: #fff; }

/* TOAST */
#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 10000; display: flex; flex-direction: column; gap: 10px; }
.toast { background: rgba(15, 23, 42, 0.95); border: 1px solid var(--border); padding: 14px 20px; border-radius: 12px; color: #fff; font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); backdrop-filter: blur(10px); animation: slideIn 0.25s ease-out; }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* LOGIN OVERLAY */
#login-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(245, 158, 11, 0.15) 0%, rgba(6, 9, 14, 0.96) 75%);
  backdrop-filter: blur(25px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 20px;
}
.login-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-radius: 28px;
  width: 100%;
  max-width: 440px;
  padding: 40px 32px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(245, 158, 11, 0.18);
  text-align: center;
  animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}
@keyframes modalPop {
  from { opacity: 0; transform: scale(0.92) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.login-icon {
  width: 72px;
  height: 72px;
  background: var(--gold-btn);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  font-size: 34px;
  margin: 0 auto 20px;
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.5);
  animation: pulseGold 3s infinite alternate ease-in-out;
}
@keyframes pulseGold {
  0% { transform: scale(1); box-shadow: 0 0 25px rgba(245, 158, 11, 0.4); }
  100% { transform: scale(1.04); box-shadow: 0 0 40px rgba(245, 158, 11, 0.7); }
}
.login-title {
  font-size: 24px;
  font-weight: 800;
  color: #ffd700;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}
.login-sub {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 26px;
}
.pwd-input-wrap {
  position: relative;
  margin-bottom: 18px;
}
.pwd-input-wrap i.prefix-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #f59e0b;
  font-size: 16px;
}
.pwd-input-wrap input {
  width: 100%;
  padding: 14px 46px 14px 44px;
  font-size: 15px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 14px;
  color: #fff;
  letter-spacing: 0.5px;
}
.pwd-input-wrap input:focus {
  border-color: #ffd700;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.35);
}
.pwd-toggle-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 15px;
  cursor: pointer;
  transition: color 0.2s;
}
.pwd-toggle-btn:hover { color: #ffd700; }
.login-error {
  background: var(--red-bg);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 18px;
  display: none;
}
.shake {
  animation: shakeAnim 0.4s ease-in-out;
}
@keyframes shakeAnim {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

/* zLocket admin theme */
:root {
  color-scheme: light;
  --bg-main: #fffbf1; --panel: #fffdf7; --panel-card: #fff5d9;
  --border: #edd9a6; --border-subtle: #ecdfbf; --gold: #9d6000;
  --gold-light: #754800; --gold-btn: #ffb000; --gold-gradient: linear-gradient(135deg, #ffce52, #ffb000);
  --text: #281c0a; --text-muted: #695539;
  --green: #116345; --red: #942c38; --blue: #244f9b; --purple: #674093;
}
body { background: radial-gradient(ellipse at top right, #ffe8ab, #fffbf1 38rem); }
.header, .card, .stat-card { border-color: var(--border-subtle); box-shadow: 0 5px 16px #69470e0d; }
.brand-icon, .login-icon { background: #ffe7a4; color: #754800; box-shadow: none; }
.brand h1, .card-title, .stat-num, .user-name-title, .login-title { color: var(--text); }
.tabs, thead tr { background: #fff4d7; border-color: var(--border-subtle); }
.tab-btn:hover, .btn-secondary:hover { color: var(--text); background: #ffedbc; }
.btn, .tab-btn { border-radius: 999px; }
.btn-secondary { background: #fffdf7; color: var(--text); border-color: var(--border); }
.btn-success, .mode-all { color: var(--green); }
.btn-danger, .login-error { color: var(--red); }
.mode-white { color: var(--blue); }
input, select, textarea, select option, .pwd-input-wrap input { background: #fffaf0; color: var(--text); border-color: var(--border); }
.table-responsive { border-color: var(--border-subtle); }
td { border-color: #f0e5ca; }
tbody tr:hover td { background: #fff7e2; }
#login-overlay { background: #fffbf1; background-image: radial-gradient(ellipse at top, #ffe5a0, transparent 65%); }
.login-card { background: #fffdf7; color: var(--text); border: 1px solid var(--border); box-shadow: 0 18px 50px #68451620; }
:focus-visible { outline: 2px solid #9d6000; outline-offset: 3px; }
@media (max-width: 600px) {
  .header, .card { padding: 15px; }
  .stats-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr)); gap: 8px; }
  .stat-card { padding: 12px; gap: 8px; }
  .form-row > *, .search-input-wrap { min-width: 0; max-width: 100%; }
  .tabs { scroll-snap-type: x proximity; }
  .tab-btn { scroll-snap-align: start; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
