/* ============================================================
   Website – Globales Stylesheet
   Layout: Sidebar (1/3) | Main (2/3) | Slide-Panel (0 → 25%)
   Themes: [data-theme="light"] / [data-theme="dark"]
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700&family=Outfit:wght@300;400;500&display=swap');

/* ── CSS Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  --font-display: 'Syne', sans-serif;
  --font-body:    'Outfit', sans-serif;

  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;

  --sidebar-w:  25%;
  --panel-w:    25%;
  --transition: 0.32s cubic-bezier(0.4, 0, 0.2, 1);

  --nav-item-h: 44px;
}

/* ── Light Theme ───────────────────────────────────────────── */
[data-theme="light"] {
  --bg:           #edeae3;
  --bg-sidebar:   #e8e4dc;
  --bg-main:      #edeae3;
  --bg-panel:     #e8e4dc;
  --bg-card:      #e4e0d8;
  --bg-hover:     #dedad1;
  --bg-active:    #d6d1c8;

  --border:       #ccc8c0;
  --border-hover: #b8b4ac;

  --text:         #1a1a1a;
  --text-2:       #4a4a44;
  --text-3:       #9a9690;
  --text-inv:     #ffffff;

  --accent:       #1a1a1a;
  --accent-soft:  #dedad1;
  --accent-hover: #333330;

  /* Blau-Akzente (identisch in beiden Themes) */
  --blue-1:       #38bdf8;
  --blue-2:       #2563eb;
  --blue-grad:    linear-gradient(135deg, #2563eb, #0ea5e9);
  --blue-soft:    rgba(37, 99, 235, 0.08);
  --blue-border:  rgba(37, 99, 235, 0.15);

  --link:         #2563eb;
  --link-hover:   #38bdf8;

  --shadow-sm:    0 1px 3px rgba(0,0,0,.06);
  --shadow-md:    0 4px 16px rgba(0,0,0,.08);
  --shadow-panel: -8px 0 32px rgba(0,0,0,.08);
}

/* ── Dark Theme ────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg:           #1c1c1c;
  --bg-sidebar:   #222222;
  --bg-main:      #1c1c1c;
  --bg-panel:     #222222;
  --bg-card:      #252525;
  --bg-hover:     #2a2a2a;
  --bg-active:    #303030;

  --border:       #333333;
  --border-hover: #444444;

  --text:         #f0ede8;
  --text-2:       #a09c98;
  --text-3:       #666260;
  --text-inv:     #1c1c1c;

  --accent:       #f0ede8;
  --accent-soft:  #252525;
  --accent-hover: #c8c4c0;

  /* Blau-Akzente (identisch in beiden Themes) */
  --blue-1:       #38bdf8;
  --blue-2:       #2563eb;
  --blue-grad:    linear-gradient(135deg, #2563eb, #0ea5e9);
  --blue-soft:    rgba(56, 189, 248, 0.08);
  --blue-border:  rgba(56, 189, 248, 0.15);

  --link:         #38bdf8;
  --link-hover:   #7dd3fc;

  --shadow-sm:    0 1px 3px rgba(0,0,0,.3);
  --shadow-md:    0 4px 16px rgba(0,0,0,.4);
  --shadow-panel: -8px 0 32px rgba(0,0,0,.5);
}

/* ── Base ──────────────────────────────────────────────────── */
body {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

/* ── Layout Shell ──────────────────────────────────────────── */
.site-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
  position: relative;
}

/* ── Sidebar Navigation ────────────────────────────────────── */
.site-sidebar {
  width: var(--sidebar-w);
  min-width: 220px;
  max-width: 320px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width var(--transition), background var(--transition), border-color var(--transition);
}

/* Scrollbar im Sidebar */
.site-sidebar::-webkit-scrollbar { width: 4px; }
.site-sidebar::-webkit-scrollbar-track { background: transparent; }
.site-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Logo / Brand */
.sidebar-brand {
  padding: 28px 24px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -.03em;
  color: var(--text);
  text-decoration: none;
  display: block;
  line-height: 1.2;
}

.brand-tagline {
  font-size: .72rem;
  color: var(--text-3);
  margin-top: 4px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* Navigation */
.sidebar-nav {
  flex: 1;
  padding: 16px 0;
}

.nav-section {
  margin-bottom: 8px;
}

.nav-section-label {
  font-size: .68rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: 8px 24px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--nav-item-h);
  padding: 0 24px;
  color: var(--text-2);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 400;
  border-radius: 0;
  position: relative;
  transition: color .15s, background .15s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.nav-item.active {
  color: var(--text);
  background: var(--bg-active);
  font-weight: 500;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 25%;
  bottom: 25%;
  width: 2px;
  background: var(--blue-2);
  border-radius: 0 2px 2px 0;
}

.nav-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: .6;
  transition: opacity .15s;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon { opacity: 1; }

.nav-icon svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.nav-badge {
  margin-left: auto;
  font-size: .68rem;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--bg-active);
  color: var(--text-2);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px 24px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-active);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 600;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name  { font-size: .82rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role  { font-size: .72rem; color: var(--text-3); }

/* Theme Toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  color: var(--text-2);
  font-family: var(--font-body);
  font-size: .78rem;
  cursor: pointer;
  transition: all .15s;
  width: 100%;
  justify-content: center;
}

.theme-toggle:hover {
  border-color: var(--border-hover);
  color: var(--text);
  background: var(--bg-hover);
}

.theme-toggle svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.5; }

/* ── Main Content Area ─────────────────────────────────────── */
.site-main {
  margin-left: var(--sidebar-w);
  min-width: 0;
  flex: 1;
  min-height: 100vh;
  background: var(--bg-main);
  transition: margin-right var(--transition), background var(--transition);
  display: flex;
  flex-direction: column;
}

/* Wenn Panel offen: Main bekommt rechts Abstand */
.site-shell.panel-open .site-main {
  margin-right: var(--panel-w);
}

/* Content Wrapper (zentriert, max-width) */
.main-content {
  flex: 1;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 40px;
}

/* ── Top Bar (optional, für Breadcrumbs / Page Title) ──────── */
.main-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 56px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 16px;
}

.topbar-title {
  font-family: var(--font-display);
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--text);
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  color: var(--text-3);
}

.topbar-breadcrumb a { color: var(--text-2); text-decoration: none; transition: color .15s; }
.topbar-breadcrumb a:hover { color: var(--text); }
.topbar-breadcrumb span { color: var(--text-3); }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* Panel-Trigger Button (im Topbar) */
.panel-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-2);
  font-family: var(--font-body);
  font-size: .78rem;
  cursor: pointer;
  transition: all .15s;
}

.panel-trigger:hover {
  border-color: var(--border-hover);
  color: var(--text);
  background: var(--bg-hover);
}

.panel-trigger svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.5; }

/* ── Theme Toggle (Topbar, oben rechts) ────────────────────── */
.theme-btn-top {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-2);
  font-family: var(--font-body);
  font-size: .78rem;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}

.theme-btn-top:hover {
  border-color: var(--border-hover);
  color: var(--text);
  background: var(--bg-hover);
}

.theme-icon-top { font-size: .9rem; line-height: 1; }

/* ── Slide-in Panel (rechts) ───────────────────────────────── */
.site-panel {
  width: var(--panel-w);
  min-width: 260px;
  max-width: 360px;
  background: var(--bg-panel);
  border-left: 1px solid var(--border);
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  z-index: 300;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  transform: translateX(100%);
  transition: transform var(--transition), background var(--transition), border-color var(--transition);
  box-shadow: var(--shadow-panel);
}

.site-panel.open {
  transform: translateX(0);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.panel-title {
  font-family: var(--font-display);
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: -.01em;
}

.panel-close {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  color: var(--text-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}

.panel-close:hover { background: var(--bg-hover); color: var(--text); }
.panel-close svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.5; }

.panel-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.panel-section { margin-bottom: 24px; }
.panel-section-label {
  font-size: .7rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 8px;
}

/* ── Footer ────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: .78rem;
  color: var(--text-3);
  flex-shrink: 0;
  transition: border-color var(--transition);
}

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-3);
  text-decoration: none;
  transition: color .15s;
}

.footer-links a:hover { color: var(--text-2); }

/* ── Typografie ────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: -.02em;
  line-height: 1.2;
  color: var(--text);
}

h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; }
h2 { font-size: clamp(1.4rem, 2.5vw, 1.9rem); font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 600; }
h4 { font-size: .95rem; font-weight: 500; }

p { color: var(--text-2); line-height: 1.7; margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--link); transition: color .15s; }
a:hover { color: var(--link-hover); }

/* ── Komponenten ───────────────────────────────────────────── */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all .15s;
  white-space: nowrap;
  line-height: 1;
}

.btn-primary {
  background: var(--blue-grad);
  color: #ffffff;
  border-color: transparent;
}
.btn-primary:hover { opacity: .9; transform: translateY(-1px); color: #ffffff; border-color: transparent; }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--border-hover); background: var(--bg-hover); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }

.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.5; }

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color .2s, box-shadow .2s, background var(--transition);
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
}

.card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -.01em;
  margin-bottom: 8px;
}

/* Divider */
.divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

/* Badge */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 500;
  border: 1px solid var(--border);
  color: var(--text-2);
}

/* Grid Layouts */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1200px) {
  :root { --sidebar-w: 280px; --panel-w: 280px; }
}

@media (max-width: 900px) {
  .site-sidebar {
    transform: translateX(-100%);
    width: 280px !important;
    max-width: 280px;
  }
  .site-sidebar.mobile-open { transform: translateX(0); }
  .site-main { margin-left: 0 !important; }
  .site-shell.panel-open .site-main { margin-right: 0; }
  .main-content { padding: 32px 24px; }
  .main-topbar { padding: 0 24px; }
  .site-footer { padding: 20px 24px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .mobile-menu-btn { display: flex !important; }
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text);
  cursor: pointer;
  transition: all .15s;
}

.mobile-menu-btn:hover { background: var(--bg-hover); }
.mobile-menu-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.5; }

/* Mobile Overlay */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 199;
  backdrop-filter: blur(2px);
}

.mobile-overlay.active { display: block; }

/* ── Utility ───────────────────────────────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.text-muted { color: var(--text-2); }
.text-faint { color: var(--text-3); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
