/* === Design tokens (HygaCert Corporate Design: Forest Green / Amber Gold / Ivory White) === */
:root {
  --c-bg: #f5f3ee;             /* Ivory White */
  --c-surface: #ffffff;
  --c-ink: #1f2937;            /* gray-800 */
  --c-ink-soft: #374151;       /* gray-700 */
  --c-muted: #6b7280;          /* gray-500 */
  --c-line: #e5e7eb;           /* gray-200 */
  --c-line-soft: #f3f4f6;      /* gray-100 */

  --c-brand: #1e4d2b;          /* Forest Green (primär) */
  --c-brand-2: #2d6a3e;
  --c-brand-3: #12301b;
  --c-brand-soft: #e4ece5;
  --c-accent: #c8962a;         /* Amber Gold (Akzent/CTA) */
  --c-accent-2: #a37a1f;
  --c-grad-1: #e7e9dd;
  --c-grad-2: #ebe4d2;

  --c-work: #2d6a3e;
  --c-pause: #b46c00;
  --c-stop: #ef4444;
  --c-vac:  #1e4d2b;
  --c-sick: #b42318;
  --c-holi: #6a4ea0;
  --c-warn: #b46c00;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 22px;

  --sh-1: 0 1px 2px rgba(20,37,42,.06), 0 4px 14px rgba(20,37,42,.05);
  --sh-2: 0 4px 18px rgba(20,37,42,.10);

  --f-sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--f-sans);
  color: var(--c-ink);
  background:
    radial-gradient(1200px 600px at 90% -10%, var(--c-grad-1) 0%, transparent 60%),
    radial-gradient(900px 500px at -10% 110%, var(--c-grad-2) 0%, transparent 55%),
    var(--c-bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 15px; color: var(--c-ink); }

/* === Topbar === */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 24px;
  padding: 14px 20px;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--c-line);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  height: 36px; width: auto; display: block;
  object-fit: contain;
}
.brand-name { font-weight: 700; letter-spacing: .2px; color: var(--c-brand-3); }
.role-switch { display: flex; gap: 6px; margin-left: auto; background: var(--c-line-soft); padding: 4px; border-radius: 999px; }
.role-btn {
  border: 0; padding: 8px 16px; border-radius: 999px;
  background: transparent; color: var(--c-ink-soft); font-weight: 600;
  font-size: 14px;
}
.role-btn.active { background: var(--c-brand); color: #fff; box-shadow: var(--sh-1); }
.help-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px 6px 10px; border-radius: 999px;
  background: var(--c-line-soft); color: var(--c-ink-soft);
  text-decoration: none; font-size: 13px; font-weight: 600;
  border: 1px solid transparent;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.help-btn:hover { background: var(--c-brand-soft); color: var(--c-brand); border-color: var(--c-brand); }
.help-btn > span:first-child {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--c-brand); color: #fff;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; line-height: 1;
}
@media (max-width: 520px) { .help-btn .help-text { display: none; } .help-btn { padding: 6px 8px; } }

.user-chip { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 999px; background: var(--c-line-soft); }

.live-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--c-brand-soft); color: var(--c-brand);
  font-size: 12px; font-weight: 700; letter-spacing: .04em;
  margin-left: auto;
}
.live-pill .live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--c-vac);
  box-shadow: 0 0 0 0 rgba(47,122,79,.6);
  animation: livePulse 1.6s ease-out infinite;
}
.live-pill.offline .live-dot { background: var(--c-stop); animation: none; }
.live-pill.offline { background: rgba(239,68,68,.10); color: var(--c-stop); }
.live-pill .live-ts { font-family: var(--f-mono); font-weight: 600; font-size: 11px; color: var(--c-ink-soft); margin-left: 4px; }
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(47,122,79,.55); }
  70%  { box-shadow: 0 0 0 8px rgba(47,122,79,0); }
  100% { box-shadow: 0 0 0 0 rgba(47,122,79,0); }
}
.user-chip span { font-size: 13px; font-weight: 600; }
.link-btn { background: none; border: 0; color: var(--c-brand); font-weight: 600; padding: 0; font-size: 13px; }
.link-btn:hover { text-decoration: underline; }

/* === Generic === */
.view { padding: 24px; max-width: 1280px; margin: 0 auto; }
.muted { color: var(--c-muted); }
.hint { font-size: 12.5px; color: var(--c-muted); margin-top: 8px; }
h1 { font-size: 24px; margin: 0 0 4px; }
h2 { font-size: 18px; margin: 24px 0 10px; }
h3 { font-size: 15px; margin: 18px 0 8px; color: var(--c-ink-soft); text-transform: uppercase; letter-spacing: .6px; }

/* === Buttons === */
.primary, .ghost, .danger {
  border: 0; padding: 10px 16px; border-radius: var(--r-md);
  font-weight: 600; font-size: 14px;
  transition: transform .04s ease, box-shadow .2s ease, background .2s ease;
}
.primary { background: var(--c-brand); color: #fff; }
.primary:hover { background: var(--c-brand-2); }
.ghost { background: transparent; color: var(--c-ink); border: 1px solid var(--c-line); }
.ghost:hover { background: var(--c-line-soft); }
.danger { background: var(--c-stop); color: #fff; }
.danger:hover { filter: brightness(.95); }
.block { width: 100%; padding: 14px; }
.huge {
  width: 100%;
  padding: 22px;
  font-size: 18px;
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}
.huge.primary {
  background: linear-gradient(135deg, var(--c-brand-2) 0%, var(--c-brand) 60%, var(--c-brand-3) 130%);
  color: #fff;
}
.huge.primary:hover { background: var(--c-brand); filter: brightness(1.04); }
.huge.ghost { background: #fff; }
.huge:active { transform: translateY(1px); }

/* === Login === */
.login-wrap {
  max-width: 420px; margin: 60px auto;
  background: var(--c-surface); padding: 28px; border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  border: 1px solid var(--c-line);
}
.login-err { background: #f4d6d1; color: #8a2920; padding: 8px 12px; border-radius: var(--r-sm); font-size: 13px; margin: 6px 0 10px; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.field > span { font-size: 13px; color: var(--c-ink-soft); font-weight: 600; }
.field input, .field select {
  padding: 10px 12px; border: 1px solid var(--c-line); border-radius: var(--r-sm);
  background: #fff;
}
.field input:focus, .field select:focus { outline: 2px solid var(--c-brand); outline-offset: 1px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 8px 0; }

/* === Techniker shell === */
.tech-shell {
  max-width: 480px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 16px;
}
.tabbar {
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--c-surface); border-radius: var(--r-lg); padding: 4px;
  border: 1px solid var(--c-line);
}
.tab {
  border: 0; background: transparent; color: var(--c-ink-soft);
  padding: 10px 4px; font-weight: 600; font-size: 14px;
  border-radius: 12px;
}
.tab.active { background: var(--c-brand); color: #fff; }
.tab-panel { background: var(--c-surface); border-radius: var(--r-lg); padding: 18px; border: 1px solid var(--c-line); }

/* Status card */
.status-card { padding: 22px 18px 18px; text-align: center; }
.status-line { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 999px; background: var(--c-line-soft); }
.status-dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--c-muted);
  box-shadow: 0 0 0 0 rgba(0,0,0,0);
}
.status-text { font-weight: 600; font-size: 13px; color: var(--c-ink-soft); }
.status-card[data-state="working"] .status-dot { background: var(--c-work); box-shadow: 0 0 0 4px rgba(44,85,89,.15); }
.status-card[data-state="working"] .status-text { color: var(--c-work); }
.status-card[data-state="paused"] .status-dot { background: var(--c-pause); box-shadow: 0 0 0 4px rgba(184,134,44,.18); }
.status-card[data-state="paused"] .status-text { color: var(--c-pause); }
.big-clock {
  font-family: var(--f-mono);
  font-size: 56px; font-weight: 700; letter-spacing: 1px;
  margin: 16px 0 4px; color: var(--c-brand);
  font-variant-numeric: tabular-nums;
}
.sub-clock { color: var(--c-ink-soft); font-size: 14px; margin-bottom: 18px; }
.action-stack { display: flex; flex-direction: column; gap: 10px; }
.sync-row { margin-top: 14px; font-size: 12.5px; color: var(--c-muted); display: inline-flex; gap: 6px; align-items: center; }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-vac); }
.sync-dot.offline { background: var(--c-warn); }

/* Booking list */
.booking-list { list-style: none; padding: 0; margin: 0; }
.booking-list li {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--c-line-soft);
}
.booking-list .bk-type { font-weight: 600; color: var(--c-brand); }
.booking-list .bk-time { font-family: var(--f-mono); color: var(--c-ink-soft); }
.booking-list .bk-dur { font-family: var(--f-mono); }

/* Segmented control */
.seg { display: flex; gap: 4px; background: var(--c-line-soft); padding: 4px; border-radius: var(--r-md); margin-bottom: 12px; }
.seg-btn { flex: 1; border: 0; background: transparent; padding: 8px; border-radius: 8px; font-weight: 600; color: var(--c-ink-soft); }
.seg-btn.active { background: #fff; color: var(--c-brand); box-shadow: var(--sh-1); }

/* Requests */
.req-list { list-style: none; padding: 0; }
.req-list li { padding: 10px 8px; border-bottom: 1px solid var(--c-line-soft); display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.req-list .meta { font-size: 13px; color: var(--c-muted); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.req { background: #f4eada; color: #8a651a; }
.badge.ok { background: #d8ecdf; color: #1f5e3a; }
.badge.no { background: #f4d6d1; color: #8a2920; }

/* KPI grid */
.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 8px 0 4px; }
.kpi-grid.wide { grid-template-columns: repeat(4, 1fr); }
.kpi {
  background: var(--c-surface); border: 1px solid var(--c-line);
  border-radius: var(--r-md); padding: 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.kpi-label { font-size: 12px; color: var(--c-muted); text-transform: uppercase; letter-spacing: .4px; }
.kpi-value { font-size: 20px; font-weight: 700; color: var(--c-brand); font-variant-numeric: tabular-nums; }

/* Tables */
.data-tbl { width: 100%; border-collapse: collapse; background: var(--c-surface); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--sh-1); }
.data-tbl th, .data-tbl td { padding: 10px 12px; text-align: left; font-size: 14px; }
.data-tbl thead th { background: var(--c-line-soft); color: var(--c-ink-soft); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.data-tbl tbody tr { border-top: 1px solid var(--c-line-soft); }
.data-tbl tbody tr:hover { background: #fbfaf6; }
.data-tbl.small th, .data-tbl.small td { font-size: 12.5px; padding: 6px 10px; }
.login-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  padding: 4px 9px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  background: var(--c-line-soft);
  color: var(--c-ink-soft);
}
.login-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}
.login-pill.online { background: rgba(47,122,79,.12); color: var(--c-vac); }
.login-pill.offline { background: rgba(120,112,101,.12); color: var(--c-ink-soft); }

/* === Office shell === */
.office-shell { display: grid; grid-template-columns: 220px 1fr; gap: 24px; }
.side-nav {
  background: var(--c-surface); border: 1px solid var(--c-line);
  border-radius: var(--r-lg); padding: 8px; height: fit-content;
  position: sticky; top: 80px;
}
.side-btn {
  display: block; width: 100%; text-align: left; border: 0;
  padding: 10px 12px; background: transparent; border-radius: 8px;
  color: var(--c-ink-soft); font-weight: 600; font-size: 14px;
  margin: 2px 0;
}
.side-btn:hover { background: var(--c-line-soft); }
.side-btn.active { background: var(--c-brand); color: #fff; }

.office-main { min-width: 0; }
.page-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .head-tools { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.head-tools select, .head-tools input { padding: 8px 10px; border: 1px solid var(--c-line); border-radius: var(--r-sm); background: #fff; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; background: var(--c-surface); padding: 16px; border-radius: var(--r-md); border: 1px solid var(--c-line); }
.action-row { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; align-items: center; }

/* Calendar */
.legend { display: flex; gap: 12px; margin: 10px 0; flex-wrap: wrap; }
.lg { font-size: 12px; padding: 4px 10px; border-radius: 999px; font-weight: 600; }
.lg-work { background: rgba(44,85,89,.12); color: var(--c-work); }
.lg-vac { background: rgba(47,122,79,.12); color: var(--c-vac); }
.lg-sick { background: rgba(169,58,82,.12); color: var(--c-sick); }
.lg-holi { background: rgba(106,78,160,.12); color: var(--c-holi); }
.lg-incomplete { background: rgba(200,132,26,.18); color: var(--c-warn); }
.lg-ferien { background: rgba(106,78,160,.06); color: var(--c-holi); border: 1px dashed rgba(106,78,160,.4); }
.lg-pending { background: rgba(184,134,44,.18); color: var(--c-pause); }
.tech-cal-head { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 10px; }
.cal-nav { padding: 6px 12px; }
.cal-cell.ferien { background-image: repeating-linear-gradient(135deg, rgba(106,78,160,.08) 0 6px, transparent 6px 12px); }
.cal-cell.pending { background: rgba(184,134,44,.10); border-color: rgba(184,134,44,.35); }
.cal-cell .multi { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 2px; }
.cal-cell .chip { font-size: 10px; padding: 1px 5px; border-radius: 4px; background: var(--c-line-soft); color: var(--c-ink-soft); }
.cal-cell .chip.vac  { background: rgba(47,122,79,.18);  color: var(--c-vac); }
.cal-cell .chip.pen  { background: rgba(184,134,44,.22); color: var(--c-pause); }
.cal-cell .chip.sick { background: rgba(169,58,82,.18);  color: var(--c-sick); }

/* Kürzel-Legende unter dem Kalender (Alle-Mitarbeiter-Ansicht) */
.initials-legend { margin-top: 12px; }
.initials-legend:empty { display: none; }
.initials-legend h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--c-muted); margin: 0 0 8px; }
.initials-legend ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.initials-legend li { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; background: var(--c-line-soft); border-radius: 999px; font-size: 13px; }
.initials-legend .ini-chip { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--c-brand); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .5px; }
.cal-label { font-weight: 600; min-width: 140px; text-align: center; }

.calendar {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
  background: var(--c-surface); padding: 8px; border-radius: var(--r-md);
  border: 1px solid var(--c-line);
}
.cal-head { font-size: 11px; text-transform: uppercase; color: var(--c-muted); padding: 6px; text-align: center; font-weight: 700; letter-spacing: .5px; }
.cal-cell {
  min-height: 86px; padding: 6px; border-radius: 6px; border: 1px solid var(--c-line-soft);
  background: #fff; display: flex; flex-direction: column; gap: 4px;
  font-size: 12px;
  position: relative;
}
.cal-cell.outside { background: #fbf9f4; color: var(--c-muted); }
.cal-cell .d-num { font-weight: 700; font-size: 13px; color: var(--c-ink-soft); }
.cal-cell.today .d-num { color: var(--c-accent); }
.cal-cell .tag { display: inline-block; padding: 1px 6px; border-radius: 4px; font-weight: 600; font-size: 11px; }
.cal-cell.work { background: rgba(44,85,89,.07); border-color: rgba(44,85,89,.25); }
.cal-cell.vac  { background: rgba(47,122,79,.10); border-color: rgba(47,122,79,.3); }
.cal-cell.sick { background: rgba(169,58,82,.10); border-color: rgba(169,58,82,.3); }
.cal-cell.holi { background: rgba(106,78,160,.10); border-color: rgba(106,78,160,.3); }
.cal-cell.incomplete::after {
  content:""; position:absolute; top: 4px; right: 4px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--c-warn);
}
.cal-cell .hours { font-family: var(--f-mono); font-weight: 700; color: var(--c-brand); }

/* Holidays list */
.holi-list { list-style: none; padding: 0; margin: 8px 0 0; max-height: 220px; overflow: auto; }
.holi-list li { padding: 4px 0; font-size: 13px; display: flex; justify-content: space-between; border-bottom: 1px dashed var(--c-line-soft); }

/* Settings */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.settings-grid fieldset { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-md); padding: 14px; }
.settings-grid legend { padding: 0 6px; font-weight: 700; color: var(--c-brand); }

/* Brand / Theme picker */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 8px; }
.theme-card { border: 2px solid var(--c-line); border-radius: var(--r-md); padding: 8px; background: #fff; cursor: pointer; text-align: left; transition: transform .08s ease, box-shadow .15s ease, border-color .15s ease; }
.theme-card:hover { transform: translateY(-1px); box-shadow: var(--sh-1); }
.theme-card.active { border-color: var(--c-brand); box-shadow: 0 0 0 3px rgba(0,0,0,.04); }
.theme-swatch { display: flex; gap: 0; height: 30px; border-radius: 6px; overflow: hidden; margin-bottom: 6px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.theme-swatch span { flex: 1; }
.theme-card .t-name { font-weight: 700; font-size: 13px; color: var(--c-ink); }
.theme-card .t-sub { font-size: 11px; color: var(--c-muted); }

.logo-preview {
  display: flex; align-items: center; gap: 12px; padding: 10px;
  background: var(--c-line-soft); border-radius: var(--r-md); margin: 8px 0;
}
.logo-preview img { max-height: 48px; max-width: 160px; object-fit: contain; background: #fff; padding: 4px 8px; border-radius: 4px; box-shadow: 0 0 0 1px var(--c-line); }
.logo-preview .meta { font-size: 12px; color: var(--c-muted); }

/* Preview */
.preview-wrap { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-md); padding: 16px; margin-top: 12px; min-height: 40px; }
.preview-wrap:empty { display: none; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(20,37,42,.45); display: grid; place-items: center; padding: 16px; z-index: 60; overflow: hidden; }
.modal[hidden], .toast[hidden] { display: none !important; }
.modal-card { background: #fff; width: min(720px, 100%); max-height: calc(100vh - 32px); border-radius: var(--r-lg); box-shadow: var(--sh-2); overflow: hidden; display: flex; flex-direction: column; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--c-line); }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-body { padding: 16px 18px; overflow: auto; min-height: 0; }
.modal-body .form-grid { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--c-line); display: flex; justify-content: flex-end; gap: 8px; background: #fbfaf6; flex-shrink: 0; }

/* Toast */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--c-brand); color: #fff; padding: 10px 16px;
  border-radius: 999px; box-shadow: var(--sh-2);
  font-size: 14px; z-index: 80;
  animation: tIn .15s ease;
}
@keyframes tIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; } }

/* Responsive */
@media (max-width: 860px) {
  .office-shell { grid-template-columns: 1fr; }
  .side-nav { position: static; display: flex; flex-wrap: wrap; gap: 4px; }
  .side-btn { width: auto; }
  .kpi-grid.wide { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .topbar { gap: 10px; padding: 10px 12px; flex-wrap: wrap; }
  .brand-name { display: none; }
  .role-switch { order: 3; width: 100%; margin-left: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .role-btn { padding: 6px 12px; font-size: 13px; }
  .user-chip { margin-left: auto; max-width: calc(100vw - 24px); }
  .view { padding: 14px; }
  .kpi-grid, .kpi-grid.wide { grid-template-columns: repeat(2, 1fr); }
  .data-tbl { display: block; max-width: 100%; overflow-x: auto; }
  .data-tbl th, .data-tbl td { padding: 8px 8px; font-size: 13px; }
  .big-clock { font-size: 44px; }
  .modal { padding: 8px; align-items: stretch; }
  .modal-card { width: 100%; max-height: calc(100vh - 16px); border-radius: var(--r-md); }
  .modal-head, .modal-body, .modal-foot { padding-left: 12px; padding-right: 12px; }
  .modal-body .form-grid { grid-template-columns: 1fr; gap: 8px; }
  .modal-foot { justify-content: stretch; }
  .modal-foot button { flex: 1; }
}

/* Print (for Stundenzettel) */
@media print {
  .topbar, .side-nav, .action-row, .legend, .role-switch, .user-chip, .modal { display: none !important; }
  body { background: #fff; }
  .view { padding: 0; }
  .data-tbl { box-shadow: none; }
}

/* === Zeitkorrektur (Mitarbeiter-Anträge) === */
.field textarea {
  padding: 10px 12px; border: 1px solid var(--c-line); border-radius: var(--r-sm);
  background: #fff; min-height: 90px; resize: vertical; font-size: 15px;
}
.field textarea:focus { outline: 2px solid var(--c-brand); outline-offset: 1px; }
.field .counter { font-size: 12px; color: var(--c-muted); align-self: flex-end; }
.tab .tab-count {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px;
  border-radius: 999px; background: var(--c-accent); color: #fff; font-size: 11px; line-height: 18px;
}
.side-btn .tab-count {
  display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px;
  border-radius: 999px; background: var(--c-accent); color: #fff; font-size: 11.5px; line-height: 20px; text-align: center;
}
.notice {
  border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 12px; font-size: 14px;
  background: #f7efdc; border: 1px solid #e6d2a4; color: #6b4e12;
}
.notice strong { display: block; margin-bottom: 4px; }
.notice button { margin-top: 8px; }
.corr-list { list-style: none; padding: 0; margin: 0; }
.corr-list li {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center;
  padding: 12px 4px; border-bottom: 1px solid var(--c-line-soft);
}
.corr-list .c-date { font-weight: 600; color: var(--c-brand-3); }
.corr-list .c-time { font-family: var(--f-mono); font-size: 13.5px; color: var(--c-ink-soft); }
.corr-list .c-act { grid-row: 1 / span 2; grid-column: 2; text-align: right; }
.corr-list .c-act button { font-size: 13px; padding: 8px 12px; }
.corr-diff { font-family: var(--f-mono); font-size: 12.5px; line-height: 1.5; }
.corr-diff .old { color: var(--c-muted); text-decoration: line-through; }
.corr-diff .new { color: var(--c-brand); font-weight: 600; }
.corr-reason { font-size: 13px; max-width: 320px; white-space: pre-wrap; }
.corr-reason .cat { display: inline-block; font-weight: 600; color: var(--c-brand-3); margin-bottom: 2px; }
.badge.wd { background: var(--c-line-soft); color: var(--c-muted); }
.pause-rows .pause-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; }
.pause-rows .pause-row .field { margin: 6px 0; }
.locked-note { font-size: 12px; color: var(--c-muted); }
@media (min-width: 861px) { .office-main .kpi-grid.wide { grid-template-columns: repeat(5, 1fr); } }
.tab-count[hidden] { display: none !important; }

/* === Geschäftsführung: Nur-Lesen-Modus (body.ro) === */
body.ro #officePage [data-act],
body.ro #empAddBtn, body.ro #bookAddBtn, body.ro #cfgSaveBtn, body.ro #cfgSaveState,
body.ro #sendAll, body.ro #cfgHolisRecalc, body.ro #cfgSeed, body.ro #cfgReset, body.ro #cfgLogoReset,
body.ro #calState, body.ro #cfgLogoFile, body.ro #prjAddBtn, body.ro #bookLockHint { display: none !important; }
body.ro #officePage td:has(> [data-act]:first-child) { font-size: 0; }
body.ro .settings-grid input, body.ro .settings-grid select, body.ro .settings-grid .theme-grid { pointer-events: none; opacity: .65; }
.ro-note { margin-bottom: 14px; }

/* === Projekte === */
.proj-box { border-top: 1px solid var(--c-line); margin-top: 6px; padding: 16px 18px 4px; }
.proj-links { display: flex; gap: 16px; }
.proj-today { list-style: none; padding: 0; margin: 10px 0 0; font-size: 13.5px; }
.proj-today li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--c-line-soft); }
.proj-today li .t { font-family: var(--f-mono); }
.proj-today li.cur { font-weight: 600; color: var(--c-brand); }
.proj-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--c-brand-soft); color: var(--c-brand-3); font-size: 12.5px; font-weight: 600; }
.proj-breakdown { font-size: 12.5px; line-height: 1.55; white-space: nowrap; }
.radio-row { display: flex; gap: 18px; flex-wrap: wrap; }

/* =====================================================================
   Mitarbeiter-Ansicht v2: Projektkarte oben, Navigationsleiste unten
   ===================================================================== */
.tech-shell { padding-bottom: calc(96px + env(safe-area-inset-bottom)); gap: 12px; }

/* --- Untere Navigationsleiste (Daumenzone, App-Muster) --- */
.tabbar {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(520px, 100%); z-index: 40;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid var(--c-line); border-bottom: 0;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -6px 24px rgba(18, 48, 27, .08);
}
.tab {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 54px; padding: 6px 2px; border: 0; border-radius: 14px;
  background: transparent; color: var(--c-muted);
  font-size: 11px; font-weight: 600; letter-spacing: .1px;
  transition: color .15s ease, background-color .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.tab svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab:hover { color: var(--c-brand); }
.tab.active { background: var(--c-brand-soft); color: var(--c-brand); }
.tab.active svg { stroke-width: 2.2; }
.tab:focus-visible { outline: 2px solid var(--c-brand); outline-offset: -2px; }
.tab .tab-count {
  position: absolute; top: 3px; left: calc(50% + 6px); margin: 0;
  min-width: 17px; line-height: 17px; padding: 0 5px; font-size: 10.5px;
  box-shadow: 0 0 0 2px #fff;
}
.tab-label { white-space: nowrap; }
@media (max-width: 380px) { .tab { font-size: 10px; } .tab svg { width: 21px; height: 21px; } }
body:has(.tabbar) .toast { bottom: calc(88px + env(safe-area-inset-bottom)); }

/* --- Startseite: Karten statt Kasten-in-Kasten --- */
.panel-home { background: none; border: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.panel-home .notice { margin: 0; }
.panel-home .status-card {
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}

/* --- Projektkarte --- */
.proj-card { --proj-c: #9ca3af; }
.proj-current {
  width: 100%; display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 14px 14px 14px 16px; background: var(--c-surface);
  border: 1px solid var(--c-line); border-left: 5px solid var(--proj-c);
  border-radius: var(--r-lg); box-shadow: var(--sh-1);
  transition: box-shadow .15s ease, transform .1s ease;
}
.proj-current:hover { box-shadow: var(--sh-2); }
.proj-current:active { transform: scale(.99); }
.proj-current:focus-visible { outline: 2px solid var(--c-brand); outline-offset: 2px; }
.proj-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--proj-c); }
.proj-card.is-running .proj-dot { animation: projPulse 1.8s ease-out infinite; }
@keyframes projPulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--proj-c) 55%, transparent); }
  100% { box-shadow: 0 0 0 9px transparent; }
}
@media (prefers-reduced-motion: reduce) { .proj-card.is-running .proj-dot { animation: none; } }
.proj-cur-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.proj-cur-label { font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--c-muted); }
.proj-card.is-running .proj-cur-label { color: var(--c-brand); }
.proj-cur-text strong { font-size: 16.5px; color: var(--c-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-card.is-none .proj-cur-text strong { color: var(--c-ink-soft); font-weight: 600; }
.proj-cur-text small { font-size: 12.5px; color: var(--c-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-cur-text small:empty { display: none; }
.proj-cur-action {
  flex: none; display: inline-flex; align-items: center; gap: 2px;
  font-size: 13px; font-weight: 600; color: var(--c-brand);
  padding: 7px 8px 7px 12px; border-radius: 999px; background: var(--c-brand-soft);
}
.proj-cur-action svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* --- Heute je Projekt --- */
.proj-today-card {
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg);
  box-shadow: var(--sh-1); padding: 14px 16px 10px;
}
.proj-today-card header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; font-size: 12px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--c-muted); }
.proj-today-card ul { list-style: none; margin: 0; padding: 0; }
.proj-today-card li { padding: 7px 0; }
.proj-today-card li + li { border-top: 1px solid var(--c-line-soft); }
.proj-today-card .row { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.proj-today-card .nm { display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-today-card .nm i { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--proj-c); }
.proj-today-card .nm em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--c-brand); background: var(--c-brand-soft); padding: 1px 7px; border-radius: 999px; }
.proj-today-card .t { font-family: var(--f-mono); font-variant-numeric: tabular-nums; color: var(--c-ink-soft); }
.proj-today-card li.cur .nm { font-weight: 600; }
.proj-today-card li.none .nm, .proj-today-card li.none .t { color: var(--c-muted); }
.proj-today-card .bar { height: 4px; margin-top: 6px; border-radius: 999px; background: var(--c-line-soft); overflow: hidden; }
.proj-today-card .bar span { display: block; height: 100%; border-radius: inherit; background: var(--proj-c); }

/* --- Projektauswahl (Dialog) --- */
.pp-intro { margin: 0 0 12px; font-size: 13.5px; color: var(--c-ink-soft); }
.pp-search { width: 100%; padding: 11px 14px; border: 1px solid var(--c-line); border-radius: 12px; margin-bottom: 10px; background: #fff; }
.pp-search:focus { outline: 2px solid var(--c-brand); outline-offset: 1px; }
.pp-list { display: flex; flex-direction: column; gap: 8px; }
.pp-group { margin: 8px 2px 0; font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--c-muted); }
.pp-item {
  --proj-c: #9ca3af;
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  min-height: 56px; padding: 10px 14px; background: #fff;
  border: 1px solid var(--c-line); border-radius: 14px;
  transition: border-color .12s ease, background-color .12s ease;
}
.pp-item:hover { border-color: var(--proj-c); }
.pp-item:focus-visible { outline: 2px solid var(--c-brand); outline-offset: 1px; }
.pp-item.active { border-color: var(--c-brand); background: var(--c-brand-soft); }
.pp-item[hidden] { display: none; }
.pp-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--proj-c); }
.pp-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pp-txt strong { font-size: 15px; color: var(--c-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-txt small { font-size: 12.5px; color: var(--c-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-t { flex: none; font-family: var(--f-mono); font-size: 12.5px; color: var(--c-ink-soft); }
.pp-check { flex: none; width: 20px; height: 20px; fill: none; stroke: var(--c-brand); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; visibility: hidden; }
.pp-item.active .pp-check { visibility: visible; }
.pp-empty { margin: 6px 2px; font-size: 13.5px; color: var(--c-muted); }
.pp-group[hidden] { display: none; }
.panel-home[hidden] { display: none !important; }

/* Feinschliff v2 */
.proj-cur-text strong { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; }
.proj-cur-text small { white-space: normal; }
@media (max-width: 440px) {
  .proj-cur-action { padding: 8px; }
  .proj-cur-action .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
.role-switch[hidden] { display: none !important; }
@media (min-width: 600px) {
  .tabbar { bottom: 16px; border-bottom: 1px solid var(--c-line); border-radius: 20px; box-shadow: 0 10px 30px rgba(18, 48, 27, .12); padding-bottom: 6px; }
  .tech-shell { padding-bottom: 110px; }
  body:has(.tabbar) .toast { bottom: 104px; }
}
/* Dialoge auf dem Handy als Bottom Sheet */
@media (max-width: 520px) {
  .modal { align-items: end; padding: 0; }
  .modal-card { width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom); animation: sheetIn .2s ease-out; }
  @keyframes sheetIn { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
}
.role-switch[hidden] + .help-btn { margin-left: auto; }
.booking-list .bk-proj { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: -2px; }
.bk-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--c-line-soft); font-size: 12.5px; color: var(--c-ink-soft); }
.bk-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--proj-c); }
.bk-chip b { font-family: var(--f-mono); font-weight: 600; font-size: 12px; }
