:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #dde3ea;
  --text: #1a2230;
  --muted: #627084;
  --brand: #1e3a5f;
  --brand-2: #2b5d94;
  --accent: #2b6cb0;
  --danger: #c53030;
  --weekend: #f1f4f8;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 2px 8px rgba(16, 24, 40, .06);
  --radius: 14px;
  --on-brand: #ffffff;
  color-scheme: light;
}
/* Dunkles Design: automatisch nach System-Einstellung (außer „Hell“ gewählt) oder fest gewählt */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f141b;
    --surface: #18202b;
    --surface-2: #1d2733;
    --border: #2b3746;
    --text: #e6ebf2;
    --muted: #93a1b4;
    --brand: #8fb4e3;
    --brand-2: #6d9bd6;
    --accent: #6d9bd6;
    --danger: #f07171;
    --weekend: #222d3b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 2px 10px rgba(0, 0, 0, .3);
    --on-brand: #0f141b;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f141b;
  --surface: #18202b;
  --surface-2: #1d2733;
  --border: #2b3746;
  --text: #e6ebf2;
  --muted: #93a1b4;
  --brand: #8fb4e3;
  --brand-2: #6d9bd6;
  --accent: #6d9bd6;
  --danger: #f07171;
  --weekend: #222d3b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 2px 10px rgba(0, 0, 0, .3);
  --on-brand: #0f141b;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
[hidden] { display: none !important; }
h1 { font-size: 1.5rem; margin: 0; }
h2 { font-size: 1.1rem; margin: 2rem 0 .75rem; }
h3 { margin: 0 0 .25rem; font-size: 1.15rem; }
h4 { margin: .5rem 0; font-size: .95rem; color: var(--muted); }
.sub, .hint { color: var(--muted); margin: .2rem 0 0; font-size: .9rem; }
small { color: var(--muted); font-size: .8rem; }

/* ---------- Formulare & Buttons ---------- */
label { display: flex; flex-direction: column; gap: .3rem; font-size: .88rem; font-weight: 600; color: var(--muted); }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 9px; padding: .55rem .7rem; min-width: 0;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.btn {
  font: inherit; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 9px; padding: .55rem 1rem; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-solid:hover { filter: brightness(1.08); background: var(--danger); }
.theme-toggle { display: inline-flex; align-items: center; gap: .35rem; }
.theme-toggle .tt-icon { font-size: 1rem; line-height: 1; }
.landing-form { position: relative; }
.landing-theme { position: absolute; top: 1rem; right: 1rem; }
.cf-text { margin: 0; white-space: pre-line; }
.switch { flex-direction: row; align-items: center; gap: .45rem; font-weight: 600; cursor: pointer; color: var(--text); }
.switch input { width: 1.05rem; height: 1.05rem; accent-color: var(--brand); margin: 0; cursor: pointer; }
.switch.off { color: var(--muted); }
select.mini { padding: .25rem .5rem; font-size: .85rem; border-radius: 7px; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: .35rem .7rem; font-size: .85rem; }
.btn.xs { padding: .15rem .5rem; font-size: .78rem; border-radius: 7px; }
.btn-group { display: flex; gap: .35rem; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: .9rem; }
.spacer { flex: 1; }

/* ---------- Landing Page / Anmeldung ---------- */
.landing { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; }
.landing-hero {
  color: #fff; padding: 2.5rem clamp(1.5rem, 5vw, 4.5rem);
  display: flex; flex-direction: column; gap: 2rem;
  background:
    radial-gradient(900px 500px at -10% -20%, rgba(255, 255, 255, .13), transparent 60%),
    radial-gradient(700px 500px at 110% 115%, rgba(109, 155, 214, .5), transparent 60%),
    linear-gradient(140deg, #13274a, #1e3a5f 45%, #2b5d94);
}
.on-dark .brand-mark { background: rgba(255, 255, 255, .16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.landing-hero .brand-lg { justify-content: flex-start; }
.hero-main { margin-top: auto; }
.hero-title { font-size: clamp(2.1rem, 4.2vw, 3.4rem); line-height: 1.08; letter-spacing: -.5px; }
.hero-date { font-size: 1.05rem; opacity: .85; margin: .6rem 0 0; font-variant-numeric: tabular-nums; }
.hero-lead { font-size: 1.05rem; max-width: 34rem; opacity: .92; margin: 1.2rem 0 0; }
.features { list-style: none; padding: 0; margin: 0 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; max-width: 40rem; }
.features li {
  display: flex; gap: .8rem; align-items: flex-start; padding: .9rem 1rem; border-radius: 14px;
  background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.features strong { display: block; }
.features span:not(.fi) { font-size: .86rem; opacity: .82; }
.fi { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, .14); }
.fi svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hero-foot { font-size: .82rem; opacity: .65; margin: 0; }
.landing-form { display: grid; place-items: center; padding: 2rem 16px; }
.auth-title { margin: 0; font-size: 1.5rem; }
.auth-card {
  width: min(400px, 100%); background: var(--surface); border-radius: 18px;
  box-shadow: var(--shadow); padding: 2rem; display: flex; flex-direction: column; gap: 1.2rem;
}
@media (max-width: 900px) {
  .landing { grid-template-columns: 1fr; }
  .landing-hero { padding: 1.5rem 16px 2rem; gap: 1rem; }
  .hero-main { margin-top: .5rem; }
  .hero-lead, .features, .hero-foot { display: none; }
  .landing-form { place-items: start center; padding-top: 1.5rem; }
}
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.seg-btn { font: inherit; font-weight: 600; border: 0; background: transparent; color: var(--muted); padding: .45rem; border-radius: 8px; cursor: pointer; }
.seg-btn.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.msg { margin: 0; padding: .6rem .8rem; border-radius: 9px; font-size: .9rem; background: var(--surface-2); }
.msg.error { color: var(--danger); }

/* ---------- Kopfzeile ---------- */
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 800; letter-spacing: .2px; }
.brand-lg { font-size: 1.35rem; justify-content: center; }
.brand-mark {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 800;
}
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .6rem 1.25rem; background: var(--surface); border-bottom: 1px solid var(--border);
}
.tabs { display: flex; gap: .25rem; flex: 1; overflow-x: auto; scrollbar-width: none; }
.tabs button {
  font: inherit; font-weight: 600; color: var(--muted); background: transparent; border: 0;
  padding: .5rem .8rem; border-radius: 9px; cursor: pointer; white-space: nowrap;
}
.tabs button:hover { background: var(--surface-2); color: var(--text); }
.tabs button.active { background: var(--surface-2); color: var(--brand); box-shadow: inset 0 -2px 0 var(--brand); }
.usermenu { display: flex; align-items: center; gap: .25rem; }
.me-name { font-weight: 600; margin-right: .4rem; }
.count-badge { background: var(--danger); color: #fff; border-radius: 99px; font-size: .72rem; padding: .05rem .45rem; margin-left: .25rem; }

main { padding: 1.5rem 1.25rem 3rem; max-width: 1400px; margin: 0 auto; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; margin-bottom: 1rem; }
.toolbar.tight { margin: 0; align-items: center; }

/* ---------- Anwesenheits-Grid ---------- */
.legend { display: flex; flex-wrap: wrap; gap: .4rem .9rem; font-size: .82rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: .35rem; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; }
.tile {
  font: inherit; color: inherit; text-align: left; padding: 0; margin: 0;
  aspect-ratio: 1 / 1; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 6px 6px; /* runde Ecken oben */
  box-shadow: var(--shadow); overflow: hidden;
}
button.tile { cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
button.tile:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(16, 24, 40, .14); }
button.tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.tile.mine { border: 2px solid var(--brand); }
.tile-head {
  padding: .8rem .9rem .7rem; font-weight: 700; font-size: 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: .4rem;
}
.tile-head .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { font-size: .7rem; font-weight: 700; color: var(--brand); border: 1px solid var(--brand); border-radius: 99px; padding: 0 .45rem; flex: none; }
.tile-status {
  flex: 1; display: flex; flex-direction: column; justify-content: center; gap: .25rem;
  padding: .7rem .9rem; color: #fff; background: var(--c, #8a94a6);
}
.tile-status .label { font-size: 1.15rem; font-weight: 800; letter-spacing: .3px; text-transform: uppercase; }
.tile-status .since { font-size: .85rem; opacity: .92; }
.tile-status .comment {
  font-size: .85rem; background: rgba(0, 0, 0, .16); border-radius: 7px; padding: .3rem .5rem; margin-top: .25rem;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; word-break: break-word;
}

/* ---------- Status-Dialog ---------- */
.dialog {
  border: 0; border-radius: 16px; padding: 1.5rem; width: min(460px, calc(100vw - 32px));
  background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
.dialog.wide { width: min(680px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(10, 16, 25, .5); }
.dialog-actions { display: flex; gap: .5rem; justify-content: flex-end; align-items: center; margin-top: .25rem; }
.status-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .5rem; }
.status-opt {
  font: inherit; font-weight: 700; cursor: pointer; padding: .7rem .5rem; border-radius: 10px;
  border: 2px solid var(--c); background: transparent; color: var(--text);
  display: flex; align-items: center; gap: .45rem; justify-content: center;
}
.status-opt::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.status-opt.selected { background: var(--c); color: #fff; }
.status-opt.selected::before { background: #fff; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.form-grid .span2 { grid-column: span 2; }

/* ---------- Tabellen ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow-x: auto; box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: .55rem .75rem; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.weekend td { background: var(--weekend); }
.table tr.day { cursor: pointer; }
.table tr.day:hover td { background: var(--surface-2); }
.table tr.empty td { color: var(--muted); }
.table tr.total td { font-weight: 800; background: var(--surface-2); }
.table tr.details td { background: var(--surface-2); white-space: normal; }
.table tr.pending td { background: color-mix(in srgb, #d69e2e 14%, var(--surface)); }
.muted { color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; font-weight: 700; border-radius: 99px; padding: .05rem .5rem; color: #fff; background: var(--c); }
.ev-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.ev-list li { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.ev-time { font-variant-numeric: tabular-nums; font-weight: 700; width: 3.2rem; }
.actions { display: flex; gap: .3rem; justify-content: flex-end; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .8rem 1rem; box-shadow: var(--shadow); }
.card .k { font-size: .78rem; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: .4rem; }
.card .v { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.card.hl { border-color: var(--brand); }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.column { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: .75rem; min-height: 200px; }
.column-head { display: flex; justify-content: space-between; align-items: center; font-weight: 800; padding: .2rem .3rem .7rem; }
.column-head .n { color: var(--muted); font-weight: 700; font-size: .85rem; }
.column-head::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c); margin-right: .5rem; }
.column-head .t { flex: 1; }
.cards-col { display: flex; flex-direction: column; gap: .6rem; }
.inq {
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--c);
  border-radius: 10px; padding: .7rem .8rem; cursor: pointer; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: .3rem;
}
.inq:hover { border-color: var(--accent); border-left-color: var(--c); }
.inq .subj { font-weight: 700; word-break: break-word; }
.inq .cust { font-size: .88rem; }
.inq .meta { font-size: .8rem; color: var(--muted); display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.inq .quick { display: flex; gap: .35rem; margin-top: .2rem; }
.empty-col { color: var(--muted); font-size: .85rem; text-align: center; padding: 1.5rem .5rem; }
.log { list-style: none; padding: 0; margin: 0; max-height: 160px; overflow-y: auto; font-size: .85rem; display: flex; flex-direction: column; gap: .25rem; }
.log li span { color: var(--muted); }

/* ---------- Meine Arbeitszeit ---------- */
.mywork { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.1rem 1.1rem; margin-bottom: 1.25rem; }
.mywork-head { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .8rem; }
.mywork-head h2 { margin: 0; }
.mywork-head .hint { margin: 0; }
.live { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 700; color: #1f9d55; }
.live i { width: 9px; height: 9px; border-radius: 50%; background: #1f9d55; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.75); } }
@media (prefers-reduced-motion: reduce) { .live i { animation: none; } }
.mw-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .75rem; }
.mw-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: .75rem .9rem; display: flex; flex-direction: column; gap: .3rem; }
.mw-card .k { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; display: flex; align-items: center; gap: .4rem; }
.mw-card .v { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.15; }
.mw-card .v small { font-size: .9rem; font-weight: 600; color: var(--muted); }
.mw-card .s { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.mw-card .s.pos { color: #1f9d55; }
.mw-card .s.neg { color: var(--danger); }
.bar { height: 6px; border-radius: 99px; background: var(--border); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: var(--c, var(--brand)); transition: width .4s ease; }

/* ---------- made by © Tom Niestroy (Zeichen in der Textfarbe → Navy im hellen, Weiß im dunklen Design) ---------- */
.made-by { display: flex; align-items: center; justify-content: center; gap: .6rem; padding-top: .75rem; border-top: 1px solid var(--border); font-size: .85rem; color: var(--muted); }
.made-by strong { color: var(--text); }
.tn-mark {
  display: inline-block; width: 22px; height: 31px; flex: none;
  background: var(--text);
  -webkit-mask: url(/tn-mark.svg) no-repeat center / contain; mask: url(/tn-mark.svg) no-repeat center / contain;
}

/* ---------- MPA-Logo (transparent → auf weißer Fläche, damit es in Hell und Dunkel lesbar ist) ---------- */
.logo-plate {
  display: inline-flex; align-items: center; background: #fff; border-radius: 8px; padding: 4px 9px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .18); flex: none;
}
.logo-plate .logo { height: 26px; width: auto; display: block; }
.logo-plate.lg { border-radius: 14px; padding: 12px 18px; }
.logo-plate.lg .logo { height: clamp(48px, 7vw, 72px); }
.landing-hero .brand-lg { flex-direction: column; align-items: flex-start; gap: .6rem; }
.brand-sub { font-size: .95rem; font-weight: 700; letter-spacing: .4px; opacity: .85; text-transform: uppercase; }
.brand-text { font-weight: 800; color: var(--muted); }
@media (max-width: 900px) {
  .logo-plate.lg .logo { height: 44px; }
}

/* ---------- Hinweis: unsicheres Passwort ---------- */
.pw-warning {
  display: flex; align-items: center; justify-content: center; gap: .75rem; flex-wrap: wrap;
  padding: .55rem 16px; font-weight: 700; font-size: .9rem; text-align: center;
  background: color-mix(in srgb, var(--danger) 16%, var(--surface)); color: var(--text); border-bottom: 1px solid var(--danger);
}

/* ---------- Handy: kompaktere Übersicht ---------- */
@media (max-width: 760px) {
  .mw-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .mw-card { padding: .6rem .65rem; }
  .mw-card .v { font-size: 1.15rem; }
  .mw-card .v small { font-size: .78rem; }
  .mw-card .s { font-size: .74rem; }
  .mw-card .btn { white-space: normal; text-align: left; max-width: 100%; }
  .mywork { padding: .8rem; }
  .mywork-head .hint { flex-basis: 100%; }
  #btn-kiosk { display: none; }
  .bug-fab { right: 12px; bottom: 12px; width: 44px; height: 44px; }
}

/* ---------- Fehlerbericht ---------- */
.bug-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 50; width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; color: var(--on-brand);
  background: var(--brand); border: 0; box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}
.bug-fab:hover { filter: brightness(1.1); }
.bug-fab .ico { width: 22px; height: 22px; }
body.kiosk .bug-fab { display: none; }
.bug-ctx summary { cursor: pointer; font-size: .85rem; color: var(--muted); }
.bug-ctx pre { font-size: .75rem; white-space: pre-wrap; word-break: break-word; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: .5rem; margin: .4rem 0 0; max-height: 180px; overflow: auto; }
.bug-table td { white-space: normal; vertical-align: top; }
.bug-table .desc { font-size: .85rem; color: var(--muted); white-space: pre-wrap; margin-top: .2rem; max-width: 34rem; }
.bug-table .tech { font-size: .72rem; color: var(--muted); max-width: 16rem; word-break: break-word; }
.bug-table textarea { width: 100%; min-width: 12rem; font-size: .85rem; padding: .3rem .5rem; }
.kind-tag { font-size: .72rem; font-weight: 800; border-radius: 99px; padding: .05rem .5rem; color: #fff; background: #c53030; white-space: nowrap; }
.kind-tag.vorschlag { background: #2b6cb0; }
main { padding-bottom: 5rem; }

/* ---------- Symbole, Profil, Changelog ---------- */
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; flex: none; }
.ico.lg { width: 44px; height: 44px; stroke-width: 1.6; color: var(--muted); }
.bell, .profile-btn { display: inline-flex; align-items: center; gap: .4rem; }
.avatar { border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-2); }
.avatar.sm { width: 24px; height: 24px; }
.avatar.tile-av { width: 26px; height: 26px; box-shadow: 0 0 0 2px var(--surface); }
.tile-head .name-wrap { display: flex; align-items: center; gap: .45rem; min-width: 0; }
.avatar-row { display: flex; gap: 1rem; align-items: center; }
.avatar-preview { width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; flex: none; }
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.file-btn { display: inline-flex; flex-direction: row; color: var(--text); cursor: pointer; }
.app-foot { max-width: 1400px; margin: 0 auto; padding: 0 1.25rem 1.5rem; font-size: .8rem; color: var(--muted); }
.link-btn { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline dotted; position: relative; }
.link-btn:hover { color: var(--text); }
.new-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); margin-left: .35rem; vertical-align: middle; }
.changelog { display: flex; flex-direction: column; gap: 1rem; max-height: 65vh; overflow-y: auto; padding-right: .25rem; }
.changelog .ver { border: 1px solid var(--border); border-radius: 12px; padding: .75rem 1rem; background: var(--surface-2); }
.changelog .ver.current { border-color: var(--brand); }
.changelog .ver h4 { margin: 0 0 .35rem; color: var(--text); font-size: 1rem; display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; }
.changelog .ver h4 small { font-weight: 500; }
.changelog .sec { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin: .45rem 0 .2rem; }
.changelog ul { margin: 0; padding-left: 1.2rem; font-size: .9rem; }
.changelog .tag-new { font-size: .7rem; font-weight: 800; color: #fff; background: var(--danger); border-radius: 99px; padding: 0 .45rem; }

/* ---------- Anfragen: Angebot & Abgeschlossen, Verwaltung ---------- */
.inq .offer { font-size: .8rem; font-weight: 700; color: #1f9d55; display: flex; align-items: center; gap: .3rem; }
.inq .offer button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline dotted; }
.inq .quick { flex-wrap: wrap; }
.inq.old { border-color: var(--danger); border-left-color: var(--danger); background: color-mix(in srgb, var(--danger) 9%, var(--surface)); }
.inq .age { font-size: .78rem; font-weight: 800; color: var(--danger); }
.inq .parts { font-size: .8rem; color: var(--muted); }
.inq .parts.me { color: var(--brand); font-weight: 700; }
.retention-hint { margin: 0 0 .6rem; font-size: .88rem; padding: .55rem .8rem; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); }
.res-badge { font-size: .75rem; font-weight: 800; border-radius: 99px; padding: .1rem .55rem; color: #fff; white-space: nowrap; }
.res-badge.abgeschlossen { background: #1f9d55; }
.res-badge.abgelehnt { background: #c53030; }
.reject-note { display: block; font-size: .8rem; color: var(--muted); white-space: normal; margin-top: .2rem; }
.invite-list { display: flex; flex-direction: column; gap: .35rem; max-height: 50vh; overflow-y: auto; }
.invite-list .switch { padding: .35rem .5rem; border-radius: 8px; border: 1px solid var(--border); }
.closed-area { margin-top: 1.25rem; display: flex; flex-direction: column; gap: .75rem; align-items: flex-start; }
.closed-area > div { width: 100%; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 2rem 0 .75rem; }
.section-head h2 { margin: 0; }
.switch.remember { color: var(--muted); font-weight: 600; }

/* ---------- Rollen & Rechte, Protokoll ---------- */
.perm-table th.role-col { min-width: 9.5rem; vertical-align: top; text-transform: none; letter-spacing: 0; }
.perm-table th.role-col input { width: 100%; padding: .3rem .5rem; font-size: .88rem; font-weight: 700; }
.perm-table .role-meta { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; margin-top: .3rem; font-weight: 500; }
.perm-table td { white-space: normal; }
.perm-table td.perm-cell { text-align: center; }
.perm-table td.perm-cell input { width: 1.1rem; height: 1.1rem; accent-color: var(--brand); cursor: pointer; }
.perm-table td.perm-cell input:disabled { cursor: not-allowed; }
.perm-table tr.group-row td { background: var(--surface-2); font-weight: 800; font-size: .78rem; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.audit-table td.details { white-space: pre-wrap; min-width: 18rem; }
.nowrap { white-space: nowrap; }

/* ---------- Gleitzeit (schraffiert) ---------- */
.hatched {
  background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .28) 0 7px, transparent 7px 14px) !important;
}
.status-opt.hatched:not(.selected) { background-image: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 22%, transparent) 0 6px, transparent 6px 12px) !important; }
td.flex-cell { background-image: repeating-linear-gradient(135deg, color-mix(in srgb, #b7791f 22%, transparent) 0 5px, transparent 5px 10px); font-weight: 700; }
.warn { color: #b7791f; }

/* ---------- Mitteilungen & Anträge ---------- */
.bell { position: relative; font-size: 1rem; }
.bell .count-badge { position: absolute; top: -2px; right: -4px; margin: 0; }
.notify-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; max-height: 60vh; overflow-y: auto; }
.notify-list li { border: 1px solid var(--border); border-radius: 10px; padding: .65rem .8rem; background: var(--surface-2); cursor: pointer; }
.notify-list li.unread { border-left: 4px solid var(--brand); }
.notify-list .t { font-weight: 700; }
.notify-list .b { font-size: .88rem; white-space: pre-line; margin-top: .25rem; }
.notify-list .d { font-size: .75rem; color: var(--muted); }
.req-grid { display: grid; grid-template-columns: minmax(220px, 1fr) 2fr; gap: 1rem; align-items: stretch; }
.account-card .v { font-size: 2rem; }
.account-card .s { font-size: .85rem; margin-top: .3rem; white-space: pre-line; }
.badge-st { font-size: .75rem; font-weight: 700; border-radius: 99px; padding: .1rem .55rem; color: #fff; }
.badge-st.offen { background: #d69e2e; }
.badge-st.genehmigt { background: #1f9d55; }
.badge-st.abgelehnt { background: #c53030; }
.pos-n { color: #1f9d55; font-weight: 700; }
.neg-n { color: var(--danger); font-weight: 700; }
@media (max-width: 760px) { .req-grid { grid-template-columns: 1fr; } }

/* ---------- Live-Anzeige & Monitor-Modus ---------- */
.conn { display: inline-flex; align-items: center; gap: .35rem; font-size: .75rem; font-weight: 700; color: #1f9d55; vertical-align: middle; margin-left: .5rem;
  border: 1px solid currentColor; border-radius: 99px; padding: .05rem .55rem; }
.conn i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 1.6s ease-in-out infinite; }
.conn.off { color: var(--muted); }
.conn.off i { animation: none; }
.clock { font-variant-numeric: tabular-nums; }
.board-tools { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; justify-content: flex-end; }
.half-tag { font-size: .68rem; font-weight: 800; color: #b7791f; border: 1px solid currentColor; border-radius: 6px; padding: 0 .3rem; cursor: default; }
.admin .half-tag { cursor: pointer; }
.chip .ty { opacity: .85; font-weight: 600; }
input.narrow { width: 7rem; }

body.kiosk .topbar, body.kiosk .mywork, body.kiosk #btn-kiosk { display: none !important; }
body.kiosk main { max-width: none; padding: 1.5rem 2rem; }
body.kiosk #tab-board h1 { font-size: 2.2rem; }
body.kiosk #tab-board .sub { font-size: 1.2rem; }
body.kiosk .clock { font-size: 1.6rem; font-weight: 800; color: var(--text); }
body.kiosk .grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.25rem; }
body.kiosk .tile-head { font-size: 1.2rem; }
body.kiosk .tile-status .label { font-size: 1.45rem; }
body.kiosk button.tile { pointer-events: none; }

/* ---------- Verwaltung: Status & Einstellungen ---------- */
#va-table input { width: 5.5rem; text-align: right; padding: .3rem .5rem; font-size: .88rem; }
#statuses-table input[type=text], #statuses-table input:not([type]) { padding: .3rem .5rem; font-size: .88rem; width: 100%; min-width: 9rem; }
#statuses-table input[type=color], .add-row input[type=color] { padding: 0; width: 2.4rem; height: 2rem; border-radius: 7px; cursor: pointer; }
.label-cell { display: flex; align-items: center; gap: .4rem; }
.label-cell input { flex: 1; }
.sys-tag { font-size: .7rem; font-weight: 700; color: var(--muted); border: 1px solid var(--border); border-radius: 99px; padding: 0 .45rem; margin-left: .35rem; }
.add-row { margin-top: .75rem; }
.settings { display: flex; flex-wrap: wrap; gap: 1.25rem 2rem; align-items: flex-end; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1rem; box-shadow: var(--shadow); }
.settings select { min-width: 16rem; }

/* ---------- Urlaubskalender ---------- */
.cal-nav { display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.cal-nav h2 { margin: 0 .5rem; min-width: 10.5rem; text-align: center; }
.calendar { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head span { padding: .5rem; font-size: .78rem; font-weight: 700; text-transform: uppercase; color: var(--muted); background: var(--surface-2); text-align: center; }
.cal-day {
  min-height: 104px; padding: .35rem; border-top: 1px solid var(--border); border-left: 1px solid var(--border);
  cursor: pointer; display: flex; flex-direction: column; gap: .25rem; min-width: 0;
}
.cal-day:nth-child(7n + 1) { border-left: 0; }
.cal-day:hover { background: var(--surface-2); }
.cal-day.weekend, .cal-day.holiday { background: var(--weekend); }
.cal-day.other .cal-num { opacity: .4; }
.cal-num { font-size: .85rem; font-weight: 700; display: flex; gap: .35rem; align-items: baseline; flex-wrap: wrap; }
.cal-day.today .cal-num > .n { background: var(--brand); color: var(--surface); border-radius: 99px; padding: 0 .45rem; }
.cal-hol { font-size: .7rem; font-weight: 600; color: var(--danger); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-chips { display: flex; flex-direction: column; gap: .2rem; }
.chip {
  font-size: .74rem; font-weight: 700; color: #fff; background: var(--c); border-radius: 6px; padding: .1rem .4rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chip.mine { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .7); }
.auto-tag {
  display: inline-grid; place-items: center; width: 1.05rem; height: 1.05rem; border-radius: 4px; margin-left: .25rem;
  font-size: .65rem; font-weight: 800; color: #fff; background: #d69e2e; vertical-align: middle;
}
#autopause-hint .auto-tag { margin: 0 .3rem 0 0; }
@media (max-width: 760px) {
  .cal-day { min-height: 64px; padding: .2rem; }
  .chip { font-size: .62rem; padding: 0 .2rem; }
  .cal-hol { display: none; }
  .cal-nav h2 { min-width: 0; flex: 1; font-size: 1rem; }
}

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100;
  background: var(--text); color: var(--bg); padding: .65rem 1.1rem; border-radius: 10px; box-shadow: var(--shadow);
  font-weight: 600; max-width: calc(100vw - 32px);
}
.toast.error { background: var(--danger); color: #fff; }

/* ---------- Mittlere Breite: Kopfzeile kompakter ---------- */
.ul-icon { display: none; }
@media (max-width: 1250px) {
  .topbar .theme-toggle .tt-label { display: none; }
  .brand-text { display: none; }
  .me-name { display: none; }
  .ul-label { display: none; }
  .ul-icon { display: inline; }
  .tabs button { padding: .5rem .6rem; font-size: .92rem; }
  .topbar { gap: .6rem; }
}

/* ---------- Mobil ---------- */
@media (max-width: 760px) {
  .topbar { padding: .5rem 16px; gap: .4rem; }
  .brand-text { display: none; }
  .tabs { order: 3; flex-basis: 100%; }
  .usermenu { margin-left: auto; }
  .me-name { display: none; }
  .theme-toggle .tt-label { display: none; }
  main { padding: 1rem 16px 3rem; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .tile-status .label { font-size: .95rem; }
  .kanban { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span2 { grid-column: auto; }
  .toolbar label { flex: 1 1 140px; }
}
