/* =========================================================================
   Schmückstück – Brand-System (verifiziert lt. Brand Kit)
   Hintergrund Reinweiß · Schrift immer Tinte · ein Akzent (Zartrosa).
   ========================================================================= */
:root {
  --brand-bg:        #ffffff;   /* Reinweiß – Bühne */
  --brand-surface:   #ffffff;   /* Karten */
  --brand-ink:       #2a2622;   /* Tinte – einzige Schriftfarbe */
  --brand-muted:     #8a827b;   /* sekundärer Text (Tinte, aufgehellt) */
  --brand-accent:    #e47d73;   /* Zartrosa – CTA/Buttons/Grafik, NIE Text */
  --brand-accent-d:  #d96a5f;   /* dunklere Variante (Hover) */
  --brand-accent-bg: #fbeeec;   /* sehr helle Akzentfläche (Badges) */
  --brand-border:    #ece8e4;   /* warme, ruhige Trennlinie */
  --radius:          14px;
  --shadow:          0 6px 28px rgba(42, 38, 34, .06);
  --font:            "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--brand-ink);
  background: var(--brand-bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body.centered {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

/* --- Brand / Logo --- */
.brand { display: flex; align-items: center; gap: 12px; }
.brand--stacked { flex-direction: column; gap: 16px; text-align: center; }
.brand__logo { height: 26px; width: auto; }              /* Wortmarke = Logo */
.brand--stacked .brand__logo { height: auto; width: 100%; max-width: 230px; }
.brand__caption {
  font-size: .8rem; font-weight: 500; letter-spacing: .14em;
  text-transform: uppercase; color: var(--brand-muted);
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--brand-border);
}
.topbar__nav { display: flex; align-items: center; gap: 22px; }
.topbar__link {
  color: var(--brand-muted); text-decoration: none; font-size: .88rem;
  letter-spacing: .02em;
  white-space: nowrap;            /* "← Übersicht" nie umbrechen */
}
.topbar__link:hover { color: var(--brand-accent); }
.topbar__user {
  font-size: .82rem; color: var(--brand-muted);
  padding: 3px 10px; border-radius: 999px; background: var(--brand-accent-bg);
  white-space: nowrap;
}

/* --- Layout --- */
.layout {
  max-width: 680px;
  margin: 40px auto;
  padding: 0 20px;
  display: grid;
  gap: 24px;
}
.layout--wide { max-width: 880px; }
.layout--wide .h1 { margin-top: 8px; }
.layout--wide .muted { margin-bottom: 8px; }

/* --- Kacheln (App-Übersicht) --- */
.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);   /* fest 3 pro Zeile */
  gap: 20px;
}
.tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 150px;
  padding: 24px;
  background: var(--brand-surface);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--brand-ink);
  transition: border-color .15s, box-shadow .15s, transform .05s;
}
.tile:hover {
  border-color: var(--brand-accent);
  box-shadow: 0 10px 32px rgba(42, 38, 34, .10);
}
.tile:active { transform: translateY(1px); }
.tile__title { font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; }
.tile__desc { color: var(--brand-muted); font-size: .92rem; flex: 1; }
.tile__cta {
  align-self: flex-start;
  margin-top: 6px;
  font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--brand-accent-d);
}
.tile--disabled {
  border-style: dashed;
  box-shadow: none;
  background: transparent;
  cursor: default;
}
.tile--disabled .tile__title,
.tile--disabled .tile__desc { color: var(--brand-muted); }
.tile--disabled:hover { border-color: var(--brand-border); box-shadow: none; }

/* --- Cards --- */
.card {
  background: var(--brand-surface);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}
.card--narrow { width: 100%; max-width: 380px; }

.h1 { font-size: 1.55rem; font-weight: 700; margin: 0 0 6px; letter-spacing: -.01em; }
.h2 { font-size: 1.1rem; font-weight: 700; margin: 0 0 18px; letter-spacing: .01em; }
.muted { color: var(--brand-muted); margin: 0 0 24px; }

/* --- Form --- */
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; grid-column: 1 / -1; }
.field--small { grid-column: span 1; }
.field__label {
  font-size: .76rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--brand-muted);
}
.field__input {
  font: inherit;
  color: var(--brand-ink);
  padding: 12px 13px;
  border: 1px solid var(--brand-border);
  border-radius: 10px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.field__input:focus {
  outline: none;
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(228, 125, 115, .18);
}
/* Select wie ein Textfeld aussehen lassen (eigener Pfeil, gleiche Höhe). */
select.field__input {
  appearance: none;
  -webkit-appearance: none;
  height: 45px;
  cursor: pointer;
  padding-right: 38px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%238a827b' stroke-width='1.6' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.btn {
  grid-column: 1 / -1;
  font: inherit; font-weight: 700; letter-spacing: .02em;
  color: #fff;
  background: var(--brand-accent);
  border: none;
  border-radius: 10px;
  padding: 13px 16px;
  cursor: pointer;
  transition: background .15s, transform .02s;
}
.btn:hover { background: var(--brand-accent-d); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: progress; }

/* --- Status / Alerts --- */
.status { margin-top: 18px; font-size: .92rem; }
.status--info  { color: var(--brand-muted); }
.status--error { color: #b4232a; }

.alert { margin: 4px 0 0; font-size: .88rem; }
.alert--error { color: #b4232a; }

/* --- Ergebnisliste --- */
.results { list-style: none; counter-reset: rank; margin: 0; padding: 0; }
.results__item {
  counter-increment: rank;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 4px;
  border-bottom: 1px solid var(--brand-border);
}
.results__item:last-child { border-bottom: none; }
.results__item::before {
  content: counter(rank);
  flex: 0 0 28px;
  height: 28px; width: 28px;
  display: grid; place-items: center;
  font-size: .78rem; font-weight: 700;
  color: var(--brand-accent-d);
  background: var(--brand-accent-bg);
  border-radius: 50%;
}
.results__link {
  flex: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  text-decoration: none; color: inherit;
  padding: 2px 6px; margin: -2px -6px;
  border-radius: 8px;
  transition: background .12s, color .12s;
}
.results__link:hover { background: var(--brand-accent-bg); }
.results__link:hover .results__name { color: var(--brand-accent-d); }
.results__name { flex: 1; font-weight: 600; }
.results__dist { color: var(--brand-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* --- Detailansicht Kunde --- */
.detail { display: grid; gap: 18px; }
.detail__row { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--brand-border); }
.detail__row:last-child { border-bottom: none; }
.detail__label { color: var(--brand-muted); font-size: .9rem; }
.detail__value { font-weight: 600; text-align: right; }
.detail__value a { color: var(--brand-ink); }
.kpi { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.kpi__box { padding: 18px; border: 1px solid var(--brand-border); border-radius: var(--radius); background: var(--brand-accent-bg); }
.kpi__label { font-size: .76rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-muted); }
.kpi__num { font-size: 1.5rem; font-weight: 700; margin-top: 6px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi__sub { color: var(--brand-muted); font-size: .85rem; margin-top: 2px; }
.map { height: 320px; border-radius: var(--radius); border: 1px solid var(--brand-border); overflow: hidden; }
.address { font-style: normal; line-height: 1.6; }

@media (max-width: 480px) {
  .kpi { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }   /* Tablet: 2 pro Zeile */
}

@media (max-width: 480px) {
  .card { padding: 22px; }
  .form { grid-template-columns: 1fr; }
  .field--small { grid-column: 1 / -1; }
  .tiles { grid-template-columns: 1fr; }              /* Handy: 1 pro Zeile */
  /* Topbar kompakter: Logo weiter links, Navigation enger und einzeilig. */
  .topbar { padding: 14px 16px; }
  .topbar__nav { gap: 14px; }
  .topbar__link { font-size: .82rem; letter-spacing: 0; }
  .brand__logo { height: 22px; }
}
