/* CornellCameras — Design System */
/* Color system, layout, components — no frameworks, no shadows, no gradients */

/* ─── Custom properties ──────────────────────────────────────────────────── */
:root {
  --carnelian:   #B31B1B;
  --white:       #FFFFFF;
  --dark-gray:   #222222;
  --warm-gray:   #A2998B;
  --sage-gray:   #9FAD9F;
  --blue:        #006699;
  --green:       #4B7B36;
  --light-green: #6EB43F;
  --orange:      #D97800;
  --red:         #EF3E33;
  --dark-teal:   #003B49;
  --light-gray:  #F7F7F7;
  --border:      #DEDBD7;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --header-h: 48px;
  --info-h: 36px;
  --radius: 3px;
  --transition: 160ms ease;
}

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

html, body {
  height: 100%;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--dark-gray);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--carnelian); }
a:focus-visible { outline: 2px solid var(--carnelian); outline-offset: 2px; }

button {
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  border: none;
  background: none;
}
button:focus-visible { outline: 2px solid var(--carnelian); outline-offset: 2px; }

input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--dark-gray);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--carnelian);
  outline-offset: -1px;
}

/* ─── Header ─────────────────────────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--dark-gray);
  display: flex;
  align-items: center;
  gap: 0;
  z-index: 1000;
  border-bottom: 2px solid var(--carnelian);
}

.site-name {
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0 16px;
  flex-shrink: 0;
}

.header-nav {
  display: flex;
  align-items: stretch;
  height: 100%;
  flex: 1;
}

.tab-btn {
  height: 100%;
  padding: 0 18px;
  color: var(--warm-gray);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-right: 1px solid #333;
  transition: color var(--transition), background var(--transition);
}
.tab-btn:hover { color: var(--white); }
.tab-btn.active {
  color: var(--white);
  background: var(--carnelian);
}
.tab-btn:focus-visible { outline: 2px solid var(--white); outline-offset: -3px; }

.header-actions {
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  margin-left: auto;
}

/* ─── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  min-height: 36px;
}
.btn:focus-visible { outline: 2px solid var(--carnelian); outline-offset: 2px; }

.btn-primary {
  background: var(--carnelian);
  color: var(--white);
}
.btn-primary:hover { background: #991515; }

.btn-secondary {
  background: var(--white);
  color: var(--dark-gray);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--light-gray); }

.btn-ghost {
  background: transparent;
  color: var(--dark-gray);
  padding: 6px 10px;
}
.btn-ghost:hover { background: var(--light-gray); }

.btn-danger {
  background: var(--red);
  color: var(--white);
}
.btn-danger:hover { background: #c5231a; }

.btn-sm { padding: 5px 10px; font-size: 12px; min-height: 28px; }

/* ─── Main layout ────────────────────────────────────────────────────────── */
.main-content {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  bottom: var(--info-h);
  overflow: hidden;
}

.view {
  position: absolute;
  inset: 0;
  display: none;
}
.view.active { display: block; }

/* ─── Map ─────────────────────────────────────────────────────────────────── */
#map {
  width: 100%;
  height: 100%;
  background: var(--light-gray);
}

/* Override Leaflet's default ocean-blue background when tiles are loading */
.leaflet-container { background: var(--light-gray) !important; }

/* Leaflet zoom controls — match design system */
.leaflet-control-zoom {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  overflow: hidden;
}
.leaflet-control-zoom a {
  width: 32px !important;
  height: 32px !important;
  line-height: 32px !important;
  color: var(--dark-gray) !important;
  background: var(--white) !important;
  border-bottom: 1px solid var(--border) !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  box-shadow: none !important;
  text-indent: 0 !important;
}
.leaflet-control-zoom a:last-child { border-bottom: none !important; }
.leaflet-control-zoom a:hover { background: var(--light-gray) !important; color: var(--dark-gray) !important; }
.leaflet-control-zoom-in  { border-radius: 0 !important; }
.leaflet-control-zoom-out { border-radius: 0 !important; }
/* Remove Leaflet's default box shadow on all controls */
.leaflet-bar { box-shadow: none !important; }

.map-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.map-control-btn {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--dark-gray);
  box-shadow: none;
  transition: background var(--transition);
}
.map-control-btn:hover { background: var(--light-gray); }
.map-control-btn.active { background: var(--dark-gray); color: var(--white); border-color: var(--dark-gray); }

/* ─── Camera pins ─────────────────────────────────────────────────────────── */
.camera-pin {
  width: 28px;
  height: 28px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(0,0,0,0.2);
}
.camera-pin-outdoor { background: var(--blue); }
.camera-pin-indoor  { background: var(--orange); }

.cluster-pin {
  background: var(--dark-gray);
  color: var(--white);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  border: 2px solid var(--white);
}

/* ─── Map popup ──────────────────────────────────────────────────────────── */
.leaflet-popup-content-wrapper {
  border-radius: var(--radius) !important;
  box-shadow: none !important;
  border: 1px solid var(--border);
}
.leaflet-popup-tip-container { display: none; }

.popup-content { padding: 4px 0; }
.popup-building { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.popup-meta { color: var(--warm-gray); font-size: 12px; }
.popup-note { margin-top: 6px; font-size: 13px; }
.popup-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  margin-left: 6px;
}
.badge-outdoor { background: #E5F2FA; color: var(--blue); }
.badge-indoor  { background: #FDF3E3; color: var(--orange); }

/* ─── List view ──────────────────────────────────────────────────────────── */
#view-list {
  overflow-y: auto;
  background: var(--white);
}

.list-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 16px;
}

.list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.list-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--warm-gray);
  border-bottom: 2px solid var(--border);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.list-table th:hover { color: var(--dark-gray); }
.list-table th.sort-asc::after  { content: ' ↑'; }
.list-table th.sort-desc::after { content: ' ↓'; }

.list-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.list-table tr:last-child td { border-bottom: none; }
.list-table tr:hover td { background: var(--light-gray); }

.list-empty {
  text-align: center;
  padding: 48px 0;
  color: var(--warm-gray);
  font-size: 14px;
}

/* ─── Submission form panel ──────────────────────────────────────────────── */
.form-overlay {
  position: fixed;
  inset: 0;
  background: rgba(34,34,34,0.5);
  z-index: 2000;
  display: none;
}
.form-overlay.open { display: block; }

.form-panel {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--white);
  border-top: 2px solid var(--carnelian);
  z-index: 2001;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 240ms ease;
}
.form-panel.open { transform: translateY(0); }

.form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--white);
}
.form-title { font-size: 16px; font-weight: 600; }
.form-close { color: var(--warm-gray); font-size: 20px; line-height: 1; padding: 4px; }
.form-close:hover { color: var(--dark-gray); }

.form-body { padding: 20px; }

/* ─── Form fields ─────────────────────────────────────────────────────────── */
.field { margin-bottom: 16px; }
.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--warm-gray);
  margin-bottom: 6px;
}
.field-required::after { content: ' *'; color: var(--carnelian); }

.field-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--dark-gray);
  transition: border-color var(--transition);
}
.field-input:focus { border-color: var(--carnelian); outline: none; }

.field-select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--dark-gray);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23A2998B'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 30px;
}
.field-select:focus { border-color: var(--carnelian); outline: none; }

.field-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  resize: vertical;
  min-height: 72px;
}
.field-textarea:focus { border-color: var(--carnelian); outline: none; }

.char-count { font-size: 11px; color: var(--warm-gray); text-align: right; margin-top: 3px; }
.char-count.over { color: var(--red); }

/* ─── Toggle switch (indoor/outdoor) ─────────────────────────────────────── */
.type-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.type-toggle-btn {
  flex: 1;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--warm-gray);
  background: var(--white);
  transition: background var(--transition), color var(--transition);
  border-right: 1px solid var(--border);
}
.type-toggle-btn:last-child { border-right: none; }
.type-toggle-btn.active[data-value="outdoor"] { background: var(--blue);   color: var(--white); }
.type-toggle-btn.active[data-value="indoor"]  { background: var(--orange); color: var(--white); }
.type-toggle-btn:focus-visible { outline: 2px solid var(--carnelian); outline-offset: -2px; }

/* ─── Photo upload ────────────────────────────────────────────────────────── */
.photo-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition);
}
.photo-upload-area:hover,
.photo-upload-area.drag-over { border-color: var(--carnelian); }
.photo-upload-area.has-file  { border-color: var(--green); border-style: solid; }

.photo-upload-icon { font-size: 28px; margin-bottom: 8px; }
.photo-upload-text { font-size: 13px; color: var(--warm-gray); }
.photo-upload-sub  { font-size: 11px; color: var(--sage-gray); margin-top: 4px; }
.photo-preview { max-width: 100%; max-height: 140px; border-radius: var(--radius); margin-top: 10px; }
#photo-input { display: none; }

/* ─── Consent checkbox ───────────────────────────────────────────────────── */
.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.5;
  color: var(--dark-gray);
  padding: 12px;
  background: var(--light-gray);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.consent-label input[type="checkbox"] {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--carnelian);
}

/* ─── GPS error ──────────────────────────────────────────────────────────── */
.gps-error {
  background: #FFF5F5;
  border: 1px solid var(--red);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--dark-gray);
  margin-bottom: 14px;
  display: none;
}
.gps-error.visible { display: block; }
.gps-error strong { color: var(--red); }

/* ─── Status messages ────────────────────────────────────────────────────── */
.status-msg {
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
}
.status-msg.visible { display: block; }
.status-msg.success { background: #F0F7EC; border: 1px solid var(--green); color: #2a5a1a; }
.status-msg.error   { background: #FFF5F5; border: 1px solid var(--red);   color: #8b1515; }

.loading-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--warm-gray);
}
.spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--carnelian);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Info tab ───────────────────────────────────────────────────────────── */
.info-tab-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--info-h);
  z-index: 1000;
  display: flex;
  align-items: stretch;
  background: var(--dark-gray);
}

.info-tab-btn {
  background: var(--dark-gray);
  color: var(--white);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  transition: background var(--transition);
}
.info-tab-btn:hover { background: #333; }
.info-tab-btn:focus-visible { outline: 2px solid var(--carnelian); outline-offset: -2px; }

.info-panel {
  position: fixed;
  bottom: var(--info-h);
  left: 0; right: 0;
  background: var(--white);
  border-top: 2px solid var(--carnelian);
  padding: 16px 20px;
  z-index: 999;
  transform: translateY(100%);
  visibility: hidden;
  transition: transform var(--transition), visibility var(--transition);
}
.info-panel.open { transform: translateY(0); visibility: visible; }
.info-panel a { font-size: 15px; color: var(--carnelian); }

@media (min-width: 640px) {
  .info-tab-bar { left: auto; right: 0; width: auto; }
  .info-panel   { left: auto; right: 0; width: 280px; }
}

/* ─── Admin login ─────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--light-gray);
}

.login-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-top: 3px solid var(--carnelian);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 360px;
}
.login-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.login-sub   { font-size: 13px; color: var(--warm-gray); margin-bottom: 24px; }

/* ─── Admin dashboard ─────────────────────────────────────────────────────── */
.admin-wrap {
  display: none;
  flex-direction: column;
  height: 100vh;
}
.admin-wrap.active { display: flex; }

.admin-header {
  height: var(--header-h);
  background: var(--dark-gray);
  border-bottom: 2px solid var(--carnelian);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 16px;
  flex-shrink: 0;
}
.admin-header-name { color: var(--white); font-size: 15px; font-weight: 600; }
.admin-badge {
  background: var(--carnelian);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 10px;
}
.admin-header-actions { margin-left: auto; display: flex; gap: 8px; }

.timeline-bar {
  background: var(--light-gray);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  flex-shrink: 0;
}
.timeline-label { font-size: 11px; font-weight: 600; color: var(--warm-gray); letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 6px; }
.timeline-controls { display: flex; align-items: center; gap: 12px; }
.timeline-scrubber { flex: 1; accent-color: var(--carnelian); height: 4px; }
.timeline-date { font-size: 12px; font-weight: 500; min-width: 90px; text-align: right; }

.admin-panels {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
}

/* ── Left: camera list ── */
.panel-list {
  width: 260px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-list-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.panel-list-count { font-size: 12px; color: var(--warm-gray); }
.panel-list-body  { flex: 1; overflow-y: auto; }

/* ── Center: map ── */
.panel-map { flex: 1; position: relative; min-width: 0; }
#admin-map { width: 100%; height: 100%; background: var(--light-gray); }

.place-mode-hint {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30, 30, 30, 0.82);
  color: var(--white);
  padding: 6px 10px 6px 14px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 500;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  pointer-events: auto;
}

/* ── Right: zones panel ── */
.panel-zones {
  width: 248px;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--white);
}

.panel-zones-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 6px;
}
.panel-zones-title { font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--warm-gray); }
.zone-add-btns { display: flex; gap: 5px; }

.zone-add-btn.inclusion { background: #EBF4E7; color: var(--green); border: 1px solid #c5ddb9; }
.zone-add-btn.inclusion:hover { background: #daefd3; }
.zone-add-btn.exclusion { background: #FDECEA; color: var(--red); border: 1px solid #f5b9b5; }
.zone-add-btn.exclusion:hover { background: #fad7d5; }
.zone-add-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Zone draw/edit mode UI */
.zone-mode-ui {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--light-gray);
  flex-shrink: 0;
}
.zone-mode-badge {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}
.zone-mode-hint {
  font-size: 11px;
  color: var(--warm-gray);
  line-height: 1.5;
  margin-bottom: 6px;
}
.zone-mode-stat {
  font-size: 12px;
  color: var(--dark-gray);
  margin-bottom: 2px;
}
.zone-mode-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

/* Zone list */
.zones-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
.zones-empty {
  padding: 20px 14px;
  font-size: 12px;
  color: var(--warm-gray);
  line-height: 1.6;
}

.zone-item {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.zone-item:last-child { border-bottom: none; }
.zone-item-info {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
  min-width: 0;
}
.zone-type-pill {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 10px;
  flex-shrink: 0;
}
.zone-type-pill.inclusion { background: #EBF4E7; color: var(--green); }
.zone-type-pill.exclusion { background: #FDECEA; color: var(--red); }
.zone-item-label { font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.zone-item-pts   { font-size: 11px; color: var(--warm-gray); flex-shrink: 0; margin-left: auto; }
.zone-item-actions { display: flex; gap: 5px; }
.zone-del-btn { color: var(--warm-gray); font-size: 13px; }
.zone-del-btn:hover { color: var(--red); }

/* Zone legend */
.zone-legend {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.zone-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--warm-gray);
  margin-bottom: 4px;
}
.zone-legend-item:last-child { margin-bottom: 0; }
.zone-legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.zone-legend-dot.inclusion { background: var(--green); }
.zone-legend-dot.exclusion { background: var(--red); }

/* Draggable point handle */
.zone-point-handle div {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2.5px solid var(--white);
  cursor: grab;
}
.zone-point-handle div:active { cursor: grabbing; }

/* ─── Camera list rows ───────────────────────────────────────────────────── */
.camera-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.camera-row:hover { background: var(--light-gray); }
.camera-row.pending { opacity: 0.6; }

.camera-thumb {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: var(--light-gray);
  border: 1px solid var(--border);
  object-fit: cover;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--warm-gray);
  font-size: 18px;
}
.camera-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); }

.camera-info { flex: 1; min-width: 0; }
.camera-building { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.camera-meta    { font-size: 11px; color: var(--warm-gray); margin-top: 2px; }
.camera-note    { font-size: 12px; margin-top: 3px; color: var(--dark-gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.camera-actions { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }

.status-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.status-live    { background: #F0F7EC; color: var(--green); }
.status-pending { background: var(--light-gray); color: var(--warm-gray); }

/* ─── Edit modal ─────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(34,34,34,0.55);
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--white);
  border: 1px solid var(--border);
  border-top: 3px solid var(--carnelian);
  border-radius: var(--radius);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--white);
}
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close { color: var(--warm-gray); font-size: 20px; line-height: 1; }
.modal-close:hover { color: var(--dark-gray); }

.modal-body { padding: 20px; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: var(--white);
  position: sticky;
  bottom: 0;
}

/* ─── Delete confirmation ────────────────────────────────────────────────── */
.delete-confirm-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--red);
  border-radius: var(--radius);
  margin-top: 8px;
  font-family: var(--font-mono);
}

/* ─── Photo modal ────────────────────────────────────────────────────────── */
.photo-modal-img {
  width: 100%;
  border-radius: var(--radius);
  display: block;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (min-width: 640px) {
  .form-panel { max-width: 480px; left: auto; border-left: 1px solid var(--border); }
}

/* Tablet: collapse zones panel under map */
@media (max-width: 900px) {
  .panel-list  { width: 220px; }
  .panel-zones { width: 210px; }
}

/* Mobile: stack all panels vertically */
@media (max-width: 680px) {
  .site-name { font-size: 13px; padding: 0 10px; }
  .tab-btn   { padding: 0 12px; font-size: 12px; }

  .admin-panels { flex-direction: column; }
  .panel-list  { width: 100%; flex-shrink: 0; border-right: none; border-bottom: 1px solid var(--border); max-height: 38vh; min-height: 0; }
  .panel-map   { min-height: 220px; flex: 1; }
  .panel-zones { width: 100%; flex-shrink: 0; border-left: none; border-top: 1px solid var(--border); max-height: 36vh; min-height: 0; }

  .zone-add-btns { flex-wrap: wrap; }
  .panel-zones-header { flex-wrap: wrap; gap: 8px; }
}
