/* ──────────────────────────────────────────────────────────────────────
   BNI Chapter-Site – Public Dashboard mit Sidebar
   Stil: analog Cockpit, BNI-Rot, kein Login
   ────────────────────────────────────────────────────────────────────── */

:root {
  --brand: #cf102e;
  --brand-dark: #a50d24;
  --brand-soft: #fdecef;
  --brand-tint: rgba(207, 16, 46, 0.10);

  --bg: #f4f5f7;
  --card: #ffffff;
  --border: #e5e7eb;
  --border-soft: #f1f2f4;

  --text: #111827;
  --text-2: #1f2937;
  --muted: #6b7280;
  --muted-2: #9ca3af;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(17,24,39,.04), 0 1px 3px rgba(17,24,39,.06);
  --shadow-md: 0 4px 12px rgba(17,24,39,.06), 0 16px 32px -16px rgba(17,24,39,.16);

  --sidebar-w: 260px;
  --topbar-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100vh; }

body {
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

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

/* ── Sidebar ─────────────────────────────────────────────────────────── */
.sidebar {
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  min-height: var(--topbar-h);
}
.sidebar-brand .brand-logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 28px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.04em;
  border-radius: 4px;
  flex-shrink: 0;
}
.sidebar-brand .brand-text { line-height: 1.2; min-width: 0; }
.sidebar-brand .brand-chapter {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-brand .brand-region {
  font-size: 11.5px;
  color: var(--muted-2);
  margin-top: 1px;
}

.sidebar-nav {
  flex: 1;
  padding: 14px 12px;
  overflow-y: auto;
}

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  margin: 2px 0;
  position: relative;
  transition: background .12s, color .12s;
  cursor: pointer;
}
.nav-item:hover { background: #f5f6f8; color: var(--text); }
.nav-item svg {
  width: 18px; height: 18px;
  stroke-width: 2;
  flex-shrink: 0;
  color: var(--muted);
  transition: color .12s;
}
.nav-item:hover svg { color: var(--text-2); }

.nav-item.active {
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 600;
}
.nav-item.active svg { color: var(--brand-dark); }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 6px; bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--brand);
}

.nav-item.disabled { color: var(--muted-2); cursor: not-allowed; }
.nav-item.disabled:hover { background: transparent; }
.nav-item.disabled svg { color: var(--muted-2); }

.nav-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 2px 7px;
  border-radius: 20px;
  background: #f3f4f6;
  color: var(--muted);
}

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 16px 22px;
  flex-shrink: 0;
}
.footer-lines {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.6;
}
.footer-lines a { color: var(--muted); }
.footer-lines a:hover { color: var(--brand-dark); }
.footer-lines span { color: var(--muted-2); }

/* ── Main / Topbar ───────────────────────────────────────────────────── */
.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  background: #fff;
  padding: 0 32px;
  display: flex; align-items: center; gap: 16px;
  position: sticky; top: 0; z-index: 10;
}
.topbar-text { min-width: 0; flex: 1; }
.topbar-title { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.content { padding: 28px 32px; }

/* ── Page Header ─────────────────────────────────────────────────────── */
.page-header { margin-bottom: 24px; }
.page-header h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.page-header .subtitle {
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
}

/* ── Section-Header ──────────────────────────────────────────────────── */
.section-head {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

/* ── Termin-Karten ───────────────────────────────────────────────────── */
.meeting-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 32px;
}
@media (max-width: 1100px) { .meeting-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .meeting-grid { grid-template-columns: 1fr; } }

.meeting-card {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex; flex-direction: column; gap: 4px;
}
.meeting-date {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}
.meeting-loc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.meeting-note {
  font-size: 11.5px;
  color: var(--brand-dark);
  font-weight: 500;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Quick-Link-Kacheln ──────────────────────────────────────────────── */
.link-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 1100px) { .link-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 800px)  { .link-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .link-grid { grid-template-columns: 1fr; } }

.link-tile {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px 22px;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  min-height: 190px;
  color: inherit;
}
.link-tile:hover {
  transform: translateY(-2px);
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
}
.link-icon {
  width: 56px; height: 56px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
}
.link-icon svg { width: 32px; height: 32px; stroke-width: 1.6; }
.link-tile:hover .link-icon { color: var(--brand); }

/* Kachel mit Thumbnail statt Icon */
.link-tile.has-thumb { padding-top: 0; padding-left: 0; padding-right: 0; overflow: hidden; }
.link-tile.has-thumb .link-title,
.link-tile.has-thumb .link-sub { padding-left: 20px; padding-right: 20px; }
.link-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #f3f4f6;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.link-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.link-tile.has-thumb:hover .link-thumb img { transform: scale(1.03); }
.link-title {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--brand);
  line-height: 1.25;
}
.link-sub {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

/* ── Empty States ────────────────────────────────────────────────────── */
.empty-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px 32px;
  text-align: center;
  max-width: 520px;
  margin: 12px auto;
  box-shadow: var(--shadow-sm);
}
.empty-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-dark);
  margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
}
.empty-card h2 { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.empty-card p { color: var(--muted); font-size: 14px; max-width: 420px; margin: 0 auto; line-height: 1.6; }

/* ── Hamburger + Mobile Backdrop ─────────────────────────────────────── */
.hamburger {
  display: none;
  background: none; border: none; cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  align-items: center; justify-content: center;
  margin-right: 4px;
  transition: background .12s;
}
.hamburger:hover { background: #f3f4f6; }
.hamburger svg { width: 22px; height: 22px; }

.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(17, 24, 39, .45);
  z-index: 99;
  opacity: 0;
  transition: opacity .2s ease;
  backdrop-filter: blur(2px);
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 1100px) { .content { padding: 24px 24px; } }

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

  .sidebar {
    position: fixed;
    top: 0; left: 0;
    width: 280px; max-width: 86vw;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 100;
    box-shadow: 0 0 30px rgba(17, 24, 39, .18);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-backdrop { display: block; opacity: 1; }
  body.sidebar-open { overflow: hidden; }

  .hamburger { display: inline-flex; }

  .topbar { padding: 0 16px; gap: 10px; }
  .content { padding: 20px 16px; }
  .page-header h1 { font-size: 22px; }
}

@media (max-width: 560px) {
  .meeting-grid { gap: 10px; }
}
