:root {
  --navy: #0F4761;
  --navy-dark: #0A3448;
  --teal: #00B4A0;
  --blue: #4276B2;
  --red: #E63329;
  --ink: #17242C;
  --muted: #6A7C87;
  --line: #DCE4E9;
  --bg: #F3F6F8;
  --card: #FFFFFF;
  --radius: 6px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--navy); }
h1, h2, h3 { margin: 0 0 .6rem; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.05rem; }
h3 { font-size: .95rem; }

/* ------------------------------------------------------------- Kopfzeile */

header.top {
  background: var(--navy);
  color: #fff;
  border-bottom: 3px solid var(--teal);
}

.top-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: .7rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 1.4rem;
  flex-wrap: wrap;
}

.brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  text-decoration: none;
  letter-spacing: -.02em;
  white-space: nowrap;
}
.brand span { color: var(--teal); }

nav.main { display: flex; gap: .3rem; flex-wrap: wrap; flex: 1; }
nav.main a {
  color: #C9DBE5;
  text-decoration: none;
  padding: .35rem .7rem;
  border-radius: var(--radius);
  font-size: .92rem;
}
nav.main a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
nav.main a.active { background: rgba(0, 180, 160, .2); color: #fff; }

.who { font-size: .85rem; color: #C9DBE5; display: flex; align-items: center; gap: .6rem; }
.who form { display: inline; }
.who button {
  background: none; border: 1px solid rgba(255, 255, 255, .3); color: #C9DBE5;
  padding: .25rem .6rem; border-radius: var(--radius); cursor: pointer; font-size: .85rem;
}
.who button:hover { border-color: #fff; color: #fff; }

/* ---------------------------------------------------------------- Layout */

main { max-width: 1180px; margin: 0 auto; padding: 1.6rem 1.2rem 4rem; }

.page-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem;
}
.page-head .sub { color: var(--muted); font-size: .9rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 1.2rem;
}
.card > h2 {
  padding: .8rem 1rem;
  margin: 0;
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.card > h2 .h-extra { font-weight: 400; font-size: .85rem; color: var(--muted); }
.card-body { padding: 1rem; }

.grid { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.stats { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 1.2rem; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--teal);
  border-radius: var(--radius); padding: .8rem 1rem;
}
.stat .n { font-size: 1.55rem; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat .l { color: var(--muted); font-size: .82rem; }
.stat.warn { border-left-color: var(--red); }

/* ---------------------------------------------------------------- Tabelle */

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th {
  text-align: left; font-weight: 600; font-size: .76rem; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted); padding: .55rem 1rem;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
td { padding: .6rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #FAFCFD; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.nowrap { white-space: nowrap; }
.plate {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .82rem; background: var(--bg); border: 1px solid var(--line);
  border-radius: 3px; padding: .1rem .35rem; white-space: nowrap;
}
.delta { font-weight: 600; color: var(--navy); }
.empty { padding: 2rem 1rem; text-align: center; color: var(--muted); }
.empty a { font-weight: 600; }

/* ------------------------------------------------------------- Steuerung */

.btn {
  display: inline-block; background: var(--navy); color: #fff; border: 1px solid var(--navy);
  padding: .45rem .9rem; border-radius: var(--radius); text-decoration: none;
  font-size: .9rem; font-weight: 500; cursor: pointer; font-family: inherit;
}
.btn:hover { background: var(--navy-dark); border-color: var(--navy-dark); }
.btn.ghost { background: #fff; color: var(--navy); }
.btn.ghost:hover { background: var(--bg); }
.btn.danger { background: #fff; color: var(--red); border-color: #F0C4C1; }
.btn.danger:hover { background: #FDF2F1; }
.btn.small { padding: .25rem .55rem; font-size: .8rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.actions form { display: inline; }

.filters {
  display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap;
  padding: .8rem 1rem; border-bottom: 1px solid var(--line); background: #FAFCFD;
}
.filters label { font-size: .8rem; color: var(--muted); display: block; }

/* --------------------------------------------------------------- Formular */

.form { max-width: 620px; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .85rem; font-weight: 500; margin-bottom: .25rem; }
.field .hint { font-size: .8rem; color: var(--muted); margin-top: .25rem; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=month], select, textarea {
  width: 100%; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: var(--radius);
  font: inherit; background: #fff; color: var(--ink);
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--teal); outline-offset: 1px; border-color: var(--teal); }
.row2 { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
.check { display: flex; align-items: center; gap: .5rem; }
.check input { width: auto; }
.check label { margin: 0; font-weight: 400; }

/* --------------------------------------------------------------- Hinweise */

.msg { padding: .7rem 1rem; border-radius: var(--radius); margin-bottom: 1.2rem; font-size: .9rem; border: 1px solid; }
.msg.ok { background: #E7F8F5; border-color: #A8E4DB; color: #0A5E53; }
.msg.warn { background: #FDF3E7; border-color: #F0D3AA; color: #7A4E10; }
.msg.error { background: #FDF2F1; border-color: #F0C4C1; color: #A61B13; }

.tag {
  display: inline-block; font-size: .72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; padding: .12rem .4rem; border-radius: 3px;
}
.tag.admin { background: #E8F0F6; color: var(--navy); }
.tag.off { background: #EFF2F4; color: var(--muted); }
.tag.priv { background: #F1EAF6; color: #6B3E96; }

/* ------------------------------------------------------------- Anmeldung */

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.2rem; }
.login-box { background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--teal); border-radius: var(--radius); padding: 1.8rem; width: 100%; max-width: 370px; }
.login-box .brand { color: var(--navy); font-size: 1.3rem; display: block; margin-bottom: .3rem; }
.login-box .lead { color: var(--muted); font-size: .88rem; margin-bottom: 1.4rem; }
.login-box .btn { width: 100%; text-align: center; }

@media (max-width: 640px) {
  .row2 { grid-template-columns: 1fr; }
  th, td { padding: .5rem .6rem; }
  main { padding: 1.1rem .7rem 3rem; }
  .hide-s { display: none; }
}
