* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-dark: #0f1117;
  --bg-panel: #1a1d27;
  --bg-card: #222633;
  --bg-card-hover: #2a2f3e;
  --border: #2e3347;
  --text: #e4e6ed;
  --text-muted: #8b8fa3;
  --accent: #4f8ff7;
  --accent-hover: #3a7ae0;
  --critical: #ef4444;
  --high: #f97316;
  --medium: #eab308;
  --low: #22c55e;
  --active: #ef4444;
  --investigating: #f97316;
  --resolved: #22c55e;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 56px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

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

.logo {
  color: var(--high);
  display: flex;
}

.header h1 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.stats {
  display: flex;
  gap: 16px;
  font-size: 13px;
}

.stat {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
}

.stat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.stat-count {
  font-weight: 600;
  color: var(--text);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary {
  background: linear-gradient(135deg, #4f8ff7 0%, #3a6fd8 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(79, 143, 247, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #5a9aff 0%, #4578e0 100%);
  box-shadow: 0 4px 14px rgba(79, 143, 247, 0.35);
  transform: translateY(-0.5px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.btn-icon:hover {
  background: var(--bg-card);
  color: var(--text);
}

/* Main layout */
.main {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

#map {
  flex: 1;
  z-index: 1;
}

/* Leaflet dark theme overrides */
.leaflet-control-zoom a {
  background: var(--bg-panel) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

.leaflet-control-attribution {
  background: rgba(15, 17, 23, 0.8) !important;
  color: var(--text-muted) !important;
  font-size: 10px !important;
}

.leaflet-control-attribution a {
  color: var(--accent) !important;
}

/* Side panel */
.panel {
  width: 380px;
  background: var(--bg-panel);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 2;
}

.panel-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.panel-header h2 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}

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

.filter-row select {
  flex: 1;
  padding: 6px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}

.filter-row select:focus {
  outline: none;
  border-color: var(--accent);
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.panel-body::-webkit-scrollbar {
  width: 6px;
}

.panel-body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

/* Incident cards */
.incident-card {
  position: relative;
  display: flex;
  background: linear-gradient(135deg, rgba(26, 29, 39, 0.85) 0%, rgba(20, 22, 32, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.25s ease;
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.incident-card:hover {
  border-color: rgba(79, 143, 247, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(79, 143, 247, 0.1);
}

.incident-card.severity-critical:hover { border-color: rgba(239, 68, 68, 0.4); box-shadow: 0 8px 24px rgba(239, 68, 68, 0.1), 0 0 0 1px rgba(239, 68, 68, 0.15); }
.incident-card.severity-high:hover { border-color: rgba(249, 115, 22, 0.4); box-shadow: 0 8px 24px rgba(249, 115, 22, 0.1), 0 0 0 1px rgba(249, 115, 22, 0.15); }
.incident-card.severity-medium:hover { border-color: rgba(234, 179, 8, 0.4); box-shadow: 0 8px 24px rgba(234, 179, 8, 0.08), 0 0 0 1px rgba(234, 179, 8, 0.12); }
.incident-card.severity-low:hover { border-color: rgba(34, 197, 94, 0.4); box-shadow: 0 8px 24px rgba(34, 197, 94, 0.08), 0 0 0 1px rgba(34, 197, 94, 0.12); }

.incident-card-accent {
  width: 4px;
  flex-shrink: 0;
  border-radius: 4px 0 0 4px;
}

.incident-card-accent.severity-critical { background: linear-gradient(180deg, var(--critical), rgba(239, 68, 68, 0.3)); }
.incident-card-accent.severity-high { background: linear-gradient(180deg, var(--high), rgba(249, 115, 22, 0.3)); }
.incident-card-accent.severity-medium { background: linear-gradient(180deg, var(--medium), rgba(234, 179, 8, 0.3)); }
.incident-card-accent.severity-low { background: linear-gradient(180deg, var(--low), rgba(34, 197, 94, 0.3)); }

.incident-card-body {
  flex: 1;
  padding: 14px 14px 12px;
  min-width: 0;
}

.incident-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.incident-type-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.incident-type-icon.severity-critical { background: rgba(239, 68, 68, 0.12); color: var(--critical); }
.incident-type-icon.severity-high { background: rgba(249, 115, 22, 0.12); color: var(--high); }
.incident-type-icon.severity-medium { background: rgba(234, 179, 8, 0.12); color: var(--medium); }
.incident-type-icon.severity-low { background: rgba(34, 197, 94, 0.12); color: var(--low); }

.incident-card-info {
  flex: 1;
  min-width: 0;
}

.incident-card-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  display: block;
  margin-bottom: 6px;
  color: var(--text);
}

.incident-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.incident-card-tags .badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  padding: 2px 7px;
}

.incident-card-tags .badge svg {
  width: 10px;
  height: 10px;
}

.badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-critical { background: rgba(239,68,68,0.15); color: var(--critical); }
.badge-high { background: rgba(249,115,22,0.15); color: var(--high); }
.badge-medium { background: rgba(234,179,8,0.15); color: var(--medium); }
.badge-low { background: rgba(34,197,94,0.15); color: var(--low); }

.badge-active { background: rgba(239,68,68,0.15); color: var(--active); }
.badge-investigating { background: rgba(249,115,22,0.15); color: var(--investigating); }
.badge-resolved { background: rgba(34,197,94,0.15); color: var(--resolved); }

.incident-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.incident-card-meta svg {
  flex-shrink: 0;
  opacity: 0.6;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.incident-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.incident-card-location {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.7;
}

.incident-card-location svg {
  opacity: 0.5;
}

.incident-card-view {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.25s ease;
}

.incident-card:hover .incident-card-view {
  opacity: 1;
  transform: translateX(0);
}

/* Map markers */
.incident-marker {
  display: flex;
  align-items: center;
  justify-content: center;
}

.marker-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2.5px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  position: relative;
}

.marker-dot.critical { background: var(--critical); }
.marker-dot.high { background: var(--high); }
.marker-dot.medium { background: var(--medium); }
.marker-dot.low { background: var(--low); }

.marker-dot.pulse::after {
  content: '';
  position: absolute;
  top: -6px;
  left: -6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: inherit;
  opacity: 0.3;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.3; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Map popup */
.leaflet-popup-content-wrapper {
  background: var(--bg-panel) !important;
  color: var(--text) !important;
  border-radius: 8px !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4) !important;
}

.leaflet-popup-tip {
  background: var(--bg-panel) !important;
  border: 1px solid var(--border) !important;
  border-top: none !important;
  border-left: none !important;
}

.leaflet-popup-content {
  margin: 12px 14px !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
}

.popup-title {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 6px;
}

.popup-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.popup-link {
  color: var(--accent);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
}

.popup-link:hover {
  text-decoration: underline;
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 520px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 15px;
  font-weight: 600;
}

.modal-body {
  padding: 20px;
}

/* Form styles */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group textarea {
  min-height: 80px;
  resize: vertical;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row .form-group {
  flex: 1;
}

.form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* Detail view */
.detail-row {
  display: flex;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  width: 110px;
  flex-shrink: 0;
  color: var(--text-muted);
  font-weight: 500;
}

.detail-value {
  flex: 1;
}

.detail-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

/* Heatmap controls */
.heatmap-controls {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.heatmap-toggle {
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: all 0.15s;
}

.heatmap-toggle.active {
  background: rgba(239, 68, 68, 0.15);
  color: var(--critical);
  border-color: var(--critical);
}

.heatmap-controls select {
  padding: 6px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}

.heatmap-controls select:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.heatmap-controls select:focus {
  outline: none;
  border-color: var(--accent);
}

.heatmap-count {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Detail image */
.detail-image {
  position: relative;
  margin: -20px -20px 16px -20px;
  border-radius: 11px 11px 0 0;
  overflow: hidden;
  background: var(--bg-card);
  min-height: 160px;
}

.detail-image img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.detail-image-label {
  position: absolute;
  bottom: 8px;
  left: 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.7);
  background: rgba(0,0,0,0.5);
  padding: 3px 8px;
  border-radius: 4px;
}

.detail-image-label.live-label {
  color: #fff;
  background: rgba(220, 38, 38, 0.8);
  animation: live-pulse 2s infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Context menu */
.context-menu {
  position: fixed;
  z-index: 2000;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  min-width: 200px;
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s;
}

.context-menu-item:hover {
  background: var(--accent);
  color: #fff;
}

/* Panel tabs */
.panel-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.panel-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.panel-tab:hover {
  color: var(--text);
  background: var(--bg-card);
}

.panel-tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.panel-tab-content {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.panel-tab-content.active {
  display: flex;
}

/* X Feed */
.feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.feed-account {
  display: flex;
  align-items: center;
  gap: 10px;
}

.feed-account strong {
  display: block;
  font-size: 13px;
}

.feed-handle {
  font-size: 11px;
  color: var(--text-muted);
}

.feed-embed {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.feed-embed .twitter-timeline {
  display: block;
}

/* Modal action bar */
.modal-action-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.modal-action-bar .btn-manage {
  flex: 1;
  margin: 0;
}

.share-compact {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.btn-share-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-share-icon.btn-x {
  background: #1a1a2e;
  color: #e7e9ea;
  border: 1px solid rgba(255,255,255,0.08);
}

.btn-share-icon.btn-x:hover {
  background: #2a2a3e;
  border-color: rgba(255,255,255,0.15);
  transform: translateY(-1px);
}

.btn-share-icon.btn-wa {
  background: rgba(37, 211, 102, 0.1);
  color: #25d366;
  border: 1px solid rgba(37, 211, 102, 0.2);
}

.btn-share-icon.btn-wa:hover {
  background: rgba(37, 211, 102, 0.2);
  transform: translateY(-1px);
}

/* Tweet feed */
.tweet {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

.tweet:hover {
  background: var(--bg-card);
}

.tweet-avatar-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #1a3a5c;
  color: #5b9bd5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.tweet-body {
  flex: 1;
  min-width: 0;
}

.tweet-header {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.tweet-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.tweet-verified {
  flex-shrink: 0;
}

.tweet-handle,
.tweet-dot,
.tweet-time {
  font-size: 13px;
  color: var(--text-muted);
}

.tweet-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
  word-wrap: break-word;
  margin-bottom: 8px;
}

.tweet-image {
  margin-bottom: 10px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.tweet-image img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

.tweet-actions {
  display: flex;
  gap: 0;
  justify-content: space-between;
  max-width: 260px;
}

.tweet-action {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 50px;
  transition: all 0.15s;
}

.tweet-action:hover {
  color: var(--accent);
  background: rgba(29, 155, 240, 0.1);
}

.tweet-action-rt:hover {
  color: #00ba7c;
  background: rgba(0, 186, 124, 0.1);
}

.tweet-action-like:hover {
  color: #f91880;
  background: rgba(249, 24, 128, 0.1);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state svg {
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty-state p {
  font-size: 13px;
}

/* ==================== Case Management ==================== */

#case-management-view {
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  background: linear-gradient(135deg, #0c0e16 0%, #121420 50%, #0e1018 100%);
  position: relative;
  z-index: 500;
}

/* Case Header */
.case-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 32px;
  background: linear-gradient(180deg, rgba(26, 29, 39, 0.95) 0%, rgba(26, 29, 39, 0.85) 100%);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(79, 143, 247, 0.1);
  flex-shrink: 0;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.case-back-btn {
  flex-shrink: 0;
  border-color: rgba(255,255,255,0.1) !important;
}

.case-back-btn:hover {
  border-color: var(--accent) !important;
  background: rgba(79, 143, 247, 0.1) !important;
}

.case-header-title {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.case-id {
  font-size: 12px;
  color: var(--accent);
  font-weight: 700;
  background: rgba(79, 143, 247, 0.1);
  padding: 3px 10px;
  border-radius: 6px;
  letter-spacing: 0.02em;
}

.case-header-title h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.case-header-badges {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Stage Bar */
.stage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  background: linear-gradient(180deg, rgba(20, 22, 32, 0.9) 0%, rgba(15, 17, 23, 0.95) 100%);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  flex-shrink: 0;
}

.stage-bar-inner {
  display: flex;
  align-items: center;
  flex: 1;
  margin-right: 24px;
}

.stage-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.stage-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(34, 38, 51, 0.8);
  border: 2px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stage-step.completed .stage-dot {
  background: linear-gradient(135deg, #4f8ff7 0%, #3a6fd8 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 8px rgba(79, 143, 247, 0.3);
}

.stage-step.current .stage-dot {
  background: linear-gradient(135deg, #4f8ff7 0%, #6c5ce7 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 0 4px rgba(79, 143, 247, 0.2), 0 4px 16px rgba(79, 143, 247, 0.4);
  animation: stage-glow 2s ease-in-out infinite;
}

@keyframes stage-glow {
  0%, 100% { box-shadow: 0 0 0 4px rgba(79, 143, 247, 0.2), 0 4px 16px rgba(79, 143, 247, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(79, 143, 247, 0.15), 0 4px 20px rgba(79, 143, 247, 0.5); }
}

.stage-step[style*="cursor:pointer"] .stage-dot:hover {
  border-color: var(--accent);
  transform: scale(1.1);
}

.stage-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(139, 143, 163, 0.6);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stage-step.completed .stage-label {
  color: var(--accent);
}

.stage-step.current .stage-label {
  color: #fff;
}

.stage-connector {
  flex: 1;
  height: 2px;
  background: rgba(255,255,255,0.06);
  margin: 0 6px;
  margin-bottom: 26px;
  border-radius: 1px;
}

.stage-connector.completed {
  background: linear-gradient(90deg, var(--accent), rgba(79, 143, 247, 0.4));
}

.btn-sm {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  letter-spacing: 0.02em;
}

/* Case Summary */
.case-summary {
  padding: 20px 32px;
  background: rgba(26, 29, 39, 0.5);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  flex-shrink: 0;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  background: rgba(34, 38, 51, 0.5);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 10px;
}

.summary-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(139, 143, 163, 0.6);
}

.summary-value {
  font-size: 14px;
  font-weight: 600;
}

.summary-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  padding: 10px 14px;
  background: rgba(34, 38, 51, 0.3);
  border-radius: 8px;
  border-left: 3px solid rgba(79, 143, 247, 0.3);
}

/* Case Tabs */
.case-tabs {
  display: flex;
  background: rgba(26, 29, 39, 0.6);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  flex-shrink: 0;
  padding: 0 24px;
  gap: 4px;
}

.case-tab {
  flex: none;
  padding: 14px 24px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  letter-spacing: 0.01em;
}

.case-tab:hover {
  color: var(--text);
}

.case-tab.active {
  color: #fff;
  border-bottom-color: var(--accent);
}

.case-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--accent);
  filter: blur(4px);
}

/* Case Content */
.case-content {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px;
}

.case-content::-webkit-scrollbar {
  width: 6px;
}

.case-content::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
}

/* Tab toolbar */
.tab-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.tab-toolbar h3 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Inline forms */
.inline-form {
  background: linear-gradient(135deg, rgba(34, 38, 51, 0.6) 0%, rgba(30, 33, 45, 0.6) 100%);
  border: 1px solid rgba(79, 143, 247, 0.15);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* Responder cards */
.responder-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.responder-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: linear-gradient(135deg, rgba(34, 38, 51, 0.7) 0%, rgba(28, 31, 42, 0.7) 100%);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 14px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.responder-card:hover {
  border-color: rgba(79, 143, 247, 0.3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transform: translateY(-1px);
}

.responder-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.responder-info {
  flex: 1;
  min-width: 0;
}

.responder-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 3px;
  letter-spacing: -0.01em;
}

.responder-role {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.responder-times {
  display: flex;
  gap: 20px;
  font-size: 11px;
  color: var(--text-muted);
}

.responder-times span::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
  margin-right: 6px;
  vertical-align: middle;
}

.responder-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.responder-status-select {
  padding: 6px 10px;
  background: rgba(15, 17, 23, 0.6);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 0.15s;
}

.responder-status-select:hover {
  border-color: rgba(255,255,255,0.2);
}

.responder-status-select:focus {
  outline: none;
  border-color: var(--accent);
}

.btn-icon-sm {
  background: none;
  border: none;
  color: rgba(139, 143, 163, 0.4);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  display: flex;
  transition: all 0.15s;
}

.btn-icon-sm:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--critical);
}

/* Timeline */
.timeline-list {
  display: flex;
  flex-direction: column;
  padding-left: 4px;
}

.timeline-entry {
  display: flex;
  gap: 16px;
  min-height: 64px;
}

.timeline-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 20px;
  flex-shrink: 0;
}

.timeline-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.3), 0 2px 6px rgba(0,0,0,0.2);
}

.timeline-line {
  width: 2px;
  flex: 1;
  background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, transparent 100%);
  margin: 4px 0;
}

.timeline-entry:last-child .timeline-line {
  display: none;
}

.timeline-content {
  flex: 1;
  padding-bottom: 20px;
  padding-top: 0;
}

.timeline-time {
  font-size: 11px;
  color: rgba(139, 143, 163, 0.6);
  margin-bottom: 4px;
  font-weight: 500;
}

.timeline-actor {
  color: var(--accent);
  font-weight: 600;
  margin-left: 8px;
  font-size: 11px;
}

.timeline-message {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  padding: 10px 14px;
  background: rgba(34, 38, 51, 0.4);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.03);
}

/* Evidence cards */
.evidence-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.evidence-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(34, 38, 51, 0.6) 0%, rgba(28, 31, 42, 0.6) 100%);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 14px;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.evidence-card:hover {
  border-color: rgba(79, 143, 247, 0.2);
  transform: translateY(-1px);
}

.evidence-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(79, 143, 247, 0.15) 0%, rgba(108, 92, 231, 0.1) 100%);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.evidence-info {
  flex: 1;
  min-width: 0;
}

.evidence-desc {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.evidence-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--text-muted);
}

/* Note cards */
.note-form {
  background: linear-gradient(135deg, rgba(34, 38, 51, 0.5) 0%, rgba(30, 33, 45, 0.5) 100%);
  border: 1px solid rgba(79, 143, 247, 0.1);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.notes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.note-card {
  padding: 18px 20px;
  background: linear-gradient(135deg, rgba(34, 38, 51, 0.6) 0%, rgba(28, 31, 42, 0.6) 100%);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 14px;
  border-left: 3px solid var(--accent);
  transition: all 0.15s;
}

.note-card:hover {
  border-color: rgba(255,255,255,0.08);
  border-left-color: var(--accent);
}

.note-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.note-author {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

.note-time {
  font-size: 11px;
  color: rgba(139, 143, 163, 0.5);
  flex: 1;
}

.note-content {
  font-size: 13px;
  line-height: 1.7;
  color: rgba(228, 230, 237, 0.85);
}

/* Manage incident button */
.btn-manage {
  background: linear-gradient(135deg, #4f8ff7 0%, #3a6fd8 100%);
  color: #fff;
  justify-content: center;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  box-shadow: 0 2px 8px rgba(79, 143, 247, 0.25);
  transition: all 0.2s;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-manage:hover {
  box-shadow: 0 4px 16px rgba(79, 143, 247, 0.4);
  transform: translateY(-1px);
  background: linear-gradient(135deg, #5e9bff 0%, #4a7fe5 100%);
}

/* ==================== Police Docket ==================== */

.docket-section {
  background: linear-gradient(135deg, rgba(20, 24, 40, 0.8) 0%, rgba(16, 18, 30, 0.8) 100%);
  border: 1px solid rgba(79, 143, 247, 0.12);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.docket-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.docket-header:hover {
  background: rgba(79, 143, 247, 0.04);
}

.docket-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.docket-shield {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(79, 143, 247, 0.15) 0%, rgba(108, 92, 231, 0.1) 100%);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(79, 143, 247, 0.15);
}

.docket-header h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 2px;
}

.docket-case-num {
  font-size: 12px;
  color: var(--text-muted);
  font-family: monospace;
  letter-spacing: 0.03em;
}

.docket-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.docket-status-badge {
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.docket-chevron {
  color: var(--text-muted);
  transition: transform 0.2s;
}

.docket-body {
  padding: 20px 24px;
  transition: all 0.3s;
}

.docket-body.collapsed {
  display: none;
}

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

.docket-field label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(139, 143, 163, 0.5);
  margin-bottom: 6px;
}

.docket-field input,
.docket-field select {
  width: 100%;
  padding: 8px 12px;
  background: rgba(15, 17, 23, 0.5);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.15s;
}

.docket-field input:focus,
.docket-field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 143, 247, 0.1);
}

.docket-field input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
  vertical-align: middle;
}

.docket-sub-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.04);
}

.docket-sub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.docket-sub-header h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

/* Suspect cards */
.suspect-card {
  background: rgba(15, 17, 23, 0.4);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 10px;
  transition: border-color 0.15s;
}

.suspect-card:hover {
  border-color: rgba(79, 143, 247, 0.2);
}

.suspect-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.suspect-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f8ff7 0%, #6c5ce7 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}

.suspect-name-block {
  flex: 1;
}

.suspect-name-block strong {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}

.suspect-name-block span {
  font-size: 12px;
  color: var(--text-muted);
}

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

.suspect-detail {
  font-size: 12px;
}

.suspect-detail span {
  display: block;
  font-size: 10px;
  color: rgba(139, 143, 163, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 3px;
  font-weight: 600;
}

.suspect-detail strong {
  font-weight: 500;
  color: var(--text);
}

/* Charge cards */
.charge-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(239, 68, 68, 0.04);
  border: 1px solid rgba(239, 68, 68, 0.1);
  border-radius: 10px;
  margin-bottom: 8px;
}

.charge-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.1);
  color: var(--critical);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.charge-info {
  flex: 1;
}

.charge-offence {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 3px;
}

.charge-meta {
  font-size: 11px;
  color: var(--text-muted);
}

/* Docket notes area */
.docket-notes-area {
  width: 100%;
  min-height: 100px;
  padding: 14px;
  background: rgba(15, 17, 23, 0.4);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  line-height: 1.6;
  resize: vertical;
  margin-top: 10px;
}

.docket-notes-area:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 143, 247, 0.1);
}

/* ==================== Weather ==================== */

.weather-marker {
  background: none !important;
  border: none !important;
}

.weather-marker-inner {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(26, 29, 39, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 3px 9px 3px 5px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}

.weather-marker-icon {
  font-size: 16px;
  line-height: 1;
}

.weather-marker-temp {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

/* Weather popup */
.weather-popup { font-family: var(--font); }

.weather-popup-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.weather-popup-icon { font-size: 28px; line-height: 1; }
.weather-popup-name { font-size: 14px; font-weight: 700; }
.weather-popup-condition { font-size: 12px; color: #8b8fa3; }

.weather-popup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.weather-popup-item { display: flex; flex-direction: column; gap: 2px; }
.wp-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: #8b8fa3; }
.wp-value { font-size: 13px; font-weight: 600; }

.weather-popup-road {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* Weather alerts in panel */
.weather-alerts-section { flex-shrink: 0; }

.weather-alerts-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--high);
  border-bottom: 1px solid var(--border);
  background: rgba(249, 115, 22, 0.04);
}

.weather-alert-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.1s;
}

.weather-alert-card:hover { background: var(--bg-card); }
.weather-alert-card.severity-critical { border-left: 3px solid var(--critical); }
.weather-alert-card.severity-high { border-left: 3px solid var(--high); }

.weather-alert-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.weather-alert-message { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.weather-alert-detail { font-size: 11px; color: var(--text-muted); }

.weather-no-alerts {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  font-size: 12px;
  color: var(--low);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  background: rgba(34, 197, 94, 0.04);
}

/* Weather station cards */
.weather-stations-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.weather-station-card {
  background: linear-gradient(135deg, rgba(26, 29, 39, 0.85) 0%, rgba(20, 22, 32, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
  backdrop-filter: blur(8px);
}

.weather-station-card:hover {
  border-color: rgba(79, 143, 247, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.weather-station-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 4px;
}

.weather-station-info { flex: 1; min-width: 0; }
.weather-station-name { font-size: 13px; font-weight: 700; color: var(--text); display: block; }

.weather-station-road {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(79, 143, 247, 0.1);
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 3px;
}

.weather-station-temp-block {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.weather-station-icon { font-size: 22px; line-height: 1; }
.weather-station-temp { font-size: 20px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }

.weather-station-condition {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.weather-station-details {
  display: flex;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.weather-detail-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--text-muted);
}

.weather-detail-item svg { opacity: 0.6; flex-shrink: 0; }

.weather-updated {
  text-align: center;
  font-size: 10px;
  color: var(--text-muted);
  padding: 12px 0;
  opacity: 0.6;
}
