/* Adug-HR: App-Shell, Seitenleiste, Stempel-Utility-Farben */
:root {
  --bg: #0f1419;
  --bg-main: #f0f2f5;
  --panel: #ffffff;
  --line: #dbe0e8;
  --line-soft: #e8ecf2;
  --text: #141a22;
  --muted: #5a6575;
  --err-bg: #fde8e6;
  --err-bd: #e0a4a0;
  --ok: #0d6b3a;
  --link: #0b5c9e;
  --link-hover: #084a82;
  --shadow: 0 4px 24px rgba(12, 24, 40, 0.08);
  --shadow-soft: 0 1px 0 rgba(255, 255, 255, 0.6) inset;
  --sidebar: #121a24;
  --sidebar-text: #c5ced9;
  --sidebar-muted: #7a8799;
  --sidebar-active: #3d9fff;
  --sidebar-hover: rgba(255, 255, 255, 0.06);
  --radius: 10px;
  --font: "DM Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-main);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); }
a:hover { color: var(--link-hover); }
code { font-family: var(--font-mono); font-size: 0.88em; }

/* ——— App-Layout (eingeloggter Bereich) ——— */
.app {
  display: flex;
  min-height: 100vh;
  background: var(--bg-main);
}

.app__nav-toggle {
  display: none;
  position: fixed;
  z-index: 30;
  top: 0.75rem;
  left: 0.75rem;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 8px;
  background: var(--sidebar);
  color: #fff;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.app__nav-toggle::before {
  content: "☰";
  font-size: 1.1rem;
}

.app__sidebar {
  width: 16.5rem;
  flex-shrink: 0;
  background: linear-gradient(180deg, #121a24 0%, #0c1118 100%);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0 1rem;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 20;
  transition: transform 0.2s ease, box-shadow 0.2s;
}

.app__brand {
  padding: 0 1.1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  margin-bottom: 0.5rem;
}
.app__brand-link {
  font-weight: 700;
  font-size: 1.2rem;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.02em;
}
.app__brand-link:hover { color: #fff; opacity: 0.92; }
.app__brand-sub {
  display: block;
  font-size: 0.75rem;
  color: var(--sidebar-muted);
  margin-top: 0.25rem;
  line-height: 1.35;
}

.app__nav { flex: 1; padding: 0 0.5rem; overflow: auto; }
.app__nav-group { margin-top: 1.25rem; }
.app__nav-group-label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--sidebar-muted);
  padding: 0.35rem 0.65rem 0.5rem;
  font-weight: 600;
}
.app__nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  margin: 0.1rem 0;
  border-radius: 8px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.12s, color 0.12s;
}
.app__nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.app__nav-item.is-active {
  background: rgba(61, 159, 255, 0.15);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(61, 159, 255, 0.25);
}
.app__nav-ico {
  opacity: 0.85;
  width: 1.15rem;
  text-align: center;
  font-size: 0.9rem;
}

.app__sidebar-foot {
  padding: 1rem 1.1rem 0.25rem;
  font-size: 0.75rem;
  color: var(--sidebar-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.app__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app__topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 2.75rem;
  padding: 0.5rem 1.5rem 0.25rem;
  flex-shrink: 0;
}
.app__topbar-spacer { flex: 1; }
.app__topbar-actions { display: flex; align-items: center; gap: 0.5rem; }

/* Volle Viewport-Breite abzüglich Seitenleiste: kein künstliches max-width */
.app__content {
  flex: 1;
  width: 100%;
  max-width: none;
  min-width: 0;
  padding: 0 clamp(0.75rem, 1.2vw, 1.75rem) 2rem;
  margin: 0;
}

.app__foot {
  padding: 0.9rem 1.5rem 1.2rem;
  font-size: 0.8rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: var(--bg-main);
}

/* Mobile: Seitenleiste einblendbar */
@media (max-width: 880px) {
  .app__nav-toggle { display: flex; align-items: center; justify-content: center; }
  .app__sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    box-shadow: 0 0 0 0 rgba(0,0,0,0.5);
  }
  body:not(.app--nav-open) .app__sidebar {
    transform: translateX(-100%);
  }
  body.app--nav-open .app__sidebar {
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.35);
  }
  .app__content { padding-top: 0.5rem; }
}

/* Zugang: Login-Seite */
.auth-canvas {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse 120% 80% at 20% 20%, rgba(61, 159, 255, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse 80% 60% at 80% 90%, rgba(13, 107, 58, 0.08) 0%, transparent 45%),
    var(--bg-main);
}
.auth-card {
  width: 100%;
  max-width: 22rem;
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  padding: 1.75rem 1.75rem 1.5rem;
}
.auth-card__head { margin-bottom: 1.1rem; }
.auth-card__title { margin: 0; font-size: 1.45rem; letter-spacing: -0.03em; }
.auth-card__lead { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.9rem; }
.auth-input { font: inherit; padding: 0.6rem 0.75rem; }
.btn--wide { width: 100%; justify-content: center; }
.btn--primary { background: linear-gradient(180deg, #0d6ecf 0%, #0b5c9e 100%); border-color: #0a4f8a; }
.btn--primary:hover { filter: brightness(1.04); }
.btn--ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}
.btn--ghost:hover { color: var(--text); background: #fff; border-color: #cfd6e0; }

/* Inhalt: klassische Karten (bestehende Klassen) */
.wrap { width: 100%; max-width: none; margin: 0; padding: 0; }
.top { display: none; } /* alte Leiste, durch Shell ersetzt */
.tag {
  background: rgba(11, 92, 158, 0.12);
  color: var(--link);
  border-radius: 4px;
  padding: 0.1rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 600;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem 1.5rem;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
  margin-bottom: 1.25rem;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
}
.panel h1 { margin-top: 0; font-size: 1.45rem; letter-spacing: -0.02em; font-weight: 700; }
.lede { color: var(--muted); margin-top: -0.2rem; font-size: 0.95rem; }
.grid-2 { display: grid; gap: 1.5rem; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
h2 { font-size: 1.05rem; border-bottom: 1px solid var(--line); padding-bottom: 0.35rem; margin-top: 0; }
.dl { display: grid; grid-template-columns: 12rem 1fr; gap: 0.4rem 1rem; margin: 0; }
.dl dt { color: var(--muted); margin: 0; }
.dl dd { margin: 0; }
.muted, .note { color: var(--muted); font-size: 0.9rem; }
.warn { color: #a65c00; }

.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td { text-align: left; padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--line-soft); }
.num { font-variant-numeric: tabular-nums; }

.saldo-th-soll, .saldo-td--soll { background: rgba(20, 120, 80, 0.07); }
.saldo-td--saldo { background: rgba(200, 130, 30, 0.08); font-weight: 600; }
.saldo-td--pos { color: #145a2a; }
.saldo-td--neg { color: #9a2a2a; }

/* Laufender Überstunden-/Negativstand bis Stichtag (Saldo-Seite) */
.ueberstunden-stand {
  max-width: 36rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #f7f8fa;
}
.ueberstunden-stand--pos {
  border-color: #9fd4b0;
  background: #e6f4eb;
}
.ueberstunden-stand--neg {
  border-color: var(--err-bd);
  background: var(--err-bg);
}
.ueberstunden-stand__wert {
  font-size: 1.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.ueberstunden-stand--pos .ueberstunden-stand__wert { color: #145a2a; }
.ueberstunden-stand--neg .ueberstunden-stand__wert { color: #9a2a2a; }

.alert { background: #e6f4eb; border: 1px solid #9fd4b0; border-radius: var(--radius); padding: 0.75rem 1rem; margin: 0 0 1rem; }
.alert--err { background: var(--err-bg); border: 1px solid var(--err-bd); border-radius: var(--radius); padding: 0.75rem 1rem; margin: 0 0 1rem; }
.btn {
  display: inline-flex;
  align-items: center; justify-content: center;
  font: inherit; cursor: pointer; padding: 0.45rem 0.95rem;
  border: 1px solid var(--link);
  color: #fff; background: var(--link);
  border-radius: 8px; text-decoration: none; font-size: 0.9rem; font-weight: 500;
}
.btn:hover { filter: brightness(1.05); }
.btn:disabled, .btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn--danger { background: #a33; border-color: #822; }
.btn--link { display: inline; background: none; border: none; color: var(--link); padding: 0; cursor: pointer; font: inherit; text-decoration: underline; }
.btn--small { font-size: 0.8rem; padding: 0.22rem 0.5rem; }
.btn--active { background: #1a4d2e; border-color: #0f3320; color: #fff; font-weight: 600; }
.form { max-width: 40rem; }
.form__row { margin-bottom: 0.85rem; }
.form__row label, .form__row .form__label { display: block; font-size: 0.88rem; color: var(--muted); margin-bottom: 0.25rem; font-weight: 500; }
.form__row input[type="text"], .form__row input[type="number"], .form__row input[type="date"], .form__row input[type="password"],
.form__row select, .form__row textarea {
  width: 100%; max-width: 32rem; padding: 0.5rem 0.6rem; font: inherit;
  border: 1px solid var(--line); border-radius: 6px; box-sizing: border-box; background: #fff;
}
.form__row input:focus, .form__row select:focus, .form__row textarea:focus {
  outline: 2px solid rgba(11, 92, 158, 0.25);
  border-color: var(--link);
}
.form__row textarea { min-height: 4rem; }
.form__hint { font-size: 0.8rem; color: var(--muted); margin: 0.2rem 0 0; line-height: 1.4; }
.table-actions { white-space: nowrap; }
.table-actions .btn { margin-right: 0.25rem; }
.pager { margin: 0.5rem 0; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.admin-links { line-height: 1.85; padding-left: 1.1rem; }
.admin-links a { font-weight: 600; }
.pre { background: #f0f1f3; padding: 0.75rem; border-radius: 6px; overflow: auto; font-size: 0.75rem; font-family: var(--font-mono); border: 1px solid var(--line); }
.app__logout { margin: 0; }
.app__v { font-family: var(--font-mono); }
