:root {
  --navy: #0b1f33;
  --navy-light: #14304d;
  --charcoal: #1f2937;
  --accent: #0e7c86;       /* deep teal - engineering/infra accent */
  --accent-dark: #0a5f67;
  --accent-light: #e6f4f5;
  --bg: #f7f9fa;
  --card-bg: #ffffff;
  --border: #e2e8ef;
  --text: #1f2937;
  --text-muted: #5b6b7c;
  --success: #1c8a4b;
  --warning: #b8860b;
  --danger: #c0392b;
  --critical-bg: #fdecea;
  --high-bg: #fff4e5;
  --medium-bg: #eef6ff;
  --low-bg: #eef9f0;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(11, 31, 51, 0.08), 0 1px 2px rgba(11, 31, 51, 0.06);
  --shadow-md: 0 4px 14px rgba(11, 31, 51, 0.10);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

img { max-width: 100%; display: block; }

a { color: var(--accent); text-decoration: none; }

button, input, select, textarea { font-family: inherit; }

/* ---------- Layout shells ---------- */

.app-header {
  background: var(--navy);
  color: #fff;
  padding: 10px 16px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-row img.logo {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  padding: 2px;
}

.brand-text .company {
  font-size: 12px;
  letter-spacing: 0.3px;
  font-weight: 600;
  line-height: 1.2;
}

.brand-text .tag {
  font-size: 10.5px;
  color: #a9c0d2;
  line-height: 1.2;
}

.nav-links {
  margin-top: 8px;
  display: flex;
  gap: 14px;
  font-size: 13px;
}

.nav-links a {
  color: #cfe3ee;
  padding: 4px 0;
}

.nav-links a.active {
  color: #fff;
  border-bottom: 2px solid var(--accent);
  font-weight: 600;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
}

.container-wide {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px;
}

/* ---------- Hero / home ---------- */

.hero {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-light) 60%, var(--accent-dark) 130%);
  color: #fff;
  padding: 30px 18px 34px;
  text-align: center;
}

.hero .eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #9fd6da;
  font-weight: 700;
  margin-bottom: 8px;
}

.hero h1 {
  font-size: 30px;
  margin: 0 0 6px;
  letter-spacing: -0.3px;
}

.hero .subtitle {
  font-size: 14.5px;
  color: #d7e6ee;
  margin: 0 0 16px;
  font-weight: 500;
}

.hero .mission {
  font-size: 13.5px;
  color: #c3d6e2;
  max-width: 520px;
  margin: 0 auto 22px;
  line-height: 1.55;
}

.cta-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
  margin: 0 auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 15.5px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  min-height: 50px;
  transition: transform 0.05s ease, opacity 0.15s ease;
}

.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary { background: rgba(255,255,255,0.12); color: #fff; border: 1px solid rgba(255,255,255,0.35); }
.btn-secondary:hover { background: rgba(255,255,255,0.2); }
.btn-outline { background: #fff; color: var(--accent-dark); border: 1.5px solid var(--accent); }
.btn-block { width: 100%; }
.btn-sm { min-height: 38px; padding: 8px 14px; font-size: 13.5px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.flow-strip {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 22px auto 0;
  font-size: 11.5px;
  color: #b9d3de;
}

.flow-strip span.step {
  background: rgba(255,255,255,0.08);
  padding: 5px 9px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.15);
}

/* ---------- Sections ---------- */

.section {
  padding: 26px 18px;
}

.section h2 {
  font-size: 19px;
  margin: 0 0 14px;
  color: var(--navy);
}

.how-grid, .report-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.how-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.how-card .num {
  background: var(--accent-light);
  color: var(--accent-dark);
  font-weight: 700;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.how-card .txt strong { display: block; font-size: 14.5px; margin-bottom: 2px; }
.how-card .txt span { font-size: 12.5px; color: var(--text-muted); }

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  background: var(--medium-bg);
  color: var(--navy);
  font-size: 12.5px;
  padding: 6px 11px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

@media (min-width: 640px) {
  .how-grid { grid-template-columns: repeat(3, 1fr); }
  .hero h1 { font-size: 38px; }
}

/* ---------- Cards / forms ---------- */

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.card h3 {
  font-size: 15.5px;
  margin: 0 0 12px;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card h3 .step-badge {
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 6px;
}

.field .hint {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

input[type="text"], input[type="tel"], input[type="email"], select, textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  background: #fff;
  color: var(--text);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

textarea { resize: vertical; min-height: 90px; }

.two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 480px) {
  .two-col { grid-template-columns: 1fr 1fr; }
}

/* ---------- Location box ---------- */

.location-box {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
  background: #fafcfd;
}

.location-box.captured {
  border-style: solid;
  border-color: var(--success);
  background: #f2faf5;
  text-align: left;
}

.location-box .loc-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--success);
  font-size: 14px;
  margin-bottom: 6px;
}

.location-box .loc-details {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ---------- Image upload ---------- */

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 22px 14px;
  text-align: center;
  background: #fafcfd;
  cursor: pointer;
}

.upload-zone:active { background: var(--accent-light); }

.upload-zone .icon { font-size: 30px; margin-bottom: 6px; }
.upload-zone strong { display: block; font-size: 14.5px; color: var(--navy); }
.upload-zone span { font-size: 12px; color: var(--text-muted); }

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.thumb {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--border);
}

.thumb img { width: 100%; height: 100%; object-fit: cover; }

.thumb .remove-btn {
  position: absolute;
  top: 3px;
  right: 3px;
  background: rgba(15, 23, 33, 0.75);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-bar .fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.2s ease;
}

/* ---------- Alerts / status ---------- */

.alert {
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 13.5px;
  margin-bottom: 14px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.alert-error { background: var(--critical-bg); color: #8a2a20; border: 1px solid #f3c9c3; }
.alert-success { background: #eafaf0; color: #1c6b3d; border: 1px solid #bfe9cf; }
.alert-info { background: var(--medium-bg); color: var(--navy); border: 1px solid #cfe1f0; }

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-critical { background: var(--critical-bg); color: var(--danger); }
.badge-high { background: var(--high-bg); color: #a05a00; }
.badge-medium { background: var(--medium-bg); color: #1c5fa8; }
.badge-low { background: var(--low-bg); color: var(--success); }
.badge-status { background: #eef1f5; color: var(--charcoal); }
.badge-demo { background: #f1ecfb; color: #6b3fa0; }

/* ---------- Success screen ---------- */

.success-screen {
  text-align: center;
  padding: 30px 18px;
}

.success-screen .checkmark {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: #eafaf0;
  color: var(--success);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  margin: 0 auto 14px;
}

.complaint-id-box {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  padding: 16px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin: 16px 0;
}

/* ---------- Timeline (track page) ---------- */

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 20px 0;
}

.timeline .tl-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.timeline .tl-dot-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.timeline .tl-dot {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--border);
  color: #fff;
  font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  flex: none;
}

.timeline .tl-step.done .tl-dot { background: var(--success); }
.timeline .tl-step.current .tl-dot { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-light); }

.timeline .tl-line {
  width: 2px;
  flex: 1;
  background: var(--border);
  min-height: 26px;
}

.timeline .tl-step.done .tl-line { background: var(--success); }

.timeline .tl-content {
  padding-bottom: 22px;
  font-size: 14px;
}

.timeline .tl-content strong { display: block; color: var(--navy); margin-bottom: 2px; }
.timeline .tl-content span { color: var(--text-muted); font-size: 12.5px; }

/* ---------- Dashboard ---------- */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

@media (min-width: 720px) {
  .kpi-grid { grid-template-columns: repeat(6, 1fr); }
}

.kpi-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}

.kpi-card .kpi-value { font-size: 22px; font-weight: 700; color: var(--navy); }
.kpi-card .kpi-label { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

.dash-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 980px) {
  .dash-layout { grid-template-columns: 1.15fr 0.85fr; }
}

#map { height: 360px; border-radius: var(--radius-lg); border: 1px solid var(--border); }

.table-wrap {
  overflow-x: auto;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { background: #fafcfd; color: var(--text-muted); font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.3px; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafcfd; }

.filter-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.filter-row select {
  width: auto;
  padding: 8px 10px;
  font-size: 13px;
}

.footer-note {
  text-align: center;
  font-size: 11.5px;
  color: var(--text-muted);
  padding: 20px 16px 30px;
}

.spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }
