:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-alt: #f0f1f6;
  --text: #1a1d29;
  --text-muted: #666b7a;
  --border: #e4e6ee;
  --primary: #5b4bff;
  --primary-dark: #4636db;
  --success: #17a673;
  --warning: #e0a400;
  --danger: #e0435c;
  --radius: 14px;
  --shadow: 0 4px 24px rgba(20, 20, 40, 0.06);
  --shadow-lg: 0 12px 40px rgba(20, 20, 40, 0.12);
}

[data-theme="dark"] {
  --bg: #12131c;
  --surface: #1b1d2b;
  --surface-alt: #232537;
  --text: #eef0f7;
  --text-muted: #9a9fb5;
  --border: #2c2f42;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background .25s ease, color .25s ease;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ---------- Navbar ---------- */
.navbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.navbar .logo { font-weight: 700; font-size: 1.15rem; display: flex; align-items: center; gap: 8px; }
.navbar .logo .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.navbar nav { display: flex; gap: 22px; align-items: center; }
.navbar nav a { font-size: .92rem; color: var(--text-muted); font-weight: 500; }
.navbar nav a:hover { color: var(--text); }

.theme-toggle {
  border: 1px solid var(--border); background: var(--surface-alt);
  border-radius: 999px; width: 38px; height: 38px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
  color: var(--text);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 10px; font-weight: 600; font-size: .92rem;
  border: none; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn-primary { background: linear-gradient(135deg, var(--primary), #8b5bff); color: #fff; box-shadow: 0 8px 20px rgba(91,75,255,.3); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(91,75,255,.4); }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 8px 14px; font-size: .82rem; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- Hero ---------- */
.hero { padding: 90px 0 70px; text-align: center; }
.hero h1 { font-size: 2.6rem; font-weight: 800; line-height: 1.15; margin-bottom: 16px; letter-spacing: -0.02em; }
.hero p { color: var(--text-muted); font-size: 1.08rem; max-width: 620px; margin: 0 auto 34px; }
.hero .cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- Cards ---------- */
.card {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 600px) { .grid-3, .grid-4 { grid-template-columns: 1fr; } .hero h1 { font-size: 1.9rem; } }

.stat-card { text-align: center; }
.stat-card .num { font-size: 2rem; font-weight: 800; color: var(--primary); }
.stat-card .label { color: var(--text-muted); font-size: .88rem; margin-top: 4px; }

/* ---------- Section ---------- */
.section { padding: 60px 0; }
.section-title { text-align: center; margin-bottom: 40px; }
.section-title h2 { font-size: 1.8rem; font-weight: 800; margin-bottom: 8px; }
.section-title p { color: var(--text-muted); }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 7px; }
.form-group .hint { font-size: .78rem; color: var(--text-muted); margin-top: 5px; }
input[type=text], input[type=email], input[type=date], input[type=password], input[type=url], select, textarea {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  border: 1.5px solid var(--border); background: var(--surface);
  color: var(--text); font-size: .95rem; font-family: inherit;
  transition: border-color .15s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }
textarea { resize: vertical; min-height: 140px; }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; font-size: .88rem; color: var(--text-muted); }

/* ---------- Steps / Wizard ---------- */
.steps-nav { display: flex; justify-content: space-between; margin-bottom: 36px; position: relative; }
.steps-nav::before {
  content: ''; position: absolute; top: 15px; left: 0; right: 0; height: 2px; background: var(--border); z-index: 0;
}
.step-item { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; }
.step-circle {
  width: 32px; height: 32px; border-radius: 50%; background: var(--surface);
  border: 2px solid var(--border); display: flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 700; color: var(--text-muted);
}
.step-item.active .step-circle { border-color: var(--primary); color: var(--primary); background: var(--surface); }
.step-item.done .step-circle { background: var(--primary); border-color: var(--primary); color: #fff; }
.step-item span.label { font-size: .72rem; color: var(--text-muted); text-align: center; }

.wizard-panel { display: none; }
.wizard-panel.active { display: block; animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px);} to { opacity: 1; transform: translateY(0);} }

/* Category picker */
.category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 700px) { .category-grid { grid-template-columns: repeat(2,1fr); } }
.category-card {
  border: 1.5px solid var(--border); border-radius: 12px; padding: 16px;
  cursor: pointer; text-align: center; font-size: .85rem; font-weight: 600;
  transition: all .15s ease; background: var(--surface);
}
.category-card:hover { border-color: var(--primary); }
.category-card.selected { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, var(--surface)); color: var(--primary); }

/* File upload */
.dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius); padding: 40px 20px;
  text-align: center; cursor: pointer; color: var(--text-muted); transition: border-color .15s ease;
}
.dropzone.dragover { border-color: var(--primary); color: var(--primary); }
.file-list { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.file-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface-alt); padding: 10px 14px; border-radius: 8px; font-size: .85rem;
}
.file-item button { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 1rem; }

/* ---------- Tracker Timeline ---------- */
.timeline { display: flex; justify-content: space-between; margin: 30px 0; position: relative; }
.timeline::before { content:''; position: absolute; top: 17px; left: 0; right: 0; height: 3px; background: var(--border); }
.timeline .t-item { flex: 1; text-align: center; position: relative; z-index: 1; }
.timeline .t-dot {
  width: 34px; height: 34px; margin: 0 auto 8px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--text-muted);
}
.timeline .t-item.done .t-dot { background: var(--success); border-color: var(--success); color: #fff; }
.timeline .t-item.current .t-dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.timeline .t-label { font-size: .78rem; color: var(--text-muted); font-weight: 600; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 5px 12px; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.badge-submitted { background: #e8ecff; color: #4636db; }
.badge-under_review { background: #fff4d6; color: #a8760a; }
.badge-evidence_reviewed { background: #e0e7ff; color: #4636db; }
.badge-escalated { background: #ffe4e4; color: #b8283f; }
.badge-closed { background: #dcfce8; color: #14804a; }
.badge-rejected { background: #f3f0ff; color: #6b6b6b; }
[data-theme="dark"] .badge-submitted { background: #262a4a; color: #b6befd; }
[data-theme="dark"] .badge-under_review { background: #3a3315; color: #f0c96a; }
[data-theme="dark"] .badge-evidence_reviewed { background: #262a4a; color: #b6befd; }
[data-theme="dark"] .badge-escalated { background: #3a1c22; color: #ff9daa; }
[data-theme="dark"] .badge-closed { background: #143626; color: #6fe6a8; }

/* ---------- Alerts / Toasts ---------- */
.alert { padding: 14px 18px; border-radius: 10px; font-size: .88rem; margin-bottom: 18px; }
.alert-success { background: #dcfce8; color: #14804a; }
.alert-error { background: #ffe4e4; color: #b8283f; }
.alert-info { background: #e8ecff; color: #4636db; }

.toast-container { position: fixed; top: 20px; right: 20px; z-index: 999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  padding: 14px 18px; border-radius: 10px; min-width: 260px; font-size: .87rem;
  animation: slideIn .3s ease;
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
@keyframes slideIn { from { transform: translateX(30px); opacity:0;} to { transform: translateX(0); opacity:1;} }

/* ---------- Skeleton ---------- */
.skeleton { background: linear-gradient(90deg, var(--surface-alt) 25%, var(--border) 50%, var(--surface-alt) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 200% 0;} 100% { background-position: -200% 0; } }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--border); padding: 40px 0; margin-top: 60px; color: var(--text-muted); font-size: .85rem; }
footer .disclaimer { max-width: 720px; margin: 0 auto 16px; text-align: center; line-height: 1.6; }
footer .foot-links { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; }

/* ---------- Table (admin) ---------- */
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: left; }
th { color: var(--text-muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
tr:hover td { background: var(--surface-alt); }

.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar { width: 230px; background: var(--surface); border-right: 1px solid var(--border); padding: 24px 16px; }
.admin-sidebar a { display: block; padding: 10px 14px; border-radius: 8px; color: var(--text-muted); font-weight: 600; font-size: .88rem; margin-bottom: 4px; }
.admin-sidebar a.active, .admin-sidebar a:hover { background: var(--surface-alt); color: var(--primary); }
.admin-main { flex: 1; padding: 30px; }
