/* ==========================================================
   SMART CITIZEN HELP — Design System
   ========================================================== */
:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-light: #eef2ff;
  --accent: #06b6d4;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --success: #10b981;
  --success-light: #d1fae5;
  --info: #3b82f6;
  --info-light: #dbeafe;

  --bg: #f6f7fb;
  --sidebar-bg: #14162b;
  --sidebar-bg-2: #1c1f3a;
  --card: #ffffff;
  --text: #1f2333;
  --muted: #6b7280;
  --border: #e7e9f2;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(20, 22, 43, 0.06);
  --shadow-lg: 0 12px 32px rgba(20, 22, 43, 0.14);
}

[data-theme="dark"] {
  --bg: #0f1120;
  --card: #171a30;
  --text: #eef0fa;
  --muted: #9297b3;
  --border: #2a2d4a;
  --primary-light: #232659;
  --shadow: 0 2px 10px rgba(0,0,0,0.35);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Poppins', 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background .25s ease, color .25s ease;
}

a { text-decoration: none; color: var(--primary); }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #c6c9dd; border-radius: 10px; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #383c66; }

img { max-width: 100%; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: #fff !important;
  border: none;
  padding: 11px 20px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14.5px;
  font-weight: 600;
  font-family: inherit;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  box-shadow: 0 4px 14px rgba(79,70,229,.28);
}
.btn:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-danger { background: var(--danger); box-shadow: 0 4px 14px rgba(239,68,68,.28); }
.btn-danger:hover { background: #c81e1e; }
.btn-outline { background: transparent; color: var(--primary) !important; border: 1.5px solid var(--primary); box-shadow: none; }
.btn-outline:hover { background: var(--primary-light); transform: none; }
.btn-ghost { background: var(--border); color: var(--text) !important; box-shadow: none; }
.btn-ghost:hover { background: #dcdff0; transform: none; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------------- App Shell (sidebar layout) ---------------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 258px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--sidebar-bg), var(--sidebar-bg-2));
  color: #cfd2ea;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
  transition: transform .25s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px;
  font-weight: 700;
  font-size: 17px;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand .logo-badge {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
}

.sidebar-nav { padding: 16px 12px; flex: 1; overflow-y: auto; }
.sidebar-section-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: #6d7196; margin: 18px 12px 8px;
}
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 10px;
  color: #c3c6e2 !important; font-size: 14.5px; font-weight: 500;
  margin-bottom: 3px; transition: background .15s ease, color .15s ease;
}
.sidebar-nav a i { width: 18px; text-align: center; font-size: 15px; opacity: .9; }
.sidebar-nav a:hover { background: rgba(255,255,255,.06); color: #fff !important; }
.sidebar-nav a.active {
  background: linear-gradient(90deg, var(--primary), #6366f1);
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(79,70,229,.4);
}
.sidebar-nav .badge-count {
  margin-left: auto; background: var(--danger); color: #fff;
  font-size: 11px; padding: 1px 7px; border-radius: 20px; font-weight: 700;
}

.sidebar-footer {
  padding: 14px 20px; border-top: 1px solid rgba(255,255,255,.08);
  font-size: 12.5px; color: #83879f;
}

.sidebar-close { display: none; }

/* ---------------- Topbar ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 14px 26px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.topbar .hamburger {
  display: none; background: none; border: none; font-size: 20px; color: var(--text); cursor: pointer;
}
.topbar-search {
  flex: 1; max-width: 420px; position: relative;
}
.topbar-search input {
  width: 100%; padding: 10px 14px 10px 38px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 14px;
}
.topbar-search i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }

.topbar-actions { display: flex; align-items: center; gap: 14px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center; position: relative;
  transition: background .15s ease;
}
.icon-btn:hover { background: var(--bg); }
.icon-btn .dot {
  position: absolute; top: 6px; right: 7px; width: 8px; height: 8px; background: var(--danger);
  border-radius: 50%; border: 2px solid var(--card);
}
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.topbar-user { display: flex; align-items: center; gap: 10px; }
.topbar-user .who { font-size: 13.5px; }
.topbar-user .who b { display: block; font-size: 14px; }
.topbar-user .who span { color: var(--muted); font-size: 12px; }

/* dropdown */
.dropdown { position: relative; }
.dropdown-menu {
  display: none; position: absolute; right: 0; top: 50px; background: var(--card);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg);
  min-width: 240px; padding: 8px; z-index: 50;
}
.dropdown-menu.open { display: block; }
.dropdown-menu a, .dropdown-menu .dd-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px;
  color: var(--text) !important; font-size: 14px;
}
.dropdown-menu a:hover { background: var(--bg); }
.dropdown-menu hr { border: none; border-top: 1px solid var(--border); margin: 6px 0; }
.notif-item { padding: 10px 12px; border-radius: 8px; }
.notif-item:hover { background: var(--bg); }
.notif-item .t { font-size: 13.5px; font-weight: 600; }
.notif-item .d { font-size: 12px; color: var(--muted); }

.main-content { flex: 1; min-width: 0; }
.page-wrap { padding: 26px; max-width: 1280px; margin: 0 auto; }

/* ---------------- Cards ---------------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}
.card h2, .card h3 { margin-top: 0; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* ---------------- Stat cards ---------------- */
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.stat-card .icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 21px; color: #fff; flex-shrink: 0;
}
.stat-card .num { font-size: 26px; font-weight: 800; line-height: 1; }
.stat-card .label { color: var(--muted); font-size: 13px; margin-top: 4px; }
.stat-icon-indigo { background: linear-gradient(135deg,#6366f1,#4338ca); }
.stat-icon-cyan { background: linear-gradient(135deg,#22d3ee,#0891b2); }
.stat-icon-amber { background: linear-gradient(135deg,#fbbf24,#d97706); }
.stat-icon-red { background: linear-gradient(135deg,#f87171,#dc2626); }
.stat-icon-green { background: linear-gradient(135deg,#34d399,#059669); }

/* ---------------- Forms ---------------- */
form label { display: block; margin: 14px 0 6px; font-weight: 600; font-size: 13.5px; }
input[type=text], input[type=email], input[type=password], input[type=tel],
input[type=file], input[type=search], select, textarea {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 14px; background: var(--bg); color: var(--text); 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: 110px; }
.form-hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .input-row { grid-template-columns: 1fr; } }

/* ---------------- Table ---------------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--card); }
table th, table td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: left; font-size: 14px; }
table th { background: var(--bg); font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
table tr:last-child td { border-bottom: none; }
table tr:hover td { background: var(--bg); }
.empty-row td { text-align: center; color: var(--muted); padding: 34px 14px; }

/* ---------------- Badges ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 11px; border-radius: 20px; font-size: 11.5px; font-weight: 700;
}
.badge-urgent { background: var(--danger-light); color: #b91c1c; }
.badge-medium { background: var(--warning-light); color: #b45309; }
.badge-normal { background: var(--success-light); color: #047857; }
.badge-open { background: var(--info-light); color: #1d4ed8; }
.badge-progress { background: var(--warning-light); color: #b45309; }
.badge-resolved { background: var(--success-light); color: #047857; }
.badge-closed { background: var(--border); color: var(--muted); }
.badge-active { background: var(--success-light); color: #047857; }
.badge-blocked { background: var(--danger-light); color: #b91c1c; }

/* ---------------- Alerts / Toasts ---------------- */
.toast-stack { position: fixed; top: 20px; right: 20px; z-index: 999; display: flex; flex-direction: column; gap: 10px; }
.alert {
  padding: 13px 18px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px; min-width: 260px;
  animation: slideIn .25s ease;
}
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.alert-success { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

/* ---------------- Landing page ---------------- */
.landing-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 6vw; position: sticky; top: 0; z-index: 40;
  background: rgba(15,17,32,.75); backdrop-filter: blur(10px);
}
.landing-nav .brand { color: #fff; font-weight: 700; font-size: 19px; display: flex; align-items: center; gap: 10px; }
.landing-nav .links a { color: #cfd2ea; margin-left: 26px; font-size: 14.5px; font-weight: 500; }
.landing-nav .links a:hover { color: #fff; }

.hero {
  background: radial-gradient(circle at 20% 20%, #1e1f4b, #0a0b1c 60%);
  color: #fff; padding: 90px 6vw 110px; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, rgba(79,70,229,.35), transparent 70%);
  top: -150px; right: -100px;
}
.hero::after {
  content: ''; position: absolute; width: 400px; height: 400px; border-radius: 50%;
  background: radial-gradient(circle, rgba(6,182,212,.28), transparent 70%);
  bottom: -150px; left: -80px;
}
.hero-inner { display: flex; align-items: center; gap: 50px; position: relative; z-index: 2; flex-wrap: wrap; }
.hero-text { flex: 1; min-width: 300px; }
.hero-tag {
  display: inline-block; background: rgba(79,70,229,.18); border: 1px solid rgba(99,102,241,.4);
  color: #a5b4fc; padding: 6px 16px; border-radius: 20px; font-size: 12.5px; font-weight: 600; margin-bottom: 20px;
}
.hero-text h1 { font-size: 44px; line-height: 1.18; margin: 0 0 18px; font-weight: 800; }
.hero-text h1 span { background: linear-gradient(90deg,#818cf8,#22d3ee); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-text p { color: #b6b9d6; font-size: 16.5px; line-height: 1.7; margin-bottom: 30px; max-width: 520px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-visual { flex: 1; min-width: 300px; display: flex; justify-content: center; }

.mock-window {
  background: #171a30; border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%; max-width: 420px;
  border: 1px solid rgba(255,255,255,.08); overflow: hidden;
}
.mock-window .mock-bar { display: flex; gap: 6px; padding: 12px 16px; background: #10122455; }
.mock-window .mock-bar span { width: 10px; height: 10px; border-radius: 50%; background: #3a3d63; }
.mock-window .mock-body { padding: 22px; }
.mock-row { display: flex; align-items: center; gap: 12px; background: #1f2242; padding: 12px 14px; border-radius: 10px; margin-bottom: 10px; }
.mock-row i { color: #818cf8; }
.mock-row .bar { flex: 1; height: 8px; background: #2c2f57; border-radius: 4px; }
.mock-row .bar span { display: block; height: 100%; background: linear-gradient(90deg,#6366f1,#22d3ee); border-radius: 4px; }

.section { padding: 80px 6vw; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 50px; }
.section-head .eyebrow { color: var(--primary); font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; }
.section-head h2 { font-size: 32px; margin: 10px 0 12px; font-weight: 800; }
.section-head p { color: var(--muted); font-size: 15.5px; }

.feature-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 28px;
  transition: transform .2s ease, box-shadow .2s ease;
}
.feature-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.feature-card .f-icon {
  width: 50px; height: 50px; border-radius: 13px; display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff; margin-bottom: 16px;
}
.feature-card h4 { margin: 0 0 8px; font-size: 16.5px; }
.feature-card p { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0; }

.steps-row { display: flex; gap: 28px; flex-wrap: wrap; justify-content: center; }
.step-item { flex: 1; min-width: 220px; text-align: center; }
.step-num {
  width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(135deg,var(--primary),var(--accent));
  color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; font-size: 17px;
}
.step-item h4 { margin: 0 0 8px; font-size: 15.5px; }
.step-item p { color: var(--muted); font-size: 13.5px; }

.cta-banner {
  margin: 0 6vw 80px; padding: 56px 6vw; border-radius: 24px; text-align: center;
  background: linear-gradient(120deg, var(--primary), #4338ca 60%, var(--accent));
  color: #fff;
}
.cta-banner h2 { font-size: 28px; margin: 0 0 12px; font-weight: 800; }
.cta-banner p { opacity: .9; margin-bottom: 26px; }

.landing-footer { background: #0a0b1c; color: #8a8ec2; padding: 40px 6vw; text-align: center; font-size: 13.5px; }
.landing-footer .brand { color: #fff; font-weight: 700; margin-bottom: 8px; display: block; }

/* ---------------- Auth split screen ---------------- */
.auth-shell { min-height: 100vh; display: flex; }
.auth-side {
  flex: 1; background: radial-gradient(circle at 30% 20%, #23265f, #0a0b1c 65%);
  color: #fff; padding: 60px; display: flex; flex-direction: column; justify-content: center;
  position: relative; overflow: hidden; min-width: 320px;
}
.auth-side::before {
  content: ''; position: absolute; width: 380px; height: 380px; border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,.35), transparent 70%); top: -100px; left: -80px;
}
.auth-side-content { position: relative; z-index: 2; max-width: 420px; }
.auth-side .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; margin-bottom: 40px; }
.auth-side h2 { font-size: 28px; line-height: 1.3; margin-bottom: 16px; font-weight: 800; }
.auth-side p { color: #b6b9d6; font-size: 14.5px; line-height: 1.7; }
.auth-side .feature-mini { display: flex; align-items: center; gap: 12px; margin-top: 18px; color: #d4d6ee; font-size: 14px; }
.auth-side .feature-mini i { color: #818cf8; }

.auth-form-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--bg); }
.auth-form-inner { width: 100%; max-width: 420px; }
.auth-form-inner h2 { font-size: 25px; margin-bottom: 4px; font-weight: 800; }
.auth-form-inner .sub { color: var(--muted); font-size: 14px; margin-bottom: 26px; }

@media (max-width: 860px) {
  .auth-side { display: none; }
  .auth-form-wrap { padding: 26px; }
}

/* ---------------- Misc ---------------- */
.flex-between { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.text-muted { color: var(--muted); }
.mt-0 { margin-top: 0; }
.divider { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
.tag-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 20px;
  background: var(--primary-light); color: var(--primary); font-size: 12.5px; font-weight: 600;
}
.file-icon {
  width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff; flex-shrink: 0;
}
.file-row { display: flex; align-items: center; gap: 12px; }
.file-row .meta b { display: block; font-size: 14px; }
.file-row .meta span { color: var(--muted); font-size: 12px; }

.mini-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.mini-bar-row .lbl { width: 90px; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.mini-bar-track { flex: 1; height: 10px; background: var(--border); border-radius: 6px; overflow: hidden; }
.mini-bar-fill { height: 100%; border-radius: 6px; }
.mini-bar-row .val { width: 30px; text-align: right; font-size: 13px; font-weight: 700; }

.timeline-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px dashed var(--border); }
.timeline-item:last-child { border-bottom: none; }
.timeline-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 14px;
}
.timeline-avatar.admin { background: linear-gradient(135deg,#6366f1,#4338ca); }
.timeline-avatar.user { background: linear-gradient(135deg,#22c55e,#059669); }
.timeline-bubble { background: var(--bg); border-radius: 12px; padding: 12px 14px; flex: 1; }
.timeline-bubble .head { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 4px; }
.timeline-bubble .head b { font-size: 13.5px; }
.timeline-bubble .head span { color: var(--muted); }

.empty-state { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty-state i { font-size: 40px; opacity: .35; margin-bottom: 14px; display: block; }

/* Mobile sidebar */
@media (max-width: 980px) {
  .sidebar {
    position: fixed; left: 0; top: 0; transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: block; margin-left: auto; background: none; border: none; color: #fff; font-size: 18px; cursor: pointer; }
  .topbar .hamburger { display: block; }
  .page-wrap { padding: 18px; }
  .topbar { padding: 12px 16px; }
  .topbar-search { display: none; }
  .backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 39; }
  .backdrop.show { display: block; }
}
