:root {
  --bg: #020617;
  --card-bg: #020617;
  --border: #1f2937;
  --text: #f9fafb;
  --muted: #9ca3af;
  --accent: #22c55e;
  --accent-strong: #16a34a;
  --danger: #f97373;
  --success: #4ade80;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #0f172a 0, #020617 50%, #000 100%);
  color: var(--text);
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 230px;
  background: rgba(15, 23, 42, 0.96);
  border-right: 1px solid #111827;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.logo-circle {
  width: 26px; height: 26px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #22c55e, #16a34a 40%, #022c22);
  border: 1px solid rgba(34, 197, 94, 0.6);
}

.app-name { font-weight: 600; font-size: 15px; }
.app-tagline { font-size: 11px; color: var(--muted); }

.nav-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
  margin: 10px 0 4px;
}

.nav-list { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.nav-item { margin-bottom: 3px; }

.nav-link {
  width: 100%;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 9px;
  border-radius: 6px;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
}
.nav-link.active {
  background: rgba(34, 197, 94, 0.08);
  color: var(--text);
  border: 1px solid rgba(34, 197, 94, 0.7);
}
.nav-link:hover:not(.active) {
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
}

.sidebar-footer {
  margin-top: auto;
  font-size: 11px;
  color: var(--muted);
}

.main {
  flex: 1;
  padding: 14px 18px;
}

.main-title { font-size: 18px; font-weight: 600; margin: 0 0 4px; }
.main-subtitle { font-size: 12px; color: var(--muted); margin: 0 0 10px; }

.card {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid #111827;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
}

.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.card-title { font-size: 14px; font-weight: 500; margin: 0; }
.card-subtitle { font-size: 11px; color: var(--muted); margin: 3px 0 0; }

.btn {
  border-radius: 999px;
  border: none;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary { background: var(--accent); color: #022c22; }
.btn-primary:hover { background: var(--accent-strong); }
.btn-secondary { background: #111827; color: var(--muted); }
.btn-secondary:hover { background: #1f2937; color: var(--text); }

.alert {
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  margin-bottom: 8px;
}
.alert-info {
  background: #0b1120;
  border: 1px solid #1f2937;
  color: var(--muted);
}
.alert-error {
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.9);
  color: var(--danger);
}
.alert-success {
  background: rgba(22, 163, 74, 0.1);
  border: 1px solid rgba(22, 163, 74, 0.8);
  color: var(--success);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.table th, .table td {
  padding: 6px;
  text-align: left;
  border-bottom: 1px solid #111827;
}
.table th {
  font-weight: 500;
  color: #9ca3af;
  font-size: 11px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.badge-admin {
  background: #111827;
  color: #e5e7eb;
  border: 1px solid #4b5563;
}
.badge-user {
  background: #0b1120;
  color: #93c5fd;
  border: 1px solid #1d4ed8;
}
.badge-draft {
  background: #0b1120;
  color: #e5e7eb;
  border: 1px solid #4b5563;
}
.badge-running {
  background: #1f2937;
  color: #facc15;
  border: 1px solid #facc15;
}
.badge-done {
  background: #022c22;
  color: #6ee7b7;
  border: 1px solid #34d399;
}

.small-text { font-size: 11px; color: var(--muted); }

/* Login */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.login-card {
  width: 100%;
  max-width: 360px;
  background: rgba(15, 23, 42, 0.95);
  border-radius: 10px;
  border: 1px solid rgba(15,23,42,1);
  padding: 18px 16px 16px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.8);
}
.login-title { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.login-subtitle { font-size: 12px; color: var(--muted); margin-bottom: 12px; }

label { font-size: 12px; display: block; margin-bottom: 4px; }
input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 7px 9px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #020617;
  color: var(--text);
  font-size: 13px;
}
input::placeholder { color: #6b7280; }

.form-row { margin-bottom: 8px; }

@media (max-width: 768px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; align-items: center; overflow-x: auto; }
  .sidebar-footer { display: none; }
  .main { padding: 10px; }
}
