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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f1f5f9;
}

/* ─── Top bar ────────────────────────────────────────────────────────────── */
#top-bar {
  background: #1e293b;
  color: #fff;
  padding: 0 16px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  z-index: 10;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.logo {
  font-weight: 700;
  font-size: 14px;
  color: #f1f5f9;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.filters { display: flex; gap: 8px; }

.filters select {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #475569;
  background: #334155;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  min-width: 160px;
}

.filters select:disabled { opacity: 0.45; cursor: not-allowed; }
.filters select option { background: #334155; }

.btn-map-style {
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid #475569;
  background: #334155;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.btn-map-style:hover  { background: #475569; color: #fff; }
.btn-map-style.active { background: #f97316; border-color: #f97316; color: #fff; }

#coord-search {
  display: flex;
  align-items: center;
  gap: 4px;
}

#coord-input {
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid #475569;
  background: #334155;
  color: #fff;
  font-size: 13px;
  width: 160px;
}
#coord-input::placeholder { color: #94a3b8; }
#coord-input:focus { outline: none; border-color: #94a3b8; }

#coord-search button {
  padding: 5px 12px;
  border-radius: 6px;
  border: none;
  background: #475569;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
#coord-search button:hover { background: #64748b; }

#correction-mode-banner {
  margin-left: auto;
  background: #f59e0b;
  color: #1c1917;
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.65; }
}

/* ─── Main layout ────────────────────────────────────────────────────────── */
#main {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
}

#map { flex: 1; }

/* ─── Sidebar ────────────────────────────────────────────────────────────── */
#sidebar {
  width: 320px;
  background: #fff;
  border-left: 1px solid #e2e8f0;
  overflow-y: auto;
  z-index: 5;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

/* ─── Cards ──────────────────────────────────────────────────────────────── */
.card-header {
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  background: #f8fafc;
}

.card-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  flex: 1;
  line-height: 1.4;
}

.card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.card-footer {
  padding: 14px 16px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

/* ─── Fields ─────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 5px; }

.field > label {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.field > span {
  font-size: 14px;
  color: #1e293b;
  line-height: 1.4;
}

.required { color: #ef4444; }

/* ─── Status badges ──────────────────────────────────────────────────────── */
.status-corrected { color: #0d9488; font-weight: 600; }
.status-pending   { color: #94a3b8; }

.card-divider {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-top: 1px solid #e2e8f0;
  padding-top: 12px;
  margin-top: 2px;
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn-primary {
  width: 100%;
  padding: 10px 16px;
  background: #f97316;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover:not(:disabled) { background: #ea6010; }
.btn-primary:disabled { background: #cbd5e1; cursor: not-allowed; color: #94a3b8; }

.btn-teal {
  padding: 10px 22px;
  background: #14b8a6;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-teal:hover:not(:disabled) { background: #0d9488; }
.btn-teal:disabled { background: #cbd5e1; cursor: not-allowed; color: #94a3b8; }

.btn-secondary {
  padding: 10px 22px;
  background: transparent;
  color: #475569;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-secondary:hover { background: #f1f5f9; }

.btn-icon {
  flex-shrink: 0;
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 15px;
  padding: 4px 6px;
  border-radius: 4px;
  line-height: 1;
}
.btn-icon:hover { color: #475569; background: #f1f5f9; }

/* ─── Use-location floating bar ──────────────────────────────────────────── */
#use-location-bar {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  background: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
  z-index: 10;
}

/* ─── Toast ──────────────────────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  z-index: 20;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
  white-space: nowrap;
  max-width: 90vw;
  text-align: center;
}
#toast.show { opacity: 1; }

/* ─── Autocomplete ───────────────────────────────────────────────────────── */
#autocomplete-container { position: relative; }

#property-search {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
  color: #1e293b;
  background: #fff;
}
#property-search:focus {
  outline: none;
  border-color: #14b8a6;
  box-shadow: 0 0 0 3px rgba(20,184,166,0.12);
}

#autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}

.dropdown-item {
  padding: 9px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
}
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item:hover { background: #f8fafc; }
.dropdown-item .item-name { font-size: 13px; font-weight: 500; color: #1e293b; }
.dropdown-item .item-meta { font-size: 11px; color: #94a3b8; margin-top: 2px; }

#selected-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #f0fdfa;
  border: 1px solid #14b8a6;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  color: #0f766e;
  font-weight: 500;
  line-height: 1.3;
}

/* ─── Form inputs ────────────────────────────────────────────────────────── */
#reviewer-name,
#correction-notes {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
  color: #1e293b;
  font-family: inherit;
  background: #fff;
  resize: vertical;
}
#reviewer-name:focus,
#correction-notes:focus {
  outline: none;
  border-color: #14b8a6;
  box-shadow: 0 0 0 3px rgba(20,184,166,0.12);
}

/* ─── Utility ────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
