/* ==========================================================================
   CITY-WIDE AI TRAFFIC & ANPR MANAGEMENT PORTAL
   Official Government-Grade Design System (Navy Blue + White)
   ========================================================================== */

:root {
  /* Government Navy & Blue Palette */
  --primary-navy: #0B2545;
  --primary-navy-dark: #06152B;
  --primary-navy-light: #133E87;
  --accent-blue: #1D4ED8;
  --accent-blue-light: #3B82F6;
  --accent-cyan: #0284C7;
  --gov-gold: #D97706;
  
  /* Neutral & Backgrounds */
  --bg-main: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F1F5F9;
  --bg-subtle: #EDF2F7;
  --border-color: #E2E8F0;
  --border-focus: #3B82F6;

  /* Typography Colors */
  --text-main: #0F172A;
  --text-muted: #475569;
  --text-light: #94A3B8;
  --text-white: #FFFFFF;

  /* Status Indicators */
  --status-green: #16A34A;
  --status-green-bg: #DCFCE7;
  --status-green-border: #86EFAC;
  --status-amber: #D97706;
  --status-amber-bg: #FEF3C7;
  --status-amber-border: #FDE68A;
  --status-red: #DC2626;
  --status-red-bg: #FEE2E2;
  --status-red-border: #FCA5A5;

  /* Shadows & Radius */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  /* Layout */
  --sidebar-width: 250px;
  --topbar-height: 64px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Global Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--primary-navy);
  font-weight: 700;
  line-height: 1.25;
}

p {
  color: var(--text-muted);
}

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

a:hover {
  text-decoration: underline;
}

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

/* ==========================================================================
   HEADER & GOVERNMENT EMBLEM BANNER
   ========================================================================== */
.gov-header-banner {
  background: linear-gradient(135deg, var(--primary-navy-dark) 0%, var(--primary-navy) 100%);
  color: var(--text-white);
  border-bottom: 3px solid var(--gov-gold);
  padding: 12px 24px;
  position: relative;
  box-shadow: var(--shadow-md);
  z-index: 50;
}

.gov-header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.gov-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
}

.gov-emblem {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.1);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--gov-gold);
}

.gov-title-wrap h1 {
  color: #FFFFFF;
  font-size: 1.15rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.gov-subtitle {
  font-size: 0.75rem;
  color: #CBD5E1;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.3px;
}

.gov-header-badges {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gov-badge {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-family: 'JetBrains Mono', monospace;
  color: #E2E8F0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #22C55E;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* ==========================================================================
   CONTAINER & VIEW SYSTEM
   ========================================================================== */
.app-container {
  min-height: calc(100vh - 75px);
  display: flex;
  flex-direction: column;
}

.view-section {
  display: none;
  width: 100%;
  flex: 1;
}

.view-section.active {
  display: block;
  animation: fadeIn 0.25s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   LANDING / ROLE SELECTION PAGE
   ========================================================================== */
.landing-hero {
  max-width: 1200px;
  margin: 40px auto 20px;
  padding: 0 24px;
  text-align: center;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary-navy);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.landing-hero h2 {
  font-size: 2.25rem;
  color: var(--primary-navy);
  margin-bottom: 12px;
  font-weight: 800;
}

.landing-hero p {
  font-size: 1.05rem;
  max-width: 760px;
  margin: 0 auto 36px;
  color: var(--text-muted);
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px;
  max-width: 1200px;
  margin: 0 auto 50px;
  padding: 0 24px;
}

.portal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.portal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--border-color);
  transition: var(--transition);
}

.portal-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
  border-color: var(--accent-blue-light);
}

.portal-card.citizen:hover::before { background: #16A34A; }
.portal-card.police:hover::before { background: var(--accent-blue); }
.portal-card.gov:hover::before { background: var(--primary-navy-light); }

.portal-icon-box {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  font-size: 1.75rem;
}

.portal-card.citizen .portal-icon-box { background: #DCFCE7; color: #16A34A; }
.portal-card.police .portal-icon-box { background: #DBEAFE; color: #1D4ED8; }
.portal-card.gov .portal-icon-box { background: #EDE9FE; color: #6D28D9; }

.portal-card h3 {
  font-size: 1.35rem;
  margin-bottom: 10px;
}

.portal-card p {
  font-size: 0.925rem;
  line-height: 1.5;
  margin-bottom: 28px;
  color: var(--text-muted);
}

.portal-badge-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  width: fit-content;
}

.portal-card.citizen .portal-badge-tag { background: #F0FDF4; color: #15803D; border: 1px solid #BBF7D0; }
.portal-card.police .portal-badge-tag { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }
.portal-card.gov .portal-badge-tag { background: #F5F3FF; color: #5B21B6; border: 1px solid #DDD6FE; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  border-radius: var(--radius-md);
  padding: 12px 20px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  text-align: center;
  font-size: 0.9rem;
}

.btn-primary {
  background: var(--primary-navy);
  color: #FFFFFF;
}

.btn-primary:hover {
  background: var(--primary-navy-light);
  color: #FFFFFF;
  text-decoration: none;
}

.btn-accent {
  background: var(--accent-blue);
  color: #FFFFFF;
}

.btn-accent:hover {
  background: #1E40AF;
  color: #FFFFFF;
}

.btn-citizen {
  background: #15803D;
  color: #FFFFFF;
}

.btn-citizen:hover {
  background: #166534;
  color: #FFFFFF;
}

.btn-outline {
  background: #FFFFFF;
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background: var(--bg-subtle);
  border-color: var(--text-muted);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* ==========================================================================
   AUTHENTICATION MODALS & SCREENS
   ========================================================================== */
.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 150px);
  padding: 30px 20px;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  position: relative;
}

.auth-card-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-card-header .auth-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.auth-card-header h2 {
  font-size: 1.5rem;
  margin-bottom: 6px;
}

.auth-card-header p {
  font-size: 0.875rem;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  background: #FFFFFF;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.otp-boxes {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 20px 0;
}

.otp-input {
  width: 46px;
  height: 52px;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
}

.otp-input:focus {
  border-color: var(--accent-blue);
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.demo-credentials-box {
  background: #EFF6FF;
  border: 1px dashed #93C5FD;
  border-radius: var(--radius-md);
  padding: 12px;
  margin: 18px 0;
  font-size: 0.78rem;
  color: #1E40AF;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-fill-demo {
  background: #DBEAFE;
  color: #1E40AF;
  border: 1px solid #BFDBFE;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

/* ==========================================================================
   PORTAL DASHBOARD LAYOUT (Sidebar + Main Area)
   ========================================================================== */
.portal-layout {
  display: flex;
  min-height: calc(100vh - 75px);
}

/* Sidebar */
.portal-sidebar {
  width: var(--sidebar-width);
  background: #FFFFFF;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.sidebar-brand-badge {
  padding: 20px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.sidebar-brand-text h3 {
  font-size: 0.9rem;
  color: var(--primary-navy);
}

.sidebar-brand-text span {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.sidebar-nav {
  padding: 16px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.nav-item:hover {
  background: var(--bg-card-hover);
  color: var(--primary-navy);
}

.nav-item.active {
  background: #EFF6FF;
  color: var(--accent-blue);
  border-color: #BFDBFE;
}

.nav-item-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-item .badge-count {
  margin-left: auto;
  background: #E2E8F0;
  color: var(--text-main);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-family: 'JetBrains Mono', monospace;
}

.nav-item.active .badge-count {
  background: var(--accent-blue);
  color: #FFFFFF;
}

.sidebar-footer {
  padding: 16px 14px;
  border-top: 1px solid var(--border-color);
}

/* Main Area & Topbar */
.portal-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-main);
  overflow-x: hidden;
}

.portal-topbar {
  height: var(--topbar-height);
  background: #FFFFFF;
  border-bottom: 1px solid var(--border-color);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  z-index: 10;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-page-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-navy);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.user-profile-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  cursor: pointer;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-navy);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.user-meta {
  line-height: 1.2;
}

.user-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
}

.user-role-label {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.portal-content {
  padding: 28px;
  flex: 1;
}

.portal-subpage {
  display: none;
}

.portal-subpage.active {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

/* ==========================================================================
   METRIC STAT CARDS
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  transition: var(--transition);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #CBD5E1;
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary-navy);
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.1;
}

.stat-subtext {
  font-size: 0.72rem;
  color: var(--text-light);
  margin-top: 6px;
}

.stat-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

/* ==========================================================================
   TABLES & LISTS
   ========================================================================== */
.card-panel {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 24px;
}

.panel-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FAFAFA;
}

.panel-header h3 {
  font-size: 1rem;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.gov-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.gov-table th {
  background: #F8FAFC;
  color: var(--text-muted);
  font-weight: 600;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.4px;
}

.gov-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

.gov-table tr:last-child td {
  border-bottom: none;
}

.gov-table tr:hover td {
  background: #F8FAFC;
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
}

.badge-success { background: var(--status-green-bg); color: var(--status-green); border: 1px solid var(--status-green-border); }
.badge-warning { background: var(--status-amber-bg); color: var(--status-amber); border: 1px solid var(--status-amber-border); }
.badge-danger { background: var(--status-red-bg); color: var(--status-red); border: 1px solid var(--status-red-border); }
.badge-info { background: #EFF6FF; color: var(--accent-blue); border: 1px solid #BFDBFE; }

.plate-badge {
  display: inline-block;
  background: #FEF08A;
  color: #000000;
  border: 1.5px solid #000000;
  border-radius: 4px;
  padding: 2px 8px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 0.825rem;
  letter-spacing: 1px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* ==========================================================================
   SIMULATED GIS MAP & TRAJECTORY SECTION
   ========================================================================== */
.map-canvas-container {
  background: #0F172A;
  border-radius: var(--radius-lg);
  height: 440px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid #1E293B;
}

.map-grid-bg {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
}

.map-road-network {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.map-overlay-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  color: #FFFFFF;
  font-size: 0.78rem;
  z-index: 10;
}

.map-legend {
  position: absolute;
  bottom: 14px;
  right: 14px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  color: #FFFFFF;
  font-size: 0.72rem;
  font-family: 'JetBrains Mono', monospace;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 10;
}

.map-camera-node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  z-index: 20;
}

.camera-pin {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1D4ED8;
  border: 2px solid #FFFFFF;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  box-shadow: 0 0 12px rgba(29, 78, 216, 0.8);
  transition: transform 0.2s ease;
}

.map-camera-node:hover .camera-pin {
  transform: scale(1.15);
}

.camera-node-label {
  margin-top: 4px;
  background: rgba(15, 23, 42, 0.9);
  color: #FFFFFF;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Timeline underneath map */
.trajectory-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 10px 10px;
  overflow-x: auto;
  position: relative;
}

.trajectory-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  flex: 1;
}

.step-marker {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #EFF6FF;
  border: 2px solid #3B82F6;
  color: #1D4ED8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  margin-bottom: 8px;
  z-index: 2;
}

.step-time {
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--primary-navy);
}

.step-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  max-width: 120px;
  margin-top: 2px;
}

/* ==========================================================================
   AI RECOMMENDATION CARDS & EMERGENCY GREEN WAVE
   ========================================================================== */
.ai-insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.ai-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.ai-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.ai-card-header h4 {
  font-size: 1.05rem;
  color: var(--primary-navy);
}

.ai-confidence-pill {
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

.ai-metric-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border-color);
  font-size: 0.8rem;
}

.ai-recommendation-box {
  background: #F8FAFC;
  border-left: 3px solid var(--accent-blue);
  padding: 12px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: 14px;
  font-size: 0.85rem;
}

.ai-recommendation-box strong {
  display: block;
  color: var(--primary-navy);
  margin-bottom: 2px;
}

/* Emergency Signal Strip */
.emergency-hero-card {
  background: linear-gradient(135deg, #7F1D1D 0%, #991B1B 100%);
  color: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  margin-bottom: 24px;
}

.signal-priority-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.signal-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}

.signal-light {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin: 0 auto 10px;
  box-shadow: 0 0 10px currentColor;
}

.signal-light.green { background: #22C55E; color: #22C55E; }
.signal-light.amber { background: #F59E0B; color: #F59E0B; }
.signal-light.red { background: #EF4444; color: #EF4444; }

/* ==========================================================================
   MODAL DIALOGS
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.modal-backdrop.active {
  display: flex;
  animation: fadeIn 0.2s ease-in-out;
}

.modal-card {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  max-width: 540px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #F8FAFC;
}

.modal-header h3 {
  font-size: 1.1rem;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 14px 24px;
  background: #F8FAFC;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ==========================================================================
   FOOTER & PRIVACY DISCLAIMER
   ========================================================================== */
.gov-footer {
  background: #FFFFFF;
  border-top: 1px solid var(--border-color);
  padding: 20px 24px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: auto;
}

.privacy-notice-badge {
  display: inline-block;
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-top: 6px;
  font-size: 0.72rem;
  color: #475569;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .portal-layout {
    flex-direction: column;
  }
  .portal-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  .sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
    padding: 8px 12px;
  }
  .nav-item {
    white-space: nowrap;
    padding: 8px 12px;
  }
  .landing-hero h2 {
    font-size: 1.75rem;
  }
  .portal-topbar {
    padding: 0 16px;
  }
  .portal-content {
    padding: 16px;
  }
}
