/* === VARIABLES & RESET === */
:root {
  --bg: #f5f3f0;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #6b6560;
  --accent: #d4513b;
  --accent-hover: #be4432;
  --border: #e5e0db;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --font: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --popup-bg: #ffffff;
}

[data-theme="dark"] {
  --bg: #1a1a1e;
  --surface: #252529;
  --text: #e8e6e3;
  --text-secondary: #9a9590;
  --accent: #e8714a;
  --accent-hover: #d4513b;
  --border: #3a3a3e;
  --shadow: 0 2px 12px rgba(0,0,0,0.3);
  --popup-bg: #2c2c30;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font); background: var(--bg); color: var(--text); transition: background 0.3s, color 0.3s; }

/* === HEADER === */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1000;
}
.header-left { display: flex; align-items: center; gap: 10px; }
.logo { font-size: 22px; font-weight: 400; letter-spacing: -0.3px; font-family: 'Mansalva', cursive; }
.logo span { color: var(--accent); }
.logo a { color: inherit; text-decoration: none; }
.header-subtitle { font-size: 12px; color: var(--text-secondary); }
.header-actions { display: flex; gap: 8px; align-items: center; }

/* === BUTTONS === */
.btn {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: #16a34a; color: #fff; }
.btn-warning { background: #e89b3b; color: #fff; }
.btn-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  padding: 0;
}

/* === FORMS === */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* === TOAST === */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  z-index: 2000;
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
}
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--accent); }

/* === LINKS === */
.privacy-link { font-size: 11px; color: var(--text-secondary); text-decoration: none; }
.privacy-link:hover { color: var(--accent); }

/* === DARK MODE: LEAFLET === */
[data-theme="dark"] .leaflet-control-zoom a {
  background: var(--surface) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}
[data-theme="dark"] .leaflet-control-layers {
  background: var(--surface) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}
[data-theme="dark"] .leaflet-control-layers label { color: var(--text); }
[data-theme="dark"] .leaflet-bar { border-color: var(--border) !important; }
[data-theme="dark"] .leaflet-popup-content-wrapper {
  background: var(--popup-bg) !important;
  color: var(--text) !important;
}
[data-theme="dark"] .leaflet-popup-tip { background: var(--popup-bg) !important; }
[data-theme="dark"] .leaflet-popup-close-button { color: var(--text-secondary) !important; }
[data-theme="dark"] .leaflet-control-attribution { background: var(--surface) !important; color: var(--text-secondary) !important; }
[data-theme="dark"] .leaflet-control-attribution a { color: var(--accent) !important; }
[data-theme="dark"] .panel-close { color: var(--text); }
