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

/* ── Variables ────────────────────────────────────────────────────────────── */
:root {
  --bg:        #0a0b0e;
  --surface:   #11141a;
  --surface2:  #181c25;
  --border:    rgba(255,255,255,0.07);
  --accent:    #bba16b;
  --accent2:   #d4b97e;
  --danger:    #e05252;
  --success:   #52c47a;
  --warning:   #e0a532;
  --info:      #5289e0;
  --text:      #e8e8e8;
  --muted:     #6b7280;
  --radius:    10px;
  --shadow:    0 4px 24px rgba(0,0,0,0.5);
}

/* ── Reset ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── Login Screen ─────────────────────────────────────────────────────────── */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(187,161,107,0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 80%, rgba(82,137,224,0.06) 0%, transparent 60%),
    var(--bg);
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px 40px;
  width: 380px;
  box-shadow: var(--shadow), 0 0 60px rgba(187,161,107,0.05);
  text-align: center;
}
.login-card .logo {
  font-family: 'Cinzel', serif;
  font-size: 22px;
  color: var(--accent);
  letter-spacing: 3px;
  margin-bottom: 6px;
}
.login-card .subtitle {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 32px;
}
.login-card input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  text-align: center;
  letter-spacing: 4px;
  font-size: 18px;
  margin-bottom: 16px;
}
.login-card input:focus { border-color: var(--accent); }

/* ── App Shell ────────────────────────────────────────────────────────────── */
#app { display: none; height: 100vh; }
#app.visible { display: flex; }

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.sidebar {
  width: 220px;
  min-width: 220px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0 0 16px;
}
.sidebar-header {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo {
  font-family: 'Cinzel', serif;
  font-size: 15px;
  color: var(--accent);
  letter-spacing: 2px;
  line-height: 1.3;
}
.sidebar-logo span { display: block; font-size: 10px; color: var(--muted); letter-spacing: 1px; font-family: 'Inter', sans-serif; margin-top: 2px; }
nav { flex: 1; padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: rgba(187,161,107,0.12); color: var(--accent); }
.nav-item .icon { font-size: 16px; width: 20px; text-align: center; }
.badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}
.sidebar-footer { padding: 0 10px; }

/* ── Main Content ─────────────────────────────────────────────────────────── */
.main {
  flex: 1;
  overflow-y: auto;
  background: var(--bg);
}
.topbar {
  position: sticky;
  top: 0;
  background: rgba(10,11,14,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
}
.page-title { font-size: 16px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.server-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.content { padding: 24px 28px; }

/* ── Cards ────────────────────────────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
}
.stat-card:hover { border-color: rgba(187,161,107,0.3); }
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
}
.stat-card .label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.stat-card .value { font-size: 28px; font-weight: 700; margin: 4px 0 0; color: var(--text); }
.stat-card .icon-bg { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 32px; opacity: 0.07; }

/* ── Tables ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 13px;
}
.card-header .search-input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  width: 200px;
}
.card-header .search-input:focus { border-color: var(--accent); }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  padding: 10px 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}
td {
  padding: 11px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 13px;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* ── Badges / Pills ───────────────────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}
.pill-pending  { background: rgba(224,165,50,0.15);  color: var(--warning); }
.pill-approved { background: rgba(82,196,122,0.15);  color: var(--success); }
.pill-rejected { background: rgba(224,82,82,0.15);   color: var(--danger);  }
.pill-active   { background: rgba(224,82,82,0.15);   color: var(--danger);  }
.pill-released { background: rgba(82,196,122,0.15);  color: var(--success); }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.15s;
}
.btn-primary  { background: var(--accent);  color: #000; }
.btn-primary:hover  { background: var(--accent2); }
.btn-success  { background: rgba(82,196,122,0.15); color: var(--success); border: 1px solid rgba(82,196,122,0.3); }
.btn-success:hover  { background: rgba(82,196,122,0.25); }
.btn-danger   { background: rgba(224,82,82,0.15);  color: var(--danger);  border: 1px solid rgba(224,82,82,0.3); }
.btn-danger:hover   { background: rgba(224,82,82,0.25); }
.btn-ghost    { background: transparent; color: var(--muted); }
.btn-ghost:hover    { color: var(--text); background: var(--surface2); }
.btn-sm { padding: 4px 10px; font-size: 11px; }

/* ── Section Titles ───────────────────────────────────────────────────────── */
.section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

/* ── Loading & Empty ──────────────────────────────────────────────────────── */
.loading { text-align: center; padding: 40px; color: var(--muted); }
.empty   { text-align: center; padding: 40px; color: var(--muted); font-size: 13px; }
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ────────────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 9999;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 13px;
  box-shadow: var(--shadow);
  animation: slideIn 0.2s ease;
  max-width: 300px;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger);  }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } }

/* ── Scrollbar ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
