/* ==========================================================================
   WGGehts – dunkles, modernes Design
   ========================================================================== */

:root {
  --bg: #0b0d12;
  --bg-elev: #12151c;
  --surface: #171b24;
  --surface-2: #1e2330;
  --border: #262c3a;
  --text: #e8ebf2;
  --text-muted: #8b93a7;
  --accent: #7c5cff;
  --accent-2: #22d3a6;
  --accent-soft: rgba(124, 92, 255, 0.14);
  --success: #22d3a6;
  --danger: #ff6b81;
  --warning: #ffb547;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sidebar-w: 240px;
  color-scheme: dark;
}

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

html, body { margin: 0; }

body {
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(124, 92, 255, 0.12), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(34, 211, 166, 0.08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.02em; }
h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 750; }
h2 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0; }

.muted { color: var(--text-muted); }
.small { font-size: 0.85rem; }
.num { font-variant-numeric: tabular-nums; }
.pos { color: var(--success); }
.neg { color: var(--danger); }

/* ---------- App-Shell ---------- */

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px 16px;
  border-right: 1px solid var(--border);
  background: rgba(18, 21, 28, 0.7);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
}

.brand-logo {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-size: 1.1rem;
}

.brand span em { font-style: normal; color: var(--accent); }

.nav { display: flex; flex-direction: column; gap: 4px; }

.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 550;
  transition: background 0.15s, color 0.15s;
}

.nav a:hover { background: var(--surface); color: var(--text); }

.nav a.active {
  background: var(--accent-soft);
  color: var(--text);
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav .icon { width: 22px; text-align: center; }

.sidebar-footer { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }

.who {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
}

.main {
  padding: 36px clamp(16px, 4vw, 48px) 96px;
  max-width: 1200px;
  width: 100%;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.page-head p { margin-top: 6px; }

/* ---------- Bausteine ---------- */

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }

.card {
  background: linear-gradient(180deg, var(--surface), var(--bg-elev));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.card-head a { color: var(--accent); font-size: 0.85rem; font-weight: 600; }
.card-head a:hover { text-decoration: underline; }

.stat .label { color: var(--text-muted); font-size: 0.85rem; }
.stat .value { font-size: clamp(1.4rem, 2.4vw, 1.8rem); font-weight: 750; margin-top: 4px; letter-spacing: -0.02em; white-space: nowrap; }

.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--c, var(--accent));
  color: #0b0d12;
  font-weight: 800;
  font-size: 0.85rem;
}

.avatar.lg { width: 44px; height: 44px; font-size: 1.05rem; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 650;
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.badge.ok { background: rgba(34, 211, 166, 0.12); color: var(--success); border-color: transparent; }
.badge.warn { background: rgba(255, 181, 71, 0.12); color: var(--warning); border-color: transparent; }
.badge.accent { background: var(--accent-soft); color: #b9a8ff; border-color: transparent; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, background 0.15s, border-color 0.15s;
}

.btn:hover { border-color: #3a4256; }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #9b7dff);
  border-color: transparent;
  color: #fff;
}

.btn-primary:hover { filter: brightness(1.08); }

.input {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font: inherit;
}

.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.inline-form { display: flex; gap: 10px; }
.inline-form .input { flex: 1; }

/* ---------- Listen ---------- */

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }

.list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; }

.check {
  appearance: none;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 2px solid #3a4256;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.check:checked { background: var(--success); border-color: var(--success); }
.check:checked::after { content: "✓"; color: #0b0d12; font-weight: 900; font-size: 0.8rem; }

li:has(.check:checked) .title { text-decoration: line-through; color: var(--text-muted); }

/* ---------- Putzplan ---------- */

.chore {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.chore::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--c, var(--accent));
}

.chore-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--surface-2);
  font-size: 1.5rem;
}

.chore-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.person { display: flex; align-items: center; gap: 10px; }

/* ---------- Kasse ---------- */

.bar {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  margin-top: 10px;
}

.bar > span { display: block; height: 100%; background: var(--c, var(--accent)); border-radius: inherit; }

.settle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.settle .arrow { color: var(--text-muted); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
td.right, th.right { text-align: right; }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }

/* ---------- Pinnwand ---------- */

.posts { columns: 2 320px; column-gap: 20px; }
.posts .card { break-inside: avoid; margin-bottom: 20px; display: flex; flex-direction: column; gap: 14px; }
.post-pinned { border-color: rgba(124, 92, 255, 0.5); }
.post-meta { display: flex; align-items: center; gap: 10px; }

/* ---------- Hinweis-Banner ---------- */

.demo-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px dashed #3a4256;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ---------- Login ---------- */

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

.auth-card { width: 100%; max-width: 400px; padding: 32px; display: flex; flex-direction: column; gap: 20px; }
.auth-card .brand { justify-content: center; font-size: 1.5rem; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }

/* ---------- Mobile ---------- */

.bottom-nav { display: none; }

@media (max-width: 960px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding-top: 24px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }

  .bottom-nav {
    display: flex;
    position: fixed;
    inset: auto 12px 12px 12px;
    z-index: 10;
    justify-content: space-around;
    padding: 8px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: rgba(18, 21, 28, 0.9);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
  }

  .bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    color: var(--text-muted);
  }

  .bottom-nav a .icon { font-size: 1.2rem; }
  .bottom-nav a.active { color: var(--text); background: var(--accent-soft); }
}
