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

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

/* ── Light mode (default) — IdeaPioneers brand ───────────────────────────── */
:root {
  --bg-0: #FFFFFF;
  --bg-1: #F9FAFB;
  --bg-2: #F3F4F8;
  --bg-3: #FFFFFF;
  --bg-4: #F0F1F6;
  --bg-5: #E4E6EF;
  --border: rgba(15,23,42,0.07);
  --border-md: rgba(15,23,42,0.12);
  --border-lg: rgba(15,23,42,0.20);

  /* IdeaPioneers orange */
  --accent: #F05A22;
  --accent-dark: #D44E1B;
  --accent-light: #FF7A45;
  --accent-glow: rgba(240,90,34,0.09);
  --accent-bg: #FFF5F0;

  /* Semantic */
  --green: #059669;
  --green-glow: rgba(5,150,105,0.09);
  --amber: #D97706;
  --amber-glow: rgba(217,119,6,0.09);
  --red: #DC2626;
  --red-glow: rgba(220,38,38,0.09);
  --blue: #2563EB;
  --blue-light: #3B82F6;
  --blue-glow: rgba(37,99,235,0.09);
  --purple: #7C3AED;

  /* Text */
  --text-1: #111827;
  --text-2: #4B5675;
  --text-3: #9CA3AF;

  --mono: 'JetBrains Mono', 'Courier New', monospace;
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow: 0 1px 4px rgba(15,23,42,0.05), 0 4px 16px rgba(15,23,42,0.06);
  --shadow-lg: 0 8px 32px rgba(15,23,42,0.08), 0 24px 64px rgba(15,23,42,0.05);
  --transition: 0.18s ease;
}

/* ── Dark mode override ───────────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg-0: #05080F;
  --bg-1: #080D1A;
  --bg-2: #0C1426;
  --bg-3: #111D35;
  --bg-4: #162236;
  --bg-5: #1E2F47;
  --border: rgba(148,163,184,0.08);
  --border-md: rgba(148,163,184,0.14);
  --border-lg: rgba(148,163,184,0.22);
  --accent-glow: rgba(240,90,34,0.14);
  --accent-bg: rgba(240,90,34,0.1);
  --green: #10B981;
  --green-glow: rgba(16,185,129,0.14);
  --amber: #F59E0B;
  --amber-glow: rgba(245,158,11,0.14);
  --red: #EF4444;
  --red-glow: rgba(239,68,68,0.14);
  --blue: #3B82F6;
  --blue-light: #60A5FA;
  --blue-glow: rgba(59,130,246,0.14);
  --text-1: #F0F4F8;
  --text-2: #8B9FC0;
  --text-3: #4B5E7A;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 16px 64px rgba(0,0,0,0.5);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-1);
  color: var(--text-1);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
}

a { color: inherit; text-decoration: none; }

/* ── Typography ──────────────────────────────────────────────────────────── */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.1rem; }

.mono { font-family: var(--mono); }
.ref-number { font-family: var(--mono); font-weight: 700; color: var(--accent); letter-spacing: 0.06em; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 0.75rem 1.5rem;
  border-radius: 999px; border: none;
  font-family: inherit; font-size: 0.9rem; font-weight: 600;
  cursor: pointer; transition: var(--transition);
  white-space: nowrap; text-decoration: none;
}
.btn:disabled { opacity: 0.5; pointer-events: none; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 12px rgba(240,90,34,0.25);
}
.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(240,90,34,0.35);
}

.btn-secondary {
  background: var(--bg-0);
  color: var(--text-2);
  border: 1px solid var(--border-md);
}
.btn-secondary:hover { background: var(--bg-2); color: var(--text-1); }

.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { color: var(--text-1); background: var(--bg-2); }

.btn-danger { background: var(--red-glow); color: var(--red); border: 1px solid rgba(220,38,38,0.2); }
.btn-danger:hover { background: var(--red); color: #fff; }

.btn-sm { padding: 0.45rem 1rem; font-size: 0.8rem; }
.btn-lg { padding: 0.9rem 2rem; font-size: 1rem; }
.btn-full { width: 100%; }
.btn-icon { padding: 0.55rem; border-radius: 10px; }

/* ── Theme toggle button ─────────────────────────────────────────────────── */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border-md);
  background: var(--bg-2); color: var(--text-2); cursor: pointer;
  transition: var(--transition); flex-shrink: 0;
}
.theme-toggle:hover { color: var(--text-1); background: var(--bg-4); border-color: var(--accent); }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.field { margin-bottom: 1.25rem; }
.field label {
  display: block; font-size: 0.8rem; font-weight: 700;
  color: var(--text-2); margin-bottom: 0.5rem;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.field input,
.field textarea,
.field select {
  width: 100%; padding: 0.8rem 1rem;
  background: var(--bg-0);
  border: 1.5px solid var(--border-md);
  border-radius: var(--radius-sm);
  color: var(--text-1); font-family: inherit; font-size: 0.95rem;
  transition: var(--transition); outline: none; appearance: none;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.field input::placeholder,
.field textarea::placeholder { color: var(--text-3); }
.field textarea { resize: vertical; min-height: 120px; }
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239CA3AF' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 2.5rem;
}
.field select option { background: var(--bg-0); }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  box-shadow: var(--shadow);
}
.card-elevated {
  background: var(--bg-3); border: 1px solid var(--border-md);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
}

/* ── Status Badges ───────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

.badge-new { background: rgba(37,99,235,0.08); color: #1D4ED8; border: 1px solid rgba(37,99,235,0.12); }
.badge-new::before { background: #2563EB; }
[data-theme="dark"] .badge-new { background: rgba(59,130,246,0.14); color: #93C5FD; border-color: rgba(59,130,246,0.2); }
[data-theme="dark"] .badge-new::before { background: #3B82F6; }

.badge-in-progress { background: rgba(217,119,6,0.08); color: #B45309; border: 1px solid rgba(217,119,6,0.12); }
.badge-in-progress::before { background: #D97706; }
[data-theme="dark"] .badge-in-progress { background: rgba(245,158,11,0.14); color: #FCD34D; border-color: rgba(245,158,11,0.2); }
[data-theme="dark"] .badge-in-progress::before { background: #F59E0B; }

.badge-under-review { background: rgba(124,58,237,0.08); color: #6D28D9; border: 1px solid rgba(124,58,237,0.12); }
.badge-under-review::before { background: #7C3AED; }
[data-theme="dark"] .badge-under-review { background: rgba(139,92,246,0.14); color: #C4B5FD; border-color: rgba(139,92,246,0.2); }
[data-theme="dark"] .badge-under-review::before { background: #8B5CF6; }

.badge-resolved { background: rgba(5,150,105,0.08); color: #047857; border: 1px solid rgba(5,150,105,0.12); }
.badge-resolved::before { background: #059669; }
[data-theme="dark"] .badge-resolved { background: rgba(16,185,129,0.14); color: #6EE7B7; border-color: rgba(16,185,129,0.2); }
[data-theme="dark"] .badge-resolved::before { background: #10B981; }

.badge-closed { background: rgba(107,114,128,0.08); color: #6B7280; border: 1px solid rgba(107,114,128,0.12); }
.badge-closed::before { background: #9CA3AF; }
[data-theme="dark"] .badge-closed { background: rgba(75,94,122,0.2); color: #9CA3AF; border-color: rgba(75,94,122,0.25); }
[data-theme="dark"] .badge-closed::before { background: #6B7280; }

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.alert {
  padding: 0.85rem 1rem; border-radius: var(--radius-sm);
  font-size: 0.875rem; margin-bottom: 1rem; border-left: 3px solid;
}
.alert-error { background: var(--red-glow); color: var(--red); border-color: var(--red); }
.alert-success { background: var(--green-glow); color: var(--green); border-color: var(--green); }
.alert-info { background: var(--accent-glow); color: var(--accent); border-color: var(--accent); }
[data-theme="dark"] .alert-error { color: #FCA5A5; }
[data-theme="dark"] .alert-success { color: #6EE7B7; }
[data-theme="dark"] .alert-info { color: var(--accent-light); }

/* ── Utilities ───────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.text-muted { color: var(--text-2); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-2 { gap: 0.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }

/* ── Divider ─────────────────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* ── Spinner ─────────────────────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border-md);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  flex-shrink: 0;
}

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg-1); }
::-webkit-scrollbar-thumb { background: var(--bg-5); border-radius: 3px; }
