/* ============================================
   CONNIE DOES THE WEATHER â€" Map Dashboard
   Surfline-inspired: map + sidebar + detail panel
   ============================================ */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0f1117;
  color: #e0e0e0;
  height: 100vh;
  overflow: hidden;
}

/* ---- Top bar ---- */
.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 1.25rem;
  background: #16181f;
  border-bottom: 1px solid #2a2d38;
  height: 48px;
  z-index: 50;
}

.topbar h1 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.topbar-date {
  font-size: 0.85rem;
  color: #666;
}

.topbar-btn {
  margin-left: auto;
  padding: 0.35rem 0.85rem;
  background: #22c55e;
  color: #000;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.topbar-btn:hover { background: #16a34a; }

.topbar-privacy {
  font-size: 0.75rem;
  color: #666;
  text-decoration: none;
  padding: 0.35rem 0.4rem;
}

.topbar-privacy:hover { color: #aaa; }

/* ---- App layout: sidebar + map ---- */
.app-layout {
  display: flex;
  height: calc(100vh - 48px);
}

/* ---- Sidebar ---- */
.sidebar {
  width: 340px;
  min-width: 340px;
  background: #12141b;
  border-right: 1px solid #2a2d38;
  overflow-y: auto;
  overflow-x: hidden;
}

.loading {
  color: #666;
  padding: 1.5rem;
  font-style: italic;
  font-size: 0.9rem;
}

/* ---- Search bar ---- */
.search-bar {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #1a1c25;
  position: sticky;
  top: 0;
  background: #12141b;
  z-index: 3;
}

.search-bar input {
  width: 100%;
  padding: 0.4rem 0.6rem;
  background: #1e2030;
  border: 1px solid #2a2d38;
  border-radius: 6px;
  color: #e0e0e0;
  font-size: 0.82rem;
  font-family: inherit;
  outline: none;
}

.search-bar input::placeholder { color: #555; }
.search-bar input:focus { border-color: #60a5fa; }

.sidebar-region.hidden,
.crag-item.hidden { display: none; }

.sidebar-region {
  padding: 0.6rem 1rem 0.3rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #555;
  position: sticky;
  top: 0;
  background: #12141b;
  z-index: 2;
}

/* ---- Sidebar crag items ---- */
.crag-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.6rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid #1a1c25;
  transition: background 0.1s;
}

.crag-item-top {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.crag-item-bottom {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-left: 1.6rem;
}

.crag-info-line {
  display: flex;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.crag-rain {
  font-size: 0.7rem;
  color: #60a5fa;
}

.crag-dry {
  font-size: 0.7rem;
  color: #f59e0b;
}

/* ---- Drying bar (always visible on collapsed card) ---- */
.crag-drying-bar {
  padding: 0.3rem 0 0 1.6rem;
}

/* ---- Expandable detail card ---- */
.crag-expand {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 0 0 1.6rem;
}

.crag-expand.open {
  max-height: 600px;
  padding: 0.5rem 0 0.5rem 1.6rem;
}

.expand-section {
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #1e2030;
}

.expand-section:last-of-type {
  border-bottom: none;
}

.expand-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
}

.expand-stat {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
}

.expand-stat .label { color: #666; }
.expand-stat .value { color: #ccc; font-weight: 500; }

.expand-reason {
  font-size: 0.75rem;
  color: #ccc;
  padding: 0.15rem 0;
}

.expand-warning {
  font-size: 0.75rem;
  color: #f59e0b;
  padding: 0.15rem 0;
}

.expand-forecast-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #555;
  margin-bottom: 0.3rem;
}

.expand-forecast-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.15rem 0;
  font-size: 0.72rem;
}

.expand-day { color: #aaa; min-width: 28px; }
.expand-temp { color: #ccc; min-width: 32px; }
.expand-rain { color: #60a5fa; min-width: 36px; }
.expand-rain.heavy { color: #ef4444; }
.expand-wind { color: #888; }

.expand-notes {
  font-size: 0.72rem;
  color: #666;
  padding-top: 0.3rem;
  line-height: 1.4;
}

.crag-item:hover {
  background: #1a1c25;
}

.crag-item.active {
  background: #1e2030;
  border-left: 3px solid #60a5fa;
}

.crag-item .status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.green { background: #22c55e; box-shadow: 0 0 6px rgba(34, 197, 94, 0.4); }
.status-dot.amber { background: #f59e0b; box-shadow: 0 0 6px rgba(245, 158, 11, 0.4); }
.status-dot.red { background: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.4); }

.crag-item .crag-name {
  font-size: 0.88rem;
  font-weight: 500;
  color: #ddd;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crag-item .crag-meta {
  font-size: 0.72rem;
  color: #666;
  white-space: nowrap;
}

.crag-item .crag-temp {
  font-size: 0.8rem;
  color: #aaa;
  min-width: 36px;
  text-align: right;
}

.crag-item .tag {
  font-size: 0.6rem;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 500;
}

.tidal-tag { background: rgba(96, 165, 250, 0.15); color: #60a5fa; }
.ban-tag { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

/* ---- Forecast dots in sidebar ---- */
.crag-forecast-dots {
  display: flex;
  gap: 2px;
  margin-left: auto;
}

.forecast-day-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 18px;
}

.forecast-day-label {
  font-size: 0.5rem;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1;
}

.forecast-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.forecast-dot.green { background: #22c55e; }
.forecast-dot.amber { background: #f59e0b; }
.forecast-dot.red { background: #ef4444; }

/* ---- Map ---- */
.map-container {
  flex: 1;
  position: relative;
}

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

/* Dark map tiles */
.leaflet-tile-pane { filter: brightness(0.7) contrast(1.1) saturate(0.3); }
.leaflet-container { background: #0f1117; }

/* ---- Crag overlay (large box over map) ---- */
.crag-overlay {
  display: none;
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  bottom: 20px;
  background: rgba(18, 20, 27, 0.96);
  border: 1px solid #2a2d38;
  border-radius: 12px;
  z-index: 500;
  overflow-y: auto;
  padding: 1.5rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

.crag-overlay.open { display: block; }

.crag-overlay-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: none;
  border: none;
  color: #666;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 1;
}

.crag-overlay-close:hover { color: #fff; }

/* Overlay header */
.overlay-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-right: 2rem;
}

.overlay-header .status-dot {
  width: 16px;
  height: 16px;
}

.overlay-header h2 {
  font-size: 1.3rem;
  color: #fff;
  margin: 0;
}

.overlay-header .overlay-rock {
  font-size: 0.75rem;
  color: #666;
  background: #252830;
  padding: 2px 8px;
  border-radius: 4px;
}

.overlay-header .overlay-tags {
  display: flex;
  gap: 0.3rem;
  margin-left: auto;
}

/* Today's conditions row */
.overlay-today {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.overlay-stat {
  background: #1e2030;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  min-width: 80px;
}

.overlay-stat .label {
  font-size: 0.65rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.overlay-stat .value {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin-top: 0.1rem;
}

/* Assessment */
.overlay-assessment {
  margin-bottom: 1rem;
}

.overlay-assessment .reason {
  font-size: 0.82rem;
  color: #ccc;
  padding: 0.2rem 0;
}

.overlay-assessment .reason::before { content: "→ "; color: #555; }

.overlay-assessment .warning {
  font-size: 0.82rem;
  color: #f59e0b;
  padding: 0.2rem 0;
}

.overlay-assessment .warning::before { content: "⚠ "; }

/* Drying section */
.overlay-drying {
  margin-bottom: 1rem;
}

/* Week grid */
.overlay-week-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #555;
  margin-bottom: 0.5rem;
}

.overlay-week {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.day-card {
  background: #1e2030;
  border-radius: 8px;
  padding: 0.6rem;
  border-left: 3px solid transparent;
}

.day-card.green { border-left-color: #22c55e; }
.day-card.amber { border-left-color: #f59e0b; }
.day-card.red { border-left-color: #ef4444; }

.day-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.day-card-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #ddd;
}

.day-card-date {
  font-size: 0.7rem;
  color: #666;
}

.day-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.6rem;
  font-size: 0.72rem;
  color: #aaa;
  margin-bottom: 0.3rem;
}

.day-card-rain { color: #60a5fa; }
.day-card-rain.heavy { color: #ef4444; }

.day-card-reason {
  font-size: 0.7rem;
  color: #888;
  line-height: 1.4;
}

/* ---- Day zoom view ---- */
.day-card.selected {
  outline: 2px solid #60a5fa;
  outline-offset: -2px;
}

.day-zoom {
  display: none;
  background: #161820;
  border: 1px solid #2a2d38;
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.day-zoom.open { display: block; }

.dayzoom-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.dayzoom-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  color: #fff;
}

.dayzoom-arrow {
  background: #1e2030;
  border: 1px solid #2a2d38;
  color: #aaa;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
  min-width: 70px;
  text-align: center;
}

.dayzoom-arrow:hover:not(.disabled) { background: #252830; color: #fff; }
.dayzoom-arrow.disabled { opacity: 0.3; cursor: default; }

.dayzoom-summary {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.dayzoom-assessment {
  margin-bottom: 0.75rem;
}

.dayzoom-reason {
  font-size: 0.82rem;
  color: #ccc;
  margin-bottom: 0.3rem;
}

.dayzoom-note {
  font-size: 0.78rem;
  color: #f59e0b;
  padding: 0.15rem 0;
}

.dayzoom-note::before { content: "• "; color: #666; }

/* Hourly table */
.dayzoom-hourly {
  font-size: 0.75rem;
}

.hourly-header {
  display: flex;
  align-items: center;
  padding: 0.3rem 0;
  border-bottom: 1px solid #2a2d38;
  color: #555;
  font-weight: 500;
}

.hourly-row {
  display: flex;
  align-items: center;
  padding: 0.25rem 0;
  border-bottom: 1px solid #1a1c25;
}

.hourly-row:hover { background: #1e2030; }

.hourly-time { width: 50px; color: #888; }
.hourly-temp { width: 35px; color: #ccc; font-weight: 500; }

.hourly-rain-cell {
  width: 80px;
  position: relative;
  display: flex;
  align-items: center;
}

.hourly-wind-cell {
  width: 70px;
  position: relative;
  display: flex;
  align-items: center;
}

.hourly-bar {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  border-radius: 2px;
  opacity: 0.25;
}

.rain-bar { background: #60a5fa; }
.wind-bar { background: #a78bfa; }

.hourly-val {
  position: relative;
  z-index: 1;
  color: #aaa;
}

.hourly-val.light { color: #60a5fa; }
.hourly-val.heavy { color: #ef4444; }

.hourly-gust { width: 40px; color: #888; }
.hourly-hum { width: 40px; color: #888; }

/* Notes/info bar at bottom */
.overlay-info {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.overlay-info-block {
  font-size: 0.75rem;
  color: #888;
  background: #1e2030;
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  line-height: 1.4;
  flex: 1;
  min-width: 200px;
}

.overlay-info-block.tidal { border-left: 3px solid #60a5fa; }
.overlay-info-block.ban { border-left: 3px solid #ef4444; }

/* ---- Map popup card ---- */
.crag-popup-wrapper .leaflet-popup-content-wrapper {
  background: #1a1c25;
  color: #e0e0e0;
  border-radius: 10px;
  border: 1px solid #2a2d38;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  padding: 0;
}

.crag-popup-wrapper .leaflet-popup-tip {
  background: #1a1c25;
  border: 1px solid #2a2d38;
}

.crag-popup-wrapper .leaflet-popup-close-button {
  color: #666 !important;
  font-size: 18px !important;
  top: 6px !important;
  right: 8px !important;
}

.crag-popup-wrapper .leaflet-popup-close-button:hover {
  color: #fff !important;
}

.crag-popup-wrapper .leaflet-popup-content {
  margin: 0 !important;
}

.map-popup {
  padding: 0.75rem;
  font-size: 0.82rem;
}

.popup-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.popup-header strong {
  color: #fff;
  font-size: 0.9rem;
}

.popup-rock {
  font-size: 0.7rem;
  color: #666;
  background: #252830;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: auto;
}

.popup-stats {
  display: flex;
  gap: 0.6rem;
  font-size: 0.75rem;
  color: #aaa;
  margin-bottom: 0.4rem;
}

.popup-rain {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}

.popup-rain-since {
  font-size: 0.75rem;
  color: #60a5fa;
}

.popup-dry-time {
  font-size: 0.75rem;
  color: #f59e0b;
}

.popup-reason {
  font-size: 0.75rem;
  color: #ccc;
  margin-bottom: 0.2rem;
}

.popup-warning {
  font-size: 0.72rem;
  color: #f59e0b;
  margin-bottom: 0.4rem;
}

.popup-forecast {
  display: flex;
  gap: 3px;
  margin-bottom: 0.5rem;
}

.popup-dot {
  font-size: 0.5rem;
  padding: 2px 4px;
  border-radius: 3px;
  color: #fff;
  text-transform: uppercase;
}

.popup-dot.green { background: rgba(34, 197, 94, 0.3); color: #22c55e; }
.popup-dot.amber { background: rgba(245, 158, 11, 0.3); color: #f59e0b; }
.popup-dot.red { background: rgba(239, 68, 68, 0.3); color: #ef4444; }

.popup-more-btn {
  width: 100%;
  padding: 0.4rem;
  background: #252830;
  color: #aaa;
  border: 1px solid #3a3d48;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.1s;
}

.popup-more-btn:hover {
  background: #2a2d38;
  color: #fff;
}

/* ---- Map legend ---- */
.map-legend {
  background: rgba(18, 20, 27, 0.92);
  border: 1px solid #2a2d38;
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  font-size: 0.75rem;
  line-height: 1.6;
}

.legend-title {
  font-weight: 600;
  color: #aaa;
  margin-bottom: 0.3rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #999;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-dot.green { background: #22c55e; }
.legend-dot.amber { background: #f59e0b; }
.legend-dot.red { background: #ef4444; }

/* ---- Cluster markers ---- */
.cluster-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  padding: 3px 8px;
  cursor: pointer;
  transition: transform 0.15s;
}

.cluster-marker:hover { transform: scale(1.1); }

.cluster-marker.green { background: rgba(34, 197, 94, 0.85); }
.cluster-marker.amber { background: rgba(245, 158, 11, 0.85); }
.cluster-marker.red { background: rgba(239, 68, 68, 0.85); }

.cluster-count {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.cluster-label {
  font-size: 0.55rem;
  color: rgba(255, 255, 255, 0.85);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1;
  margin-top: 1px;
  white-space: nowrap;
}

/* Override default MarkerCluster styles */
.marker-cluster { background: none !important; }
.marker-cluster div { background: none !important; }

/* Custom map markers */
.crag-marker {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: transform 0.15s;
}

.crag-marker:hover {
  transform: scale(1.4);
  z-index: 1000 !important;
}

.crag-marker.green { background: #22c55e; box-shadow: 0 0 10px rgba(34, 197, 94, 0.5); }
.crag-marker.amber { background: #f59e0b; box-shadow: 0 0 10px rgba(245, 158, 11, 0.5); }
.crag-marker.red { background: #ef4444; box-shadow: 0 0 10px rgba(239, 68, 68, 0.5); }

.crag-marker.active {
  transform: scale(1.5);
  border-color: #fff;
  z-index: 1000 !important;
}

/* Map marker tooltip */
.crag-tooltip {
  background: #1a1c25 !important;
  color: #e0e0e0 !important;
  border: 1px solid #2a2d38 !important;
  border-radius: 6px !important;
  padding: 0.4rem 0.6rem !important;
  font-size: 0.8rem !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

.crag-tooltip .leaflet-tooltip-tip {
  border-top-color: #1a1c25 !important;
}

/* ---- Detail panel (slides from right) ---- */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 100;
}

.overlay.active { display: block; }

.detail-panel {
  position: fixed;
  top: 0;
  right: -500px;
  width: 460px;
  max-width: 90vw;
  height: 100vh;
  background: #16181f;
  z-index: 101;
  overflow-y: auto;
  transition: right 0.3s ease;
  padding: 2rem;
  border-left: 1px solid #2a2d38;
}

.detail-panel.active { right: 0; }

.close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: #888;
  font-size: 1.5rem;
  cursor: pointer;
}

.close-btn:hover { color: #fff; }

.detail-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.detail-status .status-dot {
  width: 16px;
  height: 16px;
}

.detail-status h2 {
  font-size: 1.3rem;
  color: #fff;
}

.detail-section {
  margin-bottom: 1.5rem;
}

.detail-section h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #555;
  margin-bottom: 0.5rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
}

.detail-stat {
  background: #1e2030;
  border-radius: 8px;
  padding: 0.6rem;
}

.detail-stat .label {
  font-size: 0.7rem;
  color: #666;
}

.detail-stat .value {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin-top: 0.15rem;
}

.detail-reasons { list-style: none; }

.detail-reasons li {
  padding: 0.35rem 0;
  font-size: 0.85rem;
  color: #ccc;
}

.detail-reasons li::before { content: "→ "; color: #555; }
.detail-warnings li::before { content: "⚠ "; color: #f59e0b; }

.detail-notes {
  font-size: 0.82rem;
  color: #999;
  background: #1e2030;
  border-radius: 8px;
  padding: 0.6rem;
  line-height: 1.5;
}

/* ---- Forecast table ---- */
.forecast-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.forecast-table th {
  text-align: left;
  color: #555;
  font-weight: 500;
  padding: 0.35rem 0.4rem;
  border-bottom: 1px solid #2a2d38;
}

.forecast-table td {
  padding: 0.35rem 0.4rem;
  color: #ccc;
  border-bottom: 1px solid #1a1c25;
}

.forecast-rain { color: #60a5fa; font-weight: 500; }
.forecast-rain.heavy { color: #ef4444; }

.forecast-reason-row td { border-bottom: 1px solid #1e2030 !important; }
.forecast-reasons { font-size: 0.72rem; color: #666; padding-bottom: 0.2rem; }

.status-dot-small {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot-small.green { background: #22c55e; }
.status-dot-small.amber { background: #f59e0b; }
.status-dot-small.red { background: #ef4444; }

/* ---- Drying bar ---- */
.drying-bar-container {
  background: #1e2030;
  border-radius: 6px;
  height: 8px;
  overflow: hidden;
}

.drying-bar {
  height: 100%;
  border-radius: 6px;
  transition: width 0.5s;
}

.drying-bar.green { background: #22c55e; }
.drying-bar.amber { background: #f59e0b; }
.drying-bar.red { background: #ef4444; }

.drying-label {
  font-size: 0.72rem;
  color: #666;
  margin-top: 0.25rem;
}

/* ---- Log entries ---- */
.log-entry {
  background: #1e2030;
  border-radius: 8px;
  padding: 0.6rem;
  margin-bottom: 0.4rem;
}

.log-entry .log-date { font-size: 0.75rem; color: #666; }
.log-entry .log-status {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.log-entry .log-status.green { background: rgba(34, 197, 94, 0.2); color: #22c55e; }
.log-entry .log-status.amber { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.log-entry .log-status.red { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.log-entry .log-notes { font-size: 0.82rem; color: #aaa; margin-top: 0.2rem; }

/* ---- Log modal ---- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
}

.modal-overlay.active { display: block; }

.modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #16181f;
  border: 1px solid #2a2d38;
  border-radius: 16px;
  padding: 1.75rem;
  width: 400px;
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  z-index: 10001;
}

.modal.active { display: block; }
.modal h2 { color: #fff; margin-bottom: 1rem; font-size: 1.1rem; }

.modal label {
  display: block;
  font-size: 0.82rem;
  color: #888;
  margin-bottom: 0.25rem;
  margin-top: 0.65rem;
}

.modal label:first-of-type { margin-top: 0; }

.modal select,
.modal input,
.modal textarea {
  width: 100%;
  padding: 0.45rem 0.65rem;
  background: #1e2030;
  border: 1px solid #3a3d48;
  border-radius: 8px;
  color: #e0e0e0;
  font-size: 0.85rem;
  font-family: inherit;
}

.modal textarea { resize: vertical; }

.btn-submit {
  margin-top: 1rem;
  width: 100%;
  padding: 0.55rem;
  background: #22c55e;
  color: #000;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-submit:hover { background: #16a34a; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .app-layout { flex-direction: column; }
  .sidebar {
    width: 100%;
    min-width: 100%;
    height: 45vh;
    border-right: none;
    border-bottom: 1px solid #2a2d38;
  }
  .map-container { height: 55vh; }
  .detail-panel { width: 100vw; }
}
