/* TOKI Konut Haritasi — teal "trust" paleti + Inter (dashboard odakli) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #0F766E;
  --primary-600: #0d655e;
  --secondary: #14B8A6;
  --cta: #0369A1;
  --bg: #F0FDFA;
  --surface: #ffffff;
  --text: #134E4A;
  --muted: #475569;
  --border: #d3e6e2;
  --shadow: 0 1px 3px rgba(15,118,110,.12), 0 8px 24px rgba(15,118,110,.06);
  --radius: 12px;
  --sidebar-w: 360px;
  --z-panel: 1200;
  --z-overlay: 1100;
  --z-header: 1000;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
a { color: var(--cta); }

/* ---------- layout ---------- */
.app { display: flex; flex-direction: column; height: 100vh; }

header.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 20px; background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow); z-index: var(--z-header);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo {
  width: 36px; height: 36px; border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: grid; place-items: center; color: #fff; flex: none;
}
.brand h1 { font-size: 17px; margin: 0; font-weight: 700; letter-spacing: -.01em; }
.brand p { margin: 0; font-size: 12px; color: var(--muted); }

.stats { display: flex; gap: 18px; margin-left: auto; }
.stat { text-align: right; }
.stat .num { font-size: 18px; font-weight: 700; color: var(--primary); line-height: 1.1; }
.stat .lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

.main { display: flex; flex: 1; min-height: 0; }

/* ---------- sidebar ---------- */
aside.sidebar {
  width: var(--sidebar-w); flex: none; background: var(--surface);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  min-height: 0; overflow-y: auto;   /* tek scroll: filtreler + sonuçlar birlikte */
}
.filters { padding: 16px; border-bottom: 1px solid var(--border); flex: none; }
.filters h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); margin: 0 0 12px; font-weight: 600; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
select, input[type="text"], input[type="number"] {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border);
  border-radius: 9px; font-size: 14px; color: var(--text); background: #fff;
}
select:focus, input:focus { outline: 2px solid var(--secondary); outline-offset: 1px; border-color: var(--secondary); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px;
  border: 1px solid var(--border); border-radius: 999px; font-size: 13px;
  background: #fff; color: var(--text); transition: all .18s ease; user-select: none;
}
.chip:hover { border-color: var(--secondary); }
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.filter-actions { display: flex; gap: 8px; margin-top: 4px; }
.btn {
  flex: 1; padding: 10px; border-radius: 9px; border: 1px solid var(--border);
  background: #fff; color: var(--text); font-weight: 600; font-size: 13px;
  transition: all .18s ease;
}
.btn:hover { border-color: var(--secondary); }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.primary:hover { background: var(--primary-600); }

/* ---------- result list ---------- */
.results { flex: none; }
.results-head {
  position: sticky; top: 0; background: var(--surface); padding: 11px 16px;
  border-bottom: 1px solid var(--border); display: flex; align-items: center;
  justify-content: space-between; font-size: 13px; z-index: 2;
}
.results-head .count { font-weight: 700; color: var(--primary); }
.card {
  padding: 13px 16px; border-bottom: 1px solid var(--border); cursor: pointer;
  transition: background .15s ease; border-left: 3px solid transparent;
}
.card:hover { background: #effbf9; }
.card.active { background: #e3f6f2; border-left-color: var(--primary); }
.card .ilce { font-size: 11px; font-weight: 700; color: var(--cta); text-transform: uppercase; letter-spacing: .03em; }
.card .title { font-size: 13.5px; font-weight: 600; margin: 2px 0 7px; line-height: 1.35; }
.card .meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--muted); }
.card .meta b { color: var(--text); font-weight: 600; }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px;
  font-weight: 600; background: #d9f2ee; color: var(--primary);
}

/* ---------- map ---------- */
.map-wrap { flex: 1; position: relative; min-width: 0; }
#map { position: absolute; inset: 0; }
.map-note {
  position: absolute; left: 12px; bottom: 12px; z-index: 500;
  background: rgba(255,255,255,.92); padding: 7px 12px; border-radius: 9px;
  font-size: 12px; color: var(--muted); box-shadow: var(--shadow);
}
.marker-pin {
  background: var(--primary); width: 16px; height: 16px; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4);
}

/* ---------- detail panel ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(19,78,74,.32); z-index: var(--z-overlay);
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.overlay.open { opacity: 1; pointer-events: auto; }
.panel {
  position: fixed; top: 0; right: 0; height: 100%; width: min(880px, 94vw);
  background: var(--surface); z-index: var(--z-panel); box-shadow: -8px 0 30px rgba(0,0,0,.18);
  transform: translateX(100%); transition: transform .26s cubic-bezier(.22,.61,.36,1);
  display: flex; flex-direction: column;
}
.panel.open { transform: translateX(0); }
.panel-head { padding: 18px 22px; border-bottom: 1px solid var(--border); }
.panel-head .ilce { font-size: 12px; font-weight: 700; color: var(--cta); text-transform: uppercase; }
.panel-head h3 { margin: 4px 0 8px; font-size: 18px; line-height: 1.3; }
.panel-head .sub { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--muted); }
.panel-head .sub b { color: var(--text); }
.panel-close {
  position: absolute; top: 14px; right: 16px; width: 36px; height: 36px;
  border-radius: 9px; border: 1px solid var(--border); background: #fff;
  display: grid; place-items: center; transition: all .15s ease;
}
.panel-close:hover { background: #effbf9; border-color: var(--secondary); }
.panel-body { flex: 1; overflow: auto; padding: 0; }

table.units { width: 100%; border-collapse: collapse; font-size: 13px; }
table.units th, table.units td { padding: 8px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid #eef4f3; }
table.units th { position: sticky; top: 0; background: #ecf8f6; color: var(--primary);
  font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .02em; z-index: 1; }
table.units td:first-child, table.units th:first-child,
table.units td.l, table.units th.l { text-align: left; }
table.units tbody tr:hover { background: #f6fcfb; }
table.units .grp { background: #f8fbfb; font-weight: 600; }
.alt-h { border-left: 2px solid var(--border); }
.money { font-variant-numeric: tabular-nums; }

.panel-loading { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- responsive ---------- */
.menu-toggle { display: none; }
@media (max-width: 900px) {
  .main { position: relative; }
  aside.sidebar {
    position: absolute; inset: 0 auto 0 0; z-index: 1050; width: min(360px, 88vw);
    transform: translateX(-100%); transition: transform .24s ease; box-shadow: var(--shadow);
  }
  aside.sidebar.open { transform: translateX(0); }
  .menu-toggle { display: grid; place-items: center; width: 40px; height: 40px;
    border-radius: 9px; border: 1px solid var(--border); background: #fff; }
  .stats { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
