:root {
  --bg: #F8F9FA;
  --surface: #FFFFFF;
  --primary: #0066FF;
  --primary-hover: #0052CC;
  --text-primary: #1A1A1A;
  --text-secondary: #6C757D;
  --border: #DEE2E6;
  --critical: #DC3545;
  --high: #FD7E14;
  --normal: #0D6EFD;
  --low: #198754;
  --minimal: #6C757D;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

#main-content {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  width: 100%;
}

/* ── Brand / Header ── */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.brand-icon {
  font-size: 24px;
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--primary);
  text-transform: uppercase;
}

/* ── Side Panels (Base) ── */
.side-panel {
  width: 340px;
  height: 100%;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(0,0,0,0.02);
}

#left-panel {
  border-right: 1px solid var(--border);
}

#right-panel {
  border-left: 1px solid var(--border);
}

/* ── Filter Bar (Left Panel) ── */
#filter-bar {
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  background: #FAFBFD;
}

.filter-btn {
  padding: 12px 16px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  color: var(--text-secondary);
  border-radius: 8px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-btn:hover {
  background: #EEF2F6;
  color: var(--text-primary);
}

.filter-btn.active {
  background: #E8F0FE;
  color: var(--primary);
  border-color: rgba(0,102,255,0.15);
}

/* ── Filter Controls (Left Panel) ── */
#filter-controls {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: var(--surface);
}

.controls-panel {
  display: none;
  flex-direction: column;
  gap: 16px;
}

.controls-panel.active {
  display: flex;
}

.controls-hint {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Groups for priority buttons */
.priority-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toggle-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  border-top: 1px dashed var(--border);
  padding-top: 12px;
}

.action-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Form Controls ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.input-sm {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 13px;
  color: var(--text-primary);
  width: 100%;
  outline: none;
  background: #FAFBFD;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-sm:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0,102,255,0.08);
}

.btn-block {
  width: 100%;
}

/* ── Buttons (Glassmorphism & Premium Design) ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  outline: none;
  letter-spacing: 0.2px;
  text-decoration: none;
}

/* Primary Button - Glass Blue */
.btn-primary {
  background: rgba(0, 102, 255, 0.12);
  color: var(--primary);
  border: 1px solid rgba(0, 102, 255, 0.35);
  box-shadow: 0 4px 15px rgba(0, 102, 255, 0.05);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.btn-primary:hover {
  background: rgba(0, 102, 255, 0.22);
  border-color: rgba(0, 102, 255, 0.5);
  box-shadow: 0 6px 20px rgba(0, 102, 255, 0.12);
  transform: translateY(-1px);
}

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

/* Secondary Button - Frosted Glass */
.btn-secondary {
  background: rgba(255, 255, 255, 0.6);
  color: var(--text-primary);
  border: 1px solid rgba(222, 226, 230, 0.8);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  background: rgba(241, 243, 245, 0.85);
  border-color: #ced4da;
  color: var(--text-primary);
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.06);
}

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

/* Text Button - Minimalist Glass */
.btn-text {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.btn-text:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
}

/* ── Range Buttons (Frosted Toggles) ── */
.range-btn {
  padding: 10px 14px;
  border: 1px solid rgba(222, 226, 230, 0.7);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.7);
  color: var(--text-secondary);
  transition: all 0.2s ease;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.range-btn:hover {
  background: rgba(241, 243, 245, 0.9);
  border-color: #c3c9d0;
  color: var(--text-primary);
  transform: translateY(-1px);
}

.range-btn.active {
  background: rgba(0, 102, 255, 0.9);
  color: #fff;
  border-color: rgba(0, 102, 255, 0.9);
  box-shadow: 0 4px 12px rgba(0, 102, 255, 0.2);
}

.range-btn.active:hover {
  background: rgba(0, 82, 204, 1);
}


.range-btn.toggle-btn {
  justify-content: center;
  text-align: center;
}

/* ── Central Map Area ── */
#map-container {
  flex: 1;
  min-width: 0;
  height: 100vh;
  position: relative;
  background: #E5E9F0;
  overflow: hidden;
}

#map {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ── Prawy Panel Wyników ── */
.team-selector-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: #FAFBFD;
}

.team-selector-container label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#device-list-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

#side-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

#results-container {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: #FFF;
  max-height: 50%;
  overflow-y: auto;
}

#results-container.hidden {
  display: none;
}

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

.team-selector-container select {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

/* ── Device Item ── */
.device-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.device-item:hover {
  background: #F1F3F5;
}

.device-item + .device-item {
  margin-top: 2px;
}

.device-item .prio-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

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

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

.device-item .dev-detail {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 1px;
}

.device-item.selected {
  background: #E8F0FE !important;
  border-left: 3px solid var(--primary);
}

.device-item .dev-visited {
  font-size: 10px;
  font-weight: 600;
  color: var(--low);
  background: #E8F5E9;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 4px;
  white-space: nowrap;
}

/* ── Result Boxes ── */
.result-box {
  width: 100%;
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.6;
}

/* ── Day Card (Smart Plan) ── */
.day-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}

.day-card h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.day-card .day-summary {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.day-card .day-devices {
  font-size: 12px;
  padding-left: 16px;
  margin-bottom: 8px;
}

.day-card .day-devices li {
  margin-bottom: 4px;
  color: var(--text-primary);
}

.plan-unassigned {
  color: var(--text-secondary);
  font-size: 12px;
  margin-top: 8px;
}

/* ── Modal ── */
#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

#modal-overlay.hidden {
  display: none;
}

#modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px;
  width: 480px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

#modal h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

#modal-device-info {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}

.form-group label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.form-group input {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,102,255,0.1);
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  align-items: center;
}

#modal-status {
  margin-top: 12px;
  font-size: 13px;
  text-align: center;
  font-weight: 500;
}

/* ── Custom InfoWindow ── */
.info-window {
  font-family: var(--font);
  min-width: 260px;
  padding: 4px 0;
}

.info-window h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.info-window .info-type {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.info-window .info-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.info-window .info-row .info-label {
  color: var(--text-secondary);
  min-width: 62px;
  font-size: 12px;
}

.info-window .info-row a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.info-window .info-row a:hover {
  text-decoration: underline;
}

.info-window .info-pills {
  display: flex;
  gap: 6px;
  margin: 8px 0;
}
/* ── Responsive ── */
@media (max-width: 768px) {
  #main-content {
    flex-direction: column;
  }
  #side-panel {
    width: 100%;
    max-height: 200px;
    border-left: none;
    border-top: 1px solid var(--border);
  }
  #filter-bar {
    flex-wrap: wrap;
  }
  .filter-btn {
    flex: 1;
    text-align: center;
    padding: 8px 10px;
    font-size: 11px;
  }
  #modal {
    width: 100%;
    padding: 20px;
    max-height: 90vh;
    overflow-y: auto;
  }
}

/* ── Google Maps InfoWindow – Route popup (Komoot-style) ── */
.gm-style .gm-style-iw-c {
  border-radius: 16px !important;
  padding: 0 !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18) !important;
}
.gm-style .gm-style-iw-d {
  overflow: hidden !important;
  padding: 0 !important;
}
.gm-style .gm-style-iw-t::after {
  display: none !important;
}

.info-window {
  padding: 16px;
  min-width: 230px;
  font-family: var(--font);
  background: #fff;
  border-radius: 16px;
}
.info-window h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.3;
}
.info-window .info-type {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}
.info-window .info-row {
  font-size: 12px;
  margin-bottom: 6px;
  display: flex;
  gap: 6px;
  align-items: baseline;
}
.info-window .info-label {
  font-size: 10px;
  color: var(--text-secondary);
  min-width: 56px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Badge kołowy A/B w dymku trasy */
.route-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  font-weight: 800;
  font-size: 12px;
  margin-right: 7px;
  flex-shrink: 0;
}

/* Zaznaczone urządzenie w trybie trasy */
.device-item.selected {
  border-left: 3px solid var(--primary) !important;
  background: rgba(0, 102, 255, 0.06) !important;
}

/* ── Unlocated Devices Container ── */
#unlocated-container {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(220, 53, 69, 0.02);
  max-height: 250px;
  overflow-y: auto;
}
#unlocated-container.hidden {
  display: none;
}
#unlocated-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--critical);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.unlocated-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px dashed rgba(220, 53, 69, 0.25);
  margin-bottom: 6px;
}
.unlocated-item .dev-info {
  flex: 1;
  min-width: 0;
}
.unlocated-item .dev-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.unlocated-item .dev-detail {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 1px;
}
.btn-edit-address {
  padding: 6px 8px;
  font-size: 11px;
  border-radius: 6px;
  margin-left: 8px;
  flex-shrink: 0;
  background: rgba(0, 102, 255, 0.06);
  border: 1px solid rgba(0, 102, 255, 0.2);
  color: var(--primary);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-edit-address:hover {
  background: rgba(0, 102, 255, 0.12);
  border-color: var(--primary);
}

/* ── Address Correction Panel (sidebar) ── */
#address-panel {
  padding: 16px;
  border-bottom: 2px solid var(--primary);
  background: var(--surface);
}
#address-panel.hidden { display: none; }
#address-panel h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}
#address-panel-device-info {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}
#address-geocode-result {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 12px;
}
#address-geocode-result.success { background: #E8F5E9; color: #2E7D32; border: 1px solid #A5D6A7; }
#address-geocode-result.error   { background: #FFEBEE; color: #C62828; border: 1px solid #EF9A9A; }

/* Google Places Autocomplete dropdown – musi być powyżej modalu */
.pac-container {
  z-index: 3000 !important;
}

/* ── Team Load Bars (visit modal) ── */
.btn-assign-team {
  background: none; border: none; cursor: pointer;
  padding: 0; line-height: 1;
}
.gear-icon {
  font-size: 16px;
  color: #9E9E9E;
  transition: color 0.2s;
}
.team-load-row { margin-bottom: 10px; }
.team-gantt { margin-top: 6px; margin-bottom: 6px; }
.gantt-wrap { position: relative; }
.gantt-scale {
  display: flex; justify-content: space-between;
  font-size: 9px; color: #9E9E9E; margin-bottom: 2px;
}
.gantt-track {
  position: relative; height: 14px;
  background: #F5F5F5; border-radius: 4px; overflow: hidden;
}
.gantt-bar {
  position: absolute; top: 0; height: 100%;
  background: #0066FF; border-radius: 3px; opacity: 0.75;
}
.gantt-empty { font-size: 11px; color: #9E9E9E; padding: 4px 0; }
.gantt-slot-row {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; padding: 3px 0;
  border-bottom: 1px solid #F0F0F0;
}
.gantt-slot-time { color: #0066FF; font-weight: 600; min-width: 80px; flex-shrink: 0; }
.gantt-slot-name { flex: 1; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gantt-slot-travel { color: #FF9800; font-size: 10px; flex-shrink: 0; }
.gantt-slots { margin-top: 6px; margin-bottom: 6px; }
.gantt-suggestion {
  font-size: 11px; color: #2E7D32; background: #E8F5E9;
  border-radius: 6px; padding: 5px 8px; margin-top: 4px;
}
.gantt-suggest-marker {
  position: absolute; top: 0; bottom: 0; width: 2px;
  background: #4CAF50; opacity: 0.9;
}

#calendar-panel {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
#calendar-strip {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 0 16px;
  min-width: max-content;
  margin: 0 auto;
}
#calendar-strip.hidden { display: none; }
.cal-day {
  display: inline-flex; flex-direction: column; align-items: center;
  width: 48px; cursor: pointer; border-radius: 8px;
  padding: 6px 4px; transition: background 0.2s;
  border: 1px solid transparent;
}
.cal-day:hover, .cal-day.active {
  background: rgba(0,102,255,0.08);
  border-color: var(--primary);
}
.cal-day-label {
  font-size: 10px; color: var(--text-secondary);
  margin-bottom: 4px; text-align: center;
}
.cal-bars {
  display: flex; gap: 2px; width: 100%; height: 28px;
}
.cal-team-bar {
  flex: 1; border-radius: 3px;
}

/* ── Route mode ── */
#route-scheduled-items {
  display: flex; flex-direction: column; gap: 4px;
}
.route-sched-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 10px; border-radius: 8px;
  background: var(--bg-secondary); cursor: pointer;
  transition: background 0.15s; font-size: 12px;
}
.route-sched-item:hover { background: rgba(0,102,255,0.06); }
.route-sched-item.in-route { background: rgba(76,175,80,0.1); border: 1px solid #4CAF50; }

#route-points-list {
  display: flex; flex-direction: column; gap: 4px;
}
.route-point-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 10px; border-radius: 6px;
  background: var(--bg-primary); font-size: 12px;
}
.route-point-order {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; margin-right: 8px; flex-shrink: 0;
}

/* ── Tooltip najbliższych ekip ── */
.nearby-teams-trigger {
  cursor: pointer;
  margin-left: 6px;
  font-size: 14px;
  display: inline-block;
  position: relative;
}

.nearby-teams-tooltip {
  display: none;
  position: absolute;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 10px 14px;
  margin-top: 6px;
  font-size: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  z-index: 100;
  width: calc(100% - 32px);
}

.nearby-teams-trigger:hover ~ .nearby-teams-tooltip,
.nearby-teams-tooltip:hover {
  display: block;
}

.nearby-teams-tooltip .tt-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nearby-teams-tooltip .tt-list li {
  padding: 4px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.nearby-teams-tooltip .tt-list li:last-child {
  border-bottom: none;
}

.nearby-teams-tooltip .tt-team-name {
  font-weight: 600;
}

.nearby-teams-tooltip .tt-distance {
  color: var(--text-secondary, #666);
}

.nearby-teams-tooltip .tt-free {
  color: var(--text-secondary, #666);
}

#modal-status:not(:empty) {
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}

/* ── Custom confirm modal ── */
#confirm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}
#confirm-modal-overlay.hidden {
  display: none;
}
#confirm-modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  width: 400px;
  max-width: 100%;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
#confirm-modal h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}
#confirm-modal-body {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.settings-team-card {
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.settings-team-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.print-only {
  display: none;
}
@media print {
  body * {
    visibility: hidden;
  }
  #print-protocol-container, #print-protocol-container * {
    visibility: visible;
  }
  #print-protocol-container {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    display: block !important;
    background: #fff;
    color: #000;
  }
  .protocol-card {
    font-family: 'Inter', sans-serif;
    padding: 20px;
    background: #fff;
  }
  .protocol-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #333;
    padding-bottom: 12px;
    margin-bottom: 20px;
  }
  .protocol-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a73e8;
  }
  .protocol-number {
    font-size: 12px;
    color: #555;
  }
  .protocol-section {
    margin-bottom: 20px;
  }
  .protocol-section h4 {
    font-size: 14px;
    font-weight: 700;
    border-bottom: 1px solid #ddd;
    padding-bottom: 4px;
    margin-bottom: 8px;
    color: #333;
  }
  .protocol-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
  }
  .protocol-table td {
    padding: 6px 8px;
    border: 1px solid #eee;
  }
  .protocol-checklist {
    list-style: none;
    padding: 0;
    font-size: 12px;
  }
  .protocol-checklist li {
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .protocol-signatures {
    margin-top: 50px;
    display: flex;
    justify-content: space-between;
  }
  .sig-block {
    width: 40%;
    text-align: center;
  }
  .sig-line {
    border-bottom: 1px dashed #333;
    height: 40px;
    margin-bottom: 6px;
  }
  .sig-label {
    font-size: 10px;
    color: #666;
  }
}

/* --- Okrągłe/kwadratowe ikonki historii na mapie --- */
.map-overlay-controls {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  display: flex;
  gap: 12px;
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
}
.map-control-btn {
  background: transparent;
  border: none;
  color: #475569;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
  box-shadow: none;
}
.map-control-btn svg {
  display: block;
}
.map-control-btn:hover:not(:disabled) {
  color: var(--primary);
  transform: scale(1.15);
}
.map-control-btn:active:not(:disabled) {
  transform: scale(0.9);
}
.map-control-btn:disabled {
  color: #D1D5DB;
  cursor: not-allowed;
}
