/* ============================================================
   B2G — Cities & Governments
   ============================================================ */

/* Sub-nav — pill style */
.sub-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  padding: 5px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
}
.sub-nav-link {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  padding: 8px 10px;
  border-radius: 10px;
  border: none;
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
  line-height: 1;
}
.sub-nav-link:hover { color: rgba(255,255,255,0.85); background: rgba(255,255,255,0.07); }
.sub-nav-link.active { background: #ffffff; color: #0d0d1a; font-weight: 700; }
.sub-nav-icon { display: flex; align-items: center; justify-content: center; width: 15px; height: 15px; flex-shrink: 0; }
.back-link {
  font-family: var(--font-primary);
  font-size: 13px;
  font-weight: 500;
  color: var(--white-50);
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
}
.back-link:hover { color: var(--white-80); }

/* ============================================================
   MONITOR CARD — city sensor map
   ============================================================ */
.card-visual--monitor {
  background: radial-gradient(ellipse at 50% 40%, rgba(0,173,241,0.07) 0%, transparent 70%);
}
.city-map {
  position: absolute;
  inset: 0;
}
.map-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,173,241,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,173,241,0.06) 1px, transparent 1px);
  background-size: 30px 30px;
}
.sensor-node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sn-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(0,173,241,0.5);
  animation: sn-expand 2.4s ease-out infinite;
}
.sn-ring--warn { border-color: rgba(237,0,140,0.5); }
@keyframes sn-expand {
  0%   { width: 6px;  height: 6px;  opacity: 1; }
  100% { width: 44px; height: 44px; opacity: 0; }
}
.sn-dot {
  width: 8px;
  height: 8px;
  background: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--cyan);
  position: relative;
  z-index: 2;
}
.sn-dot--warn { background: var(--magenta); box-shadow: 0 0 8px var(--magenta); }
.sn-label {
  position: absolute;
  top: 10px;
  left: 6px;
  font-family: var(--font-primary);
  font-size: 9px;
  font-weight: 700;
  color: var(--cyan);
  white-space: nowrap;
  background: rgba(6,3,17,0.75);
  padding: 2px 5px;
  border-radius: 4px;
  z-index: 3;
}
.sn-label--warn { color: var(--magenta); }
.map-badge {
  position: absolute;
  font-family: var(--font-primary);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.map-badge--tl { top: 12px; left: 12px; color: var(--cyan); animation: data-flicker 2s infinite; }
.map-badge--br { bottom: 12px; right: 12px; color: var(--white-30); }

/* ============================================================
   DASHBOARD CARD — bar chart
   ============================================================ */
.card-visual--dashboard {
  background: rgba(0,173,241,0.02);
}
.dash-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 16px;
}
.dash-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.dash-label {
  font-family: var(--font-primary);
  font-size: 10px;
  font-weight: 600;
  color: var(--white-30);
  letter-spacing: 0.06em;
}
.dash-live-lbl {
  font-family: var(--font-primary);
  font-size: 10px;
  font-weight: 700;
  color: var(--cyan);
  animation: data-flicker 2s infinite;
}
.chart-area {
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 7px;
  padding-bottom: 2px;
}
.chart-bar {
  flex: 1;
  height: var(--h, 50%);
  background: linear-gradient(180deg, rgba(0,173,241,0.7) 0%, rgba(0,173,241,0.15) 100%);
  border-radius: 4px 4px 0 0;
  transform-origin: bottom;
  animation: bar-grow 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) var(--d, 0s) both;
}
.chart-bar--hi {
  background: linear-gradient(180deg, rgba(237,0,140,0.8) 0%, rgba(237,0,140,0.15) 100%);
}
@keyframes bar-grow {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}
.chart-days {
  display: flex;
  gap: 7px;
  margin-top: 5px;
}
.chart-days span {
  flex: 1;
  text-align: center;
  font-family: var(--font-primary);
  font-size: 9px;
  font-weight: 600;
  color: var(--white-30);
}
.dash-stats {
  display: flex;
  justify-content: space-around;
  padding: 10px 0 0;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.dash-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.dash-stat strong { font-family: var(--font-primary); font-size: 13px; font-weight: 800; color: var(--cyan); }
.dash-stat span   { font-family: var(--font-body); font-size: 10px; color: var(--white-30); }

/* ============================================================
   ALERT CARD — GPS map + notification
   ============================================================ */
.card-visual--alert {
  background: radial-gradient(ellipse at 50% 55%, rgba(237,0,140,0.07) 0%, transparent 70%);
}
.alert-scene {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
}
.alert-map {
  flex: 1;
  position: relative;
  overflow: hidden;
}
.alert-map-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 28px 28px;
}
.alert-danger {
  position: absolute;
  top: 25%;
  left: 28%;
  width: 90px;
  height: 90px;
  background: radial-gradient(circle, rgba(237,0,140,0.28) 0%, transparent 70%);
  border-radius: 50%;
  animation: danger-pulse 2s ease-in-out infinite;
}
@keyframes danger-pulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50%       { transform: scale(1.35); opacity: 1; }
}
.alert-gps-ring {
  position: absolute;
  top: 50%; left: 60%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1.5px solid rgba(0,173,241,0.6);
  animation: gps-ring-expand 2.4s ease-out infinite;
}
@keyframes gps-ring-expand {
  0%   { width: 8px;  height: 8px;  opacity: 1; }
  100% { width: 72px; height: 72px; opacity: 0; }
}
.alert-gps-dot {
  position: absolute;
  top: 50%; left: 60%;
  transform: translate(-50%, -50%);
  width: 10px; height: 10px;
  background: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--cyan);
  z-index: 2;
}
.alert-notif {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 12px 14px;
  padding: 10px 14px;
  background: rgba(237,0,140,0.12);
  border: 1px solid rgba(237,0,140,0.3);
  border-radius: 10px;
  animation: notif-cycle 4s ease infinite;
}
@keyframes notif-cycle {
  0%, 8%   { opacity: 0; transform: translateY(6px); }
  18%, 78% { opacity: 1; transform: translateY(0); }
  90%, 100% { opacity: 0; transform: translateY(-4px); }
}
.alert-notif-ico {
  font-size: 18px;
  flex-shrink: 0;
}
.alert-notif-body { display: flex; flex-direction: column; gap: 2px; }
.alert-notif-body strong { font-family: var(--font-primary); font-size: 11px; font-weight: 700; color: var(--white); }
.alert-notif-body span   { font-family: var(--font-body); font-size: 10px; color: var(--white-50); }

/* Responsive */
@media (max-width: 768px) {
  .sub-nav { display: none; }
  .back-link { font-size: 12px; }
  .site-header-bar { position: relative; }
  .mobile-menu-link { gap: 10px; }
}
