:root{color-scheme:light dark;--bg:#edf1f4;--surface:#fff;--ink:#152630;--sub:#4b606a;--edge:#ccd7dc;--accent:#00614f;--soft:#dbeee7}
:root[data-theme=dark]{color-scheme:dark;--bg:#101a1f;--surface:#17252c;--ink:#ebf5f5;--sub:#a9bdc5;--edge:#36505b;--accent:#76e1bd;--soft:#233e38}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:15px/1.6 system-ui,sans-serif}
header{background:#142e37;color:#f4fbfb;padding:.8rem clamp(1rem,4vw,3rem);display:flex;justify-content:space-between;align-items:center;gap:1rem}.brand{color:inherit;font-size:1.15rem;font-weight:800;text-decoration:none}.brand span{font-weight:500;color:#b5dfd3}
.layout{display:grid;grid-template-columns:235px minmax(0,1fr);min-height:calc(100vh - 65px)}nav{background:var(--surface);padding:1.25rem .75rem;border-right:1px solid var(--edge)}nav a{display:block;padding:.5rem .8rem;margin:.15rem 0;border-radius:8px;text-decoration:none;color:var(--sub)}nav a:hover,nav a[aria-current]{background:var(--soft);color:var(--accent);font-weight:650}
main{padding:clamp(1rem,4vw,3rem);max-width:1350px;width:100%}h1{margin:.15rem 0 1.25rem;font-size:clamp(1.7rem,3vw,2.6rem);line-height:1.2;letter-spacing:-.03em}h2{font-size:1.15rem;margin:0 0 .85rem}.eyebrow{font-size:.85rem;color:var(--sub);margin:0}
section{background:var(--surface);padding:1.2rem;border:1px solid var(--edge);border-radius:12px;margin-bottom:1rem}section p:last-child{margin-bottom:0}.metrics{display:grid;gap:.8rem;grid-template-columns:repeat(auto-fit,minmax(135px,1fr))}.metrics strong{display:block;font-size:1.6rem;line-height:1.25;margin-top:.45rem}.metrics span{color:var(--sub)}
button,input{font:inherit;border:1px solid var(--edge);border-radius:7px;padding:.4rem .65rem;background:var(--surface);color:var(--ink)}button,summary{cursor:pointer}button:hover{border-color:var(--accent)}a{color:var(--accent)}form{display:grid;gap:.7rem;max-width:530px;margin:.8rem 0}label{display:block}label input:not([type=checkbox]){display:block;width:100%}form button{justify-self:start;background:var(--soft);color:var(--accent);font-weight:650}.search{max-width:340px;margin-bottom:.8rem}
.scroll{overflow:auto}table{border-collapse:collapse;width:100%;text-align:left}th,td{padding:.55rem .65rem;border-bottom:1px solid var(--edge);vertical-align:top}th button{border:0;padding:0;font-weight:700}td details{min-width:9rem}.notice{background:var(--soft);padding:.7rem 1rem;border-radius:8px}
@media(max-width:750px){.layout{display:block}nav{display:flex;overflow-x:auto;gap:.35rem;padding:.55rem;white-space:nowrap;border-bottom:1px solid var(--edge);border-right:0}nav a{flex:none}}

/* Shared workspace surfaces and controls */
:root {
  --bg: #edf3f8;
  --edge: #d5e1ec;
  --accent: #075ca0;
  --soft: #e3effb;
  --depth: 0 10px 30px #1739590d;
}
:root[data-theme=dark] {
  --accent: #a7d3ff;
  --soft: #243d58;
  --depth: 0 10px 30px #0004;
}
body {
  background: radial-gradient(ellipse at 90% 0, var(--soft), transparent 55%), var(--bg);
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
}
header {
  background: linear-gradient(115deg, #12304d, #204b70);
  min-height: 64px;
}
header button {
  background: #ffffff14;
  color: #f4fbff;
  border-color: #ffffff50;
}
.brand span { color: #c6e3ff; }
nav { background: color-mix(in srgb, var(--surface) 84%, transparent); }
section {
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--depth);
  border-radius: 16px;
}
.metrics section { border-top: 3px solid var(--accent); }
.metrics strong { color: var(--accent); }
.workspace-heading {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 1.3rem;
}
.workspace-heading h1 { margin: 0; }
.primary-action {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1rem;
  border-radius: 9px;
  background: #075ca0;
  color: white;
  text-decoration: none;
  font-weight: 700;
}
.primary-action:hover { background: #064a80; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
thead { background: var(--soft); }
th button { background: transparent; }
tbody tr:hover { background: color-mix(in srgb, var(--soft) 42%, transparent); }
tbody tr[hidden] { display: none; }
output { overflow-wrap: anywhere; user-select: all; }
output:empty { display: none; }
select {
  max-width: 100%;
  padding: .45rem .65rem;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: 7px;
}
#neues-postfach:target { border-color: var(--accent); }
@media (max-width: 750px) {
  nav { position: sticky; top: 0; z-index: 1; backdrop-filter: blur(16px); }
  .workspace-heading { align-items: flex-start; }
  .scroll { overscroll-behavior-inline: contain; }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
}
.brand .brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #d9edff;
  color: #143958;
  font-weight: 850;
}
.nav-group + .nav-group { margin-top: 1rem; }
.nav-label {
  display: block;
  color: var(--sub);
  font-size: .73rem;
  font-weight: 750;
  padding: .25rem .7rem;
}
nav a {
  display: flex;
  align-items: center;
  gap: .55rem;
  border: 1px solid transparent;
  padding: .37rem .55rem;
}
nav a[aria-current] { border-color: var(--edge); }
.nav-icon {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  min-height: 26px;
  border-radius: 7px;
  color: var(--accent);
  background: var(--soft);
  font: 700 16px/1 system-ui,sans-serif;
}
.metrics section { min-height: 132px; }
.metrics .nav-icon { display: grid; width: 32px; height: 32px; margin-bottom: .55rem; }
.metrics strong { margin-top: .25rem; }
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(200px,1fr));
  gap: .65rem;
}
.quick-actions a {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .6rem;
  padding: .75rem;
  border: 1px solid var(--edge);
  border-radius: 10px;
  text-decoration: none;
  font-weight: 650;
}
.quick-actions a:hover { background: var(--soft); }
.status span { color: #168359; margin-right: .35rem; }
.table-toolbar {
  padding: .65rem .75rem;
  border: 1px solid var(--edge);
  border-radius: 10px;
  margin-bottom: .7rem;
  background: color-mix(in srgb,var(--soft) 35%,var(--surface));
}
.table-toolbar .search { margin-bottom: 0; }
@media (max-width: 750px) {
  .nav-group, .nav-group + .nav-group { display: flex; margin: 0; gap: .25rem; }
  .nav-label { display: none; }
  .metrics section { min-height: 116px; }
}
