/* ============================================================
   Garagen Klagenfurt – Interne Standortanalyse
   Premium UI · Apple/Stripe/Linear-Ästhetik
   ============================================================ */

:root {
  /* Brand */
  --ink:        #0e0f12;
  --ink-soft:   #33363d;
  --muted:      #6b7079;
  --muted-2:    #9aa0aa;
  --line:       #e9eaee;
  --line-soft:  #f1f2f5;
  --bg:         #ffffff;
  --bg-tint:    #fafafb;
  --bg-tint-2:  #f5f6f8;

  /* Gold accent (aus Logo) */
  --gold:       #c8a04a;
  --gold-deep:  #a9842f;
  --gold-soft:  #f6efdd;
  --gold-glow:  rgba(200,160,74,.28);

  /* Support */
  --near:       #1f9d6b;
  --far:        #d9822b;

  --radius:     18px;
  --radius-sm:  12px;
  --radius-xs:  9px;

  --shadow-sm:  0 1px 2px rgba(16,17,18,.05), 0 1px 3px rgba(16,17,18,.04);
  --shadow-md:  0 4px 14px rgba(16,17,18,.06), 0 2px 6px rgba(16,17,18,.05);
  --shadow-lg:  0 24px 60px -18px rgba(16,17,18,.22), 0 8px 24px rgba(16,17,18,.08);

  --ease:       cubic-bezier(.22,.61,.36,1);
  --font:       "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.55;
  font-feature-settings: "cv02","cv03","cv04","ss01";
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }

.wrap { max-width: 1320px; margin: 0 auto; padding: 0 clamp(18px, 4vw, 40px); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 900;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 66px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 30px; width: auto; max-width: 62vw; object-fit: contain; }
.brand__sep { width: 1px; height: 22px; background: var(--line); }
.brand__tag {
  font-size: 12.5px; font-weight: 500; color: var(--muted);
  letter-spacing: .01em;
}
.topbar__meta {
  display: flex; align-items: center; gap: 14px;
  font-size: 12.5px; color: var(--muted);
}
.dot-live {
  display: inline-flex; align-items: center; gap: 7px;
  font-weight: 500; color: var(--ink-soft);
}
.dot-live::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--near); box-shadow: 0 0 0 3px rgba(31,157,107,.15);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ---------- Internal notice ---------- */
.notice {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(90deg, #14151a, #1d1f26);
  color: #f4f0e4;
  font-size: 13px; font-weight: 500; letter-spacing: .01em;
  padding: 9px clamp(18px,4vw,40px);
}
.notice svg { flex: none; color: var(--gold); }
.notice b { color: #fff; font-weight: 600; }

/* ---------- Hero ---------- */
.hero { padding: clamp(46px, 7vw, 88px) 0 clamp(30px, 4vw, 46px); }
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold-deep); margin-bottom: 20px;
}
.hero__eyebrow::before {
  content: ""; width: 26px; height: 1.5px; background: var(--gold);
}
.hero h1 {
  font-size: clamp(30px, 5vw, 56px);
  line-height: 1.05; letter-spacing: -.03em; font-weight: 700;
  margin: 0 0 18px; max-width: 15ch;
}
.hero h1 .accent {
  background: linear-gradient(120deg, var(--gold-deep), var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p {
  font-size: clamp(15px, 1.6vw, 18.5px); color: var(--muted);
  max-width: 60ch; margin: 0; line-height: 1.6;
}

/* ---------- Dashboard shell ---------- */
.dash {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
  padding-bottom: 40px;
  align-items: start;
}
@media (max-width: 1080px) { .dash { grid-template-columns: 1fr; } }

/* Sidebar */
.sidebar {
  position: sticky; top: 82px;
  display: flex; flex-direction: column; gap: 16px;
}
@media (max-width: 1080px) { .sidebar { position: static; } }

.panel {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.panel__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 12px;
}
.panel__title {
  font-size: 12px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted);
}
.panel__count {
  font-size: 12px; font-weight: 600; color: var(--ink-soft);
  background: var(--bg-tint-2); border-radius: 20px; padding: 3px 10px;
}

/* Stat cards */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat {
  padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #fff, var(--bg-tint));
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #dfe0e6; }
.stat__label { font-size: 11.5px; color: var(--muted); font-weight: 500; margin-bottom: 8px; }
.stat__value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.stat__value small { font-size: 13px; font-weight: 500; color: var(--muted-2); margin-left: 3px; }
.stat__sub { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.stat--wide { grid-column: 1 / -1; }

/* Controls */
.controls { padding: 4px 18px 18px; display: flex; flex-direction: column; gap: 14px; }
.search {
  position: relative;
}
.search input {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg-tint); padding: 11px 12px 11px 38px;
  font-size: 14px; color: var(--ink); outline: none;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease);
}
.search input::placeholder { color: var(--muted-2); }
.search input:focus {
  background: #fff; border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-2); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  border-radius: 20px; padding: 7px 13px; font-size: 12.5px; font-weight: 500;
  transition: all .25s var(--ease);
}
.chip:hover { border-color: var(--gold); color: var(--gold-deep); }
.chip[aria-pressed="true"] {
  background: var(--ink); border-color: var(--ink); color: #fff;
}

/* Tenant list */
.list { max-height: 460px; overflow-y: auto; padding: 2px 8px 8px; }
.list::-webkit-scrollbar { width: 8px; }
.list::-webkit-scrollbar-thumb { background: #e3e4e9; border-radius: 8px; border: 2px solid #fff; }

.tenant {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px; border-radius: var(--radius-sm);
  cursor: pointer; border: 1px solid transparent;
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.tenant:hover { background: var(--bg-tint); border-color: var(--line); }
.tenant.is-active { background: var(--gold-soft); border-color: #ecdfb8; }
.tenant__avatar {
  flex: none; width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center; font-size: 14px; font-weight: 700; color: #fff;
  background: linear-gradient(140deg, var(--ink-soft), var(--ink));
}
.tenant.is-firma .tenant__avatar { background: linear-gradient(140deg, var(--gold), var(--gold-deep)); }
.tenant__body { min-width: 0; flex: 1; }
.tenant__name {
  font-size: 14px; font-weight: 600; letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tenant__addr { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.tenant__meta { display: flex; align-items: center; gap: 8px; margin-top: 7px; flex-wrap: wrap; }
.pill {
  font-size: 11px; font-weight: 600; letter-spacing: .01em;
  padding: 3px 8px; border-radius: 20px; background: var(--bg-tint-2); color: var(--ink-soft);
}
.pill--dist { background: #eef7f2; color: var(--near); }
.pill--dist.is-far { background: #fbf1e6; color: var(--far); }
.pill--firma { background: rgba(191, 154, 79, .14); color: var(--gold-deep); }
.pill--approx { background: #f2f0ec; color: var(--muted); }
.tenant__contact { display: flex; gap: 10px; margin-top: 7px; }
.tenant__contact a { font-size: 11.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.tenant__contact a:hover { color: var(--gold-deep); }

.list__empty { text-align: center; color: var(--muted-2); font-size: 13.5px; padding: 40px 20px; }

/* ---------- Map ---------- */
.mapcard {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  background: #eef0f3;
}
#map { height: clamp(520px, 74vh, 780px); width: 100%; z-index: 1; }
@media (max-width: 1080px) { #map { height: 62vh; } }

.map-overlay {
  position: absolute; z-index: 500; pointer-events: none;
}
.map-legend {
  left: 16px; bottom: 16px;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; box-shadow: var(--shadow-md);
  font-size: 12px; display: flex; flex-direction: column; gap: 9px;
}
.legend-row { display: flex; align-items: center; gap: 9px; color: var(--ink-soft); font-weight: 500; }
.legend-swatch { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.legend-swatch.garage { background: var(--gold); box-shadow: 0 0 0 4px var(--gold-glow); }
.legend-swatch.tenant { background: #fff; border: 2.5px solid var(--ink); }

.map-badge {
  right: 16px; top: 16px;
  background: rgba(14,15,18,.86); color: #fff;
  backdrop-filter: blur(8px);
  border-radius: 10px; padding: 8px 13px; font-size: 12px; font-weight: 500;
  display: flex; align-items: center; gap: 8px; box-shadow: var(--shadow-md);
}
.map-badge svg { color: var(--gold); }

/* ---------- Custom Leaflet markers ---------- */
.garage-marker {
  width: 46px; height: 46px; position: relative;
}
.garage-marker__glow {
  position: absolute; inset: -8px; border-radius: 50%;
  background: radial-gradient(circle, var(--gold-glow), transparent 70%);
  animation: glow 3s var(--ease) infinite;
}
@keyframes glow { 0%,100%{transform:scale(1);opacity:.9} 50%{transform:scale(1.25);opacity:.5} }
.garage-marker__pin {
  position: absolute; inset: 0; margin: auto;
  width: 42px; height: 42px; border-radius: 50% 50% 50% 4px;
  transform: rotate(45deg);
  background: linear-gradient(140deg, var(--gold), var(--gold-deep));
  box-shadow: 0 6px 16px rgba(169,132,47,.5), inset 0 1px 2px rgba(255,255,255,.4);
  border: 2px solid #fff;
}
.garage-marker__icon {
  position: absolute; inset: 0; margin: auto; width: 42px; height: 42px;
  display: grid; place-items: center; color: #fff; z-index: 2;
}

.tenant-marker {
  width: 30px; height: 30px;
  border-radius: 50% 50% 50% 4px; transform: rotate(45deg);
  background: #fff; border: 2.5px solid var(--ink);
  box-shadow: 0 3px 9px rgba(16,17,18,.25);
  transition: transform .2s var(--ease), border-color .2s var(--ease);
}
.tenant-marker.is-firma { border-color: var(--gold-deep); }
.tenant-marker.is-active { transform: rotate(45deg) scale(1.25); border-color: var(--gold); z-index: 1000; }

/* Cluster */
.cluster-icon {
  background: rgba(14,15,18,.92); color: #fff;
  border: 2px solid #fff; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
  box-shadow: 0 4px 12px rgba(16,17,18,.3);
}

/* Leaflet popup restyle */
.leaflet-popup-content-wrapper {
  border-radius: 14px !important; box-shadow: var(--shadow-lg) !important;
  padding: 4px !important; border: 1px solid var(--line);
}
.leaflet-popup-content { margin: 14px 16px !important; font-family: var(--font) !important; line-height: 1.5; }
.leaflet-popup-tip { box-shadow: var(--shadow-md) !important; }
.pop__type { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-deep); }
.pop__name { font-size: 16px; font-weight: 700; letter-spacing: -.01em; margin: 3px 0 6px; color: var(--ink); }
.pop__row { font-size: 13px; color: var(--muted); margin: 2px 0; display: flex; gap: 7px; align-items: center; }
.pop__row svg { color: var(--muted-2); flex: none; }
.pop__row a { color: var(--gold-deep); font-weight: 500; }
.pop__dist {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 9px;
  font-size: 12px; font-weight: 600; color: var(--near);
  background: #eef7f2; border-radius: 20px; padding: 4px 10px;
}
.pop--garage .pop__type { color: var(--gold-deep); }
.pop__approx {
  margin-top: 8px; font-size: 11.5px; color: var(--muted);
  background: #f2f0ec; border-radius: 8px; padding: 4px 9px; display: inline-block;
}

/* ---------- Bottom sections ---------- */
.sections { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 8px 0 60px; }
@media (max-width: 820px) { .sections { grid-template-columns: 1fr; } }
.section-card { padding: 24px; }
.section-card h2 {
  font-size: 17px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 4px;
  display: flex; align-items: center; gap: 9px;
}
.section-card h2 svg { color: var(--gold); }
.section-card p.lead { font-size: 13.5px; color: var(--muted); margin: 0 0 18px; }

.quality-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-top: 1px solid var(--line-soft);
}
.quality-row:first-of-type { border-top: none; }
.quality-row span { font-size: 13.5px; color: var(--ink-soft); }
.quality-bar { flex: 1; height: 6px; background: var(--bg-tint-2); border-radius: 20px; margin: 0 14px; overflow: hidden; }
.quality-bar i { display: block; height: 100%; border-radius: 20px; background: linear-gradient(90deg, var(--gold), var(--gold-deep)); }
.quality-val { font-size: 13px; font-weight: 700; min-width: 42px; text-align: right; }

.geo-fail { display: flex; flex-direction: column; gap: 8px; }
.geo-fail__item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 13px; background: #fdf6ee; border: 1px solid #f2e2cc; border-radius: 10px;
  font-size: 13px; color: var(--ink-soft);
}
.geo-fail__item svg { color: var(--far); flex: none; }
.geo-fail__item--approx { background: #faf8f4; border-color: var(--line-soft); cursor: pointer; transition: border-color .15s, background .15s; }
.geo-fail__item--approx svg { color: var(--gold); }
.geo-fail__item--approx:hover { background: #f5f1e9; border-color: #e6d6b8; }
.geo-fail__item--approx em { color: var(--muted-2); font-style: normal; }
.geo-ok { display: flex; align-items: center; gap: 10px; color: var(--near); font-size: 14px; font-weight: 500; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line-soft); padding: 28px 0 48px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-size: 12.5px; color: var(--muted-2);
}
.footer strong { color: var(--ink-soft); font-weight: 600; }

/* Skeleton / loading */
.loading { padding: 40px; text-align: center; color: var(--muted); font-size: 13.5px; }
.spinner {
  width: 22px; height: 22px; border: 2.5px solid var(--line); border-top-color: var(--gold);
  border-radius: 50%; margin: 0 auto 12px; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: .001ms !important; }
}
