/* ============================================
   COLOR VARIABLES - Dark Professional Theme
   ============================================ */

:root {
  /* Dark Theme - Base Colors */
  --color-bg-primary: #0f0f0f;
  --color-bg-secondary: #1a1a1a;
  --color-bg-tertiary: #252525;
  --color-bg-elevated: #2a2a2a;
  --color-bg-hover: #333333;

  /* Accent Colors */
  --color-accent: #F97316;
  --color-accent-hover: #FB923C;
  --color-accent-muted: rgba(249, 115, 22, 0.15);
  --color-accent-glow: rgba(249, 115, 22, 0.3);

  /* Border Colors */
  --color-border: #333333;
  --color-border-light: #404040;
  --color-border-focus: #F97316;

  /* Text Colors */
  --color-text-primary: #ffffff;
  --color-text-secondary: #a0a0a0;
  --color-text-muted: #8a8a8a;  /* Improved contrast from #666666 */
  --color-text-accent: #F97316;

  /* Status Colors - distinct from category colors (El=orange, Brann=red) */
  --color-status-overdue: #DC2626;      /* Rød - forfalt */
  --color-status-soon: #FFC107;         /* Amber/gold - innen 30 dager (bedre synlighet) */
  --color-status-ok: #42A5F5;           /* Lyseblå - 31-90 dager (skiller seg fra grønn) */
  --color-status-good: #4CAF50;         /* Grønn - over 90 dager */
  --color-status-unknown: #78909C;      /* Blågrå - ukjent (litt varmere enn ren grå) */

  /* Legacy aliases */
  --color-overdue: var(--color-status-overdue);
  --color-warning: var(--color-status-soon);
  --color-ok: var(--color-status-ok);
  --color-good: var(--color-status-good);
  --color-unknown: var(--color-status-unknown);

  /* Shadows for dark theme */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 20px rgba(249, 115, 22, 0.2);

  /* Deprecated - keeping for backwards compatibility */
  --color-dark-gray: #1a1a1a;
  --color-charcoal: #0f0f0f;
  --color-orange: #F97316;
  --color-orange-hover: #FB923C;
  --color-light-gray: #252525;
  --color-medium-gray: #8a8a8a;  /* Improved contrast */
  --color-border-gray: #333333;
  --color-bg-gray: #1a1a1a;
  --color-light-orange: rgba(249, 115, 22, 0.1);
  --color-text-light: #ffffff;
}

/* ============================================
   GLOBAL STATUS COLOR UTILITIES
   Use these classes for consistent status colors
   ============================================ */

/* Text colors */
.text-status-overdue { color: var(--color-status-overdue) !important; }
.text-status-soon { color: var(--color-status-soon) !important; }
.text-status-ok { color: var(--color-status-ok) !important; }
.text-status-good { color: var(--color-status-good) !important; }
.text-status-unknown { color: var(--color-status-unknown) !important; }

/* Background colors with appropriate text */
.bg-status-overdue { background: var(--color-status-overdue) !important; color: #fff !important; }
.bg-status-soon { background: var(--color-status-soon) !important; color: #000 !important; }
.bg-status-ok { background: var(--color-status-ok) !important; color: #fff !important; }
.bg-status-good { background: var(--color-status-good) !important; color: #fff !important; }
.bg-status-unknown { background: var(--color-status-unknown) !important; color: #fff !important; }

/* ============================================
   RESET & BASE STYLES
   ============================================ */

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

html {
  scroll-behavior: smooth;
}

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

a {
  color: var(--color-orange);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-orange-hover);
  text-decoration: underline;
}

/* ============================================
   LAYOUT - MAIN CONTAINER
   ============================================ */

.container {
  display: flex;
  flex-direction: row;
  height: 100vh;
  background: transparent; /* Allow map to show through */
  pointer-events: none; /* Let clicks pass through to map */
}

.container > *:not(.map-container) {
  pointer-events: auto; /* But UI elements are clickable (except map-container which needs pass-through) */
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
  width: 400px;
  background: var(--color-bg-secondary);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.3);
  border-right: 1px solid var(--color-border);
  border-left: none;
  overflow-y: auto;
  order: -1;
}

.sidebar-header {
  padding: 16px 16px;
  background: var(--color-bg-tertiary);
  color: #fff;
  border-bottom: 3px solid var(--color-orange);
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

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

.header-logo {
  width: 50px;
  height: 50px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.header-text {
  flex: 1;
  text-align: left;
}

.sidebar-header h1 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin: 0 0 4px 0;
  color: #fff;
  line-height: 1.2;
}

.company-name {
  font-size: 11px;
  font-weight: 600;
  margin: 0 0 2px 0;
  color: #E0E0E0;
  letter-spacing: 0.3px;
}

.year {
  font-size: 12px;
  margin: 0;
  color: #A0A0A0;
  font-weight: 500;
}

/* User bar - logged in user info */
.user-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--color-bg-tertiary);
  border-bottom: 1px solid var(--color-border);
  gap: 10px;
}

.user-bar .user-name {
  font-size: 13px;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-bar .nightmode-btn,
.user-bar .logout-btn {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.user-bar .nightmode-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(249, 115, 22, 0.1);
}

.user-bar .nightmode-btn.satellite-active {
  border-color: var(--color-success);
  color: var(--color-success);
  background: rgba(34, 197, 94, 0.1);
}

.user-bar .logout-btn:hover {
  border-color: var(--color-overdue);
  color: var(--color-overdue);
  background: rgba(239, 68, 68, 0.1);
}

.sidebar.collapsed .user-bar {
  justify-content: center;
  padding: 10px;
}

.sidebar.collapsed .user-bar .user-name {
  display: none;
}

.sidebar.collapsed .user-bar .logout-btn span {
  display: none;
}

.sidebar-toggle {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
}

.sidebar-toggle i {
  transition: transform 0.3s ease;
}

/* Collapsed Sidebar State */
.sidebar.collapsed {
  width: 70px;
}

.sidebar.collapsed .tab-item span,
.sidebar.collapsed .header-content {
  display: none;
}

.sidebar.collapsed .tab-item {
  padding: 14px 16px;
  justify-content: center;
}

.sidebar.collapsed .tab-item i {
  font-size: 20px;
}

.sidebar.collapsed .sidebar-toggle i {
  transform: rotate(180deg);
}

.sidebar.collapsed .tab-navigation {
  flex-direction: column;
}

.sidebar.collapsed .search-box,
.sidebar.collapsed .omrade-filter,
.sidebar.collapsed .selected-info,
.sidebar.collapsed .actions,
.sidebar.collapsed .warning-actions,
.sidebar.collapsed .tab-header,
.sidebar.collapsed .customer-list,
.sidebar.collapsed .saved-routes-list,
.sidebar.collapsed .calendar-container,
.sidebar.collapsed .planner-container,
.sidebar.collapsed .warnings-container {
  display: none;
}

.sidebar.collapsed .tab-content {
  display: none;
}

/* Adjust map to fill space when sidebar is collapsed */
.container.sidebar-collapsed .map-container {
  flex: 1;
}

/* ============================================
   TAB NAVIGATION - VERTICAL TABS
   ============================================ */

.tab-navigation {
  display: flex;
  flex-direction: column;
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.tab-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
}

.tab-item i {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.tab-item:hover {
  background: var(--color-bg-tertiary);
  color: var(--color-text-secondary);
}

.tab-item.active {
  background: var(--color-accent-muted);
  border-left-color: var(--color-accent);
  color: var(--color-accent);
}

.tab-item.active i {
  color: var(--color-accent);
}

/* ============================================
   TAB CONTENT
   ============================================ */

.tab-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--color-bg-secondary);
}

.tab-pane {
  display: none;
  flex-direction: column;
  height: 100%;
}

.tab-pane.active {
  display: flex;
}

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

.tab-header h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0;
}

/* ============================================
   CUSTOMER ADMIN TAB
   ============================================ */

.customer-admin {
  display: flex;
  flex-direction: column;
  height: calc(100% - 60px);
  overflow: hidden;
}

.customer-search {
  padding: 12px 16px;
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-secondary);
}

.search-input-wrapper {
  flex: 1;
  position: relative;
}

.search-input-wrapper i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
}

.search-input-wrapper input {
  width: 100%;
  padding: 10px 14px 10px 36px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 14px;
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
}

.search-input-wrapper input:focus {
  outline: none;
  border-color: var(--color-accent);
}

/* Kategori tabs */
.kategori-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);
}

.kategori-tab {
  flex: 1;
  padding: 6px 8px;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  background: var(--color-bg-tertiary);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.kategori-tab:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.kategori-tab.active {
  background: var(--color-accent);
  color: white;
}

.kategori-tab[data-kategori="El-Kontroll"].active {
  background: #F59E0B;
}

.kategori-tab[data-kategori="Brannvarsling"].active {
  background: #EF4444;
}

.kategori-tab[data-kategori="El-Kontroll + Brannvarsling"].active {
  background: #8B5CF6;
}

.customer-stats {
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--color-text-secondary);
  background: var(--color-bg-tertiary);
  border-bottom: 1px solid var(--color-border);
}

.toggle-list-btn {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.toggle-list-btn:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.toggle-list-btn.collapsed i {
  transform: rotate(180deg);
}

.customer-admin-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  transition: max-height 0.3s ease, opacity 0.2s ease, padding 0.3s ease;
}

.customer-admin-list.collapsed {
  max-height: 0 !important;
  overflow: hidden;
  padding: 0 8px;
  opacity: 0;
}

.customer-admin-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 2px;
  background: var(--color-bg-tertiary);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.customer-admin-item:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-border-light);
}

.customer-admin-item.no-coords {
  border-left: 2px solid var(--color-warning);
}

.customer-admin-item .customer-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.customer-admin-item .customer-name {
  font-weight: 500;
  font-size: 13px;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.customer-admin-item .customer-location {
  font-size: 11px;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.customer-admin-item .control-badge {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 500;
  white-space: nowrap;
}

.customer-admin-item .control-badge.ok {
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
}

.customer-admin-item .control-badge.warning {
  background: rgba(245, 158, 11, 0.15);
  color: #F59E0B;
}

.customer-admin-item .control-badge.overdue {
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
}

/* ============================================
   SEARCH & FILTERS
   ============================================ */

.search-box {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-secondary);
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  align-items: center;
}

.search-box input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 14px;
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
  transition: all 0.2s ease;
}

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

.search-box input:focus {
  outline: none;
  border-color: var(--color-orange);
  background: var(--color-bg-elevated);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.search-toggle {
  background: var(--color-light-gray);
  border: 1px solid var(--color-border-gray);
  color: var(--color-text-secondary);
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-toggle:hover {
  background: var(--color-bg-gray);
  border-color: var(--color-orange);
  color: var(--color-orange);
}

.search-toggle i {
  transition: transform 0.3s ease;
}

.search-toggle.collapsed i {
  transform: rotate(180deg);
}

.customer-list-container {
  flex: 1;
  overflow-y: auto;
  background: var(--color-bg-secondary);
}

.customer-list-container.hidden {
  display: none;
}

/* ============================================
   AREA FILTER
   ============================================ */

.omrade-filter {
  padding: 12px 20px;
  border-bottom: 1px solid var(--color-border-gray);
  background: var(--color-bg-secondary);
  flex-shrink: 0;
}

.omrade-filter select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--color-border-gray);
  border-radius: 6px;
  font-size: 13px;
  background: var(--color-bg-gray);
  color: var(--color-text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.omrade-filter select:focus {
  outline: none;
  border-color: var(--color-orange);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

/* ============================================
   SELECTED INFO BANNER
   ============================================ */

.selected-info {
  padding: 12px 20px;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.05) 0%, rgba(249, 115, 22, 0.02) 100%);
  border-bottom: 1px solid var(--color-border-gray);
  font-size: 13px;
  color: var(--color-text-secondary);
  font-weight: 500;
  flex-shrink: 0;
}

#selectedCount {
  color: var(--color-orange);
  font-weight: 700;
}

/* ============================================
   ACTION BUTTONS
   ============================================ */

.actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--color-border-gray);
  background: var(--color-bg-secondary);
  flex-shrink: 0;
}

.actions .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.actions .btn i {
  font-size: 14px;
}

.warning-actions {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--color-border-gray);
  background: var(--color-bg-secondary);
  flex-shrink: 0;
}

.warning-actions .btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* Primary Button - Orange */
.btn-primary {
  background: var(--color-accent);
  color: #fff;
  border: 1px solid var(--color-accent);
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

/* Secondary Button - Dark */
.btn-secondary {
  background: var(--color-bg-tertiary);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--color-bg-hover);
  border-color: var(--color-border-light);
  color: var(--color-text-primary);
}

/* Danger Button - Red */
.btn-danger {
  background: var(--color-overdue);
  color: #fff;
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}

.btn-danger:hover:not(:disabled) {
  background: #B91C1C;
  box-shadow: 0 4px 8px rgba(220, 38, 38, 0.3);
}

/* Small Button */
.btn-small {
  padding: 8px 12px;
  font-size: 13px;
}

/* ============================================
   CUSTOMER LIST
   ============================================ */

.customer-list {
  padding: 12px 20px;
  background: var(--color-bg-secondary);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.customer-list-container {
  flex: 1;
  overflow-y: auto;
  background: var(--color-bg-secondary);
}

.customer-section {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.section-header {
  width: 100%;
  padding: 8px 12px;
  background: var(--color-bg-elevated);
  color: var(--color-text-secondary);
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-accent);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.section-header:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.section-toggle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.section-toggle-icon i {
  font-size: 10px;
  transition: transform 0.2s ease;
  color: var(--color-text-muted);
}

.section-title {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.section-postnr {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-accent);
  background: rgba(249, 115, 22, 0.15);
  padding: 2px 6px;
  border-radius: 3px;
  flex-shrink: 0;
}

.section-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-primary);
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.section-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.area-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.area-badge.urgent {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.area-badge.warning {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.section-count {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-bg-tertiary);
  padding: 2px 8px;
  border-radius: 10px;
}

.section-content {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 8px;
  max-height: 9999px;
  opacity: 1;
  transition: all 0.3s ease;
  overflow: hidden;
  padding-left: 8px;
}

.section-content.collapsed {
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
  overflow: hidden;
}

.customer-item {
  padding: 8px 10px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;
  margin-bottom: 4px;
}

.customer-item:last-of-type {
  margin-bottom: 0;
}

.customer-item:hover {
  border-color: var(--color-border-light);
  background: var(--color-bg-hover);
}

.customer-item.selected {
  background: var(--color-accent-muted);
  border: 1px solid var(--color-accent);
}

/* Status indicator bar on left */
.customer-status-indicator {
  width: 4px;
  height: 36px;
  border-radius: 2px;
  flex-shrink: 0;
  background: var(--color-text-muted);
}

/* Status classes matching getControlStatus() return values */
.customer-status-indicator.status-overdue {
  background: var(--color-status-overdue);
}

.customer-status-indicator.status-soon {
  background: var(--color-status-soon);
}

.customer-status-indicator.status-ok {
  background: var(--color-status-ok);
}

.customer-status-indicator.status-good {
  background: var(--color-status-good);
}

.customer-status-indicator.status-unknown {
  background: var(--color-status-unknown);
}

.customer-checkbox {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: var(--color-orange);
  flex-shrink: 0;
}

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

.customer-info h3 {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0 0 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.customer-info p {
  font-size: 10px;
  color: var(--color-text-muted);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Control info on right side */
.customer-control-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
  min-width: 70px;
}

.control-date {
  font-size: 10px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

/* Status-based control-date colors */
.control-date.status-overdue {
  color: var(--color-status-overdue);
  font-weight: 600;
}

.control-date.status-soon {
  color: var(--color-status-soon);
  font-weight: 600;
}

.control-date.status-ok {
  color: var(--color-status-ok);
}

.control-date.status-good {
  color: var(--color-status-good);
}

.control-date.status-unknown {
  color: var(--color-status-unknown);
}

.control-days {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
  background: var(--color-bg-elevated);
  color: var(--color-text-muted);
}

/* Status-based control-days colors */
.control-days.status-overdue {
  background: rgba(239, 68, 68, 0.2);
  color: var(--color-status-overdue);
}

.control-days.status-soon {
  background: rgba(245, 158, 11, 0.2);
  color: var(--color-status-soon);
}

.control-days.status-ok {
  background: rgba(59, 130, 246, 0.15);
  color: var(--color-status-ok);
}

.control-days.status-good {
  background: rgba(34, 197, 94, 0.15);
  color: var(--color-status-good);
}

.control-days.status-unknown {
  background: rgba(139, 92, 246, 0.15);
  color: var(--color-status-unknown);
}

.customer-category {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-right: 4px;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.15) 0%, rgba(249, 115, 22, 0.08) 100%);
  color: var(--color-orange);
  border-left: 2px solid var(--color-orange);
}

.control-status {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.control-status.overdue {
  background: rgba(220, 38, 38, 0.1);
  color: var(--color-overdue);
}

.control-status.warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--color-warning);
}

.control-status.ok {
  background: rgba(59, 130, 246, 0.1);
  color: var(--color-ok);
}

/* Upcoming controls columns */
.customer-upcoming {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 90px;
  flex-shrink: 0;
  align-items: flex-end;
}

.upcoming-control {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
}

.upcoming-label {
  font-weight: 700;
  color: var(--color-text-secondary);
  min-width: 35px;
  text-align: right;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.upcoming-date {
  font-weight: 600;
  color: var(--color-text-primary);
  min-width: 45px;
  text-align: right;
  font-size: 11px;
}

.control-status.good {
  background: rgba(5, 150, 105, 0.1);
  color: var(--color-good);
}

.edit-btn {
  opacity: 0;
  background: var(--color-orange);
  color: #fff;
  border: none;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: opacity 0.2s;
  margin-left: auto;
  flex-shrink: 0;
}

.customer-item:hover .edit-btn {
  opacity: 1;
}

/* ============================================
   WARNINGS CONTAINER
   ============================================ */

.warnings-container {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px;
  background: var(--color-bg-secondary);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.warning-section {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.warning-header {
  padding: 12px 14px;
  background: var(--color-warning);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  border-radius: 6px 6px 0 0;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
}

.warning-item {
  padding: 12px 14px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-top: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.warning-item:last-child {
  border-radius: 0 0 6px 6px;
}

.warning-item:hover {
  background: var(--color-bg-hover);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
  border-color: var(--color-warning);
}

.warning-customer {
  flex: 1;
}

.warning-customer h4 {
  font-size: 13px;
  color: var(--color-text-primary);
  font-weight: 600;
  margin: 0 0 4px 0;
}

.warning-customer p {
  font-size: 11px;
  color: var(--color-text-secondary);
  margin: 0;
}

.warning-date {
  text-align: right;
  margin-left: 12px;
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.warning-date p {
  margin: 0;
  font-size: 10px;
  color: var(--color-text-muted);
}

/* ============================================
   OVERDUE (FORFALTE) TAB
   ============================================ */

.tab-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--color-overdue);
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
  animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.tab-item {
  position: relative;
}

.overdue-count-header {
  font-size: 14px;
  color: var(--color-text-muted);
  font-weight: 400;
  margin-left: 8px;
}

.overdue-filters {
  padding: 12px 20px;
  background: var(--color-bg-tertiary);
  border-bottom: 1px solid var(--color-border);
}

.overdue-filters .filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.overdue-filters label {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.overdue-filters select {
  padding: 6px 12px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text-primary);
  font-size: 12px;
  cursor: pointer;
}

.overdue-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  background: var(--color-bg-secondary);
}

.overdue-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.overdue-empty i {
  font-size: 48px;
  color: var(--color-success);
  margin-bottom: 16px;
}

.overdue-empty p {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0 0 8px 0;
}

.overdue-empty span {
  font-size: 14px;
  color: var(--color-text-muted);
}

.overdue-section {
  margin-bottom: 20px;
}

.overdue-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 8px 8px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.overdue-section-header i {
  color: var(--color-accent);
}

.overdue-severity-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.overdue-severity-dot.critical {
  background: #DC2626;
  box-shadow: 0 0 8px rgba(220, 38, 38, 0.5);
}

.overdue-severity-dot.warning {
  background: #F59E0B;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.overdue-severity-dot.mild {
  background: #FBBF24;
}

.overdue-item {
  padding: 14px 16px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-top: none;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.overdue-item:last-child {
  border-radius: 0 0 8px 8px;
}

.overdue-item:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-overdue);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

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

.overdue-customer-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.overdue-customer-main h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0;
}

.overdue-category {
  font-size: 10px;
  padding: 2px 8px;
  background: rgba(249, 115, 22, 0.15);
  color: var(--color-accent);
  border-radius: 10px;
  font-weight: 500;
}

.overdue-address {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin: 0 0 6px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.overdue-phone {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-success);
  text-decoration: none;
  font-weight: 500;
  padding: 4px 10px;
  background: rgba(16, 185, 129, 0.1);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.overdue-phone:hover {
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
}

.overdue-phone i {
  font-size: 11px;
}

.overdue-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.overdue-days {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-overdue);
  background: rgba(239, 68, 68, 0.1);
  padding: 4px 10px;
  border-radius: 6px;
}

.overdue-days-inline {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}

.overdue-days-inline.critical {
  background: rgba(220, 38, 38, 0.15);
  color: #DC2626;
}

.overdue-days-inline.warning {
  background: rgba(245, 158, 11, 0.15);
  color: #F59E0B;
}

.overdue-days-inline.mild {
  background: rgba(251, 191, 36, 0.15);
  color: #D97706;
}

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

.btn-remind {
  padding: 6px 10px;
  background: rgba(249, 115, 22, 0.1);
  border: 1px solid var(--color-accent);
  border-radius: 6px;
  color: var(--color-accent);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 12px;
}

.btn-remind:hover {
  background: var(--color-accent);
  color: white;
}

.overdue-filters {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.overdue-actions {
  display: flex;
  gap: 8px;
}

.btn-group-route,
.btn-group-map {
  padding: 4px 8px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 11px;
  margin-left: auto;
}

.btn-group-route:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
}

.btn-group-map:hover {
  background: var(--color-success);
  border-color: var(--color-success);
  color: white;
}

.overdue-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.overdue-section-header .btn-group-route,
.overdue-section-header .btn-group-map {
  margin-left: 8px;
}

.overdue-section-header .btn-group-route:first-of-type {
  margin-left: auto;
}

.map-notification {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-accent);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(249, 115, 22, 0.4);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideDown 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
  }
}

/* ============================================
   SAVED ROUTES LIST
   ============================================ */

.saved-routes-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px;
  background: var(--color-bg-secondary);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.saved-route-item {
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-bg-tertiary);
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.saved-route-item:hover {
  border-color: var(--color-orange);
  background: var(--color-bg-hover);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.15);
  transform: translateY(-1px);
}

.saved-route-item h4 {
  font-size: 14px;
  color: var(--color-text-primary);
  font-weight: 600;
  margin: 0 0 6px 0;
}

.saved-route-item p {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin: 0;
}

/* ============================================
   CALENDAR
   ============================================ */

.calendar-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: var(--color-bg-secondary);
}

.calendar-header {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.calendar-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0;
  min-width: 150px;
  text-align: center;
}

.calendar-nav {
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.calendar-nav:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.calendar-add-btn {
  margin-left: auto;
  padding: 6px 12px;
  font-size: 12px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 20px;
}

.calendar-day-header {
  padding: 10px 0;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-secondary);
  text-transform: uppercase;
}

.calendar-day {
  padding: 6px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  min-height: 70px;
  background: var(--color-bg-tertiary);
  font-size: 12px;
  color: var(--color-text-secondary);
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.calendar-day:hover:not(.empty) {
  border-color: var(--color-accent);
  background: var(--color-bg-hover);
}

.calendar-day.empty {
  background: var(--color-light-gray);
  border-color: transparent;
  cursor: default;
}

.calendar-day.past {
  opacity: 0.6;
}

.calendar-day.today {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--color-ok);
}

.calendar-day.today .day-number {
  background: var(--color-ok);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
}

.calendar-day.has-content {
  background: rgba(249, 115, 22, 0.08);
}

.day-number {
  font-weight: 600;
  color: var(--color-text-primary);
  font-size: 12px;
}

.calendar-events {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.calendar-avtale {
  background: var(--color-accent);
  color: #fff;
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.calendar-avtale:hover {
  background: var(--color-accent-hover);
}

.calendar-avtale.completed {
  background: var(--color-good);
  opacity: 0.7;
}

.avtale-time {
  font-weight: 700;
  font-size: 8px;
}

.calendar-route {
  background: var(--color-ok);
  color: #fff;
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.calendar-route:hover {
  opacity: 0.85;
}

.calendar-route i {
  font-size: 8px;
  margin-right: 2px;
}

/* Upcoming avtaler section */
.upcoming-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}

.upcoming-section h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.upcoming-section h4 i {
  color: var(--color-accent);
}

.upcoming-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.upcoming-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.upcoming-item:hover {
  border-color: var(--color-accent);
  background: var(--color-bg-hover);
}

.upcoming-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--color-accent);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  min-width: 45px;
}

.upcoming-day {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.upcoming-month {
  font-size: 10px;
  text-transform: uppercase;
  opacity: 0.9;
}

.upcoming-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.upcoming-info strong {
  font-size: 13px;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upcoming-info span {
  font-size: 11px;
  color: var(--color-text-secondary);
}

/* Legacy upcoming routes */
.upcoming-routes {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border-gray);
}

.upcoming-routes h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0 0 12px 0;
}

.upcoming-route {
  padding: 10px;
  margin-bottom: 8px;
  background: var(--color-light-gray);
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.upcoming-route:hover {
  background: var(--color-bg-gray);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* ============================================
   PLANNER
   ============================================ */

.planner-container {
  overflow-y: auto;
  padding: 12px 20px;
}

.planner-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.planner-year {
  background: var(--color-light-gray);
  border-radius: 8px;
  overflow: hidden;
}

.planner-year-header {
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--color-dark-gray) 0%, var(--color-charcoal) 100%);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  border-radius: 8px 8px 0 0;
}

/* Planner Area Section */
.planner-area {
  padding: 0;
  border-bottom: 1px solid var(--color-border-gray);
}

.planner-area:last-child {
  border-bottom: none;
}

.planner-area-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.1) 0%, rgba(249, 115, 22, 0.05) 100%);
  border-bottom: 1px solid var(--color-border-gray);
}

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

.planner-area-btn {
  background: var(--color-orange);
  color: #fff;
  border: none;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.planner-area-btn:hover {
  background: var(--color-orange-hover);
  box-shadow: 0 2px 6px rgba(249, 115, 22, 0.3);
  transform: translateY(-1px);
}

.planner-area-btn i {
  font-size: 10px;
}

.planner-category {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border-gray);
}

.planner-category:last-child {
  border-bottom: none;
}

.planner-category-title {
  font-weight: 700;
  color: var(--color-orange);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.planner-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.planner-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 12px;
}

.planner-item:hover {
  background: var(--color-bg-gray);
  border-color: var(--color-orange);
  box-shadow: 0 2px 6px rgba(249, 115, 22, 0.15);
  transform: translateX(2px);
}

.planner-item-date {
  font-weight: 700;
  color: var(--color-orange);
  min-width: 70px;
  font-size: 11px;
}

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

.planner-item-name {
  font-weight: 600;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
}

.planner-item-meta {
  font-size: 11px;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.planner-item-interval {
  font-weight: 700;
  background: rgba(249, 115, 22, 0.1);
  color: var(--color-orange);
  padding: 2px 6px;
  border-radius: 3px;
  min-width: 35px;
  text-align: center;
  font-size: 10px;
}

.upcoming-route strong {
  color: var(--color-orange);
}

/* ============================================
   MAP CONTAINER & MARKERS
   ============================================ */

.map-container {
  flex: 1;
  position: relative;
  background: transparent; /* Map is in #sharedMapContainer, not here */
  pointer-events: none !important; /* CRITICAL: Let clicks pass through to shared map below */
}

.map-container > * {
  pointer-events: auto; /* But child elements (filter panel, widgets) are clickable */
}

#map {
  width: 100%;
  height: 100%;
}

/* Ensure Leaflet controls don't block our panels */
.leaflet-top,
.leaflet-bottom {
  z-index: 999 !important;
}

.leaflet-control {
  z-index: 999 !important;
}

/* Custom Marker Styling - Basic dot */
.custom-marker {
  width: 20px !important;
  height: 20px !important;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.custom-marker:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transform: scale(1.2);
}

.custom-marker.selected {
  width: 26px !important;
  height: 26px !important;
  border: 3px solid var(--color-accent);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.3);
}

/* Custom Marker with Label - Shows name and location */
.custom-marker-with-label {
  display: flex !important;
  align-items: center !important;
  gap: 6px;
  cursor: pointer !important;
  background: transparent !important;
  border: none !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif !important;
}

/* Category icon marker */
.custom-marker-with-label .marker-icon {
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
  transition: all 0.25s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 18px;
  color: #fff;
}

/* El-kontroll - yellow/gold */
.custom-marker-with-label .marker-icon.el-kontroll {
  background: linear-gradient(135deg, #F59E0B, #D97706);
}

/* Brannvarsling - bright red */
.custom-marker-with-label .marker-icon.brannvarsling {
  background: linear-gradient(135deg, #DC2626, #B91C1C);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.5), 0 0 0 1px rgba(0, 0, 0, 0.2);
}

/* Combined - split with bolt and flame */
.custom-marker-with-label .marker-icon.combined {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  background: linear-gradient(135deg, #F59E0B 0%, #F59E0B 50%, #DC2626 50%, #DC2626 100%);
  font-size: 15px;
}

/* Status-based border colors using data-status attribute */
/* forfalt = overdue (red) - kontroll forfalt - KRAFTIG PULSERENDE GLOW */
.custom-marker-with-label .marker-icon[data-status="forfalt"] {
  width: 52px;
  height: 52px;
  min-width: 52px;
  min-height: 52px;
  border-width: 4px;
  border-color: #ef4444;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.3) 0%, rgba(185, 28, 28, 0.4) 100%);
  box-shadow:
    0 0 20px rgba(239, 68, 68, 0.8),
    0 0 40px rgba(239, 68, 68, 0.5),
    0 0 60px rgba(239, 68, 68, 0.3),
    inset 0 0 15px rgba(239, 68, 68, 0.3);
  animation: glow-critical 1.2s ease-in-out infinite;
  z-index: 100 !important;
}

@keyframes glow-critical {
  0%, 100% {
    box-shadow:
      0 0 20px rgba(239, 68, 68, 0.8),
      0 0 40px rgba(239, 68, 68, 0.5),
      0 0 60px rgba(239, 68, 68, 0.3),
      inset 0 0 15px rgba(239, 68, 68, 0.3);
    transform: scale(1);
  }
  50% {
    box-shadow:
      0 0 30px rgba(239, 68, 68, 1),
      0 0 60px rgba(239, 68, 68, 0.7),
      0 0 90px rgba(239, 68, 68, 0.4),
      inset 0 0 20px rgba(239, 68, 68, 0.5);
    transform: scale(1.08);
  }
}

/* snart = soon (amber/orange) - kontroll innen 30 dager - PULSERENDE GLOW */
.custom-marker-with-label .marker-icon[data-status="snart"] {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border-width: 3px;
  border-color: #f59e0b;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(217, 119, 6, 0.35) 100%);
  box-shadow:
    0 0 15px rgba(245, 158, 11, 0.7),
    0 0 30px rgba(245, 158, 11, 0.4),
    0 0 45px rgba(245, 158, 11, 0.2),
    inset 0 0 10px rgba(245, 158, 11, 0.2);
  animation: glow-warning 2s ease-in-out infinite;
  z-index: 75 !important;
}

@keyframes glow-warning {
  0%, 100% {
    box-shadow:
      0 0 15px rgba(245, 158, 11, 0.7),
      0 0 30px rgba(245, 158, 11, 0.4),
      0 0 45px rgba(245, 158, 11, 0.2),
      inset 0 0 10px rgba(245, 158, 11, 0.2);
    transform: scale(1);
  }
  50% {
    box-shadow:
      0 0 25px rgba(245, 158, 11, 0.9),
      0 0 50px rgba(245, 158, 11, 0.5),
      0 0 70px rgba(245, 158, 11, 0.3),
      inset 0 0 15px rgba(245, 158, 11, 0.3);
    transform: scale(1.04);
  }
}

/* ok = 31-90 dager til kontroll (lyseblå border) - subtil glow */
.custom-marker-with-label .marker-icon[data-status="ok"] {
  border-color: #3b82f6;
  box-shadow:
    0 0 10px rgba(59, 130, 246, 0.5),
    0 0 20px rgba(59, 130, 246, 0.25),
    inset 0 0 8px rgba(59, 130, 246, 0.15);
}

/* god = over 90 dager til kontroll (green border) - subtil glow */
.custom-marker-with-label .marker-icon[data-status="god"] {
  border-color: #22c55e;
  box-shadow:
    0 0 10px rgba(34, 197, 94, 0.5),
    0 0 20px rgba(34, 197, 94, 0.25),
    inset 0 0 8px rgba(34, 197, 94, 0.15);
}

/* ukjent = ingen dato registrert (grå border) - dempet */
.custom-marker-with-label .marker-icon[data-status="ukjent"] {
  border-color: #6b7280;
  box-shadow: 0 0 8px rgba(107, 114, 128, 0.3);
  opacity: 0.8;
}

/* Warning badge for overdue/soon */
.custom-marker-with-label .marker-warning-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  background: #FF3B30;
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  animation: pulse-warning 2s infinite;
}

/* Legacy marker-dot support */
.custom-marker-with-label .marker-dot {
  width: 12px;
  height: 12px;
  min-width: 12px;
  min-height: 12px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
  transition: all 0.25s ease;
  background: #FF9500;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Warning icon inside marker dot (legacy) */
.custom-marker-with-label .marker-warning {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 14px;
  height: 14px;
  background: #FF3B30;
  color: #fff;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  animation: pulse-warning 2s infinite;
}

@keyframes pulse-warning {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 0 8px rgba(255, 59, 48, 0.6);
  }
}

.custom-marker-with-label:hover .marker-icon {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), 0 0 0 3px rgba(249, 115, 22, 0.4);
}

.custom-marker-with-label:hover .marker-dot {
  width: 14px;
  height: 14px;
  min-width: 14px;
  min-height: 14px;
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.25), 0 2px 8px rgba(0, 0, 0, 0.4);
  border-color: var(--color-accent);
}

.custom-marker-with-label:hover .marker-label {
  background: #1a1a1a;
  border-left-color: #FF9500;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7);
  transform: translateX(2px);
}

.custom-marker-with-label .marker-label {
  display: flex !important;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.9) !important;
  padding: 6px 10px !important;
  border-radius: 4px;
  border-left: 3px solid #FF9500 !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.8) !important;
  white-space: nowrap;
  max-width: 200px;
  transition: all 0.25s ease;
  pointer-events: auto;
}

.custom-marker-with-label .marker-name {
  display: block !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  color: #FFFFFF !important;
  line-height: 1.4 !important;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8) !important;
  letter-spacing: 0.3px;
}

.custom-marker-with-label .marker-address {
  display: block !important;
  font-size: 10px !important;
  font-weight: 500 !important;
  color: #e0e0e0 !important;
  line-height: 1.2 !important;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8) !important;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.custom-marker-with-label .marker-location {
  display: block !important;
  font-size: 9px !important;
  font-weight: 600 !important;
  color: #FFD699 !important;
  line-height: 1.2 !important;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8) !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* Selected marker with label */
.custom-marker-with-label.selected .marker-dot {
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  border: 3px solid #fff;
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.5), 0 2px 10px rgba(0, 0, 0, 0.5);
}

.custom-marker-with-label.selected .marker-label {
  background: rgba(0, 0, 0, 0.95) !important;
  border-left-color: #FF9500 !important;
  border-left-width: 4px;
  box-shadow: 0 2px 12px rgba(249, 115, 22, 0.5), 0 0 0 2px rgba(249, 115, 22, 0.3) !important;
}

.custom-marker-with-label.selected .marker-name {
  color: #FFFFFF !important;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8) !important;
  font-weight: 800 !important;
}

.custom-marker-with-label.selected .marker-address {
  color: #e0e0e0 !important;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8) !important;
}

.custom-marker-with-label.selected .marker-location {
  color: #FFD699 !important;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8) !important;
}

/* Hide labels at high zoom levels (when zoomed in close) */
#map.hide-marker-labels .marker-label {
  display: none !important;
}

#map.hide-marker-labels .custom-marker-with-label .marker-dot {
  width: 12px;
  height: 12px;
}

#map.hide-marker-labels .custom-marker-with-label:hover .marker-dot {
  width: 16px;
  height: 16px;
}

#map.hide-marker-labels .custom-marker-with-label.selected .marker-dot {
  width: 16px;
  height: 16px;
}

/* Status colors for marker dot - high contrast for satellite imagery */
.custom-marker-with-label.status-overdue .marker-dot {
  background: var(--color-status-overdue) !important;  /* Magenta/pink - forfalt */
  animation: pulse-overdue-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-overdue-dot {
  0%, 100% {
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.5);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.5), 0 0 12px rgba(220, 38, 38, 0.8);
    transform: scale(1.15);
  }
}

.custom-marker-with-label.status-soon .marker-dot {
  background: var(--color-status-soon) !important;  /* Amber/gold */
}

.custom-marker-with-label.status-ok .marker-dot {
  background: var(--color-status-ok) !important;  /* Lyseblå */
}

.custom-marker-with-label.status-good .marker-dot {
  background: var(--color-status-good) !important;  /* Grønn */
}

.custom-marker-with-label.status-unknown .marker-dot {
  background: var(--color-status-unknown) !important;  /* Blågrå */
}

/* CRITICAL: Ensure marker-label ALWAYS has dark background regardless of parent status class */
.custom-marker-with-label.status-overdue .marker-label,
.custom-marker-with-label.status-soon .marker-label,
.custom-marker-with-label.status-ok .marker-label,
.custom-marker-with-label.status-good .marker-label,
.custom-marker-with-label.status-unknown .marker-label {
  background: rgba(0, 0, 0, 0.95) !important;
}

/* Status-based colors ONLY for popup-status elements */
.popup-status.status-overdue {
  background: var(--color-status-overdue) !important;
}

.popup-status.status-soon {
  background: var(--color-status-soon) !important;
}

.popup-status.status-ok {
  background: var(--color-status-ok) !important;
}

.popup-status.status-good {
  background: var(--color-status-good) !important;
}

.popup-status.status-unknown {
  background: var(--color-status-unknown) !important;
}

/* Prevent customer-item from getting status background */
.customer-item.status-overdue,
.customer-item.status-soon,
.customer-item.status-ok,
.customer-item.status-good,
.customer-item.status-unknown {
  background: var(--color-bg-tertiary);
}

.customer-item.status-overdue:hover,
.customer-item.status-soon:hover,
.customer-item.status-ok:hover,
.customer-item.status-good:hover,
.customer-item.status-unknown:hover {
  background: var(--color-bg-hover);
}

/* Marker animations removed - was causing visibility issues */

/* Leaflet Popup Styling - Dark Theme */
.leaflet-popup-content-wrapper {
  background: var(--color-bg-secondary) !important;
  color: var(--color-text-primary) !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
  border: 1px solid var(--color-border) !important;
}

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

.leaflet-popup-content h3 {
  margin: 0 0 8px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 8px;
}

.leaflet-popup-content p {
  margin: 4px 0;
  color: var(--color-text-secondary);
  font-size: 12px;
}

.leaflet-popup-content .popup-status {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
}

.leaflet-popup-content .popup-status.status-overdue {
  background: var(--color-status-overdue);
  color: #fff !important;
}

.leaflet-popup-content .popup-status.status-soon {
  background: var(--color-status-soon);
  color: #000 !important;
}

.leaflet-popup-content .popup-status.status-ok {
  background: var(--color-status-ok);
  color: #fff !important;
}

.leaflet-popup-content .popup-status.status-good {
  background: var(--color-status-good);
  color: #fff !important;
}

.leaflet-popup-content .popup-status.status-unknown {
  background: var(--color-status-unknown);
  color: #fff !important;
}

.leaflet-popup-content .popup-control-info {
  margin-top: 8px;
}

.leaflet-popup-content .popup-status .control-days {
  font-weight: 700;
  margin-left: 4px;
}

.leaflet-popup-content .popup-status .control-date {
  font-weight: 400;
  margin-left: 6px;
  opacity: 0.9;
}

.leaflet-popup-content .popup-controls {
  margin-top: 8px;
  padding: 10px;
  background: var(--color-bg-tertiary);
  border-radius: 6px;
}

.leaflet-popup-content .popup-controls p {
  margin: 4px 0;
  font-size: 12px;
}

.leaflet-popup-content .popup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
}

.leaflet-popup-content .popup-actions .btn {
  flex: 1 1 auto;
  min-width: 80px;
  padding: 6px 8px;
  font-size: 11px;
  white-space: nowrap;
}

.leaflet-popup-tip-container {
  display: none;
}

.leaflet-popup-close-button {
  color: var(--color-text-muted) !important;
  font-size: 20px !important;
  padding: 4px 8px !important;
}

.leaflet-popup-close-button:hover {
  color: var(--color-accent) !important;
}

/* Cluster Styling - Modern Professional */
@keyframes cluster-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(249, 115, 22, 0);
  }
}

.custom-cluster {
  border-radius: 50%;
  border: none !important;
  color: #fff !important;
  font-weight: bold !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: visible !important;
  font-size: 11px !important;
  cursor: pointer !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.custom-cluster:hover {
  transform: scale(1.08);
}

.cluster-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  gap: 2px;
  position: relative;
  border-radius: 50%;
  box-shadow:
    0 4px 15px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: cluster-pulse 3s ease-in-out infinite;
}

/* Unified dark professional style */
.cluster-icon.cluster-small,
.cluster-icon.cluster-medium,
.cluster-icon.cluster-large,
.cluster-icon.cluster-xlarge {
  background: linear-gradient(145deg, #2a2a2a 0%, #1a1a1a 100%);
  border: 2px solid rgba(249, 115, 22, 0.5);
}

.cluster-count {
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.cluster-area {
  font-size: 9px;
  text-align: center;
  padding: 0 4px;
  word-break: break-word;
  max-width: 58px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.95;
  line-height: 1.1;
  font-weight: 500;
}

/* Cluster warning badge */
.cluster-warning {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  background: linear-gradient(145deg, #FF3B30, #D32F2F);
  color: #fff;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Cluster size text variations */
.cluster-icon.cluster-medium .cluster-count {
  font-size: 18px;
}

.cluster-icon.cluster-large .cluster-count {
  font-size: 16px;
}

.cluster-icon.cluster-xlarge .cluster-count {
  font-size: 15px;
}

.cluster-icon.cluster-large .cluster-area,
.cluster-icon.cluster-xlarge .cluster-area {
  font-size: 8px;
}

/* Cluster Popup */
.cluster-popup {
  min-width: 200px;
}

.cluster-popup h3 {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: var(--color-text-primary);
}

.cluster-popup p {
  margin: 0 0 12px 0;
  font-size: 12px;
  color: var(--color-text-secondary);
}

.cluster-popup-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.cluster-popup-actions .btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  padding: 8px 12px;
}

.cluster-customer-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
  max-height: 120px;
  overflow-y: auto;
}

.cluster-customer-name {
  font-size: 11px;
  color: var(--color-text-secondary);
  padding: 2px 0;
}

.cluster-more {
  font-size: 10px;
  color: var(--color-text-muted);
  font-style: italic;
  padding-top: 4px;
}

/* Spiderfy lines for overlapping markers */
.leaflet-cluster-spider-leg {
  stroke: var(--color-accent);
  stroke-width: 2;
  stroke-opacity: 0.6;
}

.leaflet-cluster-spider-leg:hover {
  stroke-opacity: 1;
}

/* Country labels for map */
.country-label {
  background: transparent;
  border: none;
}

.country-label span {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 4px;
  text-transform: uppercase;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

/* Scale control styling */
.leaflet-control-scale-line {
  background: rgba(0, 0, 0, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  border-top: none !important;
  color: #fff !important;
  font-size: 11px !important;
  padding: 2px 5px !important;
}

/* Notification Toast */
.notification-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  border: 1px solid var(--color-accent);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10000;
  animation: slideUp 0.3s ease;
}

.notification-toast i {
  color: #10B981;
  font-size: 16px;
}

.notification-toast.fade-out {
  opacity: 0;
  transform: translateX(-50%) translateY(10px);
  transition: all 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Missing Data Tab Styles */
.missing-data-container {
  padding: 12px;
}

.missing-data-intro {
  color: var(--color-text-secondary);
  font-size: 13px;
  margin-bottom: 16px;
}

.missing-section {
  background: var(--color-bg-card);
  border-radius: 8px;
  margin-bottom: 10px;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.missing-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.missing-header:hover {
  background: var(--color-bg-elevated);
}

.missing-header i:first-child {
  color: var(--color-orange);
  font-size: 14px;
  width: 18px;
}

.missing-header span:first-of-type {
  flex: 1;
  font-weight: 500;
  font-size: 13px;
}

.missing-count {
  background: var(--color-orange);
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.missing-header .toggle-icon {
  color: var(--color-text-muted);
  font-size: 12px;
  transition: transform 0.2s;
}

.missing-header .toggle-icon.rotated {
  transform: rotate(180deg);
}

.missing-list {
  border-top: 1px solid var(--color-border);
  max-height: 300px;
  overflow-y: auto;
}

.missing-list.collapsed {
  display: none;
}

.missing-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--color-border);
  transition: background 0.2s;
}

.missing-item:last-child {
  border-bottom: none;
}

.missing-item:hover {
  background: var(--color-bg-elevated);
}

.missing-item-name {
  font-weight: 500;
  font-size: 13px;
  color: var(--color-text-primary);
}

.missing-item-address {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.missing-empty {
  padding: 16px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 12px;
}

.missing-badge {
  background: var(--color-orange) !important;
}

/* Route Marker (numbered stops) */
.route-marker {
  background: var(--color-orange) !important;
  border-radius: 50% !important;
  border: 2px solid #fff !important;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.4) !important;
  color: #fff !important;
  font-weight: 700 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 14px !important;
}

/* Start/Home marker for routes */
.route-marker.route-start {
  background: #10B981 !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4) !important;
  font-size: 12px !important;
}

.route-marker.route-start i {
  color: #fff;
}

/* ============================================
   UPCOMING CONTROLS WIDGET
   ============================================ */

.upcoming-widget {
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--color-bg-secondary);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
  max-width: 380px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 999;
}

.upcoming-widget.hidden {
  display: none;
}

.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 3px solid var(--color-orange);
  background: var(--color-bg-tertiary);
  flex-shrink: 0;
}

.widget-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0;
}

.widget-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.widget-close:hover {
  color: var(--color-orange);
}

.widget-content {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.widget-item {
  padding: 10px 12px;
  background: var(--color-light-gray);
  border-left: 3px solid var(--color-orange);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;
}

.widget-item:hover {
  background: var(--color-bg-gray);
  box-shadow: 0 2px 6px rgba(249, 115, 22, 0.2);
  transform: translateX(4px);
}

.widget-item-name {
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.widget-item-info {
  font-size: 11px;
  color: var(--color-text-secondary);
  display: flex;
  justify-content: space-between;
}

.widget-item-days {
  background: rgba(249, 115, 22, 0.15);
  color: var(--color-orange);
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 700;
  font-size: 10px;
}

.widget-empty {
  padding: 20px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 12px;
}

/* ============================================
   FILTER PANEL (Right Side) - Dark Theme
   ============================================ */

.filter-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 320px;
  background: var(--color-bg-secondary);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.4);
  border-left: 1px solid var(--color-border);
  z-index: 10000 !important;
  display: flex;
  flex-direction: row;
  pointer-events: auto !important;
  transition: transform 0.3s ease, width 0.3s ease;
}

.filter-panel.collapsed {
  transform: translateX(280px);
}

.filter-panel.collapsed .filter-panel-toggle {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
  box-shadow: -4px 0 15px rgba(249, 115, 22, 0.3);
}

.filter-panel *,
.filter-panel button,
.filter-panel .btn-icon,
.filter-panel .customer-item,
.filter-panel .section-header {
  pointer-events: auto !important;
}

/* Toggle Button */
.filter-panel-toggle {
  position: absolute;
  left: -44px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 100px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-right: none;
  border-radius: 12px 0 0 12px;
  color: var(--color-text-secondary);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 16px;
  transition: all 0.3s ease;
  z-index: 10001;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
}

.filter-panel-toggle:hover {
  background: var(--color-bg-hover);
  color: var(--color-accent);
}

.filter-panel-toggle i {
  transition: transform 0.3s ease;
}

.filter-panel.collapsed .filter-panel-toggle i {
  transform: rotate(180deg);
}

.filter-panel-toggle::after {
  content: 'KUNDER';
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.filter-panel.collapsed .filter-panel-toggle::after {
  opacity: 1;
}

/* Inner Container */
.filter-panel-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.filter-panel-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-panel-header h3 i {
  color: var(--color-accent);
  font-size: 12px;
}

.customer-count {
  background: var(--color-accent);
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
}

/* Content */
.filter-panel-content {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  overflow-y: auto;
}

/* Search Field */
.search-container {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 10px;
  color: var(--color-text-muted);
  font-size: 12px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 8px 10px 8px 32px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--color-text-primary);
  background: var(--color-bg-tertiary);
  transition: all 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px var(--color-accent-muted);
}

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

/* Quick Actions */
.quick-actions {
  display: flex;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.btn-icon {
  flex: 1;
  padding: 10px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text-secondary);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover:not(:disabled) {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

.btn-icon:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-icon#addCustomerBtn {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

.btn-icon#addCustomerBtn:hover {
  background: var(--color-accent-hover);
}

/* Selection Info */
.selected-info {
  font-size: 11px;
  color: var(--color-text-muted);
  text-align: center;
  padding: 4px 0;
}

.selected-info span {
  color: var(--color-accent);
  font-weight: 700;
}

/* Category Filter */
.category-filter {
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.category-filter-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.category-filter-title.clickable-header {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  margin-bottom: 0;
  transition: color 0.2s;
}

.category-filter-title.clickable-header:hover {
  color: var(--color-accent);
}

.category-filter-title .toggle-icon {
  font-size: 10px;
  transition: transform 0.2s;
}

#driftFilterButtons {
  margin-top: 8px;
}

.category-filter-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.category-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.category-btn:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-accent);
  color: var(--color-text-primary);
}

.category-btn.active {
  background: rgba(249, 115, 22, 0.15);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.category-btn i {
  width: 16px;
  text-align: center;
}

.category-btn[data-category="El-Kontroll"] i {
  color: #FBBF24;
}

.category-btn[data-category="Brannvarsling"] i {
  color: #EF4444;
}

.category-btn.active[data-category="El-Kontroll"] {
  background: rgba(251, 191, 36, 0.15);
  border-color: #FBBF24;
  color: #FBBF24;
}

.category-btn.active[data-category="Brannvarsling"] {
  background: rgba(239, 68, 68, 0.15);
  border-color: #EF4444;
  color: #EF4444;
}

/* Color Legend */
.color-legend {
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.legend-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.legend-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}

.legend-dot.overdue {
  background: #FF3B30;
}

.legend-dot.soon {
  background: #FF9500;
}

.legend-dot.ok {
  background: #007AFF;
}

.legend-dot.good {
  background: #00D4FF;
}

.legend-dot.unknown {
  background: #AF52DE;
}

.legend-text {
  font-size: 10px;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

/* Customer List Wrapper */
.customer-list-wrapper {
  flex: 1;
  overflow-y: auto;
  margin: 0 -12px;
  padding: 0 12px;
}

/* Customer List Section (kept for compatibility) */
.filter-customer-list-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--color-border-gray);
  padding-top: 12px;
}

.filter-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
  padding: 0 0 4px 0;
}

.filter-panel-content .customer-list-container {
  max-height: 400px;
  overflow-y: auto;
  flex: 1;
}

.filter-panel-content .customer-list {
  padding: 0;
  gap: 6px;
}

.filter-panel-content .customer-item {
  padding: 8px 10px;
  font-size: 12px;
  gap: 8px;
}

.filter-panel-content .customer-info h3 {
  font-size: 12px;
  margin: 0 0 1px 0;
}

.filter-panel-content .customer-info p {
  font-size: 10px;
  margin: 0 0 2px 0;
}

.filter-panel-content .customer-upcoming {
  min-width: 75px;
  gap: 2px;
}

.filter-panel-content .upcoming-control {
  font-size: 10px;
  gap: 3px;
}

.filter-panel-content .upcoming-label {
  min-width: 30px;
  font-size: 8px;
}

.filter-panel-content .upcoming-date {
  min-width: 40px;
  font-size: 10px;
}

/* ============================================
   ROUTE INFO PANEL
   ============================================ */

.route-info {
  position: absolute;
  top: 20px;
  left: 20px;
  background: var(--color-bg-secondary);
  padding: 20px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  max-width: 360px;
  border: 1px solid var(--color-border);
  z-index: 999;
}

.route-info h3 {
  margin: 0 0 16px 0;
  color: var(--color-text-primary);
  font-size: 16px;
  font-weight: 600;
  border-bottom: 2px solid var(--color-orange);
  padding-bottom: 12px;
}

.route-info.hidden {
  display: none;
}

#routeDetails {
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* ============================================
   MODALS
   ============================================ */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--color-bg-secondary);
  border-radius: 12px;
  padding: 0;
  max-width: 520px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--color-border);
}

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

.modal-header h2 {
  margin: 0;
  color: var(--color-text-primary);
  font-size: 16px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--color-accent);
}

/* Modal Form */
.modal-content form,
.modal-content > div:not(.modal-header) {
  padding: 24px;
}

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

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 14px;
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
  font-family: inherit;
  transition: all 0.2s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--color-text-muted);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-accent);
  background: var(--color-bg-elevated);
  box-shadow: 0 0 0 2px var(--color-accent-muted);
}

/* Missing field highlight - orange/warning style */
.form-group input.missing-field,
.form-group select.missing-field {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.form-group input.missing-field::placeholder {
  color: #f59e0b;
}

.form-group input.missing-field:focus,
.form-group select.missing-field:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.3);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-row.three-cols {
  grid-template-columns: 1fr 1fr 100px;
}

/* Kunde search wrapper for avtale modal */
.kunde-search-wrapper {
  position: relative;
}

.kunde-search-wrapper input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 14px;
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
  font-family: inherit;
  transition: all 0.2s ease;
}

.kunde-search-wrapper input:focus {
  outline: none;
  border-color: var(--color-accent);
  background: var(--color-bg-elevated);
  box-shadow: 0 0 0 2px var(--color-accent-muted);
}

.kunde-search-results {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  margin-top: 4px;
  max-height: 250px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.kunde-search-results.active {
  display: block;
}

.kunde-search-item {
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-border);
  transition: background 0.15s ease;
}

.kunde-search-item:last-child {
  border-bottom: none;
}

.kunde-search-item:hover,
.kunde-search-item.active {
  background: var(--color-bg-tertiary);
}

.kunde-search-item.no-results {
  color: var(--color-text-muted);
  cursor: default;
  font-style: italic;
}

.kunde-search-item.no-results:hover {
  background: transparent;
}

.kunde-search-item .kunde-name {
  font-weight: 500;
  color: var(--color-text-primary);
}

.kunde-search-item .kunde-location {
  font-size: 12px;
  color: var(--color-text-secondary);
}

/* Control section styling */
.control-section {
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}

.control-section.hidden {
  display: none;
}

.control-section-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-section-header i.fa-bolt {
  color: #F59E0B;
}

.control-section-header i.fa-fire {
  color: #EF4444;
}

.control-section-header i.fa-phone {
  color: #10B981;
}

/* Kontaktlogg section */
.kontaktlogg-section {
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 12px;
  margin-top: 16px;
  border-left: 3px solid #10B981;
}

.kontaktlogg-add {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.kontaktlogg-add select {
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
  font-size: 13px;
  min-width: 130px;
}

.kontaktlogg-add input {
  flex: 1;
  min-width: 150px;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
  font-size: 13px;
}

.kontaktlogg-add input:focus,
.kontaktlogg-add select:focus {
  outline: none;
  border-color: var(--color-accent);
}

.kontaktlogg-list {
  margin-top: 12px;
  max-height: 200px;
  overflow-y: auto;
}

.kontaktlogg-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px;
  background: var(--color-bg-elevated);
  border-radius: 6px;
  margin-bottom: 6px;
  border: 1px solid var(--color-border);
}

.kontaktlogg-item:last-child {
  margin-bottom: 0;
}

.kontaktlogg-info {
  flex: 1;
}

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

.kontaktlogg-type {
  font-weight: 600;
  font-size: 13px;
  color: var(--color-text-primary);
}

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

.kontaktlogg-notat {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.4;
}

.kontaktlogg-delete {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 12px;
  opacity: 0.6;
  transition: all 0.2s ease;
}

.kontaktlogg-delete:hover {
  color: #EF4444;
  opacity: 1;
}

.kontaktlogg-empty {
  text-align: center;
  padding: 16px;
  color: var(--color-text-muted);
  font-size: 13px;
  font-style: italic;
}

#elKontrollSection {
  border-left: 3px solid #F59E0B;
}

#brannvarslingSection {
  border-left: 3px solid #EF4444;
}

.control-section .form-row {
  grid-template-columns: 1fr 1fr 80px;
}

.control-section .form-group label {
  font-size: 11px;
}

.control-section .form-group input,
.control-section .form-group select {
  padding: 6px 8px;
  font-size: 12px;
}

.form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.form-actions .btn {
  flex: 0 1 auto;
}

.coordinates {
  background: var(--color-bg-tertiary);
  padding: 12px;
  border-radius: 6px;
  border: 1px solid var(--color-border-gray);
}

.coord-display {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-top: 8px;
}

/* Modal lists */
.modal-content ol,
.modal-content ul {
  padding-left: 20px;
  margin-bottom: 16px;
  color: var(--color-text-secondary);
  font-size: 13px;
  line-height: 1.6;
}

.modal-content li {
  margin-bottom: 8px;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.hidden {
  display: none !important;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

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

::-webkit-scrollbar-thumb:hover {
  background: var(--color-border-light);
}

/* ============================================
   SMS CONTAINER & CARDS
   ============================================ */

.sms-container {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  min-width: 0;
}

/* Statistics Dashboard */
.sms-stats-dashboard {
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 8px;
  flex-shrink: 0;
}

.stats-row {
  display: flex;
  gap: 6px;
}

.stat-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: 6px;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  min-width: 0;
}

.stat-card .stat-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.stat-card.stat-pending .stat-icon {
  background: rgba(245, 158, 11, 0.15);
  color: #F59E0B;
}

.stat-card.stat-sent .stat-icon {
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
}

.stat-card.stat-failed .stat-icon {
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
}

.stat-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 9px;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Card Headers */
.sms-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--color-bg-elevated);
  border-bottom: 1px solid var(--color-border);
  min-width: 0;
}

.sms-card-header .header-left {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 12px;
  color: var(--color-text-primary);
  min-width: 0;
  overflow: hidden;
}

.sms-card-header .header-left span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sms-card-header .header-left i {
  color: var(--color-accent);
  flex-shrink: 0;
}

.sms-card-header .badge {
  background: var(--color-accent);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.sms-card-header.clickable {
  cursor: pointer;
  transition: background 0.2s ease;
}

.sms-card-header.clickable:hover {
  background: var(--color-bg-tertiary);
}

.sms-card-header .toggle-icon {
  color: var(--color-text-muted);
  font-size: 12px;
  transition: transform 0.2s ease;
}

.sms-config-card.collapsed .toggle-icon {
  transform: rotate(-90deg);
}

.sms-config-card.collapsed .sms-config-content {
  display: none;
}

/* Upcoming Notifications Card */
.sms-upcoming-card {
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.sms-upcoming-content {
  max-height: 150px;
  overflow-y: auto;
}

.upcoming-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid var(--color-border);
  font-size: 11px;
  gap: 8px;
}

.upcoming-item:last-child {
  border-bottom: none;
}

.upcoming-item .upcoming-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  overflow: hidden;
}

.upcoming-item .upcoming-name {
  font-weight: 600;
  color: var(--color-text-primary);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upcoming-item .upcoming-phone {
  font-size: 10px;
  color: var(--color-text-muted);
}

.upcoming-item .upcoming-days {
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.upcoming-item .upcoming-days.urgent {
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
}

.upcoming-item .upcoming-days.soon {
  background: rgba(245, 158, 11, 0.15);
  color: #F59E0B;
}

.upcoming-item .upcoming-days.normal {
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
}

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

.upcoming-email-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 4px;
  background: var(--color-accent);
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.upcoming-email-btn:hover {
  background: var(--color-accent-hover);
  transform: scale(1.05);
}

.upcoming-email-btn.disabled {
  background: var(--color-bg-tertiary);
  color: var(--color-text-muted);
  cursor: not-allowed;
}

.upcoming-email-btn.disabled:hover {
  transform: none;
}

/* Customer list email button */
.customer-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-right: 8px;
}

.customer-email-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 4px;
  background: var(--color-accent);
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0;
}

.customer-item:hover .customer-email-btn {
  opacity: 1;
}

.customer-email-btn:hover {
  background: var(--color-accent-hover);
  transform: scale(1.05);
}

.customer-email-btn.disabled {
  background: var(--color-bg-tertiary);
  color: var(--color-text-muted);
  cursor: not-allowed;
}

.customer-email-btn.disabled:hover {
  transform: none;
}

/* Popup email button */
.btn-email {
  background: var(--color-accent) !important;
  color: white !important;
}

.btn-email:hover {
  background: var(--color-accent-hover) !important;
}

.btn-disabled {
  background: var(--color-bg-tertiary) !important;
  color: var(--color-text-muted) !important;
  cursor: not-allowed !important;
}

.upcoming-empty {
  padding: 20px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 12px;
}

/* Quick Actions Row */
.sms-actions-row {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.btn-action {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 8px;
  font-size: 11px;
  font-weight: 600;
  min-width: 0;
}

.btn-action span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-action i {
  font-size: 12px;
  flex-shrink: 0;
}

/* Config Card */
.sms-config-card {
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.sms-config-content {
  padding: 10px;
}

.config-grid {
  display: grid;
  gap: 4px;
}

.config-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 11px;
  gap: 8px;
}

.config-item .config-label {
  color: var(--color-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.config-item .config-value {
  font-weight: 600;
  color: var(--color-text-primary);
  flex-shrink: 0;
  text-align: right;
}

.config-item .config-value.enabled {
  color: #10B981;
}

.config-item .config-value.disabled {
  color: #EF4444;
}

/* Test SMS Panel */
.sms-test-panel {
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-accent);
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.sms-test-panel .sms-card-header {
  background: rgba(249, 115, 22, 0.1);
  border-bottom-color: var(--color-accent);
}

.btn-close {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 12px;
  transition: color 0.2s ease;
  flex-shrink: 0;
}

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

.sms-test-content {
  padding: 10px;
}

.sms-test-content .form-group {
  margin-bottom: 10px;
}

.sms-test-content .form-group label {
  font-size: 11px;
}

.sms-test-content .form-group input,
.sms-test-content .form-group textarea {
  font-size: 12px;
  padding: 8px 10px;
}

.sms-test-content .form-group:last-of-type {
  margin-bottom: 12px;
}

.sms-test-content .btn {
  width: 100%;
  font-size: 11px;
  padding: 10px;
}

/* History Card */
.sms-history-card {
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.history-filters {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.filter-select {
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 10px;
  color: var(--color-text-primary);
  cursor: pointer;
}

.sms-action-hint {
  font-size: 10px;
  color: var(--color-text-muted);
  margin-top: 6px;
}

.sms-history-content {
  flex: 1;
  overflow-y: auto;
  min-height: 100px;
}

.sms-history-item {
  padding: 8px 10px;
  border-bottom: 1px solid var(--color-border);
  font-size: 11px;
}

.sms-history-item:last-child {
  border-bottom: none;
}

.sms-history-item .history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
  gap: 6px;
}

.sms-history-item .history-customer {
  font-weight: 600;
  color: var(--color-text-primary);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sms-history-item .history-status {
  font-size: 9px;
  padding: 2px 5px;
  border-radius: 3px;
  font-weight: 600;
  text-transform: uppercase;
  flex-shrink: 0;
}

.sms-history-item .history-status.sent {
  background: rgba(16, 185, 129, 0.2);
  color: #10B981;
}

.sms-history-item .history-status.failed {
  background: rgba(239, 68, 68, 0.2);
  color: #EF4444;
}

.sms-history-item .history-status.pending {
  background: rgba(245, 158, 11, 0.2);
  color: #F59E0B;
}

.sms-history-item .history-message {
  color: var(--color-text-secondary);
  font-size: 10px;
  margin-top: 3px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sms-history-item .history-date {
  color: var(--color-text-muted);
  font-size: 9px;
  margin-top: 3px;
}

.sms-history-empty {
  padding: 16px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 11px;
}

/* SMS Settings in Customer Modal */
.sms-settings {
  background: var(--color-bg-tertiary);
  padding: 12px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
}

.sms-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.sms-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-accent);
}

.sms-toggle label {
  font-size: 13px;
  color: var(--color-text-secondary);
  cursor: pointer;
}

.sms-options {
  padding-top: 8px;
  border-top: 1px solid var(--color-border);
}

.sms-options.hidden {
  display: none;
}

/* ============================================
   RESPONSIVE - MOBILE FIRST
   ============================================ */

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  background: var(--color-accent);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  z-index: 2000;
  box-shadow: 0 4px 20px rgba(249, 115, 22, 0.4);
  transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
  background: var(--color-accent-hover);
  transform: scale(1.05);
}

.mobile-menu-toggle.active {
  background: var(--color-bg-tertiary);
  color: var(--color-accent);
}

/* Tablet breakpoint */
@media (max-width: 1024px) {
  .filter-panel {
    width: 280px;
  }

  .filter-panel.collapsed {
    transform: translateX(240px);
  }

  .upcoming-widget {
    max-width: 320px;
  }

  .route-info {
    max-width: 300px;
  }
}

/* Mobile breakpoint */
@media (max-width: 768px) {
  /* Show mobile menu toggle */
  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Main container - stack vertically */
  .container {
    flex-direction: column;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile browsers */
  }

  /* Sidebar becomes bottom sheet on mobile - override collapsed state */
  .sidebar,
  .sidebar.collapsed {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    width: 100% !important;
    height: auto !important;
    max-height: 85vh !important;
    border-radius: 20px 20px 0 0 !important;
    border-right: none !important;
    border-top: 1px solid var(--color-border) !important;
    transform: translateY(calc(100% - 80px)) !important;
    transition: transform 0.3s ease !important;
    z-index: 1500 !important;
    order: 1 !important;
    flex-direction: column !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3) !important;
  }

  .sidebar.mobile-open,
  .sidebar.collapsed.mobile-open {
    transform: translateY(0) !important;
  }

  /* Show header content on mobile even when collapsed */
  .sidebar.collapsed .header-content {
    display: flex !important;
  }

  .sidebar.collapsed .tab-item span {
    display: inline !important;
  }

  .sidebar.collapsed .tab-content {
    display: flex !important;
  }

  .sidebar.collapsed .tab-header,
  .sidebar.collapsed .search-box,
  .sidebar.collapsed .omrade-filter,
  .sidebar.collapsed .selected-info,
  .sidebar.collapsed .actions,
  .sidebar.collapsed .warning-actions,
  .sidebar.collapsed .customer-list,
  .sidebar.collapsed .saved-routes-list,
  .sidebar.collapsed .calendar-container,
  .sidebar.collapsed .planner-container,
  .sidebar.collapsed .warnings-container {
    display: block !important;
  }

  /* Sidebar header - acts as drag handle on mobile */
  .sidebar-header,
  .sidebar.collapsed .sidebar-header {
    padding: 16px 16px 12px !important;
    cursor: grab !important;
    position: relative !important;
    display: flex !important;
    background: var(--color-bg-tertiary) !important;
  }

  .sidebar-header::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: var(--color-border-light);
    border-radius: 2px;
  }

  .sidebar-toggle {
    display: none !important;
  }

  /* Map takes full height on mobile */
  .map-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100vh;
    height: 100dvh;
    pointer-events: none !important; /* Let clicks pass through to shared map below */
  }

  /* Tab navigation - horizontal scrollable pills on mobile */
  .tab-navigation,
  .sidebar.collapsed .tab-navigation {
    flex-direction: row !important;
    overflow-x: auto !important;
    padding: 10px 12px !important;
    gap: 8px !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: var(--color-bg-tertiary) !important;
    border-bottom: 1px solid var(--color-border) !important;
    flex-shrink: 0 !important;
  }

  .tab-navigation::-webkit-scrollbar {
    display: none;
  }

  .tab-item,
  .sidebar.collapsed .tab-item {
    flex: 0 0 auto !important;
    min-width: auto !important;
    width: auto !important;
    padding: 8px 14px !important;
    border-left: none !important;
    border-bottom: none !important;
    border-radius: 20px !important;
    justify-content: center !important;
    white-space: nowrap;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text-secondary);
    transition: all 0.2s ease;
  }

  .tab-item:hover {
    background: var(--color-bg-hover);
  }

  .tab-item.active {
    border-color: var(--color-accent);
    background: var(--color-accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
  }

  .tab-item.active i {
    color: #fff;
  }

  .tab-item i {
    font-size: 16px;
    width: auto;
  }

  .tab-item span {
    font-size: 13px;
    font-weight: 600;
    display: inline !important;
  }

  /* Filter panel - show as part of Kunder tab on mobile */
  .filter-panel {
    position: static !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    border-radius: 0 !important;
    border: none !important;
    transform: none !important;
    background: transparent !important;
    box-shadow: none !important;
    z-index: auto !important;
    order: 10 !important;
  }

  .filter-panel-toggle {
    display: none !important;
  }

  .filter-panel-inner {
    padding: 0 !important;
    background: transparent !important;
  }

  .filter-panel-header {
    display: none !important;
  }

  .filter-panel-content {
    padding: 8px 12px !important;
  }

  .search-container {
    margin-bottom: 10px !important;
  }

  .quick-actions {
    margin-bottom: 10px !important;
  }

  .color-legend {
    display: none !important;
  }

  .customer-list-wrapper {
    max-height: 50vh !important;
    overflow-y: auto !important;
  }

  .customer-list {
    padding: 0 !important;
  }

  .customer-item {
    padding: 10px !important;
    margin-bottom: 6px !important;
  }

  /* Upcoming widget - bottom positioned on mobile */
  .upcoming-widget {
    position: fixed;
    top: auto;
    bottom: 80px;
    right: 10px;
    left: 10px;
    max-width: none;
    max-height: 50vh;
  }

  /* Route info - top positioned, full width on mobile */
  .route-info {
    position: fixed;
    top: 10px;
    left: 10px;
    right: 10px;
    max-width: none;
    max-height: 40vh;
    overflow-y: auto;
  }

  /* Modal adjustments */
  .modal-content {
    width: 95%;
    max-height: 85vh;
    margin: auto 10px;
  }

  .modal-header {
    padding: 16px;
  }

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

  .modal-content form,
  .modal-content > div:not(.modal-header) {
    padding: 16px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .form-group input,
  .form-group textarea,
  .form-group select {
    font-size: 16px; /* Prevents zoom on iOS */
  }

  /* Customer items - more touch friendly */
  .customer-item {
    padding: 12px;
    gap: 12px;
  }

  .customer-checkbox {
    width: 24px;
    height: 24px;
  }

  .customer-info h3 {
    font-size: 14px;
  }

  /* Buttons - larger touch targets */
  .btn {
    padding: 12px 18px;
    font-size: 14px;
    min-height: 44px; /* iOS minimum touch target */
  }

  .btn-icon {
    min-width: 44px;
    min-height: 44px;
  }

  /* Search input */
  .search-input {
    padding: 12px 12px 12px 36px;
    font-size: 16px;
  }

  /* Leaflet controls positioning */
  .leaflet-top.leaflet-left {
    top: 10px;
    left: 10px;
  }

  .leaflet-top.leaflet-right {
    top: 10px;
    right: 10px;
  }

  .leaflet-control-zoom {
    margin-top: 0 !important;
  }

  /* Popup adjustments */
  .leaflet-popup-content-wrapper {
    max-width: calc(100vw - 40px) !important;
  }

  .leaflet-popup-content {
    max-width: 280px !important;
  }

  /* Marker labels - hide by default on mobile for cleaner view */
  .custom-marker-with-label .marker-label {
    display: none;
  }

  .custom-marker-with-label:active .marker-label,
  .custom-marker-with-label.selected .marker-label {
    display: flex;
  }

  /* Actions row */
  .actions {
    padding: 12px 16px;
  }

  /* Quick actions */
  .quick-actions {
    flex-wrap: wrap;
  }

  .quick-actions .btn-icon {
    flex: 1 1 calc(50% - 4px);
  }

  /* User bar on mobile */
  .user-bar {
    padding: 8px 12px !important;
    gap: 8px !important;
    background: var(--color-bg-secondary) !important;
    border-bottom: 1px solid var(--color-border) !important;
  }

  .user-bar .user-name {
    flex: 1;
    min-width: 0;
    font-size: 12px;
  }

  .user-bar .nightmode-btn,
  .user-bar .logout-btn {
    padding: 8px 10px !important;
    min-width: 40px;
    min-height: 40px;
  }

  /* Ensure sidebar collapsed doesn't hide user bar elements on mobile */
  .sidebar.collapsed .user-bar {
    justify-content: space-between !important;
    padding: 8px 12px !important;
  }

  .sidebar.collapsed .user-bar .user-name {
    display: block !important;
  }
}

/* Small mobile breakpoint */
@media (max-width: 480px) {
  .sidebar {
    height: 70vh;
    max-height: 80vh;
    transform: translateY(calc(100% - 140px));
  }

  .sidebar-header h1 {
    font-size: 14px;
  }

  .company-name {
    font-size: 10px;
  }

  .header-logo {
    width: 40px;
    height: 40px;
  }

  /* Tabs as icon-only pills on very small screens */
  .tab-navigation {
    padding: 10px;
    gap: 6px;
  }

  .tab-item {
    padding: 10px 14px;
    border-radius: 20px;
  }

  .tab-item span {
    display: none !important;
  }

  .tab-item i {
    font-size: 18px;
    width: auto;
    margin: 0;
  }

  /* Customer list compact */
  .customer-item {
    padding: 10px;
  }

  .customer-info h3 {
    font-size: 13px;
  }

  .customer-info p {
    font-size: 11px;
  }

  .customer-control-info {
    min-width: 60px;
  }

  .control-date {
    font-size: 9px;
  }

  /* Section headers */
  .section-header {
    padding: 6px 10px;
  }

  .section-name {
    font-size: 10px;
  }

  /* Modal even more compact */
  .modal-content {
    width: 100%;
    max-width: 100%;
    max-height: 90vh;
    margin: 0;
    border-radius: 20px 20px 0 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
  }

  /* Legend compact */
  .legend-items {
    gap: 4px 8px;
  }

  .legend-text {
    font-size: 9px;
  }

  /* SMS/Email stats */
  .stat-card {
    padding: 6px 2px;
  }

  .stat-value {
    font-size: 14px;
  }

  .stat-label {
    font-size: 8px;
  }

  /* Widget compact */
  .widget-header {
    padding: 12px 16px;
  }

  .widget-header h3 {
    font-size: 14px;
  }

  .widget-item {
    padding: 8px 10px;
    font-size: 12px;
  }
}

/* Mobile floating action button for route planning */
.mobile-route-fab {
  display: none;
}

@media (max-width: 768px) {
  .mobile-route-fab {
    display: block;
    position: fixed;
    bottom: 100px;
    right: 16px;
    z-index: 1400;
  }

  .mobile-route-fab.hidden {
    display: none;
  }

  .fab-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
    min-width: 56px;
    height: 56px;
    padding: 0 20px;
    background: var(--color-accent);
    color: white;
    border: none;
    border-radius: 28px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
  }

  .fab-button:hover,
  .fab-button:active {
    background: var(--color-accent-hover);
    transform: scale(1.05);
  }

  .fab-button i {
    font-size: 20px;
  }

  #mobileRouteCount {
    font-size: 16px;
    font-weight: 700;
  }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .sidebar {
    height: 80vh;
    max-height: 85vh;
  }

  .filter-panel {
    height: 80vh;
    max-height: 90vh;
  }

  .modal-content {
    max-height: 90vh;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  /* Larger touch targets */
  .btn {
    min-height: 48px;
  }

  .customer-item {
    min-height: 60px;
  }

  .tab-item {
    min-height: 48px;
  }

  /* Remove hover effects that don't work on touch */
  .customer-item:hover {
    background: var(--color-bg-tertiary);
    border-color: var(--color-border);
  }

  .btn:hover {
    transform: none;
  }

  /* Active states instead */
  .customer-item:active {
    background: var(--color-bg-hover);
    border-color: var(--color-border-light);
  }

  .btn:active {
    transform: scale(0.98);
  }
}

/* ============================================
   BULK SELECTION - "Marker som ferdig"
   ============================================ */

/* Checkbox in customer list */
.bulk-checkbox {
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin-right: 12px;
  cursor: pointer;
  accent-color: var(--color-accent);
  flex-shrink: 0;
}

.customer-admin-item {
  display: flex;
  align-items: center;
}

.customer-admin-item.bulk-selected {
  background: var(--color-accent-muted);
  border-color: var(--color-accent);
}

.customer-admin-item .customer-info {
  flex: 1;
  min-width: 0;
}

/* Floating action bar for bulk selection */
.bulk-action-bar {
  position: fixed;
  bottom: -80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-bg-elevated);
  border: 2px solid var(--color-accent);
  border-radius: 12px;
  padding: 12px 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  z-index: 10000;
  transition: bottom 0.3s ease;
}

.bulk-action-bar.visible {
  bottom: 20px;
}

@media (max-width: 768px) {
  .bulk-action-bar.visible {
    bottom: 80px; /* Above mobile navigation */
  }
}

.bulk-action-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}

.bulk-action-bar .bulk-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bulk-count {
  font-weight: 600;
  color: var(--color-accent);
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bulk-count i {
  color: var(--color-status-good);
}

.bulk-names {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.bulk-name-tag {
  background: var(--color-accent-muted);
  color: var(--color-text-primary);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
}

.bulk-name-more {
  color: var(--color-text-secondary);
  font-size: 11px;
  font-style: italic;
}

.bulk-actions {
  display: flex;
  gap: 8px;
}

.bulk-actions .btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

/* Bulk complete modal */
.bulk-complete-modal {
  max-width: 480px;
}

.bulk-info {
  margin-bottom: 12px;
  color: var(--color-text-secondary);
}

.bulk-customer-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
  max-height: 120px;
  overflow-y: auto;
}

.bulk-customer-tag {
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--color-text-secondary);
}

.bulk-customer-more {
  color: var(--color-text-muted);
  font-size: 12px;
  font-style: italic;
  padding: 4px 10px;
}

/* Control type selection */
.control-type-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.control-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.control-option:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-border-light);
}

.control-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-accent);
}

.control-option-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--color-text-primary);
}

.control-option-label i {
  color: var(--color-accent);
}

/* Success button */
.btn-success {
  background: var(--color-status-good);
  color: #fff;
  border: none;
}

.btn-success:hover {
  background: #6BBF7E;
}

/* Complete/Check button for bulk selection in map popup */
.btn-complete {
  background: #7C4DFF;
  color: #fff;
  border: none;
}

.btn-complete:hover {
  background: #9E7FFF;
}

/* Navigate button - blue with directions icon */
.btn-navigate {
  background: #2196F3;
  color: #fff;
  border: none;
}

.btn-navigate:hover {
  background: #1976D2;
}

/* ===== AVHUKING TAB STYLES ===== */

.avhuking-info {
  background: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
}

.avhuking-info p {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.avhuking-info i {
  color: var(--color-accent);
}

.avhuking-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.avhuking-count-header {
  background: var(--color-accent);
  color: #fff;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.avhuking-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.avhuking-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-text-secondary);
}

.avhuking-empty i {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.avhuking-empty p {
  font-size: 16px;
  margin: 0 0 8px 0;
  color: var(--color-text-primary);
}

.avhuking-empty span {
  font-size: 13px;
}

.avhuking-item {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.avhuking-item:hover {
  border-color: var(--color-accent);
}

.avhuking-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.avhuking-item-name {
  font-weight: 600;
  color: var(--color-text-primary);
  font-size: 14px;
}

.avhuking-item-address {
  font-size: 12px;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.avhuking-item-kategori {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  width: fit-content;
}

.avhuking-item-kategori.el {
  background: rgba(255, 152, 0, 0.2);
  color: #FF9800;
}

.avhuking-item-kategori.brann {
  background: rgba(244, 67, 54, 0.2);
  color: #F44336;
}

.avhuking-item-kategori.begge {
  background: rgba(156, 39, 176, 0.2);
  color: #9C27B0;
}

.avhuking-item-actions {
  display: flex;
  gap: 6px;
}

.avhuking-item-actions .btn {
  padding: 6px 10px;
}

/* Avhuking badge styling */
.tab-badge.avhuking-badge {
  background: var(--color-status-good);
}

/* ============================================
   STATISTIKK TAB STYLING
   ============================================ */

.statistikk-container {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Overview Cards */
.stats-overview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.overview-card {
  background: var(--color-bg-tertiary);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  border: 1px solid var(--color-border);
  transition: all 0.2s ease;
}

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

.overview-card.status-overdue {
  background: var(--color-status-overdue);
  border: none;
}

.overview-card.status-soon {
  background: var(--color-status-soon);
  border: none;
}

.overview-card.status-good {
  background: var(--color-status-good);
  border: none;
}

/* Hvit tekst på fargede kort */
.overview-card.status-overdue .overview-value,
.overview-card.status-overdue .overview-label,
.overview-card.status-good .overview-value,
.overview-card.status-good .overview-label {
  color: #fff;
}

/* Mørk tekst på gul/amber bakgrunn for bedre lesbarhet */
.overview-card.status-soon .overview-value,
.overview-card.status-soon .overview-label {
  color: #1a1a1a;
}

.overview-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--color-accent);
}

.overview-card.status-overdue .overview-icon,
.overview-card.status-good .overview-icon {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
}

.overview-card.status-soon .overview-icon {
  color: #1a1a1a;
  background: rgba(0, 0, 0, 0.1);
}

.overview-content {
  display: flex;
  flex-direction: column;
}

.overview-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1;
}

.overview-label {
  font-size: 10px;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Stats Sections */
.stats-section {
  background: var(--color-bg-tertiary);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid var(--color-border);
}

.stats-section h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stats-section h3 i {
  color: var(--color-accent);
}

.stats-description {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}

/* Season Chart - Bar Chart */
.season-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 120px;
  padding-top: 10px;
}

.season-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

.season-bar-fill {
  width: 100%;
  max-width: 30px;
  border-radius: 4px 4px 0 0;
  transition: height 0.5s ease;
  position: relative;
  min-height: 2px;
}

.season-bar-fill.el {
  background: linear-gradient(180deg, #F59E0B, #D97706);
}

.season-bar-fill.brann {
  background: linear-gradient(180deg, #DC2626, #B91C1C);
}

.season-bar-fill.combined {
  background: linear-gradient(180deg, var(--color-accent), #EA580C);
}

.season-bar-value {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.season-bar-label {
  font-size: 10px;
  color: var(--color-text-muted);
  margin-top: 6px;
  text-transform: uppercase;
}

/* Category Stats - Horizontal Bars */
.category-stats,
.area-stats,
.eltype-stats,
.brannsystem-stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stat-bar-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-bar-label {
  font-size: 13px;
  color: var(--color-text-primary);
}

.stat-bar-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.stat-bar-track {
  height: 8px;
  background: var(--color-bg-elevated);
  border-radius: 4px;
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.stat-bar-fill.el-kontroll {
  background: linear-gradient(90deg, #F59E0B, #FBBF24);
}

.stat-bar-fill.brannvarsling {
  background: linear-gradient(90deg, #DC2626, #EF4444);
}

.stat-bar-fill.combined {
  background: linear-gradient(90deg, var(--color-accent), #FB923C);
}

.stat-bar-fill.area {
  background: linear-gradient(90deg, #6366F1, #818CF8);
}

.stat-bar-fill.eltype {
  background: linear-gradient(90deg, #F59E0B, #FBBF24);
}

.stat-bar-fill.brannsystem {
  background: linear-gradient(90deg, #DC2626, #EF4444);
}

/* Mobile adjustments for statistikk */
@media (max-width: 768px) {
  /* Fix tab-pane scrolling on mobile */
  .tab-pane.active {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: calc(85vh - 180px);
  }

  .statistikk-container {
    padding: 12px;
    gap: 16px;
    padding-bottom: 100px; /* Extra space for scrolling */
  }

  .stats-overview {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .overview-card {
    padding: 10px 8px;
  }

  .overview-icon {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }

  .overview-value {
    font-size: 18px;
  }

  .overview-label {
    font-size: 9px;
  }

  .stats-section {
    padding: 12px;
  }

  .stats-section h3 {
    font-size: 13px;
  }

  .season-chart {
    height: 80px;
  }

  .season-bar-value {
    font-size: 9px;
  }

  .season-bar-label {
    font-size: 8px;
  }

  .stat-bar-label,
  .stat-bar-value {
    font-size: 12px;
  }
}

/* ============================================
   OFFICE MARKER - Glowing House Icon
   ============================================ */

.office-marker-glow {
  background: transparent !important;
  border: none !important;
}

.office-marker-container {
  position: relative;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.office-glow-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.4) 0%, rgba(34, 197, 94, 0) 70%);
  animation: office-pulse 2s ease-in-out infinite;
}

.office-icon {
  position: relative;
  z-index: 2;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 20px rgba(34, 197, 94, 0.6),
    0 0 40px rgba(34, 197, 94, 0.4),
    0 0 60px rgba(34, 197, 94, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  animation: office-glow 2s ease-in-out infinite;
}

.office-icon svg {
  width: 18px;
  height: 18px;
  color: white;
  stroke-width: 2.5;
}

@keyframes office-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.6;
  }
}

@keyframes office-glow {
  0%, 100% {
    box-shadow:
      0 0 20px rgba(34, 197, 94, 0.6),
      0 0 40px rgba(34, 197, 94, 0.4),
      0 0 60px rgba(34, 197, 94, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: scale(1);
  }
  50% {
    box-shadow:
      0 0 30px rgba(34, 197, 94, 0.8),
      0 0 50px rgba(34, 197, 94, 0.5),
      0 0 80px rgba(34, 197, 94, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
  }
}

/* Office Popup Styling */
.office-popup-container .leaflet-popup-content-wrapper {
  background: rgba(26, 26, 26, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(34, 197, 94, 0.2);
}

.office-popup-container .leaflet-popup-tip {
  background: rgba(26, 26, 26, 0.95);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-top: none;
  border-right: none;
}

.office-popup-container .leaflet-popup-close-button {
  color: #a0a0a0 !important;
}

.office-popup-container .leaflet-popup-close-button:hover {
  color: #22c55e !important;
}

.office-popup {
  padding: 8px;
  color: #ffffff;
  text-align: center;
}

.office-popup h3 {
  margin: 0 0 12px 0;
  font-size: 18px;
  font-weight: 600;
  color: #22c55e;
}

.office-popup p {
  margin: 0 0 10px 0;
  font-size: 13px;
  line-height: 1.5;
  color: #d0d0d0;
}

.office-popup .office-address {
  background: rgba(34, 197, 94, 0.1);
  padding: 10px;
  border-radius: 8px;
  border-left: 3px solid #22c55e;
  text-align: left;
}

.office-popup .office-contact a {
  color: #22c55e;
  text-decoration: none;
  transition: color 0.2s;
}

.office-popup .office-contact a:hover {
  color: #4ade80;
  text-decoration: underline;
}

.office-popup .office-services {
  font-size: 11px;
  color: #8a8a8a;
  margin-bottom: 0;
}

/* ============================================
   DEVELOPER WATERMARK
   ============================================ */

.developer-watermark {
  position: fixed;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.7);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  z-index: 1000;
  pointer-events: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.developer-watermark a {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.developer-watermark a:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

@media (max-width: 768px) {
  .developer-watermark {
    bottom: 80px;
    right: 10px;
    font-size: 10px;
    padding: 4px 8px;
  }
}
