/* Zeiterfassung – Frank Löning Transporte */

@font-face {
  font-family: "Inter";
  src: url("inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #eef2f7;
  --border: #e4e8ef;
  --border-strong: #d3d9e3;
  --text: #0f1b2d;
  --text-2: #3d4b60;
  --muted: #6b7a90;

  --accent: #1565c0;
  --accent-hover: #0f56a8;
  --accent-soft: #e6effb;
  --accent-text: #0f4f99;

  --good: #12823b;
  --good-soft: #e5f5ea;
  --warn: #b25e00;
  --warn-fill: #f59e0b;
  --warn-soft: #fff4e0;
  --bad: #c62828;
  --bad-soft: #fdecec;
  --violet: #6d28d9;
  --violet-soft: #f1ebfe;

  --nav-bg: #0b1a2e;
  --nav-text: #a9b8cc;
  --nav-active: #ffffff;
  --nav-hover: rgba(255, 255, 255, .06);

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 27, 45, .05), 0 1px 3px rgba(15, 27, 45, .04);
  --shadow-lg: 0 12px 32px rgba(15, 27, 45, .12);
  --sidebar: 236px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #09111d;
    --surface: #0f1a2a;
    --surface-2: #132034;
    --surface-3: #18273e;
    --border: #1f2e45;
    --border-strong: #2a3b56;
    --text: #e7edf6;
    --text-2: #bac6d6;
    --muted: #8395ad;

    --accent: #5b9cf0;
    --accent-hover: #78aef3;
    --accent-soft: #15294a;
    --accent-text: #8dbaf5;

    --good: #4cc479;
    --good-soft: #10301f;
    --warn: #f4a640;
    --warn-fill: #f59e0b;
    --warn-soft: #33240f;
    --bad: #f07272;
    --bad-soft: #3a1a1f;
    --violet: #b79bf7;
    --violet-soft: #251c40;

    --nav-bg: #070e18;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, .5);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14.5px;
  line-height: 1.5;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
code { background: var(--surface-3); padding: .1em .35em; border-radius: 5px; font-size: .9em; }
strong { font-weight: 600; }

.icon { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); font-weight: 400; }
.small { font-size: .85em; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.inline { display: inline; }
.neg { color: var(--bad); }
.pos { color: var(--good); }
.print-only { display: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Grundlayout ---------- */

.main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 28px 48px;
}
.has-nav .main { margin-left: var(--sidebar); }
@media (min-width: 1460px) { .has-nav .main { margin-left: calc(var(--sidebar) + (100vw - var(--sidebar) - 1180px) / 2); } }

/* Seitenleiste */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  background: var(--nav-bg);
  color: var(--nav-text);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.brand:hover { text-decoration: none; }
.sidebar .brand { padding: 4px 8px 18px; }
.brand-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, #0d47a1, #1e88e5);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .03em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong { font-size: 14.5px; }
.brand-text small { color: var(--nav-text); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-group {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #627391;
  padding: 14px 10px 6px;
  font-weight: 600;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--nav-text);
  font-weight: 500;
}
.nav-link:hover { background: var(--nav-hover); color: #fff; text-decoration: none; }
.nav-link.active { background: rgba(91, 156, 240, .16); color: var(--nav-active); }
.nav-link.active .icon { color: #7cb3f7; }

.sidebar-user {
  padding: 12px 0 0;
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.sidebar-user-row { display: flex; align-items: center; gap: 10px; padding: 0 8px 8px; }
.sidebar-user-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.sidebar-user-actions form { margin: 0; }
.sidebar-user-actions .nav-link {
  width: 100%;
  justify-content: center;
  gap: 6px;
  padding: 7px 8px;
  font: inherit;
  font-size: 13px;
  background: rgba(255, 255, 255, .04);
  border: 0;
  cursor: pointer;
}
.sidebar-user-actions .icon { width: 16px; height: 16px; }

@media (max-width: 600px) { .hide-sm { display: none; } }
.sidebar-user-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.sidebar-user-text strong { color: #fff; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-text small { font-size: 11.5px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }

.mobilebar, .tabbar, .backdrop { display: none; }

/* Mobil: Schublade + untere Leiste */
@media (max-width: 959px) {
  .has-nav .main { margin-left: auto; padding: 16px 16px calc(84px + env(safe-area-inset-bottom)); }
  .sidebar {
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: var(--shadow-lg);
    width: min(280px, 85vw);
  }
  .nav-open .sidebar { transform: none; }
  .backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(5, 12, 22, .5);
    z-index: 35;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
  }
  .nav-open .backdrop { opacity: 1; pointer-events: auto; }

  .mobilebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 30;
    background: var(--nav-bg);
    color: #fff;
    padding: 8px 12px 8px 16px;
    padding-top: calc(8px + env(safe-area-inset-top));
  }
  .mobilebar .brand strong { font-size: 15px; }
  .mobilebar .brand-mark { width: 30px; height: 30px; font-size: 12px; }

  .tabbar {
    display: flex;
    position: fixed;
    inset: auto 0 0 0;
    z-index: 30;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 16px rgba(15, 27, 45, .06);
  }
  .tabbar a, .tabbar button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 2px;
    font: inherit;
    font-size: 11px;
    font-weight: 500;
    color: var(--muted);
    background: none;
    border: 0;
    cursor: pointer;
    text-decoration: none;
    border-radius: 8px;
  }
  .tabbar .icon { width: 22px; height: 22px; }
  .tabbar .active { color: var(--accent); }
}

/* ---------- Seitenkopf ---------- */

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.page-title h1 { font-size: 22px; font-weight: 700; }
.page-title p { margin: 2px 0 0; color: var(--muted); }
.actions, .toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar { margin-bottom: 16px; }
.toolbar .spacer { flex: 1; }
@media (max-width: 600px) {
  .page-title h1 { font-size: 19px; }
  .page-head { margin-bottom: 14px; }
}

.segmented {
  display: inline-flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  height: 36px;
}
.segmented a {
  display: grid;
  place-items: center;
  width: 34px;
  height: 100%;
  color: var(--text-2);
  border-radius: var(--radius-sm);
}
.segmented a:hover { background: var(--surface-3); }
.segmented-label { min-width: 118px; text-align: center; font-weight: 600; padding: 0 4px; }

/* ---------- Karten ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}
.card-flush { padding: 0; overflow-x: auto; }
.card.narrow { max-width: 620px; }
.card-title { font-size: 15px; font-weight: 650; margin-bottom: 12px; }
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.card-head .card-title { margin: 0; }
.card-flush > .card-head { padding: 14px 16px 0; }
.card-warning { border-color: color-mix(in srgb, var(--warn-fill) 45%, var(--border)); background: var(--warn-soft); }
.card-warning .card-title { display: flex; align-items: center; gap: 8px; color: var(--warn); }
details.card > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary .icon { color: var(--accent); }
details.card > summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .15s; }
details.card[open] > summary { margin-bottom: 16px; }
details.card[open] > summary::after { transform: rotate(180deg); }

.grid-2col { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 1000px) { .grid-2col { grid-template-columns: 3fr 2fr; } }
.grid-2col > .card { margin-bottom: 0; }

/* ---------- Kennzahlen ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stats-2 { grid-template-columns: repeat(2, 1fr); }
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  min-width: 0;
}
.stat-label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.stat-label .icon { width: 15px; height: 15px; }
.stat-value { font-size: 24px; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; margin-top: 4px; }
.stat-hint { color: var(--muted); font-size: 12px; margin-top: 2px; }
.stat-pos .stat-value { color: var(--good); }
.stat-neg .stat-value { color: var(--bad); }
@media (max-width: 600px) {
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat { padding: 12px; }
  .stat-value { font-size: 20px; }
}

/* ---------- Meldungen ---------- */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 14px;
  border: 1px solid transparent;
  font-weight: 500;
  transition: opacity .3s, transform .3s;
}
.alert > span { flex: 1; padding-top: 1px; }
.alert .icon { margin-top: 1px; }
.alert-success { background: var(--good-soft); color: var(--good); border-color: color-mix(in srgb, var(--good) 25%, transparent); }
.alert-error { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.alert-info { background: var(--accent-soft); color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.alert-close {
  border: 0;
  background: none;
  color: inherit;
  opacity: .6;
  cursor: pointer;
  padding: 0;
  display: grid;
}
.alert-close:hover { opacity: 1; }
.alert-close .icon { width: 16px; height: 16px; margin: 2px 0 0; }
.alert.is-hiding { opacity: 0; transform: translateY(-4px); }

/* ---------- Formulare ---------- */

label { display: block; font-weight: 500; font-size: 13px; color: var(--text-2); margin-bottom: 12px; }
input[type=text], input[type=password], input[type=number], input[type=date],
input[type=time], input[type=datetime-local], select {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 0 12px;
  height: 40px;
  font: inherit;
  font-size: 14.5px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: var(--muted); opacity: .8; }
input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7a90' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
}
.toolbar select, .card-head select, .page-head select { width: auto; min-width: 210px; max-width: 100%; margin: 0; height: 36px; }
label.checkbox { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); }
label.checkbox input { width: 18px; height: 18px; accent-color: var(--accent); }
.hint { color: var(--muted); font-weight: 400; }

.form-grid { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
@media (min-width: 640px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
  .span-2 { grid-column: span 2; }
  .span-all { grid-column: 1 / -1; }
}
.form-section {
  grid-column: 1 / -1;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin: 6px 0 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.form-section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.form-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.form-note { color: var(--muted); font-size: 12.5px; margin: 8px 0 0; }

.field-icon { position: relative; margin: 0; }
.field-icon > .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--muted);
  pointer-events: none;
}
.field-icon input { margin: 0; padding-left: 38px; }
.field-row { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 520px) { .field-row { grid-template-columns: 1fr 1.4fr; } }

.danger-zone {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, border-color .15s, transform .05s, box-shadow .15s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn .icon { width: 17px; height: 17px; }
.btn-sm { height: 34px; padding: 0 11px; font-size: 13.5px; }
.btn-sm .icon { width: 16px; height: 16px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(21, 101, 192, .3); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--muted); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-danger { background: var(--bad-soft); color: var(--bad); }
.btn-danger:hover { background: var(--bad); color: #fff; }
@media (prefers-color-scheme: dark) {
  .btn-primary { color: #06101d; }
}

/* ---------- Stempeluhr ---------- */

.stamp {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.stamp::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--border-strong);
}
.stamp.status-on::before { background: var(--good); }
.stamp.status-break::before { background: var(--warn-fill); }
@media (min-width: 760px) {
  .stamp { grid-template-columns: 240px 1fr; gap: 28px; padding: 24px 28px; align-items: center; }
}

.stamp-visual { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.ring { position: relative; width: 196px; height: 196px; }
.ring svg { width: 100%; height: 100%; display: block; }
.ring-track { fill: none; stroke: var(--accent-soft); stroke-width: 10; }
.ring-fill { fill: none; stroke: var(--accent); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.status-break .ring-fill { stroke: var(--warn-fill); }
.status-break .ring-track { stroke: var(--warn-soft); }
.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ring-value { font-size: 44px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.ring-label { color: var(--muted); font-size: 12.5px; margin-top: 6px; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface-3);
  font-weight: 600;
  font-size: 13.5px;
}
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status-on .status-pill { background: var(--good-soft); color: var(--good); }
.status-on .status-pill .dot { background: var(--good); animation: pulse 2s infinite; }
.status-break .status-pill { background: var(--warn-soft); color: var(--warn); }
.status-break .status-pill .dot { background: var(--warn-fill); }
.status-since { font-weight: 500; opacity: .85; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 50%, transparent); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.stamp-panel { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.stamp-panel .alert { margin: 0; }
.stamp-clock {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 500;
}
.stamp-clock span { color: var(--text); font-size: 20px; font-weight: 650; }
.stamp-form { display: flex; flex-direction: column; gap: 10px; }
.stamp-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stamp-buttons form { display: contents; }
.btn-xl { height: 56px; font-size: 17px; border-radius: 12px; width: 100%; color: #fff; }
.btn-xl .icon { width: 20px; height: 20px; }
.btn-in { background: var(--good); box-shadow: 0 4px 14px color-mix(in srgb, var(--good) 30%, transparent); }
.btn-out { background: var(--bad); box-shadow: 0 4px 14px color-mix(in srgb, var(--bad) 25%, transparent); }
.btn-break { background: var(--warn-fill); color: #2b1600; }
.btn-in:hover, .btn-out:hover, .btn-break:hover { filter: brightness(1.06); }
@media (prefers-color-scheme: dark) {
  .btn-in, .btn-out { color: #06101d; }
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.stamp-panel .chips { margin: 0; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
}
.chip .icon { width: 15px; height: 15px; color: var(--muted); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 12px;
  padding: 9px 0 9px 18px;
  position: relative;
  border-bottom: 1px solid var(--border);
}
.timeline li:last-child { border-bottom: 0; padding-bottom: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 16px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
}
.timeline li.is-running::before { background: var(--good); }
.timeline-time { font-weight: 650; font-variant-numeric: tabular-nums; }
.timeline-meta { color: var(--muted); font-size: 13px; }
.timeline-note { width: 100%; color: var(--text-2); font-size: 13px; }

/* ---------- Tabellen ---------- */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table thead th {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  background: var(--surface-2);
  white-space: nowrap;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table tfoot td, .table tfoot th { border-top: 1px solid var(--border-strong); border-bottom: 0; font-weight: 650; background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tr.is-inactive td { opacity: .5; }
.card:not(.card-flush) > .table-wrap { margin: 0 -18px -18px; }
.card .table th:first-child, .card .table td:first-child { padding-left: 18px; }
.card .table th:last-child, .card .table td:last-child { padding-right: 18px; }
.card > .card-title + .table-wrap, .card > .card-head + .table-wrap { margin-top: 0; }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.person-text small { color: var(--muted); font-size: 12px; }
.empty { color: var(--muted); text-align: center; padding: 18px 0 4px; margin: 0; }

/* Monatstabelle */
.month-table td { vertical-align: top; }
.month-table .c-day { white-space: nowrap; width: 88px; font-variant-numeric: tabular-nums; }
.month-table .wd { display: inline-block; width: 22px; color: var(--muted); font-weight: 500; }
.month-table .c-hints { width: 30%; }
.month-table tr.is-weekend td, .month-table tr.is-future td { color: var(--muted); }
.month-table tr.is-weekend td { background: var(--surface-2); }
.month-table tr.is-empty td { padding-top: 6px; padding-bottom: 6px; }
.month-table tr.is-today .c-day { box-shadow: inset 3px 0 0 var(--accent); font-weight: 650; color: var(--accent-text); }
.month-table tr.is-today .wd { color: var(--accent-text); }
.entry-line { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.entry-line + .entry-line { margin-top: 4px; }
.entry-time { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }
a.entry-time { color: var(--accent-text); }
.entry-time.is-running { color: var(--good); }
.entry-meta { color: var(--muted); font-size: 12.5px; }
.entry-note { color: var(--muted); font-size: 12.5px; }
.entry-line .entry-note { flex-basis: 100%; }
.warn { display: inline-flex; align-items: center; gap: 4px; color: var(--warn); font-size: 12.5px; font-weight: 500; margin-right: 8px; }
.warn .icon { width: 14px; height: 14px; }
.add-link {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  color: var(--muted);
  opacity: 0;
  vertical-align: middle;
}
.add-link .icon { width: 15px; height: 15px; }
.add-link:hover { background: var(--accent-soft); color: var(--accent); }
tr:hover .add-link, .add-link:focus { opacity: 1; }
@media (hover: none) { .add-link { opacity: .7; } }

/* Monatstabelle als kompakte Liste auf dem Handy */
@media (max-width: 700px) {
  .month-table, .month-table tbody, .month-table tfoot { display: block; }
  .month-table thead { display: none; }
  .month-table tr {
    display: grid;
    grid-template-columns: 62px 1fr auto;
    column-gap: 10px;
    padding: 9px 14px;
    border-bottom: 1px solid var(--border);
  }
  .month-table tr.is-empty { padding-top: 6px; padding-bottom: 6px; }
  .month-table td { display: block; padding: 0 !important; border: 0; background: none !important; width: auto; }
  .month-table td.c-day { grid-row: 1 / span 2; grid-column: 1; width: auto; box-shadow: none !important; }
  .month-table .wd { display: block; width: auto; font-size: 11.5px; line-height: 1.2; }
  .month-table td.c-times { grid-row: 1; grid-column: 2; }
  .month-table td.c-ist { grid-row: 1; grid-column: 3; font-weight: 650; }
  .month-table td.c-diff { grid-row: 2; grid-column: 3; font-size: 12.5px; }
  .month-table td.c-hints { grid-row: 2; grid-column: 2; }
  .month-table td.c-hints:empty { display: none; }
  .month-table td.c-break, .month-table td.c-soll { display: none; }
  .month-table tr.is-weekend { background: var(--surface-2); }
  .month-table tr.is-today { box-shadow: inset 3px 0 0 var(--accent); }
  .month-table tfoot tr { background: var(--surface-2); border-bottom: 0; }
  .month-table tfoot td.c-times { font-weight: 400; color: var(--muted); font-size: 12.5px; }
}

/* ---------- Badges, Tags, Avatare ---------- */

.badge, .tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--text-2);
  white-space: nowrap;
  vertical-align: middle;
}
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge-admin { background: var(--accent-soft); color: var(--accent-text); }
.badge-manuell { background: var(--warn-soft); color: var(--warn); }
.tag-on { background: var(--good-soft); color: var(--good); }
.tag-off { background: var(--surface-3); color: var(--muted); }
.tag-break { background: var(--warn-soft); color: var(--warn); }
.tag-holiday { background: var(--violet-soft); color: var(--violet); }
.tag-urlaub { background: var(--accent-soft); color: var(--accent-text); }
.tag-krank { background: var(--bad-soft); color: var(--bad); }
.tag-schulung, .tag-sonstiges { background: var(--good-soft); color: var(--good); }
.tag-ausgleich { background: var(--warn-soft); color: var(--warn); }

.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: .02em;
  color: #fff;
}
.avatar-sm { width: 30px; height: 30px; font-size: 11.5px; }
.avatar-lg { width: 40px; height: 40px; font-size: 14px; }
.avatar-0 { background: #1565c0; }
.avatar-1 { background: #00838f; }
.avatar-2 { background: #6a1b9a; }
.avatar-3 { background: #c2410c; }
.avatar-4 { background: #2e7d32; }
.avatar-5 { background: #455a64; }

/* ---------- Übersicht: Mitarbeiterkarten ---------- */

.people {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
}
.person-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  position: relative;
}
.person-card:hover { border-color: var(--border-strong); background: var(--surface-2); text-decoration: none; }
.person-card .person-text { flex: 1; }
.person-card .person-text strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-card .person-hours { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.2; }
.person-card .person-hours small { display: block; color: var(--muted); font-weight: 400; font-size: 11.5px; }
.person-card .tag { margin-top: 4px; align-self: flex-start; }
.person-card.is-on { border-left: 3px solid var(--good); }
.person-card.is-break { border-left: 3px solid var(--warn-fill); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; padding-bottom: 0; }
.list li .grow { flex: 1; min-width: 180px; }

.pager { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 14px; border-top: 1px solid var(--border); }

/* Meter (Urlaubskonto) */
.meter { display: flex; align-items: center; gap: 10px; min-width: 140px; }
.meter-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--accent-soft); overflow: hidden; display: block; }
.meter-bar svg { display: block; width: 100%; height: 6px; }
.meter-bar rect { fill: var(--accent); }
.meter.is-over .meter-bar rect { fill: var(--bad); }

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

.page-login {
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(30, 136, 229, .55), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(13, 71, 161, .5), transparent 60%),
    #071628;
  min-height: 100vh;
}
.page-login .main { max-width: none; padding: 0 16px; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 32px 0; }
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: 20px;
  padding: 28px 26px 22px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .4);
}
.login-card.wide { max-width: 520px; }
.login-card h1 { text-align: center; font-size: 20px; margin-bottom: 4px; }
.login-card .lead { text-align: center; color: var(--muted); margin: 0 0 20px; }
.login-card h2 { font-size: 15px; margin: 20px 0 10px; }
.login-logo { display: block; width: 100%; height: auto; border-radius: 12px; margin-bottom: 18px; }
.login-foot { text-align: center; color: var(--muted); font-size: 12.5px; margin: 16px 0 0; }
.login-card .btn-block { height: 44px; margin-top: 4px; }

/* ---------- Druck (Stundenzettel) ---------- */

@media print {
  @page { size: A4 portrait; margin: 12mm; }
  :root {
    --text: #000; --text-2: #222; --muted: #555; --border: #bbb; --border-strong: #888;
    --surface: #fff; --surface-2: #f2f2f2; --surface-3: #eee;
  }
  body { background: #fff; font-size: 9.5pt; }
  .sidebar, .mobilebar, .tabbar, .backdrop, .no-print, .alert, .add-link, .page-head { display: none !important; }
  .has-nav .main, .main { margin: 0; padding: 0; max-width: none; }
  .print-only { display: block; }
  .card, .stat { box-shadow: none; border-radius: 6px; }
  .print-head { display: flex; justify-content: space-between; border-bottom: 2px solid #000; padding-bottom: 6px; margin-bottom: 10px; }
  .stats { grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 8px; }
  .stat { padding: 5px 8px; }
  .stat-label .icon, .stat-hint { display: none; }
  .stat-value { font-size: 12pt; margin: 0; }
  .card-flush { overflow: visible; border: 0; }
  .month-table { font-size: 8.5pt; }
  .month-table tfoot { display: table-row-group; }
  .month-table tr { break-inside: avoid; }
  .table th, .table td,
  .card .table th:first-child, .card .table td:first-child,
  .card .table th:last-child, .card .table td:last-child { padding: 2px 5px; }
  .table tbody tr:hover td { background: none; }
  .print-page { margin-bottom: 0; }
  .month-table tr.is-empty td { padding-top: 2px; padding-bottom: 2px; }
  .tag { padding: 1px 4px; font-size: 7.5pt; }
  .tag::before { display: none; }
  .entry-meta, .entry-note, .warn { font-size: 7.5pt; }
  .signatures { display: flex; justify-content: space-between; gap: 32px; margin-top: 36px; }
  .signatures div { flex: 1; border-top: 1px solid #000; padding-top: 3px; font-size: 8pt; }
  .print-page { break-after: page; }
  .print-page:last-of-type { break-after: auto; }
}
.print-page + .print-page { margin-top: 28px; }
