.stream-view {
  padding: 18px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.stream-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(520px, 1.8fr) minmax(320px, 1fr);
  grid-template-areas:
    "chart hero"
    "weather weather";
  align-items: start;
}

.stream-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  background: linear-gradient(145deg, rgba(24, 38, 61, 0.92), rgba(12, 23, 41, 0.88));
  box-shadow: var(--glow);
  min-height: 200px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stream-card.hero {
  background: linear-gradient(140deg, rgba(45, 212, 191, 0.16), rgba(12, 23, 41, 0.9));
  grid-area: hero;
  min-height: 0;
}

.stream-headline {
  font-size: 22px;
  font-weight: 800;
  margin-top: 4px;
}

.stream-sub {
  color: var(--text-muted);
  line-height: 1.4;
  margin: 6px 0 4px;
}

.stream-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.stream-card .stat-value {
  font-size: 26px;
  font-weight: 800;
}

.stream-card .stat-sub {
  color: var(--text-muted);
  font-size: 13px;
}

.stream-card .stat-label {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-size: 12px;
}

.stream-card .stat.compact .stat-value {
  font-size: 20px;
}

.chart-card {
  position: relative;
  min-height: 0;
  grid-area: chart;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin: 8px 0 4px;
  color: var(--text-muted);
  font-size: 13px;
}

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

.legend-swatch {
  width: 16px;
  height: 10px;
  border-radius: 6px;
  display: inline-block;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.legend-swatch.level {
  background: #6ff0d5;
}

.legend-swatch.spa1 {
  background: #22c55e;
}

.legend-swatch.spa2 {
  background: #facc15;
}

.legend-swatch.spa3 {
  background: #f97316;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chart-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chart-refresh {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e0f2fe;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(14, 165, 233, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.chart-refresh:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
}

.chart-refresh:disabled {
  opacity: 0.6;
  cursor: progress;
  box-shadow: none;
}

#levelChart {
  width: 100%;
  height: 320px;
  display: block;
}

.stream-card.wide {
  grid-area: weather;
}

@media (max-width: 1080px) {
  .stream-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "chart"
      "weather"
      "hero";
  }

  #levelChart {
    height: 280px;
  }
}

.weather-embeds.inline {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.embed {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
  aspect-ratio: 16 / 9;
  min-height: 520px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.35);
}

.embed iframe,
.locked-embed {
  width: 100%;
  height: 100%;
  border: none;
  pointer-events: none;
  user-select: none;
  touch-action: none;
}

:root[data-theme="light"] .stream-card {
  background: linear-gradient(145deg, #ffffff, #eef2fb);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
  border-color: var(--border);
}

:root[data-theme="light"] .stream-card.hero {
  background: linear-gradient(140deg, rgba(14, 165, 233, 0.14), rgba(226, 240, 255, 0.94));
}

:root[data-theme="light"] .stream-card .stat-label,
:root[data-theme="light"] .stream-card .stat-sub,
:root[data-theme="light"] .stream-sub {
  color: var(--text-muted);
}

:root[data-theme="light"] .stream-card.wide,
:root[data-theme="light"] .waste-card {
  background: linear-gradient(150deg, #ffffff, #eef2fb);
  border-color: var(--border);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

:root[data-theme="light"] .waste-card.hero {
  background: linear-gradient(140deg, rgba(125, 211, 252, 0.18), rgba(230, 244, 255, 0.94));
}

:root[data-theme="light"] .embed {
  background: rgba(255, 255, 255, 0.92);
  border-color: var(--border);
  box-shadow: 0 18px 32px rgba(15, 23, 42, 0.12);
}

.waste-view {
  padding: 18px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.waste-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(420px, 1.2fr) minmax(320px, 0.8fr);
  align-items: start;
}

.waste-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  background: linear-gradient(150deg, rgba(24, 38, 61, 0.9), rgba(10, 18, 33, 0.92));
  box-shadow: var(--glow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.waste-card.hero {
  background: linear-gradient(140deg, rgba(56, 189, 248, 0.2), rgba(12, 23, 41, 0.92));
}

.mega-date {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 0.4px;
  margin: 6px 0 4px;
}

#nextPickupCountdown {
  align-self: flex-start;
}

.waste-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 4px;
}

.waste-card.overview .waste-list {
  display: grid;
  gap: 10px;
}

.waste-list .waste-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
}

.waste-row .date {
  font-weight: 700;
}

.waste-row .label {
  color: var(--text-muted);
  font-size: 13px;
}

.waste-card.info .info-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
  display: grid;
  gap: 6px;
  line-height: 1.5;
}

.waste-card.info .popup-actions {
  margin-top: auto;
}

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

/* Mobile optimizations for views */
@media (max-width: 960px) {
  .stream-view,
  .waste-view,
  .hasici-view,
  .kriminalita-view {
    padding: 14px;
  }

  .stream-grid {
    gap: 14px;
  }

  .stream-card,
  .waste-card {
    padding: 14px;
  }

  .waste-grid {
    gap: 14px;
  }

  /* Better touch targets for waste rows */
  .waste-row {
    min-height: 56px;
    padding: 14px;
  }

  /* Better button sizing */
  .button,
  .popup-button {
    min-height: 44px;
    padding: 12px 20px;
    font-size: 15px;
  }

  /* Better chart header on mobile */
  .chart-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .chart-actions {
    width: 100%;
    justify-content: space-between;
  }

  .chart-refresh {
    padding: 10px 16px;
    font-size: 14px;
  }

  /* Better embed sizing */
  .embed {
    min-height: 300px;
  }

  /* Better layer switcher on mobile - compact version */
  .layer-switcher {
    min-width: auto;
    width: auto;
    max-width: calc(100vw - 20px);
    padding: 6px 8px !important;
    border-radius: 12px !important;
    font-size: 12px;
  }
  
  .layer-switcher-title {
    font-size: 11px !important;
    margin-bottom: 2px !important;
    padding: 0 4px;
  }
  
  .layer-switcher-row {
    padding: 3px 4px !important;
    gap: 6px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
  }
  
  .layer-switcher-row input[type="checkbox"] {
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0;
  }
  
  .layer-switcher-row span {
    font-size: 12px !important;
    white-space: nowrap;
  }
  
  /* Make layer switcher horizontal/compact grid on mobile */
  #mapaLayers {
    display: flex;
    flex-direction: column;
    gap: 0;
  }
  
  #mapaLayers .layer-switcher-row {
    border-top: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }
  
  #mapaLayers .layer-switcher-row:last-child {
    border-bottom: none;
  }
  
  /* Optional: horizontal grid layout for even more compact design */
  @media (max-width: 480px) {
    #mapaLayers {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 2px;
      padding: 4px !important;
    }
    
    #mapaLayers .layer-switcher-title {
      grid-column: 1 / -1;
      margin-bottom: 4px;
      padding-bottom: 4px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    #mapaLayers .layer-switcher-row {
      border-bottom: none;
      padding: 4px 2px !important;
      font-size: 11px !important;
    }
    
    #mapaLayers .layer-switcher-row input[type="checkbox"] {
      width: 14px !important;
      height: 14px !important;
    }
  }

  /* Better popup details */
  .popup-details {
    font-size: 14px;
  }

  .popup-details > div {
    padding: 8px 0;
  }

  /* Better status chips */
  .status-chip {
    padding: 6px 12px;
    font-size: 12px;
    min-height: 32px;
  }
}

.chart-frame {
  fill: rgba(255, 255, 255, 0.02);
  stroke: var(--border);
}

.chart-grid {
  stroke: rgba(255, 255, 255, 0.06);
  stroke-dasharray: 4 6;
}

.chart-area {
  fill: url(#areaGradient);
}

.chart-line {
  stroke: #6ff0d5;
  stroke-width: 3;
  fill: none;
}

.threshold-line {
  stroke-width: 2;
  stroke-dasharray: 6 6;
  opacity: 0.9;
}

.threshold-label {
  font-size: 11px;
  fill: var(--text-muted);
}

.chart-dot {
  fill: #0c1626;
  stroke: #6ff0d5;
  stroke-width: 2.4;
}

.chart-label {
  fill: var(--text-muted);
  font-size: 12px;
  text-anchor: middle;
}

.chart-value {
  fill: #6ff0d5;
  font-size: 13px;
  font-weight: 700;
  text-anchor: middle;
}

.chart-sub {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 2px;
}

.leaflet-container {
  font-family: inherit;
  background: #f5f5f5;
}

.leaflet-container a {
  color: #2563eb;
}

.leaflet-popup-content {
  color: #0b1220;
  min-width: 320px;
  max-width: 400px;
  width: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}

.leaflet-popup-content-wrapper {
  max-width: 420px !important;
  transition: max-width 0.3s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}

.leaflet-popup-content-wrapper.popup-expanded {
  max-width: 500px !important;
}

/* Ensure form in popup is fully visible */
.leaflet-popup-content .lamp-report-form {
  min-width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Ensure form is hidden by default until button is clicked */
.leaflet-popup-content .lamp-report-form.hidden {
  display: none !important;
}

/* Ensure form is visible when not hidden */
.leaflet-popup-content .lamp-report-form:not(.hidden) {
  display: flex !important;
}

/* Force form visibility - even stronger rule */
.leaflet-popup-content .lamp-report-form[style*="display: flex"] {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Ensure show button is visible by default */
.leaflet-popup-content .show-report-form-btn.hidden {
  display: none !important;
}

/* Ensure show button is visible when not hidden */
.leaflet-popup-content .show-report-form-btn:not(.hidden) {
  display: inline-flex !important;
}

/* Ensure submit button is always at the bottom and visible */
.leaflet-popup-content .lamp-report-form .popup-button[type="submit"] {
  margin-top: auto;
  flex-shrink: 0;
}

.leaflet-popup-content-wrapper.popup-expanded .leaflet-popup-content {
  max-width: 480px;
}

/* Light, modern map styling */
.leaflet-tile-container img {
  filter: brightness(1.05) contrast(0.95);
}

.leaflet-control-zoom {
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.leaflet-control-zoom a {
  background-color: #ffffff;
  color: #1f2937;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.leaflet-control-zoom a:hover {
  background-color: #f3f4f6;
  color: #111827;
}

.leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.8);
  color: #6b7280;
  font-size: 11px;
  padding: 4px 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.marker-wrapper {
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.4));
}

.marker-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.84));
  color: #0b1220;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  position: relative;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35), 0 0 0 2px var(--marker-color);
}

.marker-badge {
  position: absolute;
  top: -10px;
  right: -10px;
  min-width: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff;
  color: var(--marker-color, #f28c38);
  border: 2px solid var(--marker-color, #f28c38);
  font-weight: 800;
  font-size: 12px;
  text-align: center;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28), 0 0 0 2px rgba(255, 255, 255, 0.9);
}

.marker-icon.marker-lampy .marker-badge {
  background: #fff;
  color: #f28c38;
}

.marker-icon.marker-lampy {
  gap: 0;
  padding: 6px;
  border-radius: 14px;
  min-width: 0;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.32), 0 0 0 2px var(--marker-color);
}

.marker-icon::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 18px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 10px solid rgba(255, 255, 255, 0.9);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.marker-icon.marker-lampy::after {
  left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 9px solid rgba(255, 255, 255, 0.9);
}

.marker-emoji {
  font-size: 18px;
}

.marker-wrapper.marker-lampy .marker-emoji {
  font-size: 14px;
}

.marker-label {
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.2px;
}

.marker-wrapper.marker-lampy .marker-label {
  display: none;
}

.popup-details {
  margin-top: 10px;
  display: grid;
  gap: 8px;
  color: #1f2937;
  font-size: 13px;
}

.popup-details div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.popup-details span {
  color: #334155;
  font-weight: 600;
}

.popup-details strong {
  color: #0b1220;
  font-weight: 800;
}

.popup-status {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 13px;
  color: #0b1220;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.32);
}

.popup-subtext {
  font-size: 12px;
  color: #6b7280;
  margin-top: -2px;
  margin-bottom: 4px;
}

.popup-no-sensor {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 8px;
  color: #78350f;
  font-weight: 600;
  font-size: 13px;
}

.popup-no-sensor-icon {
  font-size: 16px;
  line-height: 1;
}

.popup-no-sensor-text {
  line-height: 1.4;
}

.status-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2px;
  background: rgba(16, 185, 129, 0.12);
  color: #0f172a;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-chip.status-warning {
  background: rgba(249, 115, 22, 0.15);
  border-color: rgba(249, 115, 22, 0.32);
  color: #7c2d12;
}

.status-chip.status-critical {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.36);
  color: #7f1d1d;
}

.popup-warning {
  background: rgba(249, 115, 22, 0.15);
  border-color: rgba(249, 115, 22, 0.32);
}

.popup-critical {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.32);
}

.popup-actions {
  margin-top: 10px;
}

.lamp-report-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.95));
  border-radius: 14px;
  border: 2px solid rgba(249, 115, 22, 0.2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(249, 115, 22, 0.1);
}

.popup-form-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #0b1220;
  letter-spacing: 0.2px;
}

.popup-form-input {
  padding: 11px 14px;
  border-radius: 10px;
  border: 2px solid rgba(15, 23, 42, 0.12);
  background: linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(248, 250, 252, 0.98));
  color: #0b1220;
  font-size: 14px;
  font-family: inherit;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.popup-form-input:hover {
  border-color: rgba(249, 115, 22, 0.3);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.popup-form-input:focus {
  outline: none;
  border-color: #f97316;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.2), 0 4px 12px rgba(249, 115, 22, 0.15);
}

.popup-form-input::placeholder {
  color: #94a3b8;
  opacity: 0.7;
  font-weight: 500;
}

.popup-form-textarea {
  padding: 11px 14px;
  border-radius: 10px;
  border: 2px solid rgba(15, 23, 42, 0.12);
  background: linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(248, 250, 252, 0.98));
  color: #0b1220;
  font-size: 14px;
  font-family: inherit;
  font-weight: 600;
  resize: vertical;
  min-height: 80px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.popup-form-textarea:hover {
  border-color: rgba(249, 115, 22, 0.3);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.popup-form-textarea:focus {
  outline: none;
  border-color: #f97316;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.2), 0 4px 12px rgba(249, 115, 22, 0.15);
}

.popup-form-textarea::placeholder {
  color: #94a3b8;
  opacity: 0.7;
  font-weight: 500;
}

.popup-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f97316, #f59e0b);
  color: #0b1220;
  font-weight: 800;
  border: none;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(249, 115, 22, 0.35);
  transition: filter 0.2s ease;
}

.popup-button:hover {
  filter: brightness(1.05);
}

.popup-button:active {
  filter: brightness(0.95);
}

.stat-value.live {
  color: #6ff0d5;
}

.source-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  margin-top: 6px;
}

.source-link:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

/* Overlay mode for mobile */
.overlay-visible .sidebar {
  position: fixed;
  left: 0;
  top: 64px;
  bottom: 0;
  width: 260px;
  transform: translateX(0);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  z-index: 1100;
}

.sidebar-hidden {
  transform: translateX(-100%);
  transition: transform 0.2s ease;
  position: fixed;
  left: 0;
  top: 64px;
  bottom: 0;
  width: 260px;
}

.overlay-backdrop {
  display: none;
}

.overlay-visible .overlay-backdrop {
  display: block;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 1050;
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
    height: auto;
    min-height: calc(100vh - 64px);
    overflow: visible;
  }

  .sidebar {
    position: fixed;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  .content {
    grid-column: 1 / -1;
    height: auto;
    min-height: auto;
    overflow: visible;
  }

  .menu-button {
    display: grid;
  }

  .map-overlay {
    top: 12px;
    right: 12px;
  }

  .view-container {
    min-height: auto;
  }

  .view,
  .map-view {
    min-height: 520px;
  }

  #map {
    height: 70vh;
    min-height: 520px;
  }
}

@media (max-width: 640px) {
  .view,
  .map-view {
    min-height: 420px;
  }

  #map {
    height: 68vh;
    min-height: 420px;
  }
}

/* Hasici view styles */
.hasici-view {
  padding: 18px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.hasici-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
}

.hasici-item {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  background: linear-gradient(145deg, rgba(24, 38, 61, 0.92), rgba(12, 23, 41, 0.88));
  box-shadow: var(--glow);
  transition: transform 0.12s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.hasici-item:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
}

.hasici-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 12px;
}

.hasici-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.hasici-status-icon {
  font-size: 14px;
}

.hasici-time {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.hasici-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 12px 0;
  line-height: 1.4;
}

.hasici-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--text-muted);
  font-size: 14px;
}

.hasici-location {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hasici-end {
  font-size: 13px;
  opacity: 0.8;
}

.hasici-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.hasici-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: color 0.2s ease, gap 0.2s ease;
}

.hasici-link:hover {
  color: var(--accent-strong);
  gap: 8px;
}

.loading-state,
.error-state,
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(5, 150, 105, 0.2);
  border-top-color: #059669;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Light theme for loading spinner */
:root[data-theme="light"] .loading-spinner {
  border-color: rgba(5, 150, 105, 0.2);
  border-top-color: #059669;
}

.error-detail {
  font-size: 14px;
  margin-top: 8px;
  opacity: 0.7;
}

/* Light theme for hasici */
:root[data-theme="light"] .hasici-item {
  background: linear-gradient(145deg, #ffffff, #f8fafc);
  border-color: rgba(15, 23, 42, 0.1);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

:root[data-theme="light"] .hasici-item:hover {
  border-color: rgba(15, 23, 42, 0.15);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

:root[data-theme="light"] .hasici-title {
  color: #0f172a;
}

:root[data-theme="light"] .hasici-link {
  color: #059669;
}

:root[data-theme="light"] .hasici-link:hover {
  color: #047857;
}

@media (max-width: 960px) {
  .hasici-view {
    padding: 12px;
  }
  
  .hasici-item {
    padding: 14px;
  }
  
  .hasici-item-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .hasici-title {
    font-size: 16px;
  }
}

/* Kriminalita view styles */
.kriminalita-view {
  padding: 18px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.kriminalita-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
}

.kriminalita-item {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  background: linear-gradient(145deg, rgba(24, 38, 61, 0.92), rgba(12, 23, 41, 0.88));
  box-shadow: var(--glow);
  transition: transform 0.12s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.kriminalita-item:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
}

.kriminalita-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 12px;
}

.kriminalita-date {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

.kriminalita-state {
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.kriminalita-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 12px 0;
  line-height: 1.4;
}

.kriminalita-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--text-muted);
  font-size: 14px;
}

.kriminalita-relevance {
  display: flex;
  align-items: center;
  gap: 6px;
}

.kriminalita-mp {
  font-size: 13px;
  opacity: 0.8;
}

.kriminalita-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: color 0.2s ease, gap 0.2s ease;
}

.kriminalita-link:hover {
  color: var(--accent-strong);
  gap: 8px;
}

/* Light theme for kriminalita */
:root[data-theme="light"] .kriminalita-item {
  background: linear-gradient(145deg, #ffffff, #f8fafc);
  border-color: rgba(15, 23, 42, 0.1);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

:root[data-theme="light"] .kriminalita-item:hover {
  border-color: rgba(15, 23, 42, 0.15);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

:root[data-theme="light"] .kriminalita-title {
  color: #0f172a;
}

:root[data-theme="light"] .kriminalita-link {
  color: #059669;
}

:root[data-theme="light"] .kriminalita-link:hover {
  color: #047857;
}

/* Zavady (Reported Issues) */
.zavady-view {
  padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.zavady-view .view-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  gap: 20px;
}

.report-zavada-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #f97316, #f59e0b);
  color: #0b1220;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(249, 115, 22, 0.35);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.report-zavada-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(249, 115, 22, 0.45);
  filter: brightness(1.05);
}

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

.report-zavada-icon {
  font-size: 24px;
  font-weight: 300;
  line-height: 1;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 18, 32, 0.1);
  border-radius: 50%;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
  text-align: center;
  vertical-align: middle;
}

.report-zavada-label {
  letter-spacing: 0.3px;
}

/* Report zavada modal */
.report-zavada-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.report-zavada-modal.hidden {
  display: none;
}

.report-zavada-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.report-zavada-modal-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(145deg, rgba(24, 38, 61, 0.98), rgba(12, 23, 41, 0.95));
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
  padding: 24px;
}

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

.report-zavada-modal-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: 0.3px;
}

.report-zavada-modal-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-main);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.report-zavada-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-strong);
  transform: scale(1.05);
}

.report-zavada-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.report-zavada-form-label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.2px;
}

.report-zavada-form-input,
.report-zavada-form-select,
.report-zavada-form-textarea {
  padding: 12px 16px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  font-size: 14px;
  font-family: inherit;
  font-weight: 600;
  transition: all 0.2s ease;
}

.report-zavada-form-input:hover,
.report-zavada-form-select:hover,
.report-zavada-form-textarea:hover {
  border-color: rgba(249, 115, 22, 0.4);
  background: rgba(255, 255, 255, 0.08);
}

.report-zavada-form-input:focus,
.report-zavada-form-select:focus,
.report-zavada-form-textarea:focus {
  outline: none;
  border-color: #f97316;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.2);
}

.report-zavada-form-textarea {
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
}

.report-zavada-form-select {
  cursor: pointer;
}

.report-zavada-form-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.report-zavada-form-cancel,
.report-zavada-form-submit {
  flex: 1;
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.report-zavada-form-cancel {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border);
}

.report-zavada-form-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-strong);
}

.report-zavada-form-submit {
  background: linear-gradient(135deg, #f97316, #f59e0b);
  color: #0b1220;
  box-shadow: 0 8px 24px rgba(249, 115, 22, 0.35);
}

.report-zavada-form-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(249, 115, 22, 0.45);
  filter: brightness(1.05);
}

.report-zavada-form-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Light theme for report zavada */
:root[data-theme="light"] .report-zavada-modal-content {
  background: linear-gradient(145deg, #ffffff, #f8fafc);
  border-color: rgba(15, 23, 42, 0.15);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.2);
}

:root[data-theme="light"] .report-zavada-modal-header {
  border-bottom-color: rgba(15, 23, 42, 0.1);
}

:root[data-theme="light"] .report-zavada-modal-header h2 {
  color: #0b1220;
}

:root[data-theme="light"] .report-zavada-modal-close {
  background: rgba(15, 23, 42, 0.05);
  border-color: rgba(15, 23, 42, 0.15);
  color: #0b1220;
}

:root[data-theme="light"] .report-zavada-modal-close:hover {
  background: rgba(15, 23, 42, 0.1);
}

:root[data-theme="light"] .report-zavada-form-label {
  color: #0b1220;
}

:root[data-theme="light"] .report-zavada-form-input,
:root[data-theme="light"] .report-zavada-form-select,
:root[data-theme="light"] .report-zavada-form-textarea {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.15);
  color: #0b1220;
}

:root[data-theme="light"] .report-zavada-form-input:hover,
:root[data-theme="light"] .report-zavada-form-select:hover,
:root[data-theme="light"] .report-zavada-form-textarea:hover {
  border-color: rgba(249, 115, 22, 0.4);
}

:root[data-theme="light"] .report-zavada-form-input:focus,
:root[data-theme="light"] .report-zavada-form-select:focus,
:root[data-theme="light"] .report-zavada-form-textarea:focus {
  border-color: #f97316;
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.25);
}

:root[data-theme="light"] .report-zavada-form-cancel {
  background: rgba(15, 23, 42, 0.05);
  color: #0b1220;
  border-color: rgba(15, 23, 42, 0.15);
}

:root[data-theme="light"] .report-zavada-form-cancel:hover {
  background: rgba(15, 23, 42, 0.1);
}

/* Report zavada map container */
.report-zavada-map-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.report-zavada-map-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.2px;
}

.report-zavada-map {
  width: 100%;
  height: 300px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--border);
  background: #f5f5f5;
}

.report-zavada-selected {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(16, 185, 129, 0.15);
  border: 2px solid rgba(16, 185, 129, 0.3);
  border-radius: 10px;
  color: var(--text-main);
  font-weight: 600;
  font-size: 14px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.report-zavada-selected-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #22c55e;
  color: white;
  border-radius: 50%;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.report-zavada-selected-text {
  flex: 1;
  min-width: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

/* Light theme for report zavada map */
:root[data-theme="light"] .report-zavada-map {
  border-color: rgba(15, 23, 42, 0.15);
}

:root[data-theme="light"] .report-zavada-selected {
  background: rgba(5, 150, 105, 0.1);
  border-color: rgba(5, 150, 105, 0.3);
  color: #0b1220;
}

/* Mobile styles for report zavada */
@media (max-width: 960px) {
  .zavady-view .view-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .report-zavada-btn {
    width: 100%;
    justify-content: center;
  }
  
  .report-zavada-label {
    display: none;
  }
  
  .report-zavada-icon {
    width: 32px;
    height: 32px;
    font-size: 28px;
  }
  
  .report-zavada-modal {
    padding: 12px;
  }
  
  .report-zavada-modal-content {
    padding: 20px;
    max-height: 95vh;
  }
  
  .report-zavada-form-actions {
    flex-direction: column;
  }
}

.zavady-table-container {
  overflow-x: auto;
  margin-top: 20px;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

.zavady-table {
  width: 100%;
  border-collapse: collapse;
  background: linear-gradient(145deg, rgba(24, 38, 61, 0.92), rgba(12, 23, 41, 0.88));
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--glow);
}

.zavady-table thead {
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.15), rgba(34, 197, 94, 0.1));
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.zavady-table th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-main);
  border-bottom: 2px solid var(--border);
  user-select: none;
}

.zavady-table th.sortable {
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.zavady-table th.sortable:hover {
  background: rgba(45, 212, 191, 0.12);
  color: var(--accent);
}

.zavady-table th.sortable span:first-child {
  flex: 1;
}

.sort-icon {
  font-size: 14px;
  opacity: 0.4;
  transition: opacity 0.2s ease, color 0.2s ease;
  color: var(--text-muted);
}

.zavady-table th.sortable:hover .sort-icon {
  opacity: 0.7;
}

.sort-icon.sort-active {
  opacity: 1;
  color: var(--accent);
  font-weight: 900;
}

.zavady-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
  font-size: 14px;
  font-weight: 600;
}

.zavady-table td:last-child {
  padding-right: 40px; /* Make room for expand arrow */
}

.zavady-table tbody tr {
  transition: background 0.2s ease;
}

.zavady-table tbody tr:hover {
  background: rgba(45, 212, 191, 0.08);
}

.zavady-row {
  cursor: pointer;
  position: relative;
  transition: background 0.2s ease;
}

.zavady-row::after {
  content: '▼';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 12px;
  transition: transform 0.3s ease, color 0.2s ease;
  pointer-events: none;
}

.zavady-row.zavady-row-expanded::after {
  transform: translateY(-50%) rotate(180deg);
  color: var(--accent);
}

.zavady-row.zavady-row-expanded {
  background: rgba(5, 150, 105, 0.15) !important;
}

.zavady-detail-row {
  background: rgba(5, 150, 105, 0.08);
}

.zavady-detail-row.hidden {
  display: none;
}

.zavady-detail-cell {
  padding: 20px !important;
  background: rgba(5, 150, 105, 0.08);
  border-top: 1px solid rgba(5, 150, 105, 0.2);
}

.zavady-detail-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.zavady-resolved-info {
  padding: 12px 16px;
  background: rgba(5, 150, 105, 0.15);
  border: 1px solid rgba(5, 150, 105, 0.3);
  border-radius: 10px;
  color: var(--text-main);
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.zavady-resolved-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.zavady-resolution-description {
  padding-top: 8px;
  border-top: 1px solid rgba(5, 150, 105, 0.2);
  font-size: 14px;
  line-height: 1.5;
}

.zavady-resolved-days {
  color: var(--text-muted);
  font-size: 13px;
}

.zavady-map-container {
  margin-top: 10px;
}

.zavady-map-header {
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--text-main);
}

.zavady-map {
  width: 100%;
  height: 300px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid rgba(5, 150, 105, 0.3);
  background: rgba(255, 255, 255, 0.05);
}

.zavady-map-marker {
  background: transparent;
  border: none;
}

.zavady-expanded-gallery {
  margin-top: 10px;
}

.zavady-gallery-thumbnails {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.zavady-gallery-thumb-wrapper {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 10px;
  overflow: hidden;
}

.zavady-gallery-thumb-loading {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(5, 150, 105, 0.2);
  border-radius: 10px;
  z-index: 1;
}

.zavady-gallery-thumb-loading.hidden {
  display: none;
}

.zavady-gallery-thumb-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(5, 150, 105, 0.2);
  border-top-color: rgba(5, 150, 105, 0.8);
  border-radius: 50%;
  animation: zavady-thumb-spin 0.8s linear infinite;
}

.zavady-gallery-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid rgba(5, 150, 105, 0.4);
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.05);
  display: block;
}

.zavady-gallery-thumb:hover {
  transform: scale(1.05);
  border-color: #059669;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
}

.zavady-no-photos {
  color: var(--text-muted);
  font-size: 14px;
  font-style: italic;
  padding: 20px;
  text-align: center;
}

/* Zavady popup on map - light background with dark text - use very specific selectors to override Leaflet defaults */
/* Force light background ALWAYS, regardless of theme */
.leaflet-container .leaflet-popup.zavady-popup .leaflet-popup-content-wrapper,
.leaflet-popup.zavady-popup .leaflet-popup-content-wrapper,
.leaflet-container .leaflet-popup.zavady-popup .leaflet-popup-content-wrapper[style],
.leaflet-popup.zavady-popup .leaflet-popup-content-wrapper[style],
.leaflet-popup.zavady-popup .leaflet-popup-content-wrapper,
body .leaflet-popup.zavady-popup .leaflet-popup-content-wrapper {
  background: linear-gradient(145deg, #ffffff, #f8fafc) !important;
  background-color: #ffffff !important;
  background-image: none !important;
  border: 1px solid rgba(15, 23, 42, 0.15) !important;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.2) !important;
  color: #0b1220 !important;
}

.leaflet-popup.zavady-popup .leaflet-popup-content {
  color: #0b1220 !important;
  background: transparent !important;
  background-color: transparent !important;
}

.leaflet-container .leaflet-popup.zavady-popup .leaflet-popup-tip,
.leaflet-popup.zavady-popup .leaflet-popup-tip {
  background: #ffffff !important;
  background-color: #ffffff !important;
  background-image: none !important;
  border: 1px solid rgba(15, 23, 42, 0.15) !important;
  border-top: none !important;
  border-left: none !important;
}

/* Zavady popup on map - ensure all text is dark colored for light background */
.leaflet-popup.zavady-popup * {
  color: #0b1220 !important;
}

.leaflet-popup.zavady-popup .zavady-popup-header strong {
  color: #0b1220 !important;
}

.leaflet-popup.zavady-popup .zavady-popup-category {
  color: #059669 !important; /* Green accent color */
}

.leaflet-popup.zavady-popup .zavady-popup-date {
  color: #475569 !important;
}

.leaflet-popup.zavady-popup .zavady-popup-gallery-title {
  color: #0b1220 !important;
}

.leaflet-popup.zavady-popup .popup-button {
  color: #ffffff !important;
  background: rgba(249, 115, 22, 0.9) !important;
  border-color: rgba(249, 115, 22, 1) !important;
}

.leaflet-popup.zavady-popup .popup-button:hover {
  background: rgba(249, 115, 22, 1) !important;
  color: #ffffff !important;
}

/* Zavady popup on map */
.zavady-popup-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.zavady-popup-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.zavady-popup-header strong {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.4;
}

.zavady-popup-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.zavady-popup-category {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.zavady-popup-status {
  font-size: 12px;
  font-weight: 600;
}

.zavady-popup-date {
  font-size: 12px;
  color: var(--text-muted);
}

.zavady-popup-gallery {
  margin-top: 8px;
}

.zavady-popup-gallery-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.zavady-popup-gallery-thumbnails {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.zavady-popup-gallery-thumb-wrapper {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
}

.zavady-popup-gallery-thumb-loading {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(249, 115, 22, 0.2);
  border-radius: 8px;
  z-index: 1;
}

.zavady-popup-gallery-thumb-loading.hidden {
  display: none;
}

.zavady-popup-gallery-thumb-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(249, 115, 22, 0.2);
  border-top-color: rgba(249, 115, 22, 0.8);
  border-radius: 50%;
  animation: zavady-thumb-spin 0.8s linear infinite;
}

@keyframes zavady-thumb-spin {
  to {
    transform: rotate(360deg);
  }
}

.zavady-popup-gallery-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid rgba(249, 115, 22, 0.4);
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.05);
  display: block;
}

.zavady-popup-gallery-thumb:hover {
  transform: scale(1.1);
  border-color: #f97316;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
}

.zavady-table tbody tr:last-child td {
  border-bottom: none;
}

.zavady-category-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  transition: color 0.2s ease;
}

.zavady-category-link:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.zavady-status {
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Photo preview in table */
.zavady-photos-cell {
  padding: 8px 12px !important;
  vertical-align: middle;
}

.zavady-photos-preview {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  position: relative;
}

.zavady-photo-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid rgba(5, 150, 105, 0.4);
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.05);
}

.zavady-photos-preview:hover .zavady-photo-thumb {
  transform: scale(1.1);
  border-color: #059669;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
}

.zavady-photo-placeholder {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 2px solid rgba(5, 150, 105, 0.4);
}

.zavady-photo-icon {
  font-size: 20px;
  opacity: 0.6;
}

.zavady-photo-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: linear-gradient(135deg, #059669, #10b981);
  color: #ffffff;
  font-weight: 800;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 10px;
  border: 2px solid rgba(11, 18, 32, 0.9);
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
  min-width: 20px;
  text-align: center;
}

/* Photo gallery modal */
.zavady-photo-gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.zavady-photo-gallery-modal.hidden {
  display: none;
}

.zavady-photo-gallery-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}

.zavady-photo-gallery-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1200px;
  max-height: 90vh;
  background: linear-gradient(145deg, rgba(24, 38, 61, 0.98), rgba(12, 23, 41, 0.95));
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.zavady-photo-gallery-header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.zavady-photo-gallery-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: 0.3px;
}

.zavady-photo-gallery-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: white;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 20;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.zavady-photo-gallery-close:hover {
  background: rgba(220, 38, 38, 0.9);
  border-color: rgba(255, 255, 255, 0.6);
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.5);
}

.zavady-photo-gallery-main {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  max-height: 60vh;
  padding: 20px;
  background: rgba(0, 0, 0, 0.3);
}

.zavady-photo-gallery-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zavady-photo-gallery-loading.hidden {
  display: none;
}

.zavady-photo-gallery-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(5, 150, 105, 0.2);
  border-top-color: #10b981;
  border-radius: 50%;
  animation: zavady-gallery-spin 0.8s linear infinite;
}

@keyframes zavady-gallery-spin {
  to {
    transform: rotate(360deg);
  }
}

.zavady-photo-gallery-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  transition: opacity 0.3s ease, transform 0.3s ease;
  animation: fadeInImage 0.3s ease;
}

@keyframes fadeInImage {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse-marker {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.6);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.8);
  }
}

.zavady-photo-gallery-prev,
.zavady-photo-gallery-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: white;
  font-size: 32px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  padding: 0;
  margin: 0;
  text-align: center;
}

.zavady-photo-gallery-prev::before,
.zavady-photo-gallery-next::before {
  content: '';
  display: inline-block;
  height: 100%;
  vertical-align: middle;
}

.zavady-photo-gallery-prev,
.zavady-photo-gallery-next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.zavady-photo-gallery-prev > *,
.zavady-photo-gallery-next > * {
  display: inline-block;
  vertical-align: middle;
  line-height: 1;
  margin: 0;
  padding: 0;
}

.zavady-photo-gallery-prev {
  left: 24px;
}

.zavady-photo-gallery-next {
  right: 24px;
}

.zavady-photo-gallery-prev:hover,
.zavady-photo-gallery-next:hover {
  background: rgba(5, 150, 105, 0.9);
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(calc(-50% - 1px)) scale(1.15);
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.5);
}

.zavady-photo-gallery-thumbnails {
  display: flex;
  gap: 12px;
  padding: 20px 24px;
  overflow-x: auto;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  justify-content: center;
}

.zavady-photo-thumbnail {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 10px;
  border: 3px solid var(--border);
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
  opacity: 0.65;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.zavady-photo-thumbnail:hover {
  opacity: 1;
  transform: scale(1.08) translateY(-2px);
  border-color: rgba(5, 150, 105, 0.6);
  box-shadow: 0 4px 16px rgba(5, 150, 105, 0.3);
}

.zavady-photo-thumbnail.active {
  opacity: 1;
  border-color: #059669;
  border-width: 3px;
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.6);
  transform: scale(1.1) translateY(-3px);
}

.zavady-photo-gallery-info {
  padding: 12px 24px;
  text-align: center;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.zavady-photo-gallery-counter {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
}

/* Light theme for photo gallery */
:root[data-theme="light"] .zavady-photo-gallery-content {
  background: linear-gradient(145deg, #ffffff, #f8fafc);
  border-color: rgba(15, 23, 42, 0.15);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.3);
}

:root[data-theme="light"] .zavady-photo-gallery-header {
  border-bottom-color: rgba(15, 23, 42, 0.1);
}

:root[data-theme="light"] .zavady-photo-gallery-header h3 {
  color: #0b1220;
}

:root[data-theme="light"] .zavady-photo-gallery-close {
  background: rgba(15, 23, 42, 0.05);
  border-color: rgba(15, 23, 42, 0.15);
  color: #0b1220;
}

:root[data-theme="light"] .zavady-photo-gallery-main {
  background: rgba(15, 23, 42, 0.05);
}

:root[data-theme="light"] .zavady-photo-gallery-thumbnails {
  border-top-color: rgba(15, 23, 42, 0.1);
  background: rgba(15, 23, 42, 0.03);
}

:root[data-theme="light"] .zavady-photo-gallery-info {
  border-top-color: rgba(15, 23, 42, 0.1);
  background: rgba(15, 23, 42, 0.03);
}

:root[data-theme="light"] .zavady-photo-gallery-counter {
  color: #475569;
}

:root[data-theme="light"] .zavady-photo-gallery-spinner {
  border-color: rgba(5, 150, 105, 0.15);
  border-top-color: #059669;
}

:root[data-theme="light"] .zavady-photo-thumb {
  border-color: rgba(5, 150, 105, 0.4);
  background: #ffffff;
}

:root[data-theme="light"] .zavady-photos-preview:hover .zavady-photo-thumb {
  border-color: #059669;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

:root[data-theme="light"] .zavady-photo-placeholder {
  background: #f1f5f9;
  border-color: rgba(5, 150, 105, 0.4);
}

/* Mobile styles for photo gallery */
@media (max-width: 960px) {
  .zavady-photo-gallery-modal {
    padding: 0;
  }
  
  .zavady-photo-gallery-content {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
  
  .zavady-photo-gallery-main {
    min-height: 300px;
    max-height: 50vh;
    padding: 12px;
  }
  
  .zavady-photo-gallery-close {
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    font-size: 26px;
  }
  
  .zavady-photo-gallery-prev,
  .zavady-photo-gallery-next {
    width: 48px;
    height: 48px;
    font-size: 28px;
    line-height: 1;
  }
  
  .zavady-photo-gallery-prev {
    left: 12px;
  }
  
  .zavady-photo-gallery-next {
    right: 12px;
  }
  
  .zavady-photo-thumbnail {
    width: 70px;
    height: 70px;
  }
  
  .zavady-photo-thumb {
    width: 40px;
    height: 40px;
  }
  
  .zavady-photo-count {
    font-size: 10px;
    padding: 1px 4px;
    min-width: 18px;
  }
}

/* Light theme for zavady */
:root[data-theme="light"] .zavady-table {
  background: linear-gradient(145deg, #ffffff, #f8fafc);
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

:root[data-theme="light"] .zavady-table thead {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.1), rgba(5, 150, 105, 0.08));
}

:root[data-theme="light"] .zavady-table th {
  color: #0b1220;
  border-bottom-color: rgba(15, 23, 42, 0.15);
}

:root[data-theme="light"] .zavady-table th.sortable:hover {
  background: rgba(5, 150, 105, 0.1);
  color: #059669;
}

:root[data-theme="light"] .sort-icon.sort-active {
  color: #059669;
}

:root[data-theme="light"] .zavady-table td {
  color: #0b1220;
  border-bottom-color: rgba(15, 23, 42, 0.08);
}

:root[data-theme="light"] .zavady-table tbody tr:hover {
  background: rgba(2, 132, 199, 0.06);
}

:root[data-theme="light"] .zavady-category-link {
  color: #059669;
}

:root[data-theme="light"] .zavady-category-link:hover {
  color: #047857;
}

/* Mobile styles for zavady table */
@media (max-width: 960px) {
  .zavady-view {
    padding: 12px;
    overflow-x: hidden;
  }
  
  .zavady-table-container {
    margin: 12px -12px 0;
    padding: 0 12px;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    max-width: 100vw;
    position: relative;
  }

  .zavady-table {
    font-size: 11px;
    min-width: 600px;
    width: 100%;
  }

  .zavady-table th {
    padding: 8px 6px;
    font-size: 10px;
    white-space: nowrap;
  }

  .zavady-table td {
    padding: 8px 6px;
    font-size: 11px;
    word-break: break-word;
    max-width: 120px;
  }
  
  .zavady-table th:first-child,
  .zavady-table td:first-child {
    position: sticky;
    left: 0;
    background: inherit;
    z-index: 5;
    min-width: 80px;
  }
  
  .zavady-table thead th:first-child {
    z-index: 15;
  }

  .sort-icon {
    font-size: 10px;
    margin-left: 4px;
  }
  
  .zavady-category-link {
    font-size: 11px;
    white-space: nowrap;
  }
  
  .zavady-status {
    font-size: 10px;
    white-space: nowrap;
  }
}

/* Light theme for lamp report form */
:root[data-theme="light"] .lamp-report-form {
  background: linear-gradient(145deg, #ffffff, #f8fafc);
  border-color: rgba(249, 115, 22, 0.25);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(249, 115, 22, 0.15);
}

:root[data-theme="light"] .popup-form-input,
:root[data-theme="light"] .popup-form-textarea {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.15);
  color: #0b1220;
}

:root[data-theme="light"] .popup-form-input:hover,
:root[data-theme="light"] .popup-form-textarea:hover {
  border-color: rgba(249, 115, 22, 0.4);
}

:root[data-theme="light"] .popup-form-input:focus,
:root[data-theme="light"] .popup-form-textarea:focus {
  border-color: #f97316;
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.25), 0 4px 12px rgba(249, 115, 22, 0.2);
}

@media (max-width: 960px) {
  .kriminalita-view {
    padding: 12px;
  }
  
  .kriminalita-item {
    padding: 14px;
  }
  
  .kriminalita-item-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .kriminalita-title {
    font-size: 16px;
  }
}

@media (min-width: 961px) {
  .menu-button {
    display: none;
  }
}

.footer-note {
  padding: 12px 16px 16px;
  color: var(--text-muted);
  background: var(--panel);
  border-top: 1px solid var(--border);
  font-size: 13px;
}
