/* ================================================================
   UNSERE LISTE — Design System
   Warm, persönlich, ruhig. Inter + Terracotta + Creme.
   ================================================================ */

/* Google Fonts werden im HTML geladen */

:root {
  /* Farben */
  --c-primary:      #E07A5F;
  --c-primary-soft: #F8D7CF;
  --c-bg:           #FAF6F2;
  --c-surface:      #FFFFFF;
  --c-text:         #2B2B2B;
  --c-text-soft:    #6B6B6B;
  --c-border:       #ECE7E2;

  /* Status */
  --s-offen-bg:    #EEF2FF;
  --s-offen-fg:    #4D7CFE;
  --s-geplant-bg:  #FEF6DC;
  --s-geplant-fg:  #B8860B;
  --s-erledigt-bg: #E8F5EE;
  --s-erledigt-fg: #2D7A4F;

  /* Tokens */
  --radius:    16px;
  --radius-sm: 10px;
  --shadow:    0 1px 3px rgba(43,40,43,.05), 0 8px 24px rgba(43,40,43,.07);
  --shadow-lg: 0 4px 12px rgba(43,40,43,.09), 0 16px 40px rgba(43,40,43,.11);
  --sidebar:   240px;
  --ease:      cubic-bezier(.22,.68,0,1.2);
  --dur:       220ms;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 16px; line-height: 1.6;
  background: var(--c-bg); color: var(--c-text);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { display: block; max-width: 100%; }

/* ─── Layout ─────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  min-height: 100vh;
}

/* ─── Sidebar ────────────────────────────────── */
.sidebar {
  background: var(--c-surface);
  border-right: 1px solid var(--c-border);
  padding: 28px 16px 24px;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto; display: flex; flex-direction: column;
}

.brand {
  display: flex; align-items: center; gap: 9px;
  font-weight: 600; font-size: 1.05rem;
  padding: 0 10px; margin-bottom: 32px;
  color: var(--c-text);
}
.brand-heart {
  width: 22px; height: 22px; color: var(--c-primary);
  flex-shrink: 0;
}

.nav-section { margin-bottom: 24px; }
.nav-label {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--c-text-soft); padding: 0 10px; margin-bottom: 6px;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 10px; border-radius: var(--radius-sm);
  font-size: 0.9rem; color: var(--c-text);
  transition: background var(--dur), color var(--dur);
  text-align: left; white-space: nowrap; overflow: hidden;
}
.nav-item:hover { background: var(--c-bg); }
.nav-item.active {
  background: var(--c-primary-soft); color: #a3402a; font-weight: 500;
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; }

.sidebar-spacer { flex: 1; }

/* ─── Main ───────────────────────────────────── */
.main {
  min-height: 100vh;
  padding: 40px 48px 80px;
}

/* ─── Page head ──────────────────────────────── */
.page-head {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 16px;
  margin-bottom: 32px;
}
.page-title { font-size: 1.75rem; font-weight: 600; letter-spacing: -.02em; }
.page-sub   { color: var(--c-text-soft); margin-top: 3px; font-size: .95rem; }

/* ─── Counters ───────────────────────────────── */
.counters {
  display: grid; grid-template-columns: repeat(3,1fr);
  gap: 16px; margin-bottom: 36px;
}
.counter {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: 20px 22px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: var(--shadow);
}
.counter-icon {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; flex-shrink: 0;
}
.counter-icon svg { width: 20px; height: 20px; }
.counter-icon.offen    { background: var(--s-offen-bg);   color: var(--s-offen-fg); }
.counter-icon.geplant  { background: var(--s-geplant-bg); color: var(--s-geplant-fg); }
.counter-icon.erledigt { background: var(--s-erledigt-bg);color: var(--s-erledigt-fg); }
.counter-num   { font-size: 1.75rem; font-weight: 700; line-height: 1; letter-spacing: -.03em; }
.counter-label { font-size: .82rem; color: var(--c-text-soft); margin-top: 2px; }

/* ─── Toolbar ────────────────────────────────── */
.toolbar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 24px; flex-wrap: wrap;
}
.select-input, .search-input {
  border: 1px solid var(--c-border); background: var(--c-surface);
  border-radius: var(--radius-sm); padding: 9px 13px;
  font-size: .875rem; font-family: inherit; color: var(--c-text);
  transition: border-color var(--dur);
}
.search-input { flex: 1; min-width: 180px; }
.select-input:focus, .search-input:focus,
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-soft);
}

/* ─── Section subhead ────────────────────────── */
.sec-head {
  display: flex; align-items: baseline;
  justify-content: space-between; margin-bottom: 18px;
}
.sec-head h2 { font-size: 1.1rem; font-weight: 600; }
.sec-head a  { font-size: .85rem; }

/* ─── Grid ───────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px,1fr));
  gap: 22px;
}

/* ─── Card ───────────────────────────────────── */
.card {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); cursor: pointer;
  display: flex; flex-direction: column;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }

.card-media {
  aspect-ratio: 16/10; overflow: hidden;
  background: var(--c-primary-soft);
  display: grid; place-items: center; position: relative;
}
.card-media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 400ms var(--ease);
}
.card:hover .card-media img { transform: scale(1.04); }
.card-media-placeholder { color: var(--c-primary); opacity: .45; }
.card-media-placeholder svg { width: 40px; height: 40px; }

.card-body { padding: 14px 16px 18px; flex: 1; display: flex; flex-direction: column; gap: 5px; }
.card-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.card-title { font-size: 1rem; font-weight: 600; line-height: 1.3; }
.card-meta  { font-size: .8rem; color: var(--c-text-soft); }
.card-loc   { font-size: .8rem; color: var(--c-text-soft); display: flex; align-items: center; gap: 4px; }
.card-loc svg { width: 13px; height: 13px; flex-shrink: 0; }
.card-note  {
  font-size: .82rem; color: var(--c-text-soft); margin-top: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ─── Badge ──────────────────────────────────── */
.badge {
  display: inline-block; font-size: .7rem; font-weight: 600;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
  flex-shrink: 0;
}
.badge.offen    { background: var(--s-offen-bg);    color: var(--s-offen-fg); }
.badge.geplant  { background: var(--s-geplant-bg);  color: var(--s-geplant-fg); }
.badge.erledigt { background: var(--s-erledigt-bg); color: var(--s-erledigt-fg); }

/* ─── Buttons ────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 18px; border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 500; white-space: nowrap;
  transition: background var(--dur), transform 100ms, box-shadow var(--dur);
  min-height: 44px;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--c-primary); color: #fff; }
.btn-primary:hover { background: #c96b52; }
.btn-ghost { background: var(--c-surface); border: 1px solid var(--c-border); color: var(--c-text); }
.btn-ghost:hover { background: var(--c-bg); }
.btn-yellow { background: var(--s-geplant-bg); color: var(--s-geplant-fg); border: 1px solid #f0d98a; }
.btn-yellow:hover { background: #fdefc0; }
.btn-green  { background: var(--s-erledigt-bg); color: var(--s-erledigt-fg); border: 1px solid #a8dfc0; }
.btn-green:hover { background: #d0edda; }
.btn-danger { background: #fff; border: 1px solid #f2cac5; color: #c0402e; }
.btn-danger:hover { background: #fef0ee; }
.btn svg { width: 17px; height: 17px; }

/* ─── List rows (Geplant / Erledigt) ─────────── */
.list-rows { display: flex; flex-direction: column; gap: 10px; }
.list-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius-sm); padding: 12px 16px;
  box-shadow: var(--shadow); cursor: pointer;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur);
}
.list-row:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.list-thumb {
  width: 52px; height: 52px; border-radius: 10px; flex-shrink: 0;
  background: var(--c-primary-soft); overflow: hidden;
  display: grid; place-items: center;
}
.list-thumb img { width: 100%; height: 100%; object-fit: cover; }
.list-thumb svg { width: 22px; height: 22px; color: var(--c-primary); opacity: .55; }
.list-body { flex: 1; min-width: 0; }
.list-body .t { font-weight: 600; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-body .s { font-size: .8rem; color: var(--c-text-soft); }
.list-date { font-size: .82rem; color: var(--c-text-soft); white-space: nowrap; }

/* ─── Timeline ───────────────────────────────── */
.timeline-group  { margin-bottom: 32px; }
.timeline-year {
  font-size: 1.1rem; font-weight: 700; letter-spacing: -.02em;
  margin-bottom: 14px; padding-bottom: 8px;
  border-bottom: 1px solid var(--c-border);
}

/* ─── Detail ─────────────────────────────────── */
.detail { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); max-width: 680px; }
.detail-media { aspect-ratio: 16/9; background: var(--c-primary-soft); overflow: hidden; display: grid; place-items: center; }
.detail-media img { width: 100%; height: 100%; object-fit: cover; }
.detail-media svg { width: 56px; height: 56px; color: var(--c-primary); opacity: .4; }
.detail-body { padding: 28px 30px 32px; }
.detail-title-row { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; flex-wrap: wrap; }
.detail-title-row h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; }
.detail-cat { color: var(--c-text-soft); font-size: .9rem; margin-bottom: 18px; }
.detail-field { display: flex; align-items: center; gap: 9px; font-size: .92rem; margin: 8px 0; }
.detail-field svg { width: 16px; height: 16px; color: var(--c-text-soft); flex-shrink: 0; }
.detail-notes { background: var(--c-bg); border-radius: var(--radius-sm); padding: 16px 18px; margin: 18px 0; font-size: .9rem; white-space: pre-wrap; line-height: 1.65; }
.detail-stamps { font-size: .75rem; color: var(--c-text-soft); display: flex; gap: 18px; flex-wrap: wrap; margin-top: 14px; }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }

/* ─── Form ───────────────────────────────────── */
.form-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 28px; max-width: 680px; box-shadow: var(--shadow); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.span-2 { grid-column: 1/-1; }
.field label { font-size: .8rem; font-weight: 500; }
.field label .req { color: var(--c-primary); }
.field input, .field select, .field textarea {
  border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  padding: 10px 13px; font-size: .9rem; font-family: inherit;
  background: var(--c-surface); color: var(--c-text);
  transition: border-color var(--dur);
}
.field textarea { min-height: 90px; resize: vertical; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

/* ─── Empty states ───────────────────────────── */
.empty { text-align: center; padding: 64px 24px; color: var(--c-text-soft); }
.empty-icon { font-size: 2.2rem; margin-bottom: 14px; }
.empty h3 { font-size: 1.1rem; font-weight: 600; color: var(--c-text); margin-bottom: 8px; }
.empty p  { font-size: .9rem; max-width: 320px; margin: 0 auto 20px; }

/* ─── Toast ──────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #2B2B2B; color: #fff;
  padding: 12px 22px; border-radius: var(--radius-sm);
  font-size: .875rem; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none;
  transition: opacity var(--dur), transform var(--dur);
  z-index: 999; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── Utilities ──────────────────────────────── */
.back-btn { display: inline-flex; align-items: center; gap: 7px; font-size: .875rem; color: var(--c-text-soft); margin-bottom: 22px; transition: color var(--dur); }
.back-btn:hover { color: var(--c-text); }
.back-btn svg { width: 16px; height: 16px; }

/* ─── Mobile top bar ─────────────────────────── */
.mobile-topbar { display: none; }

/* ─── Mobile bottom nav ──────────────────────── */
.mobile-nav { display: none; }

/* ─── Restaurants page ───────────────────────── */
.restaurants-box {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: 40px; max-width: 480px;
  box-shadow: var(--shadow); text-align: center;
}
.restaurants-box .icon-wrap { color: var(--c-primary); margin-bottom: 16px; }
.restaurants-box .icon-wrap svg { width: 48px; height: 48px; }
.restaurants-box h2 { font-size: 1.2rem; font-weight: 600; margin-bottom: 8px; }
.restaurants-box p  { color: var(--c-text-soft); font-size: .9rem; margin-bottom: 22px; }

/* ─── Responsive ─────────────────────────────── */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 0 0 90px; }

  .mobile-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    position: sticky; top: 0; z-index: 40;
  }
  .mobile-topbar .brand { margin: 0; }

  .main-inner { padding: 20px 18px; }

  .mobile-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--c-surface); border-top: 1px solid var(--c-border);
    padding: 8px 4px max(8px, env(safe-area-inset-bottom));
    justify-content: space-around; z-index: 50;
  }
  .mobile-nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    color: var(--c-text-soft); font-size: .64rem; padding: 4px 12px;
    border-radius: 10px; min-width: 52px; text-align: center;
    transition: color var(--dur);
  }
  .mobile-nav-item.active { color: var(--c-primary); }
  .mobile-nav-item svg { width: 22px; height: 22px; }

  .mobile-fab {
    background: var(--c-primary); color: #fff !important;
    width: 48px; height: 48px; border-radius: 50%;
    margin-top: -22px; box-shadow: var(--shadow-lg);
    padding: 0; min-width: unset;
    display: flex; align-items: center; justify-content: center;
  }
  .mobile-fab svg { width: 24px; height: 24px; }

  .counters { gap: 10px; }
  .counter { padding: 14px 16px; gap: 12px; }
  .counter-num { font-size: 1.4rem; }

  .form-grid { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; gap: 12px; }
  .detail-body { padding: 20px 18px 24px; }
}

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
