/* style.css - Professional Dallas Police Active Dispatch Command Center Design System */

/* Theme Configuration Sets */
.theme-space {
  --bg-main: #060813;
  --bg-sidebar: #0a0e21;
  --bg-card: rgba(16, 22, 42, 0.65);
  --bg-card-hover: rgba(26, 36, 68, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(56, 189, 248, 0.35);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  
  --primary: #0284c7;
  --primary-light: #38bdf8;
  --primary-glow: rgba(56, 189, 248, 0.12);
  --accent: #6366f1;
  --accent-light: #818cf8;
}

.theme-cyber {
  --bg-main: #0c051a;
  --bg-sidebar: #130926;
  --bg-card: rgba(30, 11, 54, 0.6);
  --bg-card-hover: rgba(52, 17, 85, 0.75);
  --border-color: rgba(255, 0, 127, 0.2);
  --border-hover: rgba(0, 242, 254, 0.6);
  
  --text-primary: #ffffff;
  --text-secondary: #d8b4fe;
  --text-muted: #7045af;
  
  --primary: #ff007f;
  --primary-light: #ff55a3;
  --primary-glow: rgba(255, 0, 127, 0.15);
  --accent: #00f2fe;
  --accent-light: #4facfe;
}

.theme-tactical {
  --bg-main: #141716;
  --bg-sidebar: #1a1e1d;
  --bg-card: rgba(35, 40, 38, 0.7);
  --bg-card-hover: rgba(45, 52, 49, 0.9);
  --border-color: rgba(120, 130, 125, 0.15);
  --border-hover: rgba(74, 222, 128, 0.5);
  
  --text-primary: #f0f3f1;
  --text-secondary: #a3b3ab;
  --text-muted: #52635a;
  
  --primary: #15803d;
  --primary-light: #4ade80;
  --primary-glow: rgba(74, 222, 128, 0.1);
  --accent: #eab308;
  --accent-light: #fde047;
}

/* Common Priority Tiers */
:root {
  --priority-1: #f43f5e; /* Rose / Emergency */
  --priority-1-glow: rgba(244, 63, 94, 0.22);
  --priority-2: #f97316; /* High - Orange */
  --priority-2-glow: rgba(249, 115, 22, 0.18);
  --priority-3: #eab308; /* Medium - Yellow */
  --priority-3-glow: rgba(234, 179, 8, 0.12);
  --priority-4: #3b82f6; /* Low - Blue */
  --priority-4-glow: rgba(59, 130, 246, 0.12);
  
  --status-at-scene: #10b981;
  --status-enroute: #f59e0b;
  --status-dispatched: #3b82f6;
  --status-other: #64748b;
  
  --font-sans: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Scrollbar Core */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow: hidden;
  line-height: 1.4;
  transition: background-color var(--transition-normal);
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Glass panel wrapper */
.glass-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-md);
}

/* Full Viewport App Layout */
.app-viewport {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Top Command Header */
.app-header {
  height: 72px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-badge {
  background: rgba(255,255,255,0.03);
  border: 1.5px solid var(--text-muted);
  color: var(--text-primary);
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  font-family: var(--font-mono);
}

.badge-icon {
  width: 16px;
  height: 16px;
  color: var(--primary-light);
}

.header-titles h1 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
  background: linear-gradient(135deg, var(--text-primary) 40%, var(--primary-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sys-status {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.1rem;
}

.status-indicator-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.status-indicator-dot.online {
  background-color: var(--status-at-scene);
  box-shadow: 0 0 6px var(--status-at-scene);
  animation: logPulse 2s infinite;
}

/* Quick Metrics in Header */
.header-metrics {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.metric-mini {
  display: flex;
  flex-direction: column;
  background: rgba(0,0,0,0.15);
  border: 1px solid var(--border-color);
  padding: 0.35rem 1rem;
  border-radius: 6px;
  min-width: 110px;
  text-align: right;
}

.metric-mini.critical {
  border-color: rgba(244, 63, 94, 0.25);
}

.metric-mini.units {
  border-color: rgba(99, 102, 241, 0.25);
}

.mini-label {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.mini-value {
  font-size: 1.25rem;
  font-weight: 800;
  font-family: var(--font-mono);
  line-height: 1.1;
  color: var(--primary-light);
}

.metric-mini.critical .mini-value {
  color: var(--priority-1);
}

/* Controls Deck in Header */
.header-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Switch styling for console toggles */
.control-switch {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  transition: border-color var(--transition-fast);
}

.control-switch:hover {
  border-color: var(--border-hover);
}

.control-switch svg {
  color: var(--text-muted);
}

.control-switch input {
  display: none;
}

.toggle-slider {
  position: relative;
  display: inline-block;
  width: 26px;
  height: 14px;
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  border: 1px solid var(--border-color);
  transition: var(--transition-fast);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 8px;
  width: 8px;
  left: 2px;
  bottom: 2px;
  background-color: var(--text-secondary);
  border-radius: 50%;
  transition: var(--transition-fast);
}

.control-switch input:checked + .toggle-slider {
  background-color: var(--primary-glow);
  border-color: var(--primary-light);
}

.control-switch input:checked + .toggle-slider:before {
  transform: translateX(12px);
  background-color: var(--primary-light);
  box-shadow: 0 0 4px var(--primary-light);
}

/* Theme picker select element */
.theme-picker-wrapper {
  position: relative;
}

.theme-dropdown {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.35rem 1.5rem 0.35rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  transition: border-color var(--transition-fast);
}

.theme-dropdown:focus, .theme-dropdown:hover {
  border-color: var(--border-hover);
}

.theme-picker-wrapper::after {
  content: '▼';
  font-size: 0.55rem;
  color: var(--text-muted);
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.refresh-btn-icon {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 30px;
  height: 30px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.refresh-btn-icon:hover {
  border-color: var(--border-hover);
  color: var(--primary-light);
  background: rgba(255,255,255,0.06);
}

/* App Main Workspace */
.app-workspace {
  flex-grow: 1;
  display: grid;
  grid-template-columns: 29% 34% 37%;
  height: calc(100vh - 72px);
  width: 100vw;
  overflow: hidden;
}

@media (max-width: 1200px) {
  .app-workspace {
    grid-template-columns: 32% 35% 33%;
  }
}

@media (max-width: 991px) {
  .app-workspace {
    grid-template-columns: 1fr !important;
    height: calc(100vh - 72px - 60px) !important;
  }
  
  .workspace-column {
    display: none !important;
    border-right: none !important;
  }
  
  .workspace-column.mobile-visible {
    display: flex !important;
    width: 100% !important;
  }
  
  .mobile-app-nav {
    display: flex !important;
  }
}

/* Columns Layout */
.workspace-column {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-main);
  border-right: 1px solid var(--border-color);
  overflow: hidden;
}

.workspace-column:last-child {
  border-right: none;
}

/* Columns Header */
.column-header {
  height: 48px;
  background: rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid var(--border-color);
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.column-header h2 {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.ticker-count {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.ticker-count.active {
  color: var(--primary-light);
  border-color: rgba(56, 189, 248, 0.2);
  background: var(--primary-glow);
}

/* COLUMN 1: DISPATCH FEED & FILTER DECK */
.feed-filter-deck {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: rgba(0,0,0,0.06);
  flex-shrink: 0;
}

.ticker-search-wrapper {
  position: relative;
  width: 100%;
}

.ticker-search {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.55rem 0.85rem 0.55rem 2.2rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  transition: var(--transition-fast);
}

.ticker-search:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.preset-filters {
  display: flex;
  gap: 0.35rem;
  width: 100%;
}

.btn-preset {
  flex: 1;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.64rem;
  font-weight: 700;
  padding: 0.35rem 0;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-mono);
  transition: var(--transition-fast);
}

.btn-preset:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.btn-preset.active {
  background: var(--primary-glow);
  border-color: var(--primary-light);
  color: var(--primary-light);
  box-shadow: 0 0 8px var(--primary-glow);
}

.dropdown-filter-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}

.deck-select {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.74rem;
  padding: 0.4rem;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.deck-select:focus, .deck-select:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.sorting-controls {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.sorting-controls .sort-select {
  flex: 1;
}

.btn-export {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.4rem 0.75rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: var(--transition-fast);
}

.btn-export:hover {
  border-color: var(--border-hover);
  color: var(--primary-light);
}

/* Feed Scroll List */
.feed-scroll-container {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Compact Dispatch Ticker Call Card */
.call-card-ticker {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  transition: border-color var(--transition-fast), background-color var(--transition-fast), transform var(--transition-fast);
}

.call-card-ticker:hover {
  border-color: var(--border-hover);
  background-color: var(--bg-card-hover);
  transform: translateX(2px);
}

.call-card-ticker.selected {
  border-color: var(--primary-light);
  background-color: rgba(2, 132, 199, 0.12);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.15);
}

.call-card-ticker::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3.5px;
  height: 100%;
  background: var(--text-muted);
}

.call-card-ticker.priority-1::before { background: var(--priority-1); }
.call-card-ticker.priority-2::before { background: var(--priority-2); }
.call-card-ticker.priority-3::before { background: var(--priority-3); }
.call-card-ticker.priority-4::before { background: var(--priority-4); }

.call-card-ticker.critical-pulse {
  animation: ticketPulse 2s infinite ease-in-out;
}

@keyframes ticketPulse {
  0% { border-color: rgba(244, 63, 94, 0.12); }
  50% { border-color: rgba(244, 63, 94, 0.4); box-shadow: 0 0 6px rgba(244, 63, 94, 0.12); }
  100% { border-color: rgba(244, 63, 94, 0.12); }
}

.card-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.nature-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

.p-badge {
  font-size: 0.58rem;
  font-weight: 800;
  font-family: var(--font-mono);
  padding: 0.12rem 0.4rem;
  border-radius: 3px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.p-badge.p-1 { background: var(--priority-1-glow); border: 1px solid rgba(244, 63, 94, 0.35); color: #fecdd3; }
.p-badge.p-2 { background: var(--priority-2-glow); border: 1px solid rgba(249, 115, 22, 0.35); color: #fed7aa; }
.p-badge.p-3 { background: var(--priority-3-glow); border: 1px solid rgba(234, 179, 8, 0.35); color: #fef08a; }
.p-badge.p-4 { background: var(--priority-4-glow); border: 1px solid rgba(59, 130, 246, 0.35); color: #bfdbfe; }

.card-details-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.detail-part {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.detail-part svg {
  width: 12px;
  height: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.loc-short-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90%;
}

.card-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.25rem;
  border-top: 1px solid rgba(255,255,255,0.03);
  padding-top: 0.45rem;
  font-size: 0.72rem;
}

.footer-left-part {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.dot-status {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}
.dot-status.at-scene { background-color: var(--status-at-scene); box-shadow: 0 0 4px var(--status-at-scene); }
.dot-status.enroute { background-color: var(--status-enroute); box-shadow: 0 0 4px var(--status-enroute); }
.dot-status.dispatched { background-color: var(--status-dispatched); box-shadow: 0 0 4px var(--status-dispatched); }
.dot-status.other { background-color: var(--status-other); }

.status-name {
  color: var(--text-secondary);
}

.unit-code-tag {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-color);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-family: var(--font-mono);
  color: var(--text-primary);
  font-size: 0.68rem;
}

/* Empty states */
.empty-state-ticker {
  padding: 2rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

mark.text-match {
  background: rgba(56, 189, 248, 0.35);
  color: #fff;
  border-radius: 2px;
}

/* COLUMN 2: DOSSIER & INTELLIGENCE SCREENS */
.intel-screen {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.intel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Welcome Card overview */
.welcome-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
  color: var(--primary-light);
  font-family: var(--font-mono);
}

.welcome-card p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Big numbers widgets */
.stat-chart-card h4 {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-family: var(--font-mono);
}

.large-display-stat {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 1rem;
  font-family: var(--font-mono);
}

/* Division CSS Bars Grid */
.chart-container-wrapper {
  border-top: 1px solid rgba(255,255,255,0.03);
  padding-top: 0.85rem;
}

.chart-header-intel {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.division-bars-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chart-item {
  cursor: pointer;
}

.chart-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  margin-bottom: 0.25rem;
}

.chart-label { color: var(--text-secondary); font-weight: 500; }
.chart-count { color: var(--text-primary); font-weight: 700; }

.chart-bar-bg {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 2px;
  overflow: hidden;
}

.chart-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 2px;
  transform-origin: left;
  animation: growBar 0.8s ease-in-out;
}

@keyframes growBar {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.nature-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.type-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0,0,0,0.1);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition-fast);
}

.type-item:hover {
  background: rgba(255,255,255,0.02);
  border-color: var(--border-hover);
}

.type-name { color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 80%; }
.type-badge { background: var(--primary-glow); border: 1.5px solid rgba(56, 189, 248, 0.2); color: var(--primary-light); font-size: 0.7rem; font-weight: 700; padding: 0.05rem 0.4rem; border-radius: 4px; }

/* Console Sync log ticker */
.system-log-card {
  padding-bottom: 0.85rem;
}

.sync-logs-feed {
  height: 90px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.4rem 0.6rem;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border-color);
  border-radius: 6px;
}

.log-line {
  line-height: 1.35;
  color: var(--text-secondary);
}

.log-line.warning { color: #f59e0b; }
.log-line.danger { color: #ef4444; }
.log-line.success { color: #10b981; }

.log-time {
  color: var(--text-muted);
}

/* Dossier Incident ticket loaded view */
.incident-ticket-card {
  position: relative;
  border-left: 3.5px solid var(--primary-light);
}

.ticket-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1.5px solid rgba(255,255,255,0.04);
  padding-bottom: 0.65rem;
  margin-bottom: 0.85rem;
}

.ticket-inc {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.priority-label {
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
  font-family: var(--font-mono);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}
.priority-label.p-1 { background: var(--priority-1-glow); border: 1.5px solid var(--priority-1); color: #fecdd3; }
.priority-label.p-2 { background: var(--priority-2-glow); border: 1.5px solid var(--priority-2); color: #fed7aa; }
.priority-label.p-3 { background: var(--priority-3-glow); border: 1.5px solid var(--priority-3); color: #fef08a; }
.priority-label.p-4 { background: var(--priority-4-glow); border: 1.5px solid var(--priority-4); color: #bfdbfe; }

.incident-ticket-card h3 {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--text-primary);
  line-height: 1.3;
}

.ticket-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.ticket-cell {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  background: rgba(0,0,0,0.1);
  padding: 0.45rem 0.65rem;
  border-radius: 5px;
}

.cell-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.cell-val {
  font-size: 0.82rem;
  color: var(--text-primary);
  font-weight: 500;
}

.ticket-actions {
  display: flex;
  gap: 0.5rem;
  border-top: 1.5px solid rgba(255,255,255,0.04);
  padding-top: 0.85rem;
}

.btn-intel-action {
  flex: 1;
  background: linear-gradient(135deg, var(--primary), #0369a1);
  border: none;
  color: #fff;
  padding: 0.45rem 0.75rem;
  border-radius: 5px;
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: var(--transition-fast);
}

.btn-intel-action:hover {
  filter: brightness(1.1);
}

.btn-intel-action.osm {
  background: linear-gradient(135deg, #10b981, #047857);
}

.btn-intel-action.secondary {
  background: rgba(255,255,255,0.03);
  border: 1.5px solid var(--border-color);
  color: var(--text-secondary);
}
.btn-intel-action.secondary:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
}

/* Tactical Advisor checklist card */
.advisor-card {
  background: rgba(244, 63, 94, 0.02);
  border: 1px solid rgba(244, 63, 94, 0.2);
}

.advisor-title {
  display: flex;
  align-items: center;
  color: var(--priority-1);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
  margin-bottom: 0.65rem;
}

.advisor-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.advisor-list li {
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.35;
  position: relative;
  padding-left: 0.85rem;
}

.advisor-list li::before {
  content: '▪';
  position: absolute;
  left: 0;
  color: var(--priority-1);
}

/* Dispatcher CAD Activity Logs timeline */
.activity-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  padding-left: 0.75rem;
  margin-top: 0.75rem;
}

.activity-timeline::before {
  content: '';
  position: absolute;
  top: 4px; left: 0;
  width: 2px;
  height: calc(100% - 10px);
  background: var(--border-color);
}

.timeline-update {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  position: relative;
}

.timeline-update::before {
  content: '';
  position: absolute;
  top: 4px; left: -10.5px;
  width: 7px;
  height: 7px;
  background-color: var(--bg-main);
  border: 2px solid var(--primary-light);
  border-radius: 50%;
}

.timeline-time {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--primary-light);
}

.timeline-text {
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

/* COLUMN 3: GEO TRACKING MAP */
.map-controls-inline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-map-inline {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.btn-map-inline:hover {
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.2);
}

.map-wrapper {
  flex-grow: 1;
  position: relative;
  width: 100%;
}

#map {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
}

/* Legend styled as tactical overlay on Map */
.tactical-map-legend {
  position: absolute;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 500;
  background: rgba(10, 15, 30, 0.9);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.65rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.68rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.legend-dot.p1 { background-color: var(--priority-1); }
.legend-dot.p2 { background-color: var(--priority-2); }
.legend-dot.p3 { background-color: var(--priority-3); }
.legend-dot.p4 { background-color: var(--priority-4); }

/* Custom map pulse markers leaflet icon styling */
.custom-map-marker {
  background: transparent;
  border: none;
}

.map-pulse-marker {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid #ffffff;
  background-color: var(--marker-color);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.6);
  position: relative;
  transition: transform var(--transition-fast);
}

.map-pulse-marker:hover {
  transform: scale(1.3);
}

.map-pulse-marker.precise {
  border: 1.5px solid #10b981 !important;
  box-shadow: 0 0 8px #10b981, 0 0 3px rgba(0,0,0,0.5);
}

.map-pulse-marker.pulsing::after {
  content: '';
  position: absolute;
  top: -7px; left: -7px;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--priority-1);
  animation: logPulse 1.8s infinite ease-out;
  pointer-events: none;
  box-sizing: border-box;
}

@keyframes logPulse {
  0% { transform: scale(0.4); opacity: 1; }
  100% { transform: scale(1.7); opacity: 0; }
}

/* Precise map marker pulse design */
.custom-map-marker-precise {
  background: transparent;
}

.map-precise-glowing-ring {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background-color: var(--marker-color);
  box-shadow: 0 0 15px var(--marker-color), inset 0 0 6px rgba(0,0,0,0.5);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: bounceInMarker 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.map-precise-glowing-ring::after {
  content: '';
  position: absolute;
  top: -6px; left: -6px;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2.5px solid var(--marker-color);
  animation: logPulse 1.5s infinite;
  pointer-events: none;
}

@keyframes bounceInMarker {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

/* Leaflet Popup box design overrides */
.leaflet-popup-content-wrapper {
  background: rgba(10, 15, 30, 0.95) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius-md) !important;
  padding: 0 !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6) !important;
}

.leaflet-popup-content {
  margin: 0 !important;
  width: 220px !important;
}

.leaflet-popup-tip {
  background: rgba(10, 15, 30, 0.95) !important;
  border-left: 1px solid var(--border-color) !important;
  border-bottom: 1px solid var(--border-color) !important;
}

.popup-box {
  padding: 0.85rem;
}

.popup-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.4rem;
  margin-bottom: 0.45rem;
}

.popup-nature { font-weight: 700; font-size: 0.8rem; color: var(--text-primary); line-height: 1.25; }
.popup-p-badge { font-size: 0.58rem; font-weight: 800; padding: 0.1rem 0.35rem; border-radius: 3px; background: rgba(255, 255, 255, 0.05); color: var(--text-secondary); }
.popup-header-row.priority-1 .popup-p-badge { color: #fecdd3; background: var(--priority-1-glow); border: 1.5px solid var(--priority-1); }

.popup-meta {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.74rem;
  color: var(--text-secondary);
  margin-bottom: 0.65rem;
}

.popup-link-btn {
  width: 100%;
  background: rgba(56, 189, 248, 0.08);
  border: 1.5px solid rgba(56, 189, 248, 0.2);
  color: var(--primary-light);
  padding: 0.35rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.popup-link-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Toast Alerts system */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 1050;
  pointer-events: none;
}

.toast-alert {
  pointer-events: auto;
  width: 300px;
  background: rgba(10, 15, 30, 0.95);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), 0 0 12px rgba(244, 63, 94, 0.12);
  overflow: hidden;
  animation: slideInToast 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-alert.toast-exit {
  opacity: 0;
  transform: translateY(20px) scale(0.9);
}

@keyframes slideInToast {
  from { transform: translateY(40px) scale(0.85); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.toast-body {
  padding: 0.85rem;
  position: relative;
}

.toast-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.toast-tag { color: var(--priority-1); font-size: 0.62rem; font-weight: 800; letter-spacing: 0.05em; }
.toast-time { color: var(--text-muted); font-size: 0.65rem; font-family: var(--font-mono); }

.toast-main strong { display: block; font-size: 0.82rem; color: var(--text-primary); line-height: 1.3; }
.toast-main p { font-size: 0.74rem; color: var(--text-secondary); margin-top: 0.2rem; }

.toast-actions { display: flex; justify-content: flex-end; gap: 0.4rem; }
.toast-btn-action { background: var(--priority-1); border: none; color: #fff; padding: 0.2rem 0.55rem; border-radius: 3px; font-size: 0.68rem; font-weight: 700; cursor: pointer; }
.toast-btn-dismiss { background: transparent; border: none; color: var(--text-muted); font-size: 1rem; cursor: pointer; position: absolute; top: 0.5rem; right: 0.5rem; }
.toast-btn-dismiss:hover { color: #fff; }

/* Dynamic banner for Link Fault Error states */
.error-toast-banner {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: #7f1d1d;
  border: 1.5px solid #ef4444;
  color: #fff;
  border-radius: 8px;
  padding: 0.6rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  z-index: 1000;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  animation: slideBannerUp 0.3s ease-out;
}

@keyframes slideBannerUp {
  from { bottom: -50px; opacity: 0; }
  to { bottom: 1.5rem; opacity: 1; }
}

.error-banner-content {
  display: flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 600;
}

.btn-banner-retry {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-banner-retry:hover {
  background: #fff;
  color: #7f1d1d;
}

/* Shimmer Skeletal layout loading */
.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.skeleton-text {
  background: linear-gradient(90deg, rgba(255,255,255,0.02) 25%, rgba(255,255,255,0.06) 50%, rgba(255,255,255,0.02) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 3px;
}

.skeleton-title { height: 14px; width: 80%; }
.skeleton-details { height: 10px; width: 90%; }
.skeleton-footer { height: 16px; width: 100%; }

@keyframes skeleton-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.spinning {
  animation: spin 0.6s linear;
}

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

/* ==========================================================================
   Tactical Extensions: Badges, Timers, Split-Map, Resolved History & Mobile
   ========================================================================== */

/* Incident Classification Badges */
.class-badge {
  font-size: 0.6rem;
  font-weight: 800;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
  text-transform: uppercase;
  display: inline-block;
  vertical-align: middle;
}
.class-badge.violent {
  background: rgba(244, 63, 94, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(244, 63, 94, 0.3);
}
.class-badge.traffic {
  background: rgba(249, 115, 22, 0.12);
  color: #fdba74;
  border: 1px solid rgba(249, 115, 22, 0.3);
}
.class-badge.property {
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
}
.class-badge.medical {
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.class-badge.disturbance {
  background: rgba(168, 85, 247, 0.12);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.3);
}
.class-badge.other {
  background: rgba(100, 116, 139, 0.12);
  color: #cbd5e1;
  border: 1px solid rgba(100, 116, 139, 0.3);
}

/* Active Unit Duration Tracker Clock */
.live-duration-timer {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-light);
  text-shadow: 0 0 4px rgba(253, 224, 71, 0.3);
}

/* Public Safety Advisory Widget */
.advisory-card {
  margin-bottom: 1.25rem;
  border-left: 3px solid var(--accent);
  background: rgba(234, 179, 8, 0.03);
}
.advisory-card h4 {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.65rem;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.advisory-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.advisory-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--text-secondary);
}
.advisory-item.warning {
  border-color: rgba(234, 179, 8, 0.25);
  background: rgba(234, 179, 8, 0.04);
}
.advisory-item.warning .adv-indicator {
  background-color: var(--priority-3);
  box-shadow: 0 0 6px var(--priority-3);
}
.advisory-item.info {
  border-color: rgba(59, 130, 246, 0.25);
  background: rgba(59, 130, 246, 0.04);
}
.advisory-item.info .adv-indicator {
  background-color: var(--priority-4);
  box-shadow: 0 0 6px var(--priority-4);
}
.adv-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 0.35rem;
}
.adv-text {
  flex-grow: 1;
}

/* Dossier & Analytics Tab controls */
.intel-tabs-row {
  display: flex;
  gap: 0.35rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.15rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}
.intel-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition-fast);
}
.intel-tab-btn:hover {
  color: var(--text-primary);
}
.intel-tab-btn.active {
  background: var(--primary);
  color: #fff;
}

/* Resolved Session History */
.resolved-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--text-primary);
}
.resolved-card .intel-desc {
  font-size: 0.74rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.4;
}
.resolved-scroll-container {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: calc(100vh - 250px);
  overflow-y: auto;
  padding-right: 0.25rem;
}
.resolved-empty {
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  border: 1px dashed var(--border-color);
  border-radius: 8px;
}
.resolved-item-card {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  position: relative;
  transition: var(--transition-fast);
}
.resolved-item-card:hover {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.15);
}
.resolved-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.resolved-nature {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
}
.resolved-badges {
  display: flex;
  gap: 0.3rem;
  align-items: center;
}
.resolved-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.resolved-detail {
  font-size: 0.7rem;
  color: var(--text-secondary);
  line-height: 1.3;
}
.resolved-detail.text-success {
  color: var(--status-at-scene);
  font-weight: 600;
}

/* Split-Map Dual Pane layout overlay */
.map-container-inner {
  display: flex;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.map-pane {
  flex: 1 1 100%;
  height: 100%;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.map-pane.split-hidden {
  display: none !important;
}

.map-pane:not(.split-hidden) {
  flex: 1 1 50%;
  border-right: 2px solid var(--border-color);
}

.map-pane:not(.split-hidden):last-child {
  border-right: none;
}

#map-split-toggle.active {
  background: var(--primary) !important;
  color: #fff !important;
  border-color: var(--primary) !important;
}

#map-split-toggle.btn-map-inline {
  width: auto;
  padding: 0 0.55rem;
}

/* Mobile Application bottom navigation bar */
.mobile-app-nav {
  display: none; /* Hidden on desktop */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bg-sidebar);
  border-top: 1px solid var(--border-color);
  z-index: 1000;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

.mobile-nav-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  cursor: pointer;
  width: 33%;
  height: 100%;
  transition: var(--transition-fast);
}

.mobile-nav-btn svg {
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.mobile-nav-btn:hover,
.mobile-nav-btn.active {
  color: var(--text-primary);
}

.mobile-nav-btn.active svg {
  color: var(--primary-light);
}

