@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --gold: #f5c518;
  --orange: #ff6b35;
  --bg: #0d0d1a;
  --card: rgba(255,255,255,0.05);
  --border: rgba(255,255,255,0.12);
  --text: #ffffff;
  --muted: rgba(255,255,255,0.5);
}

html { font-size: 16px; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(245,197,24,0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(255,107,53,0.06) 0%, transparent 60%);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }

/* Stars background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 15%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 30% 60%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 50% 30%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 80%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 45%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 15% 85%, rgba(255,255,255,0.2) 0%, transparent 100%),
    radial-gradient(1px 1px at 65% 15%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 85% 70%, rgba(255,255,255,0.2) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

/* Nav */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(13,13,26,0.9);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar .logo {
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--gold), var(--orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.navbar .nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.navbar .username {
  color: var(--muted);
  font-size: 14px;
}

.btn-logout {
  padding: 8px 18px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-logout:hover { background: rgba(255,255,255,0.14); }

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  backdrop-filter: blur(10px);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--orange));
  color: #1a1a2e;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(245,197,24,0.35); }
.btn-primary:active { transform: translateY(0); }

.btn-danger {
  background: rgba(255,75,75,0.15);
  border: 1px solid rgba(255,75,75,0.3);
  color: #ff6b6b;
}
.btn-danger:hover { background: rgba(255,75,75,0.25); }

.btn-ghost {
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-ghost:hover { background: rgba(255,255,255,0.12); }

.btn-sm { padding: 7px 14px; font-size: 12px; border-radius: 8px; }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 14px 16px;
  font-size: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.03); }

/* Badge */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge-green { background: rgba(52,199,89,0.15); color: #34c759; border: 1px solid rgba(52,199,89,0.3); }
.badge-red { background: rgba(255,75,75,0.15); color: #ff6b6b; border: 1px solid rgba(255,75,75,0.3); }
.badge-gold { background: rgba(245,197,24,0.15); color: var(--gold); border: 1px solid rgba(245,197,24,0.3); }

/* Toggle */
.toggle-wrap { display:flex; align-items:center; gap:10px; }
.toggle {
  position: relative;
  width: 48px;
  height: 26px;
  cursor: pointer;
}
.toggle input { opacity:0; width:0; height:0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  border-radius: 26px;
  transition: 0.3s;
  border: 1px solid var(--border);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  left: 3px; bottom: 2px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}
.toggle input:checked + .toggle-slider { background: linear-gradient(135deg, var(--gold), var(--orange)); border-color: var(--gold); }
.toggle input:checked + .toggle-slider::before { transform: translateX(22px); }

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: #16162a;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}
.modal h3 { font-size: 18px; font-weight: 700; margin-bottom: 20px; }
.modal .form-group { margin-bottom: 16px; }
.modal label { display:block; color:var(--muted); font-size:13px; margin-bottom:6px; }
.modal input, .modal select {
  width: 100%;
  padding: 11px 14px;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  outline: none;
}
.modal input:focus, .modal select:focus { border-color: var(--gold); }
.modal select option { background: #16162a; }
.modal-actions { display:flex; gap:10px; justify-content:flex-end; margin-top:20px; }

/* Toast */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.34,1.56,0.64,1);
  max-width: 320px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast-success { background: #1a3a1a; border: 1px solid #34c759; color: #34c759; }
.toast-error { background: #3a1a1a; border: 1px solid #ff6b6b; color: #ff6b6b; }
.toast-info { background: #1a2a3a; border: 1px solid var(--gold); color: var(--gold); }
