/* =========================================
   SMART CITY — DESIGN SYSTEM
   Theme: Professional Civic / Government
   Fonts: DM Sans + DM Serif Display
   ========================================= */

:root {
  /* Primary Palette */
  --navy:       #0f1f3d;
  --navy-mid:   #1e3a5f;
  --blue:       #2563eb;
  --blue-light: #3b82f6;
  --blue-pale:  #eff6ff;

  /* Accent */
  --teal:       #0d9488;
  --teal-light: #99f6e4;

  /* Status Colors */
  --pending:    #f59e0b;
  --pending-bg: #fffbeb;
  --inprogress: #3b82f6;
  --inprogress-bg: #eff6ff;
  --resolved:   #10b981;
  --resolved-bg:#ecfdf5;

  /* Neutrals */
  --white:    #ffffff;
  --gray-50:  #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* Typography */
  --font-sans: 'DM Sans', sans-serif;
  --font-serif: 'DM Serif Display', serif;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
}

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--gray-800);
  background:
    radial-gradient(circle at top left, rgba(37,99,235,0.08), transparent 28%),
    linear-gradient(180deg, #f4f7fb 0%, #eef4ff 100%);
  -webkit-font-smoothing: antialiased;
}

body.report-page {
  background:
    radial-gradient(circle at top left, rgba(59,130,246,0.10), transparent 30%),
    linear-gradient(180deg, #f6f8fc 0%, #eef4ff 100%);
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }
img { max-width: 100%; display: block; }

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ============================
   NAVIGATION
   ============================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-xs);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  background: var(--gray-100);
  border-radius: 999px;
}
.lang-btn {
  border: none;
  background: transparent;
  color: var(--gray-600);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.lang-btn.active {
  background: linear-gradient(135deg, var(--blue), var(--teal));
  color: var(--white);
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--navy);
}
.logo-icon { font-size: 1.5rem; }
.nav-links { display: flex; gap: 4px; }
.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-600);
  transition: all 0.2s var(--ease);
}
.nav-link:hover { color: var(--blue); background: var(--blue-pale); }
.nav-link.active { color: var(--blue); background: var(--blue-pale); font-weight: 600; }

/* ============================
   HERO SECTION
   ============================ */
.hero {
  position: relative;
  background: linear-gradient(135deg, #0f1f3d 0%, #1b3d67 35%, #0b4f7c 100%);
  overflow: hidden;
  padding: 80px 24px 90px;
  text-align: center;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -20%, rgba(96,165,250,0.42), transparent),
    radial-gradient(ellipse 50% 55% at 85% 100%, rgba(45,212,191,0.26), transparent),
    linear-gradient(135deg, rgba(255,255,255,0.04), transparent 55%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 82px;
  background: linear-gradient(to top, rgba(245,247,251,0.96), transparent);
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.86);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 18px;
  border-radius: 100px;
  margin-bottom: 24px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
.badge-dot {
  width: 8px; height: 8px;
  background: var(--teal-light);
  border-radius: 50%;
  animation: pulse 2s infinite;
  box-shadow: 0 0 0 6px rgba(153,246,228,0.12);
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.4); }
}
.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.25rem, 5vw, 4rem);
  color: var(--white);
  line-height: 1.05;
  margin-bottom: 18px;
  letter-spacing: -0.06em;
}
.hero-sub {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: rgba(255,255,255,0.76);
  max-width: 640px;
  margin: 0 auto 40px;
  line-height: 1.7;
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 0;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-xl);
  padding: 18px 20px;
  max-width: 560px;
  margin: 0 auto;
  backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
.stat-item {
  text-align: center;
  padding: 12px 10px;
}
.stat-num {
  display: block;
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--white);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.05em;
  margin-bottom: 2px;
}
.stat-label {
  font-size: 11px;
  color: rgba(255,255,255,0.61);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.stat-divider {
  width: 1px;
  height: 54px;
  background: rgba(255,255,255,0.15);
  justify-self: center;
}

/* ============================
   FORM SECTION
   ============================ */
.form-section { padding: 48px 24px 80px; }
.container { max-width: 1100px; margin: 0 auto; }

.form-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: 0 28px 70px rgba(15,31,61,0.12);
  border: 1px solid rgba(148,163,184,0.24);
  overflow: hidden;
  margin-bottom: 48px;
}
.form-header {
  background: linear-gradient(135deg, #132d4c 0%, #1f4d7a 35%, #2563eb 100%);
  padding: 32px 40px;
}
.form-title {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 2vw, 2rem);
  color: var(--white);
  margin-bottom: 6px;
  letter-spacing: -0.04em;
}
.form-subtitle { color: rgba(255,255,255,0.72); font-size: 14px; }

.complaint-form { padding: 40px; }

.form-section-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 32px 0 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-100);
}
.form-section-label:first-of-type { margin-top: 0; }
.section-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  background: var(--blue);
  color: var(--white);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.form-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.form-group:last-child { margin-bottom: 0; }

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
}
.required { color: #ef4444; }
.optional { color: var(--gray-400); font-weight: 400; font-size: 12px; }
.field-hint { font-size: 12px; color: var(--gray-400); margin-top: -4px; }

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon {
  position: absolute;
  left: 14px;
  font-size: 16px;
  pointer-events: none;
  z-index: 1;
}
.form-input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--gray-800);
  background: var(--white);
  transition: all 0.2s var(--ease);
  outline: none;
}
.form-input:hover { border-color: var(--gray-300); }
.form-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.form-input::placeholder { color: var(--gray-400); }

.form-textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--gray-800);
  background: var(--white);
  transition: all 0.2s var(--ease);
  outline: none;
  resize: vertical;
  min-height: 100px;
}
.form-textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.form-textarea::placeholder { color: var(--gray-400); }
.small-textarea { min-height: 64px; resize: none; }

.textarea-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}
.char-count { font-size: 12px; color: var(--gray-400); }
.ai-detect-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  color: var(--white);
  border: none;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s var(--ease);
}
.ai-detect-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79,70,229,0.4); }
.ai-icon { font-size: 14px; }

/* AI Result Banner */
.ai-result {
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  border: 1px solid #bae6fd;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 20px;
  animation: slideDown 0.3s var(--ease-out);
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ai-result-inner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ai-label { font-size: 13px; color: var(--gray-600); }
.ai-category {
  font-size: 15px;
  font-weight: 700;
  color: var(--blue);
}
.ai-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  color: white;
  padding: 3px 8px;
  border-radius: 100px;
}

/* Category Grid */
.category-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.cat-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--gray-600);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s var(--ease);
}
.cat-btn:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-pale); }
.cat-btn.selected {
  border-color: var(--blue);
  background: var(--blue);
  color: var(--white);
}
.cat-icon { font-size: 18px; }

/* Locate Button */
.locate-btn {
  position: absolute;
  right: 12px;
  background: var(--blue-pale);
  border: none;
  color: var(--blue);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  transition: all 0.2s;
}
.locate-btn:hover { background: var(--blue); color: white; }

/* Map */
.map-container {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1.5px solid var(--gray-200);
  margin-bottom: 20px;
  position: relative;
}
#map { width: 100%; height: 320px; background: var(--gray-100); }
.map-hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15,31,61,0.85);
  color: rgba(255,255,255,0.9);
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 100px;
  backdrop-filter: blur(4px);
  pointer-events: none;
  white-space: nowrap;
}

/* Upload Area */
.upload-area {
  position: relative;
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius-md);
  transition: all 0.2s var(--ease);
  background: var(--gray-50);
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.upload-area.drag-over { border-color: var(--blue); background: var(--blue-pale); }
.file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.upload-content { text-align: center; padding: 28px; pointer-events: none; }
.upload-icon { font-size: 2.5rem; margin-bottom: 12px; }
.upload-text { font-size: 14px; color: var(--gray-600); margin-bottom: 4px; }
.upload-link { color: var(--blue); font-weight: 600; }
.upload-hint { font-size: 12px; color: var(--gray-400); }
.upload-preview {
  position: relative;
  width: 100%;
  padding: 16px;
}
.preview-img {
  width: 100%;
  max-height: 250px;
  object-fit: contain;
  border-radius: var(--radius-md);
}
.remove-img-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  background: rgba(0,0,0,0.7);
  color: white;
  border: none;
  width: 28px; height: 28px;
  border-radius: 50%;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.remove-img-btn:hover { background: #ef4444; }

/* Submit Button */
.form-actions { margin-top: 40px; }
.submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--navy-mid), var(--blue));
  color: var(--white);
  border: none;
  padding: 15px 36px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  transition: all 0.3s var(--ease);
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}
.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37,99,235,0.4);
}
.submit-btn:active { transform: translateY(0); }
.submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-icon { font-size: 18px; }

/* Success Message */
.success-msg {
  padding: 80px 40px;
  text-align: center;
  animation: fadeIn 0.5s var(--ease-out);
}
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}
.success-icon { font-size: 4rem; margin-bottom: 20px; }
.success-msg h3 {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  color: var(--gray-800);
  margin-bottom: 12px;
}
.success-msg p { color: var(--gray-500); font-size: 15px; max-width: 400px; margin: 0 auto 32px; }
.reset-btn {
  background: var(--blue);
  color: white;
  border: none;
  padding: 12px 28px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s;
}
.reset-btn:hover { background: var(--navy-mid); }

/* How It Works */
.how-it-works {
  background: var(--white);
  border-radius: var(--radius-xl);
  border: 1px solid var(--gray-200);
  padding: 40px;
  box-shadow: var(--shadow-md);
}
.hiw-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--gray-800);
  margin-bottom: 32px;
}
.hiw-steps {
  display: flex;
  align-items: flex-start;
  gap: 0;
  overflow-x: auto;
}
.hiw-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex: 1;
  min-width: 160px;
}
.step-circle {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--navy-mid), var(--blue));
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.step-info h4 { font-size: 14px; font-weight: 600; color: var(--gray-800); margin-bottom: 4px; }
.step-info p { font-size: 13px; color: var(--gray-500); line-height: 1.5; }
.hiw-connector {
  width: 40px;
  height: 2px;
  background: var(--gray-200);
  margin-top: 17px;
  flex-shrink: 0;
}

/* ============================
   ADMIN LAYOUT
   ============================ */
.admin-page {
  background: var(--gray-100);
  overflow: hidden;
}
.admin-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 250px;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.3s var(--ease);
  overflow: hidden;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo .logo-icon { font-size: 1.75rem; }
.sidebar-logo .logo-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--white);
}
.sidebar-nav {
  flex: 1;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  color: rgba(255,255,255,0.6);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s var(--ease);
  position: relative;
}
.sidebar-link:hover { background: rgba(255,255,255,0.08); color: var(--white); }
.sidebar-link.active {
  background: rgba(37,99,235,0.3);
  color: var(--white);
  border: 1px solid rgba(37,99,235,0.4);
}
.link-icon { font-size: 18px; flex-shrink: 0; }
.link-badge {
  margin-left: auto;
  background: #ef4444;
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 100px;
  min-width: 20px;
  text-align: center;
}
.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 16px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-avatar { font-size: 1.5rem; }
.admin-name { font-size: 14px; font-weight: 600; color: var(--white); }
.admin-role { font-size: 11px; color: rgba(255,255,255,0.4); }
.logout-btn {
  margin-left: auto;
  background: transparent;
  border: none;
  font-size: 18px;
  color: rgba(255,255,255,0.5);
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}
.logout-btn:hover { color: #ef4444; background: rgba(239,68,68,0.1); }

/* Main Content */
.admin-main {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: var(--shadow-xs);
  flex-shrink: 0;
}
.menu-toggle {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--gray-600);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  display: none;
}
.topbar-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-800);
}
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.refresh-btn {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--gray-600);
  display: flex;
  align-items: center;
  transition: all 0.2s;
}
.refresh-btn:hover { background: var(--blue-pale); color: var(--blue); border-color: var(--blue); }
.refresh-btn.spinning svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.topbar-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  padding: 8px 14px;
  border: 1px solid var(--blue);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}
.topbar-link:hover { background: var(--blue); color: white; }

/* Tab Content */
.tab-content {
  display: none;
  padding: 28px;
  flex: 1;
}
.tab-content.active { display: block; }
.page-header { margin-bottom: 28px; }
.page-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  color: var(--gray-900);
  margin-bottom: 4px;
}
.page-sub { font-size: 14px; color: var(--gray-500); }

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-icon { font-size: 2rem; flex-shrink: 0; }
.kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.kpi-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.an-small { font-size: 1.25rem; }
.kpi-trend { font-size: 12px; color: var(--gray-400); margin-top: 4px; }
.kpi-total { border-left: 4px solid var(--blue); }
.kpi-pending { border-left: 4px solid var(--pending); }
.kpi-progress { border-left: 4px solid var(--inprogress); }
.kpi-resolved { border-left: 4px solid var(--resolved); }

/* Charts */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.chart-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}
.chart-large { grid-column: span 1; }
.chart-full { grid-column: span 2; }
.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.chart-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-800);
}
.chart-period { font-size: 12px; color: var(--gray-400); font-weight: 400; }
.chart-body { position: relative; height: 240px; }
.chart-period-select {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 12px;
  color: var(--gray-600);
  cursor: pointer;
}

/* Section Card */
.section-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 20px;
}
.section-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-100);
}
.section-card-header h3 { font-size: 15px; font-weight: 700; color: var(--gray-800); }
.text-btn {
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  cursor: pointer;
  transition: color 0.2s;
}
.text-btn:hover { color: var(--navy-mid); }

/* Data Table */
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
}
.data-table td {
  padding: 13px 16px;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-50);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--gray-50); }
.table-empty {
  text-align: center;
  color: var(--gray-400);
  padding: 48px 16px !important;
  font-size: 14px;
}
.td-name { font-weight: 600; color: var(--gray-800); }
.td-email { font-size: 12px; color: var(--gray-400); }

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 100px;
}
.status-badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.badge-pending { background: var(--pending-bg); color: #92400e; }
.badge-inprogress { background: var(--inprogress-bg); color: #1e40af; }
.badge-resolved { background: var(--resolved-bg); color: #065f46; }

/* Category Tag */
.cat-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  background: var(--gray-100);
  color: var(--gray-600);
}

/* Action Buttons */
.action-btn {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  color: var(--gray-600);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
}
.action-btn:hover { background: var(--blue); color: var(--white); border-color: var(--blue); }
.action-btn.danger:hover { background: #ef4444; border-color: #ef4444; }

/* Recently Reported Issues */
.recent-complaints {
  margin-top: 80px;
  padding: 60px 20px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  border-radius: 12px;
  color: var(--white);
}
.recent-complaints .section-title {
  text-align: center;
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 40px;
}
.complaints-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}
.complaint-card {
  background: var(--white);
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s, box-shadow 0.2s;
  animation: slideIn 0.3s ease-out;
}
.complaint-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.complaint-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.complaint-category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  padding: 4px 8px;
  background: var(--gray-100);
  border-radius: 4px;
}
.complaint-status {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 100px;
  text-transform: uppercase;
}
.status-pending { background: var(--pending-bg); color: #92400e; }
.status-inprogress { background: var(--inprogress-bg); color: #1e40af; }
.status-resolved { background: var(--resolved-bg); color: #065f46; }
.complaint-description {
  color: var(--gray-700);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 12px;
}
.complaint-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--gray-500);
  margin-bottom: 12px;
}
.complaint-location {
  display: flex;
  align-items: center;
  gap: 4px;
  word-break: break-word;
}
.complaint-submitter {
  color: var(--gray-600);
  font-weight: 500;
}
.loading-spinner {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray-400);
  font-size: 14px;
}

/* Filter Bar */
.filter-bar {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}
.filter-group { display: flex; flex-direction: column; gap: 6px; }
.filter-search { flex: 1; min-width: 200px; }
.filter-label { font-size: 11px; font-weight: 700; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.06em; }
.filter-select, .filter-input {
  padding: 9px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--gray-700);
  background: var(--white);
  outline: none;
  min-width: 140px;
  transition: border-color 0.2s;
}
.filter-select:focus, .filter-input:focus { border-color: var(--blue); }
.apply-btn {
  background: var(--blue);
  color: white;
  border: none;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  transition: background 0.2s;
}
.apply-btn:hover { background: var(--navy-mid); }
.clear-btn {
  background: var(--gray-100);
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}
.clear-btn:hover { background: var(--gray-200); }

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 24px;
  border-top: 1px solid var(--gray-100);
}
.page-btn {
  min-width: 36px; height: 36px;
  padding: 0 10px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.page-btn:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-pale); }
.page-btn.active { background: var(--blue); color: white; border-color: var(--blue); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Analytics Status Bars */
.status-bars { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.status-bar-item { display: flex; flex-direction: column; gap: 8px; }
.status-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
}
.status-bar-track {
  height: 10px;
  background: var(--gray-100);
  border-radius: 5px;
  overflow: hidden;
}
.status-bar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 1s var(--ease);
}
.fill-pending { background: linear-gradient(90deg, var(--pending), #fbbf24); }
.fill-inprogress { background: linear-gradient(90deg, var(--inprogress), #60a5fa); }
.fill-resolved { background: linear-gradient(90deg, var(--resolved), #34d399); }

/* ============================
   LOGIN SCREEN
   ============================ */
.login-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}
.login-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--navy) 0%, #1a2a5e 50%, var(--navy-mid) 100%);
}
.login-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 30% 50%, rgba(37,99,235,0.3), transparent),
    radial-gradient(ellipse 40% 40% at 80% 30%, rgba(13,148,136,0.2), transparent);
}
.login-card {
  position: relative;
  z-index: 1;
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 48px 44px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-xl);
}
.login-logo {
  text-align: center;
  margin-bottom: 36px;
}
.login-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  color: var(--gray-900);
  margin: 12px 0 6px;
}
.login-sub { font-size: 14px; color: var(--gray-500); }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-btn { width: 100%; justify-content: center; margin-top: 8px; }
.toggle-pass {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  font-size: 16px;
  opacity: 0.5;
  cursor: pointer;
  transition: opacity 0.2s;
}
.toggle-pass:hover { opacity: 1; }
.login-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
}
.login-hint { text-align: center; font-size: 12px; color: var(--gray-400); margin-top: 8px; }
.back-link {
  display: block;
  text-align: center;
  margin-top: 20px;
  font-size: 13px; 
  color: var(--blue);
  font-weight: 500;
}
.back-link:hover { text-decoration: underline; }

/* ============================
   MODAL
   ============================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,31,61,0.5);
  backdrop-filter: blur(4px);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.25s var(--ease-out);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  border-bottom: 1px solid var(--gray-100);
}
.modal-title { font-size: 18px; font-weight: 700; color: var(--gray-900); }
.modal-close {
  background: var(--gray-100);
  border: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 14px;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.modal-close:hover { background: #fef2f2; color: #ef4444; }
.modal-body { padding: 28px; }
.modal-footer {
  padding: 20px 28px 28px;
  border-top: 1px solid var(--gray-100);
}
.status-update-row label { display: block; margin-bottom: 12px; }
.status-row { display: flex; flex-direction: column; gap: 10px; }
.modal-save-btn { align-self: flex-end; margin-top: 4px; }

/* Modal Detail Rows */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.detail-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.detail-value { font-size: 14px; color: var(--gray-800); font-weight: 500; }
.detail-desc {
  background: var(--gray-50);
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 14px;
  color: var(--gray-700);
  line-height: 1.6;
  margin-bottom: 16px;
  border: 1px solid var(--gray-100);
}
.modal-img {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  margin-top: 12px;
}

/* ============================
   TOAST
   ============================ */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--gray-900);
  color: var(--white);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-xl);
  z-index: 9999;
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.3s var(--ease);
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.toast-success { background: #065f46; }
.toast.toast-error   { background: #991b1b; }

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 900px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-row { grid-template-columns: 1fr; }
  .chart-full { grid-column: span 1; }
  .form-row { grid-template-columns: 1fr; }
  .hiw-steps { flex-direction: column; }
  .hiw-connector { width: 2px; height: 24px; margin: 0 17px; }
  .nav-inner { flex-wrap: wrap; padding: 12px 16px; }
}

@media (max-width: 768px) {
  .sidebar { display: none; position: fixed; z-index: 200; height: 100%; }
  .sidebar.open { display: flex; }
  .menu-toggle { display: block; }
  .complaint-form { padding: 24px; }
  .form-header { padding: 24px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .tab-content { padding: 16px; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .detail-grid { grid-template-columns: 1fr; }
  .nav-inner { justify-content: center; }
  .nav-actions { width: 100%; justify-content: space-between; }
  .nav-links { width: 100%; justify-content: center; }
  .hero { padding: 56px 18px 72px; }
  .form-card { margin-bottom: 28px; }
  .track-input-form { flex-direction: column; align-items: stretch; }
  .track-btn { width: 100%; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .hero { padding: 48px 16px 60px; }
  .hero-stats {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 18px 16px;
  }
  .stat-divider { display: none; }
  .category-grid { flex-direction: column; }
  .cat-btn { justify-content: flex-start; }
  .nav-inner { padding: 12px; }
  .nav-link { padding: 8px 10px; font-size: 13px; }
  .lang-switch { width: 100%; justify-content: center; }
  .form-header, .complaint-form { padding: 20px; }
  .section-card, .chart-card, .track-complaint { padding: 16px; }
  .topbar { padding: 12px 14px; }
  .topbar-actions { gap: 8px; }
  .track-input-form { flex-direction: column; }
  .track-btn { width: 100%; }
}

/* ============================
   TRACKING SECTION
   ============================ */
.track-complaint {
  margin-top: 80px;
  padding: 60px 20px;
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.track-complaint .section-title {
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 40px;
}

.track-form {
  max-width: 600px;
  margin: 0 auto;
}

.track-tabs {
  display: flex;
  background: var(--gray-100);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 24px;
}

.track-tab {
  flex: 1;
  background: none;
  border: none;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.2s;
}

.track-tab.active {
  background: var(--white);
  color: var(--blue);
  box-shadow: var(--shadow-xs);
}

.track-content {
  position: relative;
}

.track-panel {
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s var(--ease);
}

.track-panel.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.track-input-form {
  display: flex;
  gap: 16px;
  align-items: flex-end;
}

.track-input-form .form-group {
  flex: 1;
}

.track-btn {
  background: var(--blue);
  color: var(--white);
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.track-btn:hover {
  background: var(--navy-mid);
}

.track-results {
  margin-top: 40px;
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}

.track-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
}

.track-result-header h4 {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0;
}

.close-results {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--gray-400);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: all 0.2s;
}

.close-results:hover {
  background: var(--gray-100);
  color: var(--gray-600);
}

#trackResultContent {
  padding: 24px;
}

.track-complaint-item {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-xs);
}

.track-complaint-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.track-id {
  font-size: 14px;
  font-weight: 600;
  color: var(--blue);
  font-family: 'Courier New', monospace;
}

.track-status {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 100px;
  text-transform: uppercase;
}

.track-status.pending { background: var(--pending-bg); color: #92400e; }
.track-status.inprogress { background: var(--inprogress-bg); color: #1e40af; }
.track-status.resolved { background: var(--resolved-bg); color: #065f46; }

.track-category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  padding: 4px 8px;
  background: var(--gray-100);
  border-radius: 4px;
  margin-bottom: 8px;
}

.track-description {
  color: var(--gray-700);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 12px;
}

.track-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
  color: var(--gray-500);
  margin-bottom: 12px;
}

.track-location {
  display: flex;
  align-items: center;
  gap: 4px;
}

.track-date {
  color: var(--gray-600);
}

.track-admin-notes {
  background: var(--pending-bg);
  border: 1px solid var(--pending);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 13px;
  color: #92400e;
  margin-top: 12px;
}

.tracking-info {
  background: var(--blue-pale);
  border: 1px solid var(--blue-light);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 16px;
  text-align: center;
}

.tracking-id {
  font-size: 16px;
  font-weight: 700;
  color: var(--blue);
  font-family: 'Courier New', monospace;
  margin-bottom: 4px;
}

.tracking-note {
  font-size: 13px;
  color: var(--gray-600);
}

@media (max-width: 768px) {
  .track-input-form {
    flex-direction: column;
    align-items: stretch;
  }

  .track-btn {
    width: 100%;
  }

  .track-tabs {
    margin-bottom: 20px;
  }

  .track-result-header {
    padding: 16px 20px;
  }

  #trackResultContent {
    padding: 20px;
  }
}

/* ============================
   SMARTCITY — MODERN CIVIC UI
   ============================ */
:root {
  --navy: #102a43;
  --navy-mid: #173f5f;
  --blue: #2563eb;
  --blue-light: #4f83ff;
  --blue-pale: #eef4ff;
  --teal: #0e9f8a;
  --teal-light: #a7f3d0;
  --gray-50: #f5f7fb;
  --gray-100: #edf1f7;
  --gray-200: #dfe6ef;
  --gray-300: #c7d2e0;
  --gray-400: #8795a8;
  --gray-500: #66768a;
  --gray-600: #4d5f73;
  --gray-700: #34495e;
  --gray-800: #20364b;
  --gray-900: #12283d;
  --font-sans: 'DM Sans', Inter, system-ui, sans-serif;
  --font-serif: 'DM Sans', Inter, system-ui, sans-serif;
  --shadow-xs: 0 1px 2px rgba(16, 42, 67, .04);
  --shadow-sm: 0 4px 14px rgba(16, 42, 67, .06);
  --shadow-md: 0 12px 30px rgba(16, 42, 67, .09);
  --shadow-lg: 0 20px 48px rgba(16, 42, 67, .12);
  --shadow-xl: 0 28px 72px rgba(16, 42, 67, .16);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
}

body {
  background: #f5f7fb;
  color: #20364b;
  letter-spacing: -.01em;
}

button, input, textarea, select { font: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .28);
  outline-offset: 2px;
}

/* Public portal */
.navbar {
  background: rgba(255, 255, 255, .92);
  border-bottom-color: rgba(223, 230, 239, .8);
  box-shadow: 0 4px 18px rgba(16, 42, 67, .035);
}
.nav-inner { max-width: 1240px; min-height: 76px; }
.nav-logo { font-size: 1.2rem; letter-spacing: -.04em; }
.logo-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #edf4ff;
  font-size: 1.35rem;
}
.lang-switch { background: #f0f3f8; }
.lang-btn { padding: 7px 12px; transition: background .2s ease, color .2s ease; }
.lang-btn.active { background: #173f5f; box-shadow: 0 3px 8px rgba(16, 42, 67, .16); }
.nav-links { gap: 6px; }
.nav-link { padding: 9px 15px; font-weight: 600; }
.nav-link.active { background: #edf4ff; color: #2563eb; }

.hero {
  isolation: isolate;
  min-height: 390px;
  padding: 76px 24px 86px;
  text-align: left;
  background:
    radial-gradient(ellipse at 84% 12%, rgba(71, 143, 255, .31), transparent 31%),
    radial-gradient(ellipse at 68% 110%, rgba(20, 184, 166, .2), transparent 35%),
    #102a43;
}
.hero::before {
  content: '';
  position: absolute;
  z-index: -1;
  width: 430px;
  height: 430px;
  right: max(4vw, calc((100vw - 1220px) / 2));
  top: -145px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
  box-shadow: 0 0 0 48px rgba(255,255,255,.025), 0 0 0 96px rgba(255,255,255,.02);
}
.hero::after { height: 46px; background: linear-gradient(to top, #f5f7fb, transparent); }
.hero-content { max-width: 1180px; }
.hero-badge {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.17);
  border-radius: 10px;
  padding: 8px 13px;
  letter-spacing: .055em;
  margin-bottom: 20px;
}
.badge-dot { background: #5eead4; }
.hero-title {
  max-width: 780px;
  font-size: clamp(2.65rem, 5.4vw, 4.3rem);
  line-height: 1.04;
  letter-spacing: -.055em;
  font-weight: 700;
}
.hero-sub {
  max-width: 610px;
  margin: 0 0 30px;
  color: rgba(239, 246, 255, .76);
  font-size: 1.05rem;
  line-height: 1.75;
}
.hero-stats {
  max-width: 540px;
  margin: 0;
  padding: 16px 22px;
  border-radius: 18px;
  background: rgba(255,255,255,.075);
  border-color: rgba(255,255,255,.13);
}
.stat-num { font-size: 1.65rem; }
.stat-label { letter-spacing: .045em; }

.form-section { padding: 30px 24px 78px; }
.container { max-width: 1060px; }
.form-card {
  margin-top: -2px;
  border: 1px solid rgba(223,230,239,.9);
  border-radius: 24px;
  box-shadow: 0 18px 54px rgba(16,42,67,.09);
}
.form-header {
  padding: 30px 42px;
  background: linear-gradient(115deg, #173f5f, #245c83);
}
.form-title { font-size: 1.55rem; letter-spacing: -.035em; }
.form-subtitle { color: rgba(255,255,255,.76); }
.complaint-form { padding: 34px 42px 40px; }
.form-section-label {
  color: #3c5871;
  font-size: 12px;
  letter-spacing: .09em;
  margin: 27px 0 18px;
  border-bottom-color: #edf1f6;
}
.form-section-label:first-of-type { margin-top: 0; }
.section-num {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: #eaf1ff;
  color: #2563eb;
  font-size: 12px;
}
.form-group { gap: 9px; margin-bottom: 20px; }
.form-label { font-size: 13px; color: #34495e; }
.field-hint { color: #74859a; }
.form-input, .form-textarea, .filter-select, .filter-input {
  border: 1px solid #dce4ee;
  border-radius: 12px;
  background: #fbfcfe;
  color: #20364b;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.form-input { min-height: 48px; padding-top: 12px; padding-bottom: 12px; }
.form-input:hover, .form-textarea:hover { border-color: #bccbdd; background: #fff; }
.form-input:focus, .form-textarea:focus, .filter-select:focus, .filter-input:focus {
  border-color: #5483ef;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(37,99,235,.1);
}
.form-input::placeholder, .form-textarea::placeholder { color: #9aa8b8; }
.input-icon { opacity: .78; }
.form-textarea { min-height: 126px; }
.ai-detect-btn {
  padding: 9px 14px;
  border-radius: 10px;
  background: #f0edff;
  color: #6241c8;
  border: 1px solid #e1dbff;
}
.ai-detect-btn:hover { color: #fff; background: #6241c8; box-shadow: 0 6px 16px rgba(98,65,200,.2); }
.ai-result { border-radius: 14px; border-color: #d6e8ff; background: #f2f8ff; }
.ai-badge { background: #e8f0ff; color: #355fc2; }
.category-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.cat-btn {
  min-height: 86px;
  padding: 12px 10px;
  justify-content: center;
  flex-direction: column;
  gap: 7px;
  border: 1px solid #dce4ee;
  border-radius: 14px;
  color: #52677b;
  background: #fbfcfe;
  font-weight: 600;
}
.cat-icon { font-size: 22px; }
.cat-btn:hover { transform: translateY(-2px); background: #f3f7ff; border-color: #9bb7f5; }
.cat-btn.selected {
  color: #1d4ed8;
  border-color: #7ea2f2;
  background: #edf3ff;
  box-shadow: inset 0 0 0 1px rgba(37,99,235,.14);
}
.locate-btn { right: 8px; padding: 8px; border-radius: 10px; }
.map-container { border: 1px solid #dce4ee; border-radius: 16px; }
#map { height: 300px; }
.map-hint { background: rgba(16,42,67,.88); padding: 8px 14px; }
.upload-area {
  border: 1.5px dashed #b9c9dc;
  border-radius: 16px;
  background: #f8faff;
}
.upload-area:hover, .upload-area.drag-over { border-color: #5483ef; background: #f0f5ff; }
.upload-icon { font-size: 2.2rem; }
.submit-btn {
  min-height: 50px;
  padding: 13px 24px;
  border-radius: 12px;
  background: #2563eb;
  box-shadow: 0 7px 16px rgba(37,99,235,.19);
}
.submit-btn:hover { background: #1d4ed8; box-shadow: 0 11px 22px rgba(37,99,235,.24); }
.form-actions { margin-top: 30px; }
.success-msg { padding: 58px 36px; }
.success-icon { font-size: 3.4rem; }
.success-msg h3 { font-size: 1.65rem; letter-spacing: -.03em; }
.tracking-info {
  max-width: 440px;
  margin: 0 auto 24px;
  padding: 18px;
  background: #f3f7ff;
  border: 1px solid #dce7fb;
  border-radius: 16px;
}
.tracking-id { color: #233f68; }
.tracking-id span { color: #2563eb; font-weight: 700; }
.reset-btn, .track-btn { border-radius: 11px; background: #2563eb; }
.reset-btn:hover, .track-btn:hover { background: #1d4ed8; }

.how-it-works, .track-complaint, .recent-complaints {
  border: 1px solid #e2e9f1;
  border-radius: 22px;
  box-shadow: var(--shadow-sm);
}
.how-it-works { padding: 34px; }
.hiw-title, .track-complaint .section-title, .recent-complaints .section-title {
  font-size: 1.45rem;
  letter-spacing: -.035em;
}
.step-circle { background: #eaf1ff; color: #2563eb; }
.hiw-connector { background: #dce6f1; }
.track-complaint { margin-top: 32px; padding: 38px 34px; }
.track-complaint .section-title { margin-bottom: 24px; }
.track-tabs { background: #f1f4f8; padding: 5px; border-radius: 12px; }
.track-tab { border-radius: 9px; }
.track-tab.active { color: #1d4ed8; box-shadow: 0 2px 8px rgba(16,42,67,.08); }
.track-input-form .form-group { margin-bottom: 0; }
.track-btn { min-height: 46px; }
.track-results { border-radius: 16px; }
.track-complaint-item { border-radius: 14px; }
.track-id { color: #2563eb; }
.recent-complaints {
  margin-top: 32px;
  padding: 38px 34px;
  color: #20364b;
  background: #eef3f8;
}
.recent-complaints .section-title { color: #20364b; margin-bottom: 24px; }
.complaints-list { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.complaint-card {
  border: 1px solid #e2e9f1;
  border-radius: 16px;
  box-shadow: 0 5px 16px rgba(16,42,67,.055);
}
.complaint-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.complaint-category { border-radius: 8px; background: #f0f4f9; }

/* Admin portal */
.admin-page { background: #f3f6fa; }
.sidebar {
  width: 258px;
  background: #102a43;
  box-shadow: 8px 0 32px rgba(16,42,67,.08);
}
.sidebar-logo { padding: 24px 22px; }
.sidebar-logo .logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: rgba(255,255,255,.1);
  font-size: 1.35rem;
}
.sidebar-logo .logo-text { letter-spacing: -.035em; }
.sidebar-nav { padding: 24px 14px; gap: 6px; }
.sidebar-link {
  min-height: 46px;
  border-radius: 12px;
  color: rgba(237,244,251,.67);
}
.sidebar-link.active {
  color: #fff;
  background: rgba(89,145,255,.2);
  border-color: rgba(132,172,255,.22);
}
.sidebar-link:hover { background: rgba(255,255,255,.08); }
.sidebar-footer { padding: 18px; }
.admin-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
}
.admin-role { color: rgba(255,255,255,.62); }
.topbar {
  height: 72px;
  padding: 0 34px;
  border-bottom-color: #e5ebf2;
  box-shadow: 0 3px 14px rgba(16,42,67,.035);
}
.topbar-title { font-size: 15px; color: #52677b; }
.topbar-link { border-color: #d8e3f2; border-radius: 10px; color: #315d9f; }
.topbar-link:hover { background: #2563eb; border-color: #2563eb; }
.refresh-btn { border-radius: 10px; background: #f5f7fb; }
.tab-content { padding: 34px; }
.page-header { margin-bottom: 24px; }
.page-title { font-size: 1.8rem; font-weight: 700; letter-spacing: -.045em; color: #16324b; }
.page-sub { color: #718197; }
.kpi-grid { gap: 16px; margin-bottom: 20px; }
.kpi-card {
  min-height: 132px;
  border: 1px solid #e3eaf2;
  border-radius: 17px;
  padding: 21px;
  gap: 15px;
  box-shadow: 0 4px 15px rgba(16,42,67,.04);
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: 0 12px 24px rgba(16,42,67,.08); }
.kpi-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: #edf3ff;
  font-size: 1.45rem;
}
.kpi-pending .kpi-icon { background: #fff5df; }
.kpi-progress .kpi-icon { background: #e9f3ff; }
.kpi-resolved .kpi-icon { background: #e5f8f1; }
.kpi-label { color: #7c8ba0; }
.kpi-value { color: #16324b; letter-spacing: -.04em; }
.kpi-total, .kpi-pending, .kpi-progress, .kpi-resolved { border-left: 1px solid #e3eaf2; }
.charts-row { gap: 18px; margin-bottom: 18px; }
.chart-card, .section-card {
  border: 1px solid #e3eaf2;
  border-radius: 17px;
  box-shadow: 0 4px 15px rgba(16,42,67,.04);
}
.chart-card { padding: 22px; }
.chart-header h3, .section-card-header h3 { color: #203b55; letter-spacing: -.02em; }
.chart-body { height: 250px; }
.section-card-header { padding: 19px 22px; border-bottom-color: #edf1f6; }
.text-btn { color: #2563eb; }
.data-table { font-size: 13px; }
.data-table th { padding: 14px 16px; color: #8190a3; background: #f8fafd; }
.data-table td { padding: 15px 16px; }
.data-table tbody tr { transition: background .15s ease; }
.data-table tbody tr:hover { background: #f7faff; }
.status-badge { padding: 6px 10px; border-radius: 8px; }
.filter-bar { gap: 13px; padding: 18px; border-radius: 16px; }
.filter-select, .filter-input { min-height: 42px; border-radius: 10px; }
.apply-btn, .clear-btn { min-height: 42px; border-radius: 10px; }
.apply-btn { background: #2563eb; }
.page-btn { border-radius: 10px; }
.page-btn.active { background: #2563eb; }

.login-screen { background: #edf2f8; }
.login-bg {
  background:
    radial-gradient(ellipse at 76% 15%, rgba(69,130,238,.28), transparent 33%),
    radial-gradient(ellipse at 16% 90%, rgba(14,159,138,.2), transparent 34%),
    #102a43;
}
.login-card {
  max-width: 450px;
  padding: 42px;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 24px;
  box-shadow: 0 30px 90px rgba(4,20,37,.3);
}
.login-title { font-size: 1.65rem; font-weight: 700; letter-spacing: -.04em; }
.login-logo > span:first-child {
  display: inline-grid;
  place-items: center;
  width: 66px;
  height: 66px;
  border-radius: 20px;
  background: #edf4ff;
}
.login-form { gap: 13px; }
.login-hint { line-height: 1.55; }
.modal { border-radius: 20px; }
.modal-header, .modal-footer { border-color: #edf1f6; }
.modal-overlay { background: rgba(11,31,49,.62); }
.toast { border-radius: 13px; }

@media (max-width: 900px) {
  .hero { padding: 64px 24px 76px; }
  .category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tab-content { padding: 26px; }
  .topbar { padding: 0 24px; }
}

@media (max-width: 768px) {
  .nav-inner { justify-content: space-between; }
  .nav-actions { width: auto; }
  .nav-links { width: auto; }
  .hero { min-height: 0; padding: 54px 22px 68px; }
  .hero-title { font-size: clamp(2.35rem, 8vw, 3.5rem); }
  .hero::before { right: -240px; top: -150px; }
  .hero-stats { max-width: 100%; }
  .form-section { padding: 24px 16px 54px; }
  .complaint-form { padding: 28px; }
  .form-header { padding: 26px 28px; }
  .track-complaint, .recent-complaints { margin-top: 22px; padding: 28px 22px; }
  .sidebar {
    display: none;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 200;
    height: 100dvh;
    box-shadow: 18px 0 45px rgba(6,24,40,.24);
  }
  .sidebar.open { display: flex; }
  .admin-layout { height: 100dvh; }
  .tab-content { padding: 22px 18px; }
  .topbar { height: 64px; padding: 0 18px; }
  .menu-toggle { border-radius: 9px; background: #f1f4f8; }
}

@media (max-width: 560px) {
  .nav-inner { padding: 10px 14px; }
  .nav-logo { font-size: 1.05rem; }
  .logo-icon { width: 36px; height: 36px; border-radius: 11px; }
  .nav-actions { gap: 8px; }
  .lang-switch { width: auto; }
  .nav-links { gap: 2px; }
  .nav-link { padding: 8px 9px; font-size: 12px; }
  .hero { padding: 44px 18px 60px; }
  .hero-badge { margin-bottom: 16px; font-size: 10px; }
  .hero-title { font-size: 2.5rem; }
  .hero-sub { font-size: .95rem; margin-bottom: 24px; }
  .hero-stats { padding: 14px 12px; border-radius: 15px; }
  .stat-num { font-size: 1.45rem; }
  .stat-label { font-size: 9px; }
  .form-card { border-radius: 18px; }
  .form-header { padding: 23px 20px; }
  .form-title { font-size: 1.35rem; }
  .complaint-form { padding: 22px 20px 26px; }
  .form-section-label { margin-top: 24px; }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cat-btn { min-height: 76px; }
  .textarea-footer { align-items: flex-start; gap: 10px; flex-wrap: wrap; }
  #map { height: 250px; }
  .map-hint { max-width: calc(100% - 20px); white-space: normal; text-align: center; }
  .form-actions .submit-btn { width: 100%; justify-content: center; }
  .how-it-works, .track-complaint, .recent-complaints { padding: 24px 18px; border-radius: 18px; }
  .hiw-steps { gap: 3px; }
  .hiw-connector { margin-left: 17px; }
  .complaints-list { grid-template-columns: 1fr; }
  .track-input-form { gap: 12px; }
  .track-results { margin-top: 24px; }
  .track-result-header { padding: 15px 17px; }
  #trackResultContent { padding: 16px; }
  .toast { left: 14px; right: 14px; bottom: 14px; max-width: none; }
  .login-card { padding: 32px 24px; }
  .tab-content { padding: 20px 14px; }
  .topbar { gap: 10px; padding: 0 12px; }
  .topbar-actions { gap: 6px; }
  .topbar-link { display: none; }
  .topbar .lang-switch { gap: 2px; }
  .topbar .lang-btn { padding: 6px 8px; }
  .page-title { font-size: 1.55rem; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi-card { min-height: 116px; padding: 14px; gap: 10px; align-items: flex-start; flex-direction: column; }
  .kpi-icon { width: 36px; height: 36px; border-radius: 11px; font-size: 1.15rem; }
  .kpi-label { font-size: 10px; }
  .kpi-value { font-size: 1.65rem; }
  .kpi-trend { font-size: 10px; }
  .chart-card { padding: 17px; }
  .chart-body { height: 220px; }
  .section-card-header { padding: 16px; }
  .filter-bar { padding: 15px; }
  .filter-search { min-width: 0; }
  .filter-select, .filter-input { width: 100%; }
  .filter-bar > button { width: 100%; }
  .modal-overlay { padding: 12px; }
  .modal-header, .modal-body, .modal-footer { padding-left: 18px; padding-right: 18px; }
  .status-row .submit-btn { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
