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

:root {
  --base:     #0a0a0f;
  --base2:    #0d0d14;
  --card:     #111122;
  --card2:    #161630;
  --border:   rgba(255,107,53,0.07);
  --border2:  rgba(255,255,255,0.04);
  --orange:   #ff6b35;
  --red:      #ff2d78;
  --green:    #00e676;
  --amber:    #ffab00;
  --text:     #e8eaf6;
  --muted:    #4a5080;
  --muted2:   #6b7299;
  --sidebar-w: 240px;
}

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

body {
  background: var(--base);
  font-family: 'Inter', sans-serif;
  color: var(--text);
  min-height: 100vh;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width:5px; height:5px; }
::-webkit-scrollbar-track { background: var(--base); }
::-webkit-scrollbar-thumb { background: #1a1a35; border-radius:3px; }

/* ── AUTH LAYOUT ── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
  background: var(--base);
}

.auth-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 30%, rgba(255,107,53,0.12) 0%, transparent 70%),
    radial-gradient(ellipse 50% 60% at 80% 70%, rgba(255,107,53,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hex-grid {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='52'%3E%3Cpolygon points='30,2 58,17 58,47 30,62 2,47 2,17' fill='none' stroke='%23ff6b35' stroke-width='0.8'/%3E%3C/svg%3E");
  background-size: 60px 52px;
  pointer-events: none;
}

.auth-card {
  background: rgba(13,13,26,0.85);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 44px 40px;
  width: 100%;
  max-width: 420px;
  position: relative;
  box-shadow: 0 0 0 1px rgba(255,107,53,0.03), 0 40px 80px rgba(0,0,0,0.6);
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 60%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--orange), transparent);
  opacity: 0.4;
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo .wordmark {
  font-family: 'Syne', sans-serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--orange);
  text-shadow: 0 0 30px rgba(255,107,53,0.4);
}

.auth-logo .tagline {
  font-size: 11px;
  color: var(--muted2);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 4px;
}

/* ── INPUTS ── */
.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 7px;
}

.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px 16px;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus, .field select:focus, .field textarea:focus {
  border-color: rgba(255,107,53,0.3);
  box-shadow: 0 0 0 3px rgba(255,107,53,0.06);
}

.field input::placeholder { color: var(--muted); }

select option { background: #0d0d1a; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #ff6b35, #ff8a5c);
  color: #000;
}
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); box-shadow: 0 8px 24px rgba(255,107,53,0.2); }

.btn-ghost {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border2);
  color: var(--text);
}
.btn-ghost:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,107,53,0.15); }

.btn-danger {
  background: rgba(255,45,120,0.1);
  border: 1px solid rgba(255,45,120,0.2);
  color: var(--red);
}
.btn-danger:hover { background: rgba(255,45,120,0.2); }

.btn-sm { padding: 6px 14px; font-size: 11px; border-radius: 8px; }
.btn-full { width: 100%; }

/* ── ALERTS ── */
.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.alert-error   { background: rgba(255,45,120,0.08); border: 1px solid rgba(255,45,120,0.2); color: #ff6b9d; }
.alert-success { background: rgba(0,230,118,0.08); border: 1px solid rgba(0,230,118,0.2); color: #00e676; }
.alert-info    { background: rgba(255,107,53,0.06); border: 1px solid rgba(255,107,53,0.15); color: var(--orange); }

/* ── SIDEBAR ── */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--base2);
  border-right: 1px solid var(--border2);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 50;
  transition: transform 0.3s;
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border2);
}

.sidebar-logo .wordmark {
  font-family: 'Syne', sans-serif;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--orange);
  text-shadow: 0 0 20px rgba(255,107,53,0.3);
}

.sidebar-logo .sub {
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 2px;
}

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

.nav-section {
  font-size: 9px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 12px 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--muted2);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  margin-bottom: 2px;
}
.nav-item:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.nav-item.active { background: rgba(255,107,53,0.08); color: var(--orange); border: 1px solid rgba(255,107,53,0.12); }
.nav-item .icon { font-size: 15px; width: 20px; text-align: center; }

/* ── MAIN CONTENT ── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 32px 28px;
  min-height: 100vh;
}

.page-header {
  margin-bottom: 28px;
}
.page-header h1 {
  font-family: 'Syne', sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--orange);
}
.page-header p { font-size: 13px; color: var(--muted2); margin-top: 4px; }

/* ── STAT CARDS ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 14px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
}
.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--orange), #ff8a5c);
  opacity: 0.5;
}
.stat-card:hover { border-color: rgba(255,107,53,0.12); }
.stat-card .icon { font-size: 20px; margin-bottom: 12px; }
.stat-card .num {
  font-family: 'Syne', sans-serif;
  font-size: 30px; font-weight: 800;
  color: var(--orange);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-card .lbl { font-size: 11px; color: var(--muted2); text-transform: uppercase; letter-spacing: 0.08em; }

/* ── CARDS ── */
.card {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
}

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

.card-title {
  font-family: 'Syne', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── TABLE ── */
.tbl-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--border2);
  white-space: nowrap;
}

tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border2);
  font-size: 13px;
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(255,255,255,0.015); }

/* ── BADGES ── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.badge-active  { background: rgba(0,230,118,0.1); color: var(--green); border: 1px solid rgba(0,230,118,0.2); }
.badge-expired { background: rgba(255,45,120,0.1); color: var(--red); border: 1px solid rgba(255,45,120,0.2); }
.badge-used    { background: rgba(74,80,128,0.2); color: var(--muted2); border: 1px solid var(--border2); }

code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #ffab7a;
  background: rgba(255,107,53,0.06);
  padding: 3px 8px;
  border-radius: 5px;
}

.hamburger {
  display: none;
  position: fixed; top: 16px; left: 16px; z-index: 200;
  background: var(--card); border: 1px solid var(--border2);
  border-radius: 8px; width: 36px; height: 36px;
  align-items: center; justify-content: center;
  cursor: pointer; font-size: 18px;
}

@media(max-width: 768px) {
  .hamburger { display: flex; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 20px 16px; padding-top: 60px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}