/* ============================================================
   LGS Parents Portal — Main Stylesheet
   Colors: Logo Navy #1a2744 + Logo Gold #c9a227
   Fonts:  Plus Jakarta Sans (body) + Space Mono (accents)
           matching Skoolly design system
   ============================================================ */

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

:root {
  /* ── Logo-matched palette ── */
  --navy:      #1a2744;
  --navy-dark: #0f1a2e;
  --navy-mid:  #253761;
  --navy-light:#2e4a80;
  --gold:      #c9a227;
  --gold-lt:   #e2b93a;
  --gold-dim:  #a07d18;
  --cream:     #fdf8ee;
  --white:     #ffffff;
  --bg:        #f2f5fb;
  --text:      #1a202c;
  --text-muted:#4a5568;
  --border:    #dde3ed;
  --success:   #16a34a;
  --danger:    #dc2626;
  --warning:   #d97706;
  --info:      #2563eb;
  --shadow-sm: 0 2px 8px rgba(26,39,68,0.08);
  --shadow:    0 4px 20px rgba(26,39,68,0.12);
  --shadow-lg: 0 8px 40px rgba(26,39,68,0.18);
  --radius:    12px;
  --radius-sm: 8px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --font:      'Plus Jakarta Sans', -apple-system, sans-serif;
  --mono:      'Space Mono', monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Typography ──────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font);
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
}
h1 { font-size: 2.2rem; font-weight: 800; }
h2 { font-size: 1.7rem; font-weight: 700; }
h3 { font-size: 1.3rem; font-weight: 700; }
h4 { font-size: 1.1rem; font-weight: 600; }
p  { color: var(--text-muted); }

/* Space Mono for numbers/stats/codes */
.mono, .stat-number, .vote-count, code { font-family: var(--mono); }

a {
  color: var(--navy-mid);
  text-decoration: none;
  transition: var(--transition);
}
a:hover { color: var(--gold); }

/* ── Layout ──────────────────────────────────────────────── */
.container   { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.container-sm{ max-width: 760px; margin: 0 auto; padding: 0 24px; }

/* ── Navbar ──────────────────────────────────────────────── */
.navbar {
  background: var(--navy);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 20px rgba(0,0,0,0.2);
}
.navbar-inner {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 24px; height: 64px;
  max-width: 1160px; margin: 0 auto;
}
.navbar-brand {
  display: flex; align-items: center; gap: 12px;
  color: var(--white);
}
.navbar-brand .brand-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--gold), var(--gold-lt));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.navbar-brand .brand-text {
  font-family: var(--font);
  font-size: 17px; font-weight: 600;
}
.navbar-brand .brand-sub {
  font-size: 10px; color: rgba(255,255,255,0.55);
  display: block; letter-spacing: 1.5px; text-transform: uppercase;
}
.navbar-nav { display: flex; align-items: center; gap: 6px; }
.navbar-nav a {
  color: rgba(255,255,255,0.8); font-size: 14px; font-weight: 500;
  padding: 8px 14px; border-radius: 8px;
  transition: var(--transition);
}
.navbar-nav a:hover, .navbar-nav a.active {
  color: var(--white); background: rgba(255,255,255,0.12);
}
.navbar-nav .nav-btn {
  background: var(--gold); color: var(--navy);
  padding: 8px 18px; border-radius: 8px;
  font-weight: 600; font-size: 13px;
}
.navbar-nav .nav-btn:hover { background: var(--gold-lt); }

/* User avatar in nav */
.nav-user { display: flex; align-items: center; gap: 10px; }
.nav-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid var(--gold);
  object-fit: cover;
}
.nav-user-name { color: rgba(255,255,255,0.85); font-size: 13px; }

/* Mobile hamburger */
.navbar-toggle { display: none; background: none; border: none; cursor: pointer; color: white; font-size: 22px; }

/* ── Hero / Page Header ──────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 50%, var(--navy-mid) 100%);
  padding: 72px 24px;
  text-align: center;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle at 20% 50%, rgba(201,148,42,0.15) 0%, transparent 50%),
                    radial-gradient(circle at 80% 20%, rgba(45,80,128,0.4) 0%, transparent 50%);
}
.hero-content { position: relative; z-index: 1; }
.hero h1 { color: var(--white); font-size: 2.8rem; margin-bottom: 16px; }
.hero p { color: rgba(255,255,255,0.7); font-size: 17px; max-width: 560px; margin: 0 auto 32px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(201,148,42,0.2); border: 1px solid rgba(201,148,42,0.4);
  color: var(--gold-lt); padding: 6px 16px; border-radius: 100px;
  font-size: 12px; letter-spacing: 1px; text-transform: uppercase;
  margin-bottom: 20px;
}

/* Page header (smaller) */
.page-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  padding: 40px 24px;
}
.page-header h1 { color: white; font-size: 1.9rem; }
.page-header p { color: rgba(255,255,255,0.65); margin-top: 8px; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-body { padding: 24px; }
.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-header h3 { margin: 0; font-size: 1.1rem; }
.card-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  background: #fafbfc;
  border-radius: 0 0 var(--radius) var(--radius);
}

/* Suggestion card */
.suggestion-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: var(--transition);
  position: relative;
}
.suggestion-card:hover { box-shadow: var(--shadow); border-color: rgba(45,80,128,0.3); }
.suggestion-card.featured {
  border-color: var(--gold);
  background: linear-gradient(to bottom right, #fff, #fdf8f0);
}
.suggestion-card.featured::before {
  content: '⭐ Featured';
  position: absolute; top: -1px; right: 20px;
  background: var(--gold); color: var(--navy);
  font-size: 10px; font-weight: 700;
  padding: 3px 10px; border-radius: 0 0 8px 8px;
  letter-spacing: 0.5px;
}

.suggestion-card .card-category {
  font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
  color: var(--navy-mid); margin-bottom: 8px;
}
.suggestion-card h3 {
  font-size: 1.1rem; margin-bottom: 10px;
  color: var(--navy);
}
.suggestion-card h3 a { color: inherit; }
.suggestion-card h3 a:hover { color: var(--gold); }
.suggestion-card .card-body-text {
  color: var(--text-muted); font-size: 14px; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 18px;
}

.card-meta {
  display: flex; align-items: center; gap: 16px;
  flex-wrap: wrap; font-size: 13px; color: var(--text-muted);
}
.card-meta .meta-author { display: flex; align-items: center; gap: 6px; }
.card-meta img { width: 22px; height: 22px; border-radius: 50%; }

/* Vote & rating row */
.card-actions {
  display: flex; align-items: center; gap: 12px;
  margin-top: 16px; padding-top: 16px;
  border-top: 1px solid var(--border);
}
.btn-vote {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 1.5px solid var(--border);
  color: var(--text-muted); font-size: 13px; font-weight: 500;
  padding: 7px 14px; border-radius: 100px; cursor: pointer;
  transition: var(--transition); font-family: inherit;
}
.btn-vote:hover, .btn-vote.voted {
  background: var(--navy); color: var(--white);
  border-color: var(--navy);
}
.btn-vote.voted .vote-icon { color: var(--gold-lt); }
.vote-count { font-weight: 700; }

/* Stars rating */
.stars { display: inline-flex; gap: 3px; }
.stars .star {
  font-size: 16px; cursor: pointer; color: #ddd;
  transition: var(--transition); line-height: 1;
}
.stars .star.active, .stars .star:hover { color: var(--gold); }
.stars-display .star { cursor: default; }
.rating-avg { font-weight: 600; font-size: 14px; color: var(--gold); }
.rating-count { font-size: 12px; color: var(--text-muted); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
  border: 2px solid transparent; text-decoration: none;
}
.btn-primary {
  background: var(--navy); color: var(--white);
}
.btn-primary:hover { background: var(--navy-dark); color: white; transform: translateY(-1px); }

.btn-gold {
  background: var(--gold); color: var(--navy);
}
.btn-gold:hover { background: var(--gold-lt); }

.btn-outline {
  background: none; color: var(--navy);
  border-color: var(--border);
}
.btn-outline:hover { border-color: var(--navy); background: var(--navy); color: white; }

.btn-danger { background: var(--danger); color: white; }
.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: 6px; }
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--navy); margin-bottom: 6px; letter-spacing: 0.2px;
}
.form-control {
  width: 100%;
  padding: 11px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px; color: var(--text);
  background: var(--white);
  transition: var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--navy-mid);
  box-shadow: 0 0 0 3px rgba(45,80,128,0.12);
}
.form-control::placeholder { color: #aab; }
textarea.form-control { resize: vertical; min-height: 120px; }
select.form-control { cursor: pointer; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Toggle switch for anonymous */
.toggle-wrap {
  display: flex; align-items: center; gap: 12px;
  background: #f8fafc; padding: 14px 16px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
}
.toggle-switch {
  position: relative; width: 44px; height: 24px; flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #ccc; border-radius: 100px; transition: var(--transition);
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; left: 3px; bottom: 3px;
  background: white; border-radius: 50%; transition: var(--transition);
}
input:checked + .toggle-slider { background: var(--navy); }
input:checked + .toggle-slider::before { transform: translateX(20px); }
.toggle-label { font-size: 14px; }
.toggle-label strong { display: block; font-size: 13px; color: var(--navy); }
.toggle-label span { font-size: 12px; color: var(--text-muted); }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: 4px 10px; border-radius: 100px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
}
.badge-pending     { background: #fff3cd; color: #856404; }
.badge-review      { background: #cff4fc; color: #0a4757; }
.badge-approved    { background: #d1ecf1; color: #0c5460; }
.badge-implemented { background: #d4edda; color: #155724; }
.badge-rejected    { background: #f8d7da; color: #721c24; }

/* Category pills */
.category-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 100px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.5px;
  background: rgba(26,58,92,0.07); color: var(--navy-mid);
}

/* ── Grid layouts ────────────────────────────────────────── */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.sidebar-layout { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }

/* ── Stats / KPI cards ───────────────────────────────────── */
.stat-card {
  background: var(--white); border-radius: var(--radius);
  padding: 22px; border: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
}
.stat-icon {
  width: 50px; height: 50px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.stat-icon.blue  { background: rgba(26,58,92,0.1); }
.stat-icon.gold  { background: rgba(201,148,42,0.12); }
.stat-icon.green { background: rgba(39,174,96,0.1); }
.stat-icon.red   { background: rgba(231,76,60,0.1); }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--navy); font-family: var(--mono); }
.stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }

/* ── Alerts & Flash ──────────────────────────────────────── */
.alert {
  padding: 14px 18px; border-radius: var(--radius-sm);
  border-left: 4px solid; margin-bottom: 20px;
  font-size: 14px; display: flex; align-items: flex-start; gap: 10px;
}
.alert-success { background: #d4edda; border-color: var(--success); color: #155724; }
.alert-danger   { background: #f8d7da; border-color: var(--danger);  color: #721c24; }
.alert-warning  { background: #fff3cd; border-color: var(--warning); color: #856404; }
.alert-info     { background: #d1ecf1; border-color: var(--info);    color: #0c5460; }

/* ── Tabs ────────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 24px; }
.tab-btn {
  padding: 10px 20px; font-size: 14px; font-weight: 500;
  color: var(--text-muted); background: none; border: none; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: var(--transition); font-family: inherit;
}
.tab-btn.active { color: var(--navy); border-bottom-color: var(--navy); font-weight: 600; }
.tab-btn:hover:not(.active) { color: var(--navy-mid); }

/* ── Filters row ─────────────────────────────────────────── */
.filters-bar {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap; margin-bottom: 24px;
}
.filter-select {
  padding: 8px 14px; border: 1.5px solid var(--border); border-radius: 8px;
  font-family: inherit; font-size: 13px; color: var(--text);
  background: white; cursor: pointer; outline: none;
  transition: var(--transition);
}
.filter-select:focus { border-color: var(--navy-mid); }
.search-input-wrap { position: relative; flex: 1; min-width: 200px; }
.search-input-wrap input { padding-left: 38px; }
.search-input-wrap .search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 15px; pointer-events: none;
}

/* ── Pagination ──────────────────────────────────────────── */
.pagination { display: flex; align-items: center; gap: 8px; justify-content: center; margin-top: 32px; }
.page-btn {
  min-width: 38px; height: 38px; border: 1.5px solid var(--border);
  border-radius: 8px; background: white; color: var(--text);
  font-family: inherit; font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.page-btn:hover { border-color: var(--navy); color: var(--navy); }
.page-btn.active { background: var(--navy); color: white; border-color: var(--navy); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Auth pages ──────────────────────────────────────────── */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center;
  background: linear-gradient(135deg, var(--navy-dark), var(--navy-mid));
  padding: 40px 20px;
}
.auth-card {
  background: white; border-radius: 16px;
  max-width: 440px; width: 100%; margin: 0 auto;
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.auth-header {
  background: linear-gradient(135deg, var(--navy), var(--navy-mid));
  padding: 28px 32px; text-align: center;
}
.auth-header h1 { color: white; font-size: 1.5rem; margin-bottom: 4px; }
.auth-header p { color: rgba(255,255,255,0.65); font-size: 13px; }
.auth-body { padding: 32px; }
.auth-footer { text-align: center; font-size: 13px; color: var(--text-muted); padding-top: 16px; }
.auth-footer a { color: var(--navy-mid); font-weight: 600; }
.divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; }
.divider span { color: var(--text-muted); font-size: 12px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── Profile ─────────────────────────────────────────────── */
.profile-header {
  background: linear-gradient(135deg, var(--navy), var(--navy-mid));
  padding: 40px 24px; color: white;
}
.profile-avatar {
  width: 90px; height: 90px; border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.3);
  object-fit: cover; margin-bottom: 16px;
}
.profile-name { font-size: 1.5rem; color: white; margin-bottom: 4px; }
.profile-email { color: rgba(255,255,255,0.65); font-size: 14px; }
.ward-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.9); padding: 6px 14px; border-radius: 100px;
  font-size: 13px; margin: 4px 4px 0 0;
}

/* ── Grievance form ──────────────────────────────────────── */
.grievance-notice {
  background: linear-gradient(135deg, #fff9e6, #fff3cd);
  border: 1px solid #ffd54f; border-radius: var(--radius-sm);
  padding: 16px; margin-bottom: 24px;
  display: flex; gap: 12px;
}
.grievance-notice .icon { font-size: 22px; flex-shrink: 0; }
.grievance-notice p { font-size: 13px; color: #7a5c00; margin: 0; }
.grievance-notice strong { color: #5a4000; }

/* Priority selector */
.priority-selector { display: flex; gap: 10px; }
.priority-option {
  flex: 1; padding: 10px; border: 1.5px solid var(--border);
  border-radius: 8px; text-align: center; cursor: pointer;
  transition: var(--transition);
}
.priority-option input { display: none; }
.priority-option:has(input:checked) { border-color: var(--navy); background: rgba(26,58,92,0.05); }
.priority-option .p-icon { font-size: 20px; display: block; margin-bottom: 4px; }
.priority-option .p-label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.priority-option:has(input:checked) .p-label { color: var(--navy); }

/* ── AI badge ────────────────────────────────────────────── */
.ai-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: linear-gradient(135deg, #1a2744, #253761);
  color: white; font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: 100px;
  letter-spacing: 0.5px;
}
.ai-badge::before { content: '✦'; color: var(--gold-lt); }

.ai-suggestion-box {
  background: linear-gradient(135deg, #f0f4fa, #e8f0fd);
  border: 1px solid rgba(45,80,128,0.2); border-radius: var(--radius-sm);
  padding: 16px; margin-top: 14px;
}
.ai-suggestion-box .ai-label {
  font-size: 11px; font-weight: 700; color: var(--navy-mid);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}

/* ── Footer ──────────────────────────────────────────────── */
footer {
  background: var(--navy-dark); color: rgba(255,255,255,0.5);
  text-align: center; padding: 28px;
  font-size: 13px; margin-top: 80px;
}
footer strong { color: rgba(255,255,255,0.8); }

/* ── Section spacing ─────────────────────────────────────── */
.section { padding: 48px 0; }
.section-sm { padding: 32px 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }
.fw-600 { font-weight: 600; }
.text-navy { color: var(--navy); }
.text-gold { color: var(--gold); }
.text-sm { font-size: 13px; }
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.4; }
.empty-state h3 { color: var(--text-muted); font-family: var(--font); font-weight: 500; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .sidebar-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid-3, .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .navbar-nav { display: none; }
  .navbar-toggle { display: block; }
  .hero h1 { font-size: 2rem; }
  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.4rem; }
  .priority-selector { flex-wrap: wrap; }
}

/* ── Loading spinner ─────────────────────────────────────── */
.spinner {
  width: 36px; height: 36px; border: 3px solid var(--border);
  border-top-color: var(--navy); border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── AI thinking animation ───────────────────────────────── */
.ai-thinking {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--navy-mid);
}
.ai-thinking .dot {
  width: 6px; height: 6px; background: var(--navy-mid);
  border-radius: 50%; animation: pulse 1.4s infinite;
}
.ai-thinking .dot:nth-child(2) { animation-delay: 0.2s; }
.ai-thinking .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes pulse {
  0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* ── Suggestion detail page ──────────────────────────────── */
.suggestion-body {
  font-size: 15px; line-height: 1.8; color: var(--text);
  padding: 24px 0;
}
.comment-item {
  padding: 16px; border-radius: var(--radius-sm);
  background: #f8fafc; border: 1px solid var(--border);
  margin-bottom: 14px;
}
.comment-item .comment-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.comment-item img { width: 28px; height: 28px; border-radius: 50%; }
.comment-item .comment-author { font-size: 13px; font-weight: 600; color: var(--navy); }
.comment-item .comment-time { font-size: 12px; color: var(--text-muted); margin-left: auto; }
.comment-item p { font-size: 14px; color: var(--text); margin: 0; }

/* Admin sidebar */
.admin-sidebar {
  width: 240px; background: var(--navy);
  min-height: 100vh; position: fixed; top: 0; left: 0;
  padding: 24px 0;
}
.admin-sidebar .sidebar-brand {
  padding: 0 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 12px;
}
.admin-sidebar .sidebar-brand h2 { color: white; font-size: 1rem; }
.admin-sidebar .sidebar-brand p { color: rgba(255,255,255,0.5); font-size: 11px; }
.admin-sidebar a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; color: rgba(255,255,255,0.65);
  font-size: 14px; transition: var(--transition);
}
.admin-sidebar a:hover, .admin-sidebar a.active {
  background: rgba(255,255,255,0.1); color: white;
}
.admin-sidebar a .icon { width: 18px; text-align: center; }
.admin-content { margin-left: 240px; padding: 32px; min-height: 100vh; }

/* ============================================================
   MOBILE-FIRST RESPONSIVE OVERHAUL
   Breakpoints: 480px (xs) | 640px (sm) | 900px (md) | 1160px (lg)
   ============================================================ */

/* ── Fluid container padding on small screens ── */
@media (max-width: 640px) {
  .container, .container-sm { padding: 0 16px; }
}

/* ── Navbar mobile drawer ── */
@media (max-width: 768px) {
  .navbar-inner { padding: 0 16px; height: 58px; }

  .navbar-brand .brand-text { font-size: 15px; }
  .navbar-brand .brand-sub  { display: none; }

  .navbar-toggle { display: flex; align-items: center; padding: 8px; }

  .navbar-nav {
    display: none;
    position: fixed;
    top: 58px; left: 0; right: 0;
    background: var(--navy-dark);
    flex-direction: column;
    align-items: stretch;
    padding: 12px 0 24px;
    gap: 2px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    z-index: 99;
    border-top: 1px solid rgba(255,255,255,0.08);
    max-height: calc(100vh - 58px);
    overflow-y: auto;
  }
  .navbar-nav.open {
    display: flex !important;
    animation: navSlideDown .2s ease;
  }
  @keyframes navSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .navbar-nav a {
    padding: 13px 20px;
    font-size: 15px;
    border-radius: 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }
  .navbar-nav a:last-child { border-bottom: none; }

  .navbar-nav .nav-btn {
    margin: 12px 16px 0;
    border-radius: 10px;
    text-align: center;
    padding: 13px 20px;
    font-size: 15px;
  }

  .nav-user {
    padding: 12px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 6px;
  }
  .nav-user-name { font-size: 14px; }
}

/* ── Flash notifications on mobile ── */
@media (max-width: 640px) {
  div[style*="position:fixed;top:72px"] {
    top: 64px !important;
    right: 12px !important;
    left: 12px !important;
    max-width: 100% !important;
  }
}

/* ── Hero section ── */
@media (max-width: 768px) {
  .hero { padding: 48px 20px; }
  .hero h1 { font-size: 2rem; }
  .hero p { font-size: 15px; }
}
@media (max-width: 480px) {
  .hero { padding: 36px 16px; }
  .hero h1 { font-size: 1.7rem; }
  .hero p  { font-size: 14px; }
  .page-header { padding: 28px 16px; }
  .page-header h1 { font-size: 1.5rem; }
}

/* ── Stats / KPI row ── */
@media (max-width: 640px) {
  .stats-row, .kpi-row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
  }
  .stat-card, .kpi-card {
    padding: 14px 12px !important;
  }
  .stat-card .stat-value { font-size: 1.6rem !important; }
}
@media (max-width: 360px) {
  .stats-row, .kpi-row { grid-template-columns: 1fr 1fr !important; }
}

/* ── Suggestion cards grid ── */
@media (max-width: 900px) {
  .suggestions-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 600px) {
  .suggestions-grid { grid-template-columns: 1fr !important; }
}

/* ── Suggestion detail sidebar layout ── */
@media (max-width: 860px) {
  .sidebar-layout {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }
  .sidebar-layout > aside {
    order: -1; /* Move sidebar above content on mobile */
  }
}

/* ── Forms ── */
@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr !important; gap: 0; }
  .form-group { margin-bottom: 16px; }
  .form-control {
    font-size: 16px !important; /* Prevents iOS zoom on focus */
    padding: 11px 14px;
  }
  textarea.form-control { font-size: 16px !important; }
  select.form-control  { font-size: 16px !important; }

  .btn { padding: 11px 20px; font-size: 14px; }
  .btn-primary { width: 100%; justify-content: center; }
}

/* ── Auth pages (login/register) ── */
@media (max-width: 540px) {
  .auth-wrap { padding: 20px 16px !important; padding-top: 30px !important; }
  .auth-card { border-radius: 16px; }
  .auth-card .auth-body { padding: 20px 20px; }
  .auth-card .auth-header { padding: 24px 20px 16px; }
}

/* ── Ward rows in register ── */
@media (max-width: 540px) {
  .ward-row .form-row { grid-template-columns: 1fr !important; }
}

/* ── Profile page ── */
@media (max-width: 700px) {
  .profile-header-inner {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 16px;
  }
  .profile-avatar-wrap { align-self: center; }
}

/* ── Vote/rating action bar ── */
@media (max-width: 540px) {
  .vote-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px;
  }
  .vote-btn, .vote-bar .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ── Suggestion submit page ── */
@media (max-width: 860px) {
  .submit-layout {
    grid-template-columns: 1fr !important;
  }
  .submit-sidebar { display: none; } /* Hide tips sidebar on mobile */
}

/* ── My activity tabs ── */
@media (max-width: 540px) {
  .tabs-bar {
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .tabs-bar::-webkit-scrollbar { display: none; }
  .tab { white-space: nowrap; font-size: .8rem; padding: .4rem .7rem; }
}

/* ── Admin sidebar — collapse on mobile ── */
@media (max-width: 900px) {
  .admin-wrap { flex-direction: column; }

  .admin-sidebar {
    width: 100% !important;
    min-height: unset !important;
    position: static !important;
    padding: 0 !important;
  }

  .admin-sidebar .brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px !important;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 0 !important;
    cursor: pointer;
  }
  .admin-sidebar .brand::after {
    content: '▾';
    color: rgba(255,255,255,0.6);
    font-size: 1.1rem;
    transition: transform .2s;
  }
  .admin-sidebar.nav-open .brand::after { transform: rotate(180deg); }

  .admin-nav {
    display: none;
    flex-direction: column;
    border-bottom: 2px solid rgba(255,255,255,0.1);
  }
  .admin-sidebar.nav-open .admin-nav { display: flex; }

  .admin-nav a {
    padding: 12px 16px !important;
    border-right: none !important;
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }

  .admin-content { width: 100%; }
  .admin-body { padding: 16px !important; }
  .admin-topbar { padding: 12px 16px !important; }
  .admin-topbar h1 { font-size: 1.2rem !important; }
}

/* ── Admin tables → card view on mobile ── */
@media (max-width: 700px) {
  table { display: block; }
  thead { display: none; }
  tbody { display: block; }
  tr {
    display: block;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    margin-bottom: 12px;
    padding: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
  }
  td {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    border-bottom: 1px solid #f5f5f5 !important;
    padding: 8px 4px !important;
    font-size: .85rem;
  }
  td:last-child { border-bottom: none !important; }
  td::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: .72rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .06em;
    min-width: 80px;
    flex-shrink: 0;
    padding-top: 2px;
  }
}

/* ── Admin modals ── */
@media (max-width: 600px) {
  .modal-box {
    padding: 1.4rem !important;
    border-radius: 16px 16px 0 0 !important;
    max-height: 90vh !important;
    width: 100% !important;
    margin-top: auto;
  }
  .modal-overlay { align-items: flex-end !important; }
}

/* ── Pagination ── */
@media (max-width: 540px) {
  .pagination { gap: 4px; flex-wrap: wrap; justify-content: center; }
  .page-btn { padding: 6px 10px; font-size: .8rem; min-width: 34px; }
}

/* ── Cards general ── */
@media (max-width: 540px) {
  .card, .suggestion-card { border-radius: 10px; }
  .card-body { padding: 16px; }
}

/* ── Filter bars ── */
@media (max-width: 640px) {
  .filter-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    padding: 12px !important;
  }
  .filter-bar input,
  .filter-bar select { width: 100%; }
  .filter-bar .btn { width: 100%; text-align: center; }
}

/* ── Priority selector (grievance) ── */
@media (max-width: 540px) {
  .priority-selector {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px;
  }
  .priority-option label { padding: 10px 8px; font-size: .82rem; }
}

/* ── Toggle switches row (settings) ── */
@media (max-width: 540px) {
  .toggle-row { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ── Suggestion meta chips — wrap nicely ── */
@media (max-width: 540px) {
  .suggestion-meta, .activity-meta {
    gap: 6px;
  }
  .meta-chip, .meta-tag {
    font-size: .72rem;
  }
}

/* ── Tabs (admin) ── */
@media (max-width: 640px) {
  .tabs {
    overflow-x: auto;
    flex-wrap: nowrap !important;
    padding-bottom: 6px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab-btn { white-space: nowrap; font-size: .78rem; padding: .4rem .8rem; }
}

/* ── My grievances ── */
@media (max-width: 540px) {
  .grievance-card { padding: 14px !important; }
  .grievance-header { flex-direction: column !important; gap: 8px !important; }
}

/* ── Index homepage how-it-works ── */
@media (max-width: 640px) {
  .how-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }
}

/* ── Stat mini cards (admin) ── */
@media (max-width: 540px) {
  .stats-mini {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px;
  }
  .stat-mini-card { min-width: 0; padding: .7rem 1rem !important; }
  .stat-mini-card .val { font-size: 1.3rem; }
}

/* ── Buttons in action rows ── */
@media (max-width: 480px) {
  .suggestion-row > div:last-child {
    flex-direction: column !important;
  }
  .btn-sm { width: 100%; text-align: center; justify-content: center; }
}

/* ── Global touch targets ── */
@media (max-width: 768px) {
  a, button, .btn, .btn-sm, .page-btn, .tab, .tab-btn {
    -webkit-tap-highlight-color: transparent;
  }
  /* Ensure minimum tap target size */
  .btn-sm { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; }
}

/* ── Smooth scrolling & overflow fix ── */
html { overflow-x: hidden; }
body { overflow-x: hidden; }

