/* ==========================================================================
   OutageTAG - Modern Electrical Outage & GIS Incident Management System
   Typography & Color Tokens (Sleek High-Tech Dark / Modern Clean Theme)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Prompt:wght@300;400;500;600;700&display=swap');

:root {
  /* Brand Palette */
  --bg-main: #0B0F19;
  --bg-card: #131B2E;
  --bg-card-hover: #1A243D;
  --bg-glass: rgba(19, 27, 46, 0.85);
  --bg-glass-heavy: rgba(11, 15, 25, 0.92);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.15);
  --border-focus: #3B82F6;
  
  /* Text Colors */
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --text-inverse: #0B0F19;

  /* Status Colors */
  --status-pending: #EF4444;       /* 🔴 Red */
  --status-pending-bg: rgba(239, 68, 68, 0.15);
  --status-pending-border: rgba(239, 68, 68, 0.4);

  --status-progress: #F59E0B;      /* 🟡 Yellow */
  --status-progress-bg: rgba(245, 158, 11, 0.15);
  --status-progress-border: rgba(245, 158, 11, 0.4);

  --status-resolved: #10B981;      /* 🟢 Green */
  --status-resolved-bg: rgba(16, 185, 129, 0.15);
  --status-resolved-border: rgba(16, 185, 129, 0.4);

  --status-canceled: #64748B;
  --status-canceled-bg: rgba(100, 116, 139, 0.15);
  --status-canceled-border: rgba(100, 116, 139, 0.4);

  /* Priority Colors */
  --priority-urgent-high: #DC2626;
  --priority-urgent: #EA580C;
  --priority-normal: #3B82F6;

  /* Accent Colors */
  --primary: #3B82F6;
  --primary-hover: #2563EB;
  --primary-glow: rgba(59, 130, 246, 0.35);
  --accent-cyan: #06B6D4;
  --accent-amber: #F59E0B;
  --accent-emerald: #10B981;
  --accent-purple: #8B5CF6;

  /* Radius & Shadows */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 10px 35px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 25px rgba(59, 130, 246, 0.25);

  --font-main: 'Prompt', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

/* Light Theme overrides if toggled */
body.light-theme {
  --bg-main: #F1F5F9;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F8FAFC;
  --bg-glass: rgba(255, 255, 255, 0.9);
  --bg-glass-heavy: rgba(241, 245, 249, 0.95);
  --border-color: #E2E8F0;
  --border-light: #CBD5E1;
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

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

html, body {
  height: 100%;
  font-family: var(--font-main);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* App Shell Layout */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top Navigation Bar */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 50%, #06B6D4 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: #FFF;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
  animation: pulse-glow 3s infinite alternate;
}

@keyframes pulse-glow {
  0% { box-shadow: 0 0 10px rgba(59, 130, 246, 0.4); }
  100% { box-shadow: 0 0 22px rgba(6, 182, 212, 0.7); }
}

.brand-text h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.brand-text .badge {
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #60A5FA;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.brand-text p {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Nav Tabs & Controls */
.nav-center {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.nav-tab-btn {
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

.nav-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab-btn.active {
  background: var(--primary);
  color: #FFF;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.4);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  font-family: var(--font-main);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35);
}

.btn-success:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
}

.btn-warning {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: #FFFFFF;
}

.btn-danger {
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  color: #FFFFFF;
}

.btn-danger:hover {
  background: #DC2626;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--border-light);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
}

.btn-sm {
  padding: 0.3rem 0.7rem;
  font-size: 0.775rem;
  border-radius: var(--radius-sm);
}

/* KPI Stats Bar */
.kpi-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  padding: 1.25rem 1.5rem 0.5rem 1.5rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-light);
}

.kpi-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.kpi-card.total::before { background: #3B82F6; }
.kpi-card.pending::before { background: var(--status-pending); }
.kpi-card.progress::before { background: var(--status-progress); }
.kpi-card.resolved::before { background: var(--status-resolved); }
.kpi-card.duration::before { background: #8B5CF6; }

.kpi-info h4 {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.kpi-info .kpi-value {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.kpi-info .kpi-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.kpi-icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.kpi-card.total .kpi-icon-box { background: rgba(59, 130, 246, 0.15); color: #60A5FA; }
.kpi-card.pending .kpi-icon-box { background: var(--status-pending-bg); color: var(--status-pending); }
.kpi-card.progress .kpi-icon-box { background: var(--status-progress-bg); color: var(--status-progress); }
.kpi-card.resolved .kpi-icon-box { background: var(--status-resolved-bg); color: var(--status-resolved); }
.kpi-card.duration .kpi-icon-box { background: rgba(139, 92, 246, 0.15); color: #A78BFA; }

/* Main Content Area */
.main-content {
  flex: 1;
  padding: 1rem 1.5rem 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* View Section Control */
.view-section {
  display: none;
}
.view-section.active {
  display: block;
}

/* Split GIS & List Layout */
.gis-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.25rem;
  height: calc(100vh - 210px);
  min-height: 580px;
}

@media (max-width: 1024px) {
  .gis-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
}

/* Map Container Card */
.map-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
}

.map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border-color);
  z-index: 400;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.map-filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.map-switch-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.map-switch-label input[type="checkbox"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

#map {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 450px;
  background: #111827;
  z-index: 10;
}

/* Custom Map Floating Controls & Collapsible Legend Popup */
.map-floating-panel {
  position: absolute;
  bottom: 20px;
  left: 20px;
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1.15rem;
  z-index: 400;
  box-shadow: var(--shadow-lg);
  max-width: 290px;
  font-size: 0.78rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
}

.map-floating-panel.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.95);
  display: none !important;
}

.map-legend-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.map-legend-title {
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
}

.legend-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.legend-close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #FFF;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
  color: var(--text-secondary);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.pending { background: var(--status-pending); box-shadow: 0 0 8px var(--status-pending); }
.legend-dot.progress { background: var(--status-progress); box-shadow: 0 0 8px var(--status-progress); }
.legend-dot.resolved { background: var(--status-resolved); box-shadow: 0 0 8px var(--status-resolved); }
.legend-dot.hv { background: #38BDF8; box-shadow: 0 0 8px #38BDF8; }

/* Side Incident Feed */
.side-feed {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.feed-header {
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.feed-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.feed-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

/* Incident Item Card */
.incident-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.incident-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-light);
  transform: translateX(2px);
}

.incident-card.selected {
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
  background: rgba(59, 130, 246, 0.08);
}

.incident-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.incident-code {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.18rem 0.5rem;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
}

.status-badge.pending {
  background: var(--status-pending-bg);
  border-color: var(--status-pending-border);
  color: #F87171;
}

.status-badge.progress {
  background: var(--status-progress-bg);
  border-color: var(--status-progress-border);
  color: #FBBF24;
}

.status-badge.resolved {
  background: var(--status-resolved-bg);
  border-color: var(--status-resolved-border);
  color: #34D399;
}

.status-badge.canceled {
  background: var(--status-canceled-bg);
  border-color: var(--status-canceled-border);
  color: #94A3B8;
}

.incident-loc {
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.incident-meta {
  font-size: 0.725rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.incident-cause {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

/* Table View Section */
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.table-toolbar {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border-color);
}

.filter-inputs {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.input-control {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.85rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--transition-fast);
}

.input-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.input-control::placeholder {
  color: var(--text-muted);
}

select.input-control {
  cursor: pointer;
}

.data-table-wrapper {
  overflow-x: auto;
}

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

.data-table th {
  background: rgba(255, 255, 255, 0.03);
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

/* Modals & Dialogs */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.97);
  transition: transform var(--transition-normal);
  overflow: hidden;
  position: relative;
}

.modal-box form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.modal-overlay.active .modal-box {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-glass);
  flex-shrink: 0;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.modal-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

.modal-footer {
  padding: 0.9rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .modal-overlay {
    padding: 0.5rem;
    align-items: flex-start;
  }
  .modal-box {
    max-height: calc(100vh - 1rem);
    margin: auto 0;
  }
  .modal-body {
    padding: 1rem;
  }
  .modal-footer {
    padding: 0.75rem 1rem;
  }
}

/* Form Styles */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.form-label .req {
  color: var(--status-pending);
}

textarea.input-control {
  resize: vertical;
  min-height: 80px;
}

/* Proximity Equipment Search Box */
.hv-finder-box {
  background: rgba(59, 130, 246, 0.06);
  border: 1px dashed rgba(59, 130, 246, 0.35);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  margin-top: 0.4rem;
}

.hv-finder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #60A5FA;
}

.hv-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 150px;
  overflow-y: auto;
}

.hv-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.hv-item:hover, .hv-item.active {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.15);
}

.hv-dist-badge {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.7rem;
}

/* Photo Upload & Preview Grid (Up to 10 photos) */
.photo-upload-section {
  margin-top: 0.75rem;
}

.photo-dropzone {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.2);
  transition: all var(--transition-fast);
}

.photo-dropzone:hover {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.05);
}

.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.photo-card {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: #000;
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-fast);
}

.photo-card:hover img {
  transform: scale(1.05);
}

.photo-delete-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(239, 68, 68, 0.85);
  color: #FFF;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  backdrop-filter: blur(4px);
}

.photo-delete-btn:hover {
  background: #DC2626;
}

.photo-zoom-btn {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(0, 0, 0, 0.7);
  color: #FFF;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
}

/* Lightbox Modal for Photo Zoom */
.lightbox-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.lightbox-modal.active {
  display: flex;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 25px;
  right: 30px;
  background: rgba(255, 255, 255, 0.2);
  color: #FFF;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* Dynamic Rows for Materials and Technicians */
.dynamic-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.dynamic-row .input-control {
  flex: 1;
}

.dynamic-row .btn-remove {
  background: rgba(239, 68, 68, 0.15);
  color: var(--status-pending);
  border: 1px solid var(--status-pending-border);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Leaflet Custom Marker Styling */
.pulse-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #FFF;
  font-weight: 700;
  box-shadow: 0 0 15px rgba(0,0,0,0.5);
  transition: transform 0.2s ease;
}

.pulse-marker.pending {
  background: radial-gradient(circle, #EF4444 0%, #991B1B 100%);
  border: 2px solid #FFF;
  animation: marker-pulse-red 2s infinite;
}

.pulse-marker.progress {
  background: radial-gradient(circle, #F59E0B 0%, #B45309 100%);
  border: 2px solid #FFF;
  animation: marker-pulse-yellow 2s infinite;
}

.pulse-marker.resolved {
  background: radial-gradient(circle, #10B981 0%, #065F46 100%);
  border: 2px solid #FFF;
}

.pulse-marker.hv {
  background: radial-gradient(circle, #0284C7 0%, #0369A1 100%);
  border: 2px solid #38BDF8;
}

@keyframes marker-pulse-red {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { box-shadow: 0 0 0 14px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

@keyframes marker-pulse-yellow {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
  70% { box-shadow: 0 0 0 14px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* Leaflet Popup Styling */
.leaflet-popup-content-wrapper {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius-lg) !important;
  border: 1px solid var(--border-light) !important;
  box-shadow: var(--shadow-lg) !important;
  padding: 0 !important;
  font-family: var(--font-main) !important;
}

.leaflet-popup-content {
  margin: 0 !important;
  line-height: 1.4 !important;
}

.leaflet-popup-tip {
  background: var(--bg-card) !important;
}

.custom-popup {
  padding: 1rem;
  min-width: 250px;
}

.popup-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.popup-row {
  font-size: 0.775rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.popup-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color);
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.15rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  animation: slideInRight 0.3s ease;
  min-width: 280px;
}

.toast.success { border-left: 4px solid var(--status-resolved); }
.toast.error { border-left: 4px solid var(--status-pending); }
/* ==========================================================================
   HV Equipment Marker Icons (TR, DFC, DS, LBS, RC)
   ========================================================================== */
.hv-marker-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hv-pill {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFF;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.85);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
  cursor: pointer;
}

.hv-marker-wrap:hover .hv-pill {
  transform: scale(1.22) translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.8);
  border-color: #FFF;
}

/* HV Specific Type Colors & Gradients */
.hv-tr .hv-pill {
  background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.6);
}
.hv-dfc .hv-pill {
  background: linear-gradient(135deg, #F97316 0%, #C2410C 100%);
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.6);
}
.hv-ds .hv-pill {
  background: linear-gradient(135deg, #0284C7 0%, #0369A1 100%);
  box-shadow: 0 0 12px rgba(2, 132, 199, 0.6);
}
.hv-lbs .hv-pill {
  background: linear-gradient(135deg, #10B981 0%, #047857 100%);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.6);
}
.hv-rc .hv-pill {
  background: linear-gradient(135deg, #E11D48 0%, #9F1239 100%);
  box-shadow: 0 0 14px rgba(225, 29, 72, 0.7);
}

.hv-tag {
  position: absolute;
  top: -8px;
  right: -8px;
  padding: 1px 4px;
  font-size: 8px;
  font-weight: 800;
  border-radius: 4px;
  background: #0B0F19;
  color: #FFF;
  border: 1px solid rgba(255, 255, 255, 0.3);
  letter-spacing: 0.5px;
  line-height: 1;
}

/* ==========================================================================
   Real-Time Technician GPS Live Tracker & Route
   ========================================================================== */
.tech-live-marker {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.tech-radar-wave {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.35);
  animation: tech-radar-pulse 2s infinite ease-out;
  pointer-events: none;
}

@keyframes tech-radar-pulse {
  0% { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(2.2); opacity: 0; }
}

.tech-icon-disc {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  border: 2px solid #FFF;
  color: #FFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.85);
  cursor: pointer;
  z-index: 2;
  transition: transform 0.2s ease;
}

.tech-live-marker:hover .tech-icon-disc {
  transform: scale(1.18);
}

.tech-label-tooltip {
  position: absolute;
  top: 38px;
  white-space: nowrap;
  background: rgba(11, 15, 25, 0.92);
  border: 1px solid #F59E0B;
  color: #FFF;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  z-index: 3;
}

/* Incident Feed Technician Badge */
.incident-tech-badge {
  font-size: 0.725rem;
  font-weight: 600;
  color: #F59E0B;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 4px;
  padding: 2px 6px;
  margin: 3px 0 4px 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Accept Job Info Banner & GPS Share Box */
.accept-info-banner {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.gps-share-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  margin-top: 0.25rem;
}

/* Print Only Styles (for Work Orders & Resolution Reports) */
@media print {
  body {
    background: #FFF !important;
    color: #000 !important;
    font-size: 12pt;
  }

  .navbar, .kpi-container, .table-toolbar, .map-toolbar,
  .modal-footer, .nav-center, .nav-actions, .btn-print-hide,
  #toast-container, .side-feed {
    display: none !important;
  }

  .print-page {
    display: block !important;
    padding: 20mm;
    page-break-after: always;
  }

  .print-header {
    text-align: center;
    border-bottom: 2px solid #000;
    padding-bottom: 10px;
    margin-bottom: 20px;
  }

  .print-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
  }

  .print-table th, .print-table td {
    border: 1px solid #333;
    padding: 6px 10px;
    text-align: left;
    font-size: 10pt;
  }

  .print-photos {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
  }

  .print-photos img {
    max-height: 180px;
    object-fit: cover;
    border: 1px solid #ccc;
  }
}
