/* Reset & Grundlayout */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body, h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
table { border-collapse: collapse; width: 100%; }

body {
  font-family: var(--font-body);
  font-size: var(--fs-md);
  color: var(--ink);
  background: var(--porcelain);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .font-head { font-family: var(--font-head); font-weight: 500; letter-spacing: -0.01em; }

/* ---------- Login ---------- */
#login {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: linear-gradient(160deg, var(--shadow-green-l) 0%, var(--porcelain) 55%, var(--tiara) 100%);
}
.login-card {
  width: min(420px, calc(100vw - 2rem));
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
  padding: var(--space-6);
  text-align: center;
}
.login-card .logo { margin-bottom: var(--space-5); display: flex; justify-content: center; }
.login-card h1 { font-size: var(--fs-xl); margin-bottom: var(--space-2); }
.login-card p { color: var(--ink-soft); font-size: var(--fs-sm); margin-bottom: var(--space-6); }
.btn-ms {
  display: flex; align-items: center; justify-content: center; gap: var(--space-3);
  width: 100%; padding: var(--space-3) var(--space-4);
  background: var(--white); border: 1px solid var(--geyser);
  border-radius: var(--radius-sm); font-size: var(--fs-md); font-weight: 500;
  transition: background .15s, border-color .15s;
}
.btn-ms:hover { background: var(--porcelain); border-color: var(--tiara); }
/* Zweiter Anmeldeweg: gleicher Knopfstil wie Microsoft, darunter
   klappt das Formular mit E-Mail und Passwort auf.                */
.btn-zugang { margin-top: var(--space-2); }
.btn-zugang.offen { border-color: var(--shadow-green); background: var(--shadow-green-l); }
.login-pass { margin-top: var(--space-3); text-align: left;
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-3); border: 1px solid var(--geyser);
  border-radius: var(--radius-md); background: var(--porcelain); }
.login-pass input { width: 100%; padding: 9px 11px; border: 1px solid var(--geyser);
  border-radius: var(--radius-sm); font-size: var(--fs-sm); background: var(--white); }
.login-pass input:focus { border-color: var(--shadow-green); outline: none; }
.login-pass .btn { width: 100%; }
.login-pass .field-hint { margin: 0; }
.login-hint { margin-top: var(--space-5); font-size: var(--fs-xs); color: var(--ink-mute); }

/* ---------- App-Gerüst ---------- */
/* Die Höhe steckt in `main` – mit min-height am #app käme der
   Versatz für die feste Kopfleiste obendrauf und jede Seite wäre
   um deren Höhe zu hoch (unnötiger Leer-Scroll).               */
#app { display: none; }
#app.on { display: block; }

.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h); z-index: 20;
  display: flex; align-items: center; gap: var(--space-5);
  padding: 0 var(--space-5);
  background: var(--white); border-bottom: 1px solid var(--geyser);
}
.topbar .brand { display: flex; align-items: center; gap: var(--space-3); }
.topbar .brand svg, .topbar .brand img { display: block; }
.brand-sep { width: 1px; height: 22px; background: var(--geyser); }
.brand-app { font-family: var(--font-head); font-size: var(--fs-lg); color: var(--ink-soft); }
.topbar .spacer { flex: 1; }

.langswitch { display: flex; border: 1px solid var(--geyser); border-radius: var(--radius-sm); overflow: hidden; }
.langswitch button { padding: 4px 9px; font-size: var(--fs-xs); color: var(--ink-soft); }
.langswitch button.active { background: var(--shadow-green); color: #fff; }
.langswitch button:hover:not(.active) { background: var(--porcelain); }

/* Sprachwahl auf der Login-Karte – vor der Anmeldung wählbar */
.login-lang {
  display: flex; align-items: center; justify-content: flex-end; gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.login-lang .lbl { font-size: var(--fs-xs); color: var(--ink-mute); }

.viewas { display: flex; align-items: center; gap: var(--space-2); font-size: var(--fs-xs); color: var(--ink-soft); }
.viewas select { padding: 5px 8px; border: 1px solid var(--geyser); border-radius: var(--radius-sm); background: var(--white); font-size: var(--fs-xs); }

.userchip { display: flex; align-items: center; gap: var(--space-2); font-size: var(--fs-sm); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--shadow-green); color: #fff; display: grid; place-items: center; font-size: var(--fs-xs); font-weight: 600; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; top: var(--topbar-h); bottom: 0; left: 0; width: var(--sidebar-w); z-index: 10;
  padding: var(--space-4) var(--space-3);
  background: var(--white); border-right: 1px solid var(--geyser);
  overflow-y: auto;
}
.nav-group { margin-bottom: var(--space-5); }
.nav-group > .label { padding: 0 var(--space-3) var(--space-2); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-mute); }
.nav-item {
  display: flex; align-items: center; gap: var(--space-3); width: 100%;
  padding: var(--space-2) var(--space-3); margin-bottom: 2px;
  border-radius: var(--radius-sm); font-size: var(--fs-md); color: var(--ink-soft);
  text-align: left; transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--porcelain); color: var(--ink); }
.nav-item.active { background: var(--shadow-green-l); color: var(--ink); font-weight: 500; box-shadow: inset 2px 0 0 var(--shadow-green-d); }
.nav-item .ico { width: 16px; opacity: .75; }
.nav-sub { margin: 2px 0 var(--space-2) var(--space-5); border-left: 1px solid var(--geyser); padding-left: var(--space-2); }
.nav-sub .nav-item { font-size: var(--fs-sm); padding: 6px var(--space-3); }

/* ---------- Content ---------- */
/* Der Inhalt nutzt die Bildschirmbreite. Der Deckel ist bewusst
   hoch: breite Monitore werden ausgenutzt, auf sehr breiten bleibt
   der Lesefluss aber erhalten. Lange Fließtexte begrenzen sich
   ohnehin selbst (siehe .note/.ad-text/.task .t-desc).             */
main {
  /* Der Platz für die feste Kopfleiste steckt im PADDING, nicht im
     Margin: ein Außenabstand würde nach oben durchschlagen
     (margin collapsing) und die Seite um seine Höhe zu hoch machen –
     jede Seite hätte einen unnötigen Leer-Scroll.                  */
  margin: 0 0 0 var(--sidebar-w);
  padding: calc(var(--topbar-h) + var(--space-6)) var(--space-6) var(--space-6);
  max-width: 2400px;
  min-height: 100vh;
}
.page-head { display: flex; align-items: flex-end; gap: var(--space-4); margin-bottom: var(--space-5); flex-wrap: wrap; }
.page-head h2 { font-size: var(--fs-xl); }
.page-head .sub { font-size: var(--fs-sm); color: var(--ink-soft); margin-top: 2px; }
.page-head .spacer { flex: 1; }
.breadcrumb { font-size: var(--fs-xs); color: var(--ink-mute); margin-bottom: var(--space-2); }
.breadcrumb button { color: var(--shadow-green-d); text-decoration: underline; }

@media (max-width: 900px) {
  .sidebar { display: none; }
  main { margin-left: 0; padding: var(--space-4); }
  .topbar { padding: 0 var(--space-4); }
  .viewas .lbl { display: none; }
}

