/* ═══════════════════════════════════════════════════════════
   NETRO Municipal shared.css
   Design: Dark sidebar · Light content · Module accent colors
   Brand: NETRO — Network Enabled Tracking for Resilient Outcomes
   by Pentile Global Tech
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: 'DM Sans', sans-serif;
  background: #f1f5f8;
  color: #1e293b;
  display: flex;
  height: 100vh;
  overflow: hidden;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }

/* ── CSS Variables ──────────────────────────────────────── */
:root {
  --accent:     #E85D26;
  --accent-l:   #c44a1a;
  --accent-dim: rgba(232,93,38,.10);

  --sidebar-bg:   #0d1829;
  --sidebar-w:    236px;

  --surface:    #ffffff;
  --surface-2:  #f8fafc;
  --border:     #e2e8f0;
  --border-2:   #cbd5e1;

  --text-1:     #0f172a;
  --text-2:     #334155;
  --text-3:     #64748b;
  --text-4:     #94a3b8;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:  0 4px 12px rgba(0,0,0,.10), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:  0 10px 30px rgba(0,0,0,.12), 0 4px 8px rgba(0,0,0,.06);

  --radius:     10px;
  --radius-sm:  6px;
  --radius-lg:  14px;

  --transition: 0.18s ease;
}

/* ══════════════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  transition: width var(--transition), min-width var(--transition);
  position: relative;
  z-index: 100;
  border-right: 1px solid rgba(255,255,255,.06);
}
.sidebar.closed {
  width: 0;
  min-width: 0;
}

/* Head */
.sb-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 14px 14px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.sb-logo {
  width: 34px;
  height: 54px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}
.sb-logo svg {
  width: 18px;
  height: 18px;
}
.sb-brand {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -.3px;
}
.sb-sub {
  font-size: 9.5px;
  color: #64748b;
  margin-top: 1px;
  letter-spacing: .2px;
}

/* Nav */
.sb-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 0 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.08) transparent;
}
.sb-nav::-webkit-scrollbar { width: 4px; }
.sb-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 2px; }

.sb-section-lbl {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: #475569;
  padding: 10px 16px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  margin: 1px 8px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: #94a3b8;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
}
.nav-item:hover {
  background: rgba(255,255,255,.06);
  color: #e2e8f0;
}
.nav-item.active {
  background: rgba(232,93,38,.18);
  color: #fb9a6d;
}
.nav-item.active .ni-icon { stroke: #fb9a6d; }

.ni-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  stroke: #64748b;
  transition: stroke var(--transition);
}
.nav-item:hover .ni-icon { stroke: #e2e8f0; }

/* Footer */
.sb-footer {
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.user-row {
  display: flex;
  align-items: center;
  gap: 9px;
}
.user-ava {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c1a1a, #E85D26);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}
.user-name {
  font-size: 12px;
  font-weight: 600;
  color: #e2e8f0;
}
.user-role {
  font-size: 10px;
  color: #64748b;
  margin-top: 1px;
}

/* ══════════════════════════════════════════════════════════
   MAIN LAYOUT
══════════════════════════════════════════════════════════ */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all var(--transition);
}

/* ── Topbar ────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  height: 52px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  box-shadow: 0 1px 0 var(--border);
}
.tb-menu {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-3);
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.tb-menu:hover { background: var(--surface-2); color: var(--text-1); }

.tb-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tb-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(232,93,38,.08);
  border: 1px solid rgba(232,93,38,.22);
  font-size: 11px;
  font-weight: 500;
  color: #c44a1a;
  flex-shrink: 0;
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
  display: inline-block;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .6; transform: scale(.85); }
}
.tb-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.tb-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: var(--text-3);
}
.tb-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: background var(--transition);
}
.tb-btn:hover { background: var(--border); }

/* ── Content ────────────────────────────────────────────── */
.content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) transparent;
}
.content::-webkit-scrollbar { width: 5px; }
.content::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }

.page-animate {
  animation: fadeUp .35s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════════════════
   CARDS & SURFACES
══════════════════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* Indicator / stat cards */
.is-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), border-color var(--transition);
}
.is-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-2);
}
.is-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.is-val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}
.is-lbl {
  font-size: 10.5px;
  color: var(--text-3);
  margin-top: 3px;
  font-weight: 500;
}

/* ── Feature cards (bottom row) ──── */
.fc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}
.fc-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.fc-icon svg {
  width: 14px;
  height: 14px;
  fill: white;
}
.fc-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-1);
}
.fc-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}

/* ── Module quick access cards ──── */
.mod-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  box-shadow: var(--shadow-sm);
}
.mod-btn:hover {
  box-shadow: var(--shadow-md);
  transform: translateX(2px);
  border-color: var(--border-2);
}
.mod-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mod-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-1);
}
.mod-sub {
  font-size: 10.5px;
  color: var(--text-3);
  margin-top: 2px;
}

/* ══════════════════════════════════════════════════════════
   DASHBOARD BANNER
══════════════════════════════════════════════════════════ */
.dash-banner {
  background: linear-gradient(135deg, #0d1829 0%, #1a2035 45%, #2a1208 100%);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.dash-banner::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(232,93,38,.20) 0%, transparent 70%);
  pointer-events: none;
}
.dash-banner::after {
  content: '';
  position: absolute;
  bottom: -30px; left: 80px;
  width: 150px; height: 150px;
  background: radial-gradient(circle, rgba(37,99,235,.10) 0%, transparent 70%);
  pointer-events: none;
}
.dash-banner-left h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #f1f5f9;
}
.dash-banner-left p {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 4px;
}
.dash-banner-right {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.db-pill {
  padding: 5px 11px;
  border-radius: 20px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  font-size: 11px;
  font-weight: 500;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ══════════════════════════════════════════════════════════
   TABS
══════════════════════════════════════════════════════════ */
.tab-bar {
  display: flex;
  gap: 6px;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.tab-btn {
  padding: 7px 13px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-3);
  transition: all var(--transition);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
}
.tab-btn:hover {
  background: var(--surface-2);
  color: var(--text-2);
}
.tab-btn.active {
  background: var(--text-1);
  color: white;
  box-shadow: var(--shadow-sm);
}

/* ══════════════════════════════════════════════════════════
   TABLE
══════════════════════════════════════════════════════════ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.data-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-3);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
}
.data-table tr:hover td { background: var(--surface-2); }
.data-table tr:last-child td { border-bottom: none; }

/* ══════════════════════════════════════════════════════════
   BADGE
══════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10.5px;
  font-weight: 600;
}
.badge-green  { background: rgba(22,163,74,.1);  color: #15803d; }
.badge-red    { background: rgba(220,38,38,.1);   color: #b91c1c; }
.badge-orange { background: rgba(232,93,38,.12);  color: #9a3412; }
.badge-blue   { background: rgba(37,99,235,.1);   color: #1d4ed8; }
.badge-purple { background: rgba(124,58,237,.1);  color: #6d28d9; }
.badge-cyan   { background: rgba(8,145,178,.1);   color: #0e7490; }

/* ══════════════════════════════════════════════════════════
   FORM ELEMENTS
══════════════════════════════════════════════════════════ */
.form-input {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  color: var(--text-1);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232,93,38,.12);
}
.form-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 5px;
  display: block;
}
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2394a3b8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 8px rgba(232,93,38,.30);
}
.btn-primary:hover {
  background: #c44a1a;
  box-shadow: 0 4px 12px rgba(232,93,38,.40);
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--surface);
  color: var(--text-2);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
}
.btn-danger {
  background: #DC2626;
  color: white;
}
.btn-danger:hover { background: #b91c1c; }

/* ══════════════════════════════════════════════════════════
   MODULE COLOR PALETTE
══════════════════════════════════════════════════════════ */
.mod-urban     { --mod-color: #2563eb; }
.mod-revenue   { --mod-color: #E85D26; }
.mod-disaster  { --mod-color: #DC2626; }
.mod-health    { --mod-color: #0EA56E; }
.mod-water     { --mod-color: #0891b2; }
.mod-waste     { --mod-color: #16a34a; }
.mod-citizen   { --mod-color: #7C3AED; }
.mod-transport { --mod-color: #D97706; }
.mod-enviro    { --mod-color: #059669; }
.mod-law       { --mod-color: #64748b; }

/* ══════════════════════════════════════════════════════════
   ALERT / NOTIFICATION STRIP
══════════════════════════════════════════════════════════ */
.alert-strip {
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.alert-strip.warning {
  background: rgba(232,93,38,.08);
  border: 1px solid rgba(232,93,38,.22);
  color: #7c2d12;
}
.alert-strip.danger {
  background: rgba(220,38,38,.07);
  border: 1px solid rgba(220,38,38,.2);
  color: #991b1b;
}
.alert-strip.info {
  background: rgba(37,99,235,.07);
  border: 1px solid rgba(37,99,235,.2);
  color: #1e40af;
}
.alert-strip.success {
  background: rgba(14,165,110,.07);
  border: 1px solid rgba(14,165,110,.2);
  color: #065f46;
}

/* ══════════════════════════════════════════════════════════
   UTILITY
══════════════════════════════════════════════════════════ */
.divider { height: 1px; background: var(--border); margin: 12px 0; }
.text-muted { color: var(--text-3); }
.text-sm { font-size: 11.5px; }
.font-mono { font-family: 'JetBrains Mono', monospace; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.pg-header { display: flex; flex-direction: column; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; }

/* ── Progress bar ── */
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

/* ── Toggle switch ── */
.toggle-switch { position:relative;width:36px;height:20px;flex-shrink:0; }
.toggle-switch input { opacity:0;width:0;height:0; }
.toggle-slider { position:absolute;inset:0;background:#cbd5e1;border-radius:20px;cursor:pointer;transition:background var(--transition); }
.toggle-slider::after { content:'';position:absolute;width:14px;height:14px;left:3px;top:3px;background:white;border-radius:50%;transition:transform var(--transition); }
.toggle-switch input:checked + .toggle-slider { background:var(--accent); }
.toggle-switch input:checked + .toggle-slider::after { transform:translateX(16px); }

/* ── Map wrap ── */
.map-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}
.map-box {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #e9eff5;
}

/* ── Layer panel ── */
.layer-panel {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 10px;
}
.layer-panel-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-3);
  margin-bottom: 7px;
}
.layer-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.layer-check { display: flex; align-items: center; cursor: pointer; }
.layer-check input { position:absolute;opacity:0;width:0; }
.lc-content {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 7px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-2);
  transition: all var(--transition);
  cursor: pointer;
  user-select: none;
}
.lc-content:hover { border-color: var(--border-2); background: var(--surface-2); }
.lc-dot { width:8px;height:8px;border-radius:50%;flex-shrink:0; }
.lc-box {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1.5px solid var(--border-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}
.layer-check input:checked + .lc-content { background:rgba(232,93,38,.06);border-color:rgba(232,93,38,.3);color:var(--text-1); }
.layer-check input:checked + .lc-content .lc-box { background:var(--accent);border-color:var(--accent); }
.layer-check input:checked + .lc-content .lc-box::after {
  content:'';display:block;width:5px;height:3px;
  border-left:1.5px solid white;border-bottom:1.5px solid white;
  transform:rotate(-45deg) translateY(-1px);
}

/* Responsive */
@media (max-width: 900px) {
  .sidebar { width: 0; min-width: 0; }
}
