/* Catppuccin Mocha palette */
:root {
  --base: #1e1e2e;
  --mantle: #181825;
  --crust: #11111b;
  --surface0: #313244;
  --surface1: #45475a;
  --surface2: #585b70;
  --text: #cdd6f4;
  --subtext0: #a6adc8;
  --subtext1: #bac2de;
  --blue: #89b4fa;
  --green: #a6e3a1;
  --yellow: #f9e2af;
  --red: #f38ba8;
  --mauve: #cba6f7;
  --teal: #94e2d5;
  --overlay0: #6c7086;
}

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

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--base);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
}

/* ── Map ────────────────────────────────────────────────── */

#map {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--crust);
}

/* Azure Maps popup override */
.atlas-map-canvas { border-radius: 0; }
.popup-close, .atlas-popup-close-btn { filter: invert(1); }

/* ── Sidebar ────────────────────────────────────────────── */

#sidebar {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 380px;
  background: var(--mantle);
  border-left: 1px solid var(--surface0);
  z-index: 1000;
  display: flex;
  transition: transform 0.2s ease;
}

#sidebar.collapsed { transform: translateX(100%); }
#sidebar.collapsed #sidebar-toggle { transform: translateX(-100%) scaleX(-1); }

#sidebar-toggle {
  position: absolute;
  left: -32px;
  top: 12px;
  width: 32px;
  height: 40px;
  background: var(--mantle);
  border: 1px solid var(--surface0);
  border-right: none;
  border-radius: 6px 0 0 6px;
  color: var(--subtext0);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
}

#sidebar-toggle:hover { color: var(--text); background: var(--surface0); }

#sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

/* ── User bar ───────────────────────────────────────────── */

#user-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--surface0);
  font-size: 13px;
  color: var(--subtext0);
}

/* ── Property list ──────────────────────────────────────── */

#property-list h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--subtext1);
}

.property-card {
  background: var(--surface0);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.property-card:hover { background: var(--surface1); }

.property-card .address {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
}

.property-card .meta {
  font-size: 12px;
  color: var(--subtext0);
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.status-dot.interested { background: var(--blue); }
.status-dot.visited { background: var(--yellow); }
.status-dot.offer { background: var(--green); }
.status-dot.rejected { background: var(--red); }
.status-dot.closed { background: var(--surface2); }

/* ── Form ───────────────────────────────────────────────── */

#property-form label {
  display: block;
  font-size: 12px;
  color: var(--subtext0);
  margin-bottom: 12px;
}

#property-form input,
#property-form select,
#property-form textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  background: var(--surface0);
  border: 1px solid var(--surface1);
  border-radius: 4px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}

#property-form input:focus,
#property-form select:focus,
#property-form textarea:focus {
  outline: none;
  border-color: var(--blue);
}

#property-form textarea { resize: vertical; }

.input-row {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.input-row input { flex: 1; margin-top: 0; }

fieldset {
  border: 1px solid var(--surface1);
  border-radius: 4px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

fieldset legend {
  font-size: 12px;
  color: var(--subtext0);
  padding: 0 4px;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 13px;
}

.checklist-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}

.form-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
}

/* ── Buttons ────────────────────────────────────────────── */

.primary-btn {
  background: var(--blue);
  color: var(--crust);
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.primary-btn:hover { filter: brightness(1.1); }

.small-btn {
  background: var(--surface1);
  color: var(--text);
  border: none;
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.small-btn:hover { background: var(--surface2); }

.link-btn {
  background: none;
  border: none;
  color: var(--blue);
  font-size: 13px;
  cursor: pointer;
  padding: 4px;
}

.link-btn:hover { text-decoration: underline; }

.danger-btn {
  background: none;
  border: 1px solid var(--red);
  color: var(--red);
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  margin-left: auto;
}

.danger-btn:hover { background: var(--red); color: var(--crust); }


/* ── Utilities ──────────────────────────────────────────── */

.hidden { display: none !important; }

/* ── Responsive ─────────────────────────────────────────── */

@media (max-width: 600px) {
  #sidebar {
    width: 100%;
    top: auto;
    height: 50vh;
    border-left: none;
    border-top: 1px solid var(--surface0);
  }
  #sidebar.collapsed { transform: translateY(100%); }
  #sidebar-toggle {
    left: 12px;
    top: -32px;
    width: 40px;
    height: 32px;
    border-radius: 6px 6px 0 0;
    border: 1px solid var(--surface0);
    border-bottom: none;
  }
}
