/* ═══════════════════════════════════════════════════════════ TOKENS */
:root {
  --bg:           #07070a;
  --bg-card:      #0c0c12;
  --bg-sidebar:   #08080d;
  --border:       #14141c;
  --border-mid:   #1c1c26;
  --text:         #e0e0e8;
  --text-dim:     #505060;
  --accent:       #d93535;
  --accent-light: #f04444;
  --success-text: #40d878;
  --warn-text:    #e8aa38;
  --danger-text:  #f04444;
  --sidebar-w:    220px;
  --radius:       10px;
  --radius-sm:    6px;
  --transition:   180ms ease;
}

/* ═══════════════════════════════════════════════════════════ RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body { font-family: 'Inter', system-ui, sans-serif; font-size: 14px; background: var(--bg); color: var(--text); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; font-size: 14px; }
input, textarea, select { font-family: inherit; font-size: 14px; }
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1a1a24; border-radius: 2px; }
.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════ CANVAS */
#particles { position: fixed; inset: 0; pointer-events: none; z-index: 0; }

/* ═══════════════════════════════════════════════════════════ LOGIN */
#login-screen {
  position: fixed; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}

.login-card {
  width: 100%; max-width: 380px; padding: 44px 40px 40px;
  background: #0b0b11; border: 1px solid #1c1c26; border-radius: 16px;
  position: relative; z-index: 1;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.03), 0 24px 64px rgba(0,0,0,0.8);
}

.login-card::after {
  content: ''; position: absolute; top: -1px; left: 20%; right: 20%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(217,53,53,0.5), transparent);
}

.login-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }

.logo-mark {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 8px rgba(217,53,53,0.5); flex-shrink: 0;
}

.logo-icon { display: none; }

.logo-text { font-size: 16px; font-weight: 800; letter-spacing: 5px; color: var(--text); }

.login-tagline { font-size: 11px; color: #2e2e3c; margin-bottom: 32px; letter-spacing: 0.5px; padding-left: 17px; }

.auth-tabs {
  display: flex; gap: 3px; margin-bottom: 28px;
  background: rgba(255,255,255,0.025); border: 1px solid #16161f; border-radius: 8px; padding: 3px;
}

.tab-btn {
  flex: 1; background: none; border: none !important; outline: none !important;
  padding: 7px 12px; color: #3a3a4c; font-weight: 500; font-size: 12px;
  letter-spacing: 0.3px; border-radius: 6px; transition: all var(--transition); cursor: pointer;
}

.tab-btn::after { display: none; }
.tab-btn:hover { color: #808090; }
.tab-btn.active { background: rgba(255,255,255,0.05); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,0.3) !important; }

/* ── Login Forms */
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.login-form-panel { display: none; }
.login-form-panel.active { display: flex; flex-direction: column; gap: 16px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 11px; font-weight: 600; color: #2e2e3c; letter-spacing: 0.5px; text-transform: uppercase; }
.form-row { display: flex; gap: 10px; align-items: flex-end; }
.form-row .form-group { flex: 1; }

input[type="text"], input[type="password"], input[type="number"], input[type="email"], .input-search {
  background: #09090f; border: 1px solid #1c1c26; border-radius: var(--radius-sm);
  color: var(--text); padding: 10px 12px; outline: none; width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0px 1000px #09090f inset !important;
}

input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(217,53,53,0.1); }
input::placeholder { color: #252530; }
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text) !important;
  -webkit-box-shadow: 0 0 0px 1000px #09090f inset !important;
}
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; }
input[type=number] { -moz-appearance: textfield; }

/* ═══════════════════════════════════════════════════════════ BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: var(--radius-sm); padding: 9px 18px;
  font-weight: 600; letter-spacing: 0.3px;
  transition: all var(--transition); white-space: nowrap;
}

.btn:disabled { opacity: 0.35; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, #d93535 0%, #b82020 100%);
  color: #fff; border: none;
  box-shadow: 0 2px 12px rgba(217,53,53,0.25);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #f04444 0%, #d93535 100%);
  box-shadow: 0 4px 20px rgba(217,53,53,0.35);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent; border: 1px solid #1c1c26; color: var(--text);
}

.btn-outline:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }

.btn-full { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon { padding: 7px; }

.btn-discord-code { flex-shrink: 0; align-self: flex-end; }

.btn-signout {
  background: transparent; border: 1px solid #1a1a24; color: #3a3a4c;
  border-radius: var(--radius-sm); padding: 7px 12px; font-size: 12px; width: 100%; gap: 8px;
  transition: border-color var(--transition), color var(--transition);
  display: flex; align-items: center; justify-content: center;
}

.btn-signout:hover { border-color: rgba(217,53,53,0.3); color: var(--accent); }

/* ═══════════════════════════════════════════════════════════ DASHBOARD LAYOUT */
#dashboard { position: fixed; inset: 0; display: flex; z-index: 5; }

/* ═══════════════════════════════════════════════════════════ SIDEBAR */
#sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: #090910; border-right: 1px solid #111118;
  display: flex; flex-direction: column; height: 100%; overflow: hidden;
}

.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 22px 20px; border-bottom: 1px solid #111118;
  cursor: pointer; transition: opacity 0.2s;
}

.sidebar-brand:hover { opacity: 0.7; }

.brand-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 8px rgba(217,53,53,0.5); flex-shrink: 0;
}

.brand-icon { display: none; }

.brand-name { font-size: 13px; font-weight: 800; letter-spacing: 5px; color: #fff; }

.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px; border-bottom: 1px solid #111118;
}

.user-avatar {
  width: 30px; height: 30px; border-radius: 7px;
  background: rgba(217,53,53,0.12); border: 1px solid rgba(217,53,53,0.18);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 11px; color: var(--accent); flex-shrink: 0; text-transform: uppercase;
}

.user-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.user-name { font-weight: 600; font-size: 12px; color: #c0c0cc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.user-role { font-size: 9px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; padding: 2px 7px; border-radius: 20px; display: inline-block; width: fit-content; }

.badge-user  { background: rgba(40,40,55,0.5); color: #303040; }
.badge-admin { background: rgba(217,53,53,0.12); color: var(--accent-light); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 10px; }

.nav-section-label {
  display: block; font-size: 9px; font-weight: 700; letter-spacing: 1.5px;
  color: #202028; padding: 12px 10px 4px; text-transform: uppercase;
}

.nav-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px;
  color: #404054; font-size: 13px; font-weight: 500; border-radius: 7px;
  transition: all 150ms ease; cursor: pointer; text-decoration: none;
  margin-bottom: 1px; border: 1px solid transparent;
}

.nav-item:hover { color: #c0c0cc; background: rgba(255,255,255,0.025); }

.nav-item.active { color: #fff; background: rgba(217,53,53,0.08); border-color: rgba(217,53,53,0.12); }

.nav-icon { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.5; }
.nav-item.active .nav-icon, .nav-item:hover .nav-icon { opacity: 1; }

.sidebar-footer { padding: 14px 16px; border-top: 1px solid #111118; }

/* ═══════════════════════════════════════════════════════════ MAIN CONTENT */
#main-content {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 36px 40px; min-width: 0; height: 100%;
}

.page { display: none !important; }
.page.active { display: block !important; animation: fadeIn 180ms ease; }

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

.page-header { margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid #111118; }

.page-header h1 { font-size: 20px; font-weight: 700; color: #e0e0e8; letter-spacing: -0.3px; }

.page-subtitle { color: #353540; font-size: 12px; margin-top: 3px; }

/* ═══════════════════════════════════════════════════════════ CARDS */
.card {
  background: #0d0d14; border: 1px solid #16161f; border-radius: 10px;
  padding: 22px 24px; transition: border-color 180ms ease;
}

.card:hover { border-color: #1e1e2a; }

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

.card-title { font-size: 10px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: #2a2a38; }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px,100%), 1fr)); gap: 16px; }

.span-2 { grid-column: span 2; }
@media (max-width: 900px) { .span-2 { grid-column: span 1; } }

/* ═══════════════════════════════════════════════════════════ BADGES */
.badge { font-size: 10px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; padding: 3px 10px; border-radius: 20px; border: 1px solid transparent; }

.badge-active   { background: rgba(64,216,120,0.08);  color: #40d878; border-color: rgba(64,216,120,0.15); }
.badge-lifetime { background: rgba(232,170,56,0.08);  color: #e8aa38; border-color: rgba(232,170,56,0.15); }
.badge-expired  { background: rgba(40,40,55,0.4);     color: #35354a; border-color: rgba(40,40,55,0.3); }
.badge-banned   { background: rgba(217,53,53,0.08);   color: #f04444; border-color: rgba(217,53,53,0.15); }

/* ═══════════════════════════════════════════════════════════ LICENSE GRID */
.lic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }

.lic-item { display: flex; flex-direction: column; gap: 5px; }

.lic-label { font-size: 9px; font-weight: 700; color: #252530; text-transform: uppercase; letter-spacing: 0.8px; }

.lic-value { font-size: 13px; font-weight: 500; color: #b0b0bc; word-break: break-all; }

.lic-value.full { grid-column: span 2; }

.hwid-box { background: #09090f; border: 1px solid #16161f; border-radius: 6px; padding: 10px 12px; }

.hwid-value { font-size: 10px; font-family: 'Courier New', monospace; color: #303040; word-break: break-all; display: block; }

/* ═══════════════════════════════════════════════════════════ SETUP PAGE */
.setup-card { max-width: 560px; text-align: center; }
.setup-icon { color: var(--accent); margin-bottom: 14px; display: flex; justify-content: center; }
.setup-desc { color: #404050; font-size: 13px; margin-bottom: 20px; line-height: 1.7; }
.setup-desc strong { color: #b0b0bc; }
.setup-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.setup-timer { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; color: #40d878; }
.setup-timer.urgent { color: #f04444; }
.cmd-box { display: flex; align-items: center; gap: 10px; background: #09090f; border: 1px solid #1a1a24; border-radius: 7px; padding: 12px 14px; margin-bottom: 12px; text-align: left; }
.cmd-text { flex: 1; font-family: 'Courier New', monospace; font-size: 12px; color: #b0b0bc; word-break: break-all; white-space: pre-wrap; }
.setup-hint { font-size: 12px; color: #353540; margin-bottom: 16px; }

/* ═══════════════════════════════════════════════════════════ FORM STACK */
.form-stack { display: flex; flex-direction: column; gap: 14px; }

/* ═══════════════════════════════════════════════════════════ TABLES */
.table-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.search-row { display: flex; gap: 8px; flex: 1; max-width: 400px; }
.filter-row { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-btn { background: transparent; border: 1px solid #1a1a24; border-radius: 20px; color: #353540; padding: 4px 14px; font-size: 10px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; transition: all 150ms ease; cursor: pointer; }
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.table-meta { font-size: 12px; color: #353540; white-space: nowrap; }
.table-wrap { overflow-x: auto; margin: 0 -24px; padding: 0 24px; max-width: 100%; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 480px; }
.data-table th { text-align: left; padding: 8px 12px; font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #252530; border-bottom: 1px solid #16161f; white-space: nowrap; }
.data-table td { padding: 11px 12px; border-bottom: 1px solid #111118; vertical-align: middle; color: #707080; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,0.012); color: #9090a0; }
.table-empty td { text-align: center; color: #252530; padding: 36px 10px; font-size: 13px; }
.action-btn { display: inline-flex; align-items: center; gap: 4px; border: none; border-radius: 5px; padding: 4px 10px; font-size: 10px; font-weight: 700; letter-spacing: 0.4px; cursor: pointer; transition: filter 150ms ease; }
.action-btn:hover { filter: brightness(1.3); }
.action-btn.ban   { background: rgba(240,68,68,0.1);  color: #f04444; }
.action-btn.unban { background: rgba(64,216,120,0.1); color: #40d878; }
.action-btn.reset { background: rgba(232,170,56,0.1); color: #e8aa38; }
.pagination { display: flex; align-items: center; gap: 12px; margin-top: 16px; justify-content: flex-end; }
.page-info { font-size: 12px; color: #353540; }
.row-status-active  { color: #40d878; }
.row-status-banned  { color: #f04444; }
.row-status-expired { color: #353540; }

/* ═══════════════════════════════════════════════════════════ KEYS */
.key-result { background: #09090f; border: 1px solid #1a1a24; border-radius: 8px; padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.key-result-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #252530; display: block; margin-bottom: 4px; }
.key-result-value { font-family: 'Courier New', monospace; font-size: 12px; color: #40d878; word-break: break-all; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 16px; }
.stat-item { display: flex; flex-direction: column; gap: 3px; }
.stat-value { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; color: #e0e0e8; letter-spacing: -1px; line-height: 1; }
.stat-value.success { color: #40d878; }
.stat-value.danger  { color: #f04444; }
.stat-value.warn    { color: #e8aa38; }
.stat-value.accent  { color: var(--accent); }
.stat-label { font-size: 10px; color: #252530; text-transform: uppercase; letter-spacing: 0.8px; font-weight: 600; margin-top: 4px; }

/* ═══════════════════════════════════════════════════════════ LOGS */
.log-type { font-size: 10px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; padding: 2px 8px; border-radius: 20px; }
.log-login    { background: rgba(64,216,120,0.08);  color: #40d878; }
.log-register { background: rgba(100,120,255,0.08); color: #8090f8; }
.log-ban      { background: rgba(240,68,68,0.08);   color: #f04444; }
.log-error    { background: rgba(240,68,68,0.1);    color: #f04444; }
.log-payload  { background: rgba(232,170,56,0.08);  color: #e8aa38; }
.log-default  { background: rgba(40,40,55,0.3);     color: #353540; }

/* ═══════════════════════════════════════════════════════════ PAYLOAD */
.payload-status-box { background: #09090f; border: 1px solid #16161f; border-radius: 7px; padding: 16px; min-height: 80px; display: flex; flex-direction: column; gap: 8px; }
.payload-status-text { color: #404050; font-size: 13px; }
.payload-detail-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.payload-detail-label { color: #353540; }
.payload-detail-value { color: #b0b0bc; font-weight: 500; }
.payload-exists-dot { width: 7px; height: 7px; border-radius: 50%; background: #40d878; flex-shrink: 0; }
.drop-zone { position: relative; border: 2px dashed #1a1a24; border-radius: 10px; padding: 36px 20px; text-align: center; transition: border-color 150ms, background 150ms; cursor: pointer; margin-bottom: 14px; }
.drop-zone:hover, .drop-zone.drag-over { border-color: var(--accent); background: rgba(217,53,53,0.025); }
.drop-input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.drop-inner { pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 8px; color: #404050; }
.drop-title { font-size: 14px; font-weight: 600; color: #808090; }
.drop-hint { font-size: 12px; }
.drop-link { color: var(--accent); font-weight: 500; }
.upload-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.upload-simple { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.selected-file-name { font-size: 12px; color: #353540; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-wrap { display: flex; align-items: center; gap: 10px; }
.progress-bar-track { flex: 1; height: 4px; background: #1a1a24; border-radius: 2px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 100ms linear; }
.progress-label { font-size: 11px; font-variant-numeric: tabular-nums; color: #353540; width: 36px; text-align: right; }

/* ═══════════════════════════════════════════════════════════ TOAST */
.toast { position: fixed; bottom: 24px; right: 24px; z-index: 9999; background: #0f0f18; border: 1px solid #1e1e2a; border-radius: 10px; padding: 12px 18px; font-size: 13px; font-weight: 500; color: #d0d0dc; box-shadow: 0 8px 32px rgba(0,0,0,0.6); max-width: 320px; animation: toastIn 180ms ease; }
.toast.toast-success { border-left: 3px solid #40d878; }
.toast.toast-error   { border-left: 3px solid #f04444; }
.toast.toast-warn    { border-left: 3px solid #e8aa38; }
.toast.toast-info    { border-left: 3px solid #8090f8; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ═══════════════════════════════════════════════════════════ SESSION / INJECT */
.fivem-status { display: flex; align-items: center; gap: 10px; padding: 12px; background: #09090f; border: 1px solid #16161f; border-radius: 7px; margin-bottom: 14px; font-size: 13px; color: #404050; }
.fivem-indicator { width: 8px; height: 8px; border-radius: 50%; background: #252530; flex-shrink: 0; transition: background 150ms ease; }
.fivem-indicator.running { background: #40d878; box-shadow: 0 0 8px rgba(64,216,120,0.4); }
.inject-btn { font-size: 14px; padding: 11px; margin-bottom: 8px; gap: 8px; }
.inject-hint { font-size: 11px; color: #353540; text-align: center; }
.inject-pending-indicator { display: flex; align-items: center; gap: 10px; padding: 12px; background: rgba(217,53,53,0.05); border: 1px solid rgba(217,53,53,0.12); border-radius: 7px; font-size: 13px; color: #f04444; }
.spinner { width: 15px; height: 15px; border: 2px solid rgba(240,68,68,0.2); border-top-color: #f04444; border-radius: 50%; animation: spin 0.7s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

.toggle-row { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.toggle-label { font-size: 12px; color: #404050; font-weight: 500; }
.toggle-checkbox { display: none; }
.toggle-switch { width: 34px; height: 18px; background: #1a1a24; border-radius: 9px; position: relative; transition: background 150ms ease; flex-shrink: 0; }
.toggle-switch::after { content: ''; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: #303040; transition: transform 150ms ease, background 150ms ease; }
.toggle-checkbox:checked + .toggle-switch { background: var(--accent); }
.toggle-checkbox:checked + .toggle-switch::after { transform: translateX(16px); background: #fff; }

/* ═══════════════════════════════════════════════════════════ PRODUCT ACCESS */
.access-external-only [data-product="bypass"]   { display: none !important; }
.access-bypass-only   [data-product="external"] { display: none !important; }
.no-access-notice { display: none; padding: 32px; text-align: center; color: #404050; font-size: 14px; }
.access-none .no-access-notice { display: block; }
.access-none [data-product] { display: none !important; }
