:root {
  --bg: #0b1220;
  --bg-card: #121c2e;
  --bg-sidebar: #0e1628;
  --border: #1e2d45;
  --text: #e8eef7;
  --muted: #8fa3bf;
  --accent: #00c9a7;
  --accent-dim: #009e82;
  --danger: #ff6b6b;
  --warning: #fbbf24;
  --success: #34d399;
  --radius: 12px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.hidden { display: none !important; }

a { color: var(--accent); text-decoration: none; }

button, .btn {
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: 0.15s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  color: #041018;
  font-weight: 600;
}

.btn-primary:hover { filter: brightness(1.08); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover { color: var(--text); border-color: var(--accent); }

.btn-danger {
  background: rgba(255, 107, 107, 0.15);
  color: var(--danger);
  border: 1px solid rgba(255, 107, 107, 0.35);
}

input, select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  font-size: 0.95rem;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 201, 167, 0.15);
}

label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.form-group { margin-bottom: 1rem; }

/* Auth screens */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
  background:
    radial-gradient(circle at 20% 20%, rgba(0, 201, 167, 0.08), transparent 40%),
    radial-gradient(circle at 80% 0%, rgba(56, 189, 248, 0.06), transparent 35%),
    var(--bg);
}

.auth-card {
  width: min(420px, 100%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #38bdf8);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #041018;
}

.brand h1 { font-size: 1.35rem; }
.brand p { color: var(--muted); font-size: 0.85rem; }

.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.alert-error {
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid rgba(255, 107, 107, 0.35);
  color: #ffb4b4;
}

.alert-success {
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: #a7f3d0;
}

/* App layout */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

.sidebar .brand { margin-bottom: 2rem; }

.nav { list-style: none; flex: 1; }

.nav li {
  margin-bottom: 0.35rem;
}

.nav button {
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--muted);
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  border: 1px solid transparent;
}

.nav button.active,
.nav button:hover {
  background: rgba(0, 201, 167, 0.1);
  color: var(--text);
  border-color: rgba(0, 201, 167, 0.25);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
}

.main {
  padding: 1.5rem 2rem;
  overflow: auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.topbar h2 { font-size: 1.4rem; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}

.stat-card .label { color: var(--muted); font-size: 0.8rem; }
.stat-card .value { font-size: 1.5rem; font-weight: 700; margin-top: 0.25rem; }

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.panel-header h3 { font-size: 1rem; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th, td {
  text-align: left;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border);
}

th { color: var(--muted); font-weight: 600; }

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-admin { background: rgba(56, 189, 248, 0.15); color: #7dd3fc; }
.badge-upload { background: rgba(0, 201, 167, 0.15); color: #5eead4; }
.badge-off { background: rgba(255, 107, 107, 0.15); color: #fca5a5; }

.actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: 0.15s;
}

.dropzone.dragover {
  border-color: var(--accent);
  background: rgba(0, 201, 167, 0.05);
  color: var(--text);
}

.empty { color: var(--muted); text-align: center; padding: 2rem; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { border-right: none; border-bottom: 1px solid var(--border); }
  .nav { display: flex; gap: 0.35rem; overflow-x: auto; }
  .nav li { margin: 0; flex: 0 0 auto; }
}
