:root {
  /* Freundlichere Farbwelt: blau getönte Flächen statt Schwarz/Weiß, Navy statt Schwarz für Text */
  --bg: #edf2f8; --surface: #ffffff; --surface-2: #f4f7fb; --border: #dde6f0; --text: #1d2d44; --muted: #687b93;
  --primary: #143f6c; --primary-2: #2468b6; --primary-soft: #e5eefa; --accent: #f0a830; --ok: #1f8a4c; --ok-bg: #ddf5e6; --warn: #b46207; --warn-bg: #fff1d6;
  --bad: #c43333; --bad-bg: #fde6e6; --info-bg: #e3edfb; --radius: 12px;
  --shadow: 0 1px 2px rgba(20,63,108,.06), 0 4px 14px rgba(20,63,108,.06);
  --c-blue: #2f6fd6; --c-blue-bg: #e6effc; --c-violet: #6d55d1; --c-violet-bg: #eeeafc; --c-teal: #0e8f82; --c-teal-bg: #ddf3f0;
  --c-amber: #c97a0a; --c-amber-bg: #fdf0db; --c-green: #23894f; --c-green-bg: #dff4e7; --c-rose: #cc3f66; --c-rose-bg: #fce6ec;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 14px; color: var(--text); background: var(--bg); }
a { color: var(--primary-2); text-decoration: none; }
h1 { font-size: 23px; margin: 0 0 16px; color: var(--primary); letter-spacing: -.01em; } h2 { font-size: 17px; margin: 0 0 12px; } h3 { font-size: 15px; margin: 0 0 8px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .grow { flex: 1; } .stack > * + * { margin-top: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }

/* Layout Admin */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 236px; background: linear-gradient(185deg, #17497c 0%, #123a63 55%, #0f3156 100%); color: #dbe7f5; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; flex-shrink: 0; }
.sidebar .brand { padding: 18px 18px 14px; font-weight: 700; color: #fff; font-size: 16px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar .brand small { display: block; font-weight: 400; color: #9fb6d1; font-size: 12px; margin-top: 2px; }
.sidebar nav { padding: 10px 8px; overflow-y: auto; flex: 1; }
.sidebar nav a { display: flex; align-items: center; gap: 11px; color: #d6e4f4; padding: 7px 10px; border-radius: 10px; margin-bottom: 3px; }
.sidebar nav a > span:first-child { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; background: rgba(255,255,255,.08); font-size: 16px; flex-shrink: 0; }
.sidebar nav a:hover { background: rgba(255,255,255,.08); }
.sidebar nav a.active { background: rgba(255,255,255,.14); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.sidebar nav a.active > span:first-child { background: var(--accent); color: #1d2d44; }
.sidebar nav .section { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #8aa5c4; padding: 14px 12px 6px; }
.sidebar .user { padding: 12px 18px; border-top: 1px solid rgba(255,255,255,.1); font-size: 12px; }
.sidebar .user button { margin-top: 6px; }
.badge-count { margin-left: auto; background: var(--accent); color: #111; border-radius: 10px; padding: 0 7px; font-size: 11px; font-weight: 700; }
.main { flex: 1; padding: 24px 28px; min-width: 0; }
.topbar-mobile { display: none; }
@media (max-width: 860px) {
  .layout { display: block; }
  .sidebar { position: fixed; z-index: 50; left: -260px; transition: left .2s; }
  .sidebar.open { left: 0; }
  .topbar-mobile { display: flex; align-items: center; gap: 12px; background: var(--primary); color: #fff; padding: 12px 16px; position: sticky; top: 0; z-index: 40; }
  .topbar-mobile button { background: none; border: 0; color: #fff; font-size: 22px; padding: 0; }
  .main { padding: 16px; }
}

/* Karten, Tabellen */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.main > h1:first-child, .main > .row:first-child h1 { color: var(--primary); }
.card.tight { padding: 0; overflow: hidden; }
.kpi { display: flex; flex-direction: column; gap: 4px; } .kpi .val { font-size: 26px; font-weight: 700; } .kpi .lbl { color: var(--muted); font-size: 12px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 12px; color: #4f6683; font-weight: 600; background: #eef3f9; position: sticky; top: 0; }
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: #eaf1fb; }
.table-wrap { overflow-x: auto; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Formulare */
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 500; }
input, select, textarea { width: 100%; padding: 8px 10px; border: 1px solid #d0dbe8; border-radius: 9px; font: inherit; background: #fbfdff; color: var(--text); }
input[type=checkbox] { width: auto; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid #cfe0f7; border-color: var(--primary-2); background: #fff; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin: 0 0 14px; }
legend { font-weight: 600; padding: 0 6px; }

button, .btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #d3deeb; background: #f3f7fc; color: #1f4673; padding: 8px 14px; border-radius: 8px; font: inherit; font-weight: 500; cursor: pointer; }
button:hover, .btn:hover { background: var(--primary-soft); border-color: #b9cde6; }
button.primary, .btn.primary { background: var(--primary-2); border-color: var(--primary-2); color: #fff; box-shadow: 0 2px 6px rgba(36,104,182,.25); }
button.primary:hover { background: var(--primary); }
button.danger { color: var(--bad); border-color: #fecaca; } button.danger:hover { background: var(--bad-bg); }
button.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
button.small, .btn.small { padding: 4px 9px; font-size: 12px; }
button.link { border: 0; background: none; color: var(--primary-2); padding: 0; }
button:disabled { opacity: .5; cursor: not-allowed; }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; background: #e6edf6; color: #36506f; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); } .pill.info { background: var(--info-bg); color: var(--primary-2); }
.alert { padding: 10px 12px; border-radius: 8px; background: var(--warn-bg); color: #7c4a03; margin-bottom: 10px; }
.alert.bad { background: var(--bad-bg); color: var(--bad); } .alert.ok { background: var(--ok-bg); color: var(--ok); } .alert.info { background: var(--info-bg); color: var(--primary); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 8px 8px 0 0; background: none; padding: 9px 14px; color: var(--muted); }
.tabs button.active { border-bottom-color: var(--primary-2); color: var(--primary-2); background: var(--primary-soft); font-weight: 600; }

/* Dienstplan */
.plan { display: grid; border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; background: var(--surface); }
.plan .cell { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 6px; min-height: 64px; min-width: 130px; }
.plan .head { background: var(--surface-2); font-weight: 600; font-size: 12px; position: sticky; top: 0; z-index: 2; min-height: 0; }
.plan .head.today { background: #dbeafe; }
.plan .rowhead { background: var(--surface-2); font-weight: 600; position: sticky; left: 0; z-index: 1; min-width: 170px; }
.plan .cell.add:hover { background: #f8fbff; cursor: copy; }
.plan .weekend { background: #fbfcfe; }
.shift { border-left: 4px solid var(--primary-2); background: #f1f5fb; border-radius: 6px; padding: 5px 7px; margin-bottom: 5px; cursor: pointer; font-size: 12px; line-height: 1.35; }
.shift:hover { filter: brightness(.97); }
.shift .t { font-weight: 700; } .shift .names { color: #334155; }
.shift.full { background: #ecfdf3; } .shift.partial { background: #fff8e6; } .shift.empty { background: #fdecec; }
.shift .cap { float: right; font-weight: 700; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: flex-start; justify-content: center; z-index: 100; padding: 40px 12px; overflow-y: auto; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 760px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal.wide { max-width: 1000px; }
.modal header { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal header h2 { margin: 0; flex: 1; }
.modal .body { padding: 18px; }
.modal footer { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 12px 12px; }
.modal footer .left { margin-right: auto; }
.close-x { border: 0; background: none; font-size: 22px; color: var(--muted); padding: 0 4px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #173a61; color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 200; box-shadow: var(--shadow); max-width: 90vw; }
.toast.err { background: var(--bad); }
.list-item { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.empty { padding: 24px; text-align: center; color: var(--muted); }
.gb-entry { border-left: 4px solid #94a3b8; padding: 10px 12px; background: #fff; border-radius: 6px; margin-bottom: 8px; border: 1px solid var(--border); border-left-width: 4px; }
.gb-entry.hoch { border-left-color: var(--bad); } .gb-entry.mittel { border-left-color: var(--accent); }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: linear-gradient(160deg, #0f3d6e, #1d5fa8); }
.login-box { background: #fff; padding: 28px; border-radius: 14px; width: 100%; max-width: 380px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.login-box h1 { margin-bottom: 4px; }

@media print {
  .sidebar, .topbar-mobile, .no-print, button { display: none !important; }
  .main { padding: 0; } .card { box-shadow: none; border: 0; }
}

/* Aufträge, Stammdaten-Übersicht */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.dot.big { width: 14px; height: 14px; }
.day-head { padding: 10px 14px; font-weight: 600; background: var(--surface-2); border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; }
.day-head.today { background: var(--info-bg); color: var(--primary); }
.shift-row { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-bottom: 1px solid var(--border); cursor: pointer; }
.shift-row:last-child { border-bottom: 0; }
.shift-row:hover { background: var(--surface-2); }
.sr-time { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 92px; }
.sr-main { flex: 1; min-width: 0; }
.type-tile, .hub-tile { color: inherit; transition: border-color .15s, transform .15s; }
.type-tile:hover, .hub-tile:hover { border-color: var(--primary-2); transform: translateY(-1px); }
.hub-tile { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.hub-tile strong { font-size: 15px; }
.hub-icon { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 11px; font-size: 21px; background: var(--c-blue-bg); color: var(--c-blue); }
.grid3 > .hub-tile:nth-child(6n+2) .hub-icon { background: var(--c-violet-bg); color: var(--c-violet); }
.grid3 > .hub-tile:nth-child(6n+3) .hub-icon { background: var(--c-teal-bg); color: var(--c-teal); }
.grid3 > .hub-tile:nth-child(6n+4) .hub-icon { background: var(--c-amber-bg); color: var(--c-amber); }
.grid3 > .hub-tile:nth-child(6n+5) .hub-icon { background: var(--c-green-bg); color: var(--c-green); }
.grid3 > .hub-tile:nth-child(6n+6) .hub-icon { background: var(--c-rose-bg); color: var(--c-rose); }
@media (max-width: 600px) { .shift-row { flex-wrap: wrap; gap: 4px 12px; } .sr-time { min-width: 0; } }
.alert.warn { background: var(--warn-bg); color: var(--warn); }

/* KI-Planungsassistent (Chatfenster unten rechts) */
.ai-fab { position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 60; width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--primary-2); color: #fff; font-size: 26px; box-shadow: 0 6px 20px rgba(15,23,42,.25); display: flex; align-items: center; justify-content: center; padding: 0; }
.ai-fab:hover { background: var(--primary); }
.ai-panel { position: fixed; right: 20px; bottom: calc(90px + env(safe-area-inset-bottom, 0px)); z-index: 60; width: 400px; max-width: calc(100vw - 32px); height: min(620px, calc(100vh - 120px)); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 12px 40px rgba(15,23,42,.25); display: flex; flex-direction: column; overflow: hidden; }
.ai-panel[hidden] { display: none; }
.ai-panel header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; background: var(--primary); color: #fff; }
.ai-panel header .small { color: #c9d9ec; font-size: 12px; }
.ai-panel header .close-x { color: #fff; background: none; border: 0; font-size: 22px; }
.ai-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.ai-msg { max-width: 88%; padding: 9px 12px; border-radius: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.ai-msg.user { align-self: flex-end; background: var(--primary-2); color: #fff; border-bottom-right-radius: 4px; }
.ai-msg.assistant { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.ai-dots { color: var(--muted); font-style: italic; }
.ai-hello { color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; line-height: 1.45; }
.ai-examples { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.ai-examples button { text-align: left; font-size: 13px; background: var(--surface-2); white-space: normal; }
.ai-actions { background: var(--surface); border: 2px solid var(--accent); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.ai-actions-title { font-weight: 600; }
.ai-actions .check { align-items: flex-start; line-height: 1.4; }
.ai-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); background: var(--surface); }
.ai-input textarea { flex: 1; resize: none; min-height: 44px; }
@media (max-width: 600px) { .ai-panel { right: 8px; left: 8px; width: auto; max-width: none; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); height: calc(100vh - 110px); } .ai-fab { right: 14px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); } }

/* Betrieb: Alarme, Ersatzsuche, Scanstation, Fotos, QR */
.sidebar nav a.nav-alarm { background: var(--bad); color: #fff; font-weight: 700; margin-bottom: 8px; }
.sidebar nav a.nav-alarm:hover { background: #991b1b; }
.mobile-alarm { margin-left: auto; background: var(--bad); color: #fff; font-weight: 700; border-radius: 999px; padding: 3px 10px; font-size: 13px; }
.mobile-alarm[hidden] { display: none; }
.sidebar .user .user-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.sidebar .user .user-actions button { margin-top: 0; }
.alarm-card { border-color: #fca5a5; border-left: 4px solid var(--bad); }
.alarm-item.offen { background: #fff7f7; }
.list-item.unread { background: #f5f9ff; }
.rp-excluded td { opacity: .5; }
.rp-ai td { background: #fffbeb; }
.rp-why { color: var(--primary); font-weight: 600; margin-bottom: 2px; }
.station-input { font-size: 22px; padding: 14px 16px; letter-spacing: .04em; text-transform: uppercase; }
.station-go { padding: 14px 22px; font-size: 16px; }
.station-result { margin-top: 12px; font-size: 18px; border-radius: 10px; }
.station-result:empty { display: none; }
.station-result.ok, .station-result.info, .station-result.warn, .station-result.bad { padding: 14px 16px; }
.station-result.ok { background: var(--ok-bg); color: var(--ok); }
.station-result.info { background: var(--info-bg); color: var(--primary); }
.station-result.warn { background: var(--warn-bg); color: var(--warn); }
.station-result.bad { background: var(--bad-bg); color: var(--bad); }
.qr-mini { width: 56px; height: 56px; }
.qr-mini svg, .badge-qr svg { width: 100%; height: 100%; display: block; }
.badge-qr { width: 150px; height: 150px; flex-shrink: 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; }
.photo-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.photo-grid figure { margin: 0; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.photo-grid .ph-img { width: 130px; height: 98px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: zoom-in; }
.photo-grid .ph-img img { width: 100%; height: 100%; object-fit: cover; }
.bc-emps { max-height: 220px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: 8px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px; }
.bc-emps label[hidden] { display: none; }
.inq-chat { margin-top: 6px; padding: 8px 10px; background: var(--surface-2); border-radius: 8px; display: flex; flex-direction: column; gap: 4px; }
a.kpi.type-tile { color: inherit; }
@media (max-width: 600px) { .station-input { font-size: 18px; } .badge-qr { width: 120px; height: 120px; } }

/* Schicht als aufklappbarer Bereich */
.sb { border-bottom: 1px solid var(--border); }
.sb:last-child { border-bottom: 0; }
.sb .shift-row { border-bottom: 0; }
.sb-head.open { background: var(--info-bg); }
.sb-chev { width: 14px; color: var(--muted); font-size: 13px; }
.sb-body { padding: 4px 14px 14px; background: var(--surface); }
.sb-tools { margin: 8px 0; gap: 8px; }
.sb-table td, .sb-table th { padding: 6px 8px; }
.sb-empty td { background: var(--warn-bg); }
.sb-subrow td { background: var(--surface-2); }
.sb-pending td { background: var(--info-bg); }
.icon-btn { padding: 2px 8px; line-height: 1.4; }
.sb-edit { margin: 10px 0 4px; padding: 12px; border: 1px solid var(--primary-2); border-radius: var(--radius); background: var(--surface-2); }
.sb-edit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.sb-edit-grid .full { grid-column: 1 / -1; }
.sb-chg { font-weight: 700; color: var(--primary); }
.sb-slot-edit > td { background: var(--surface-2); padding: 10px !important; }
.sb-note-cell { min-width: 170px; cursor: pointer; }
.sb-note { display: inline-block; padding: 3px 8px; border-radius: 6px; background: var(--warn-bg); color: var(--warn); font-weight: 600; font-size: 13px; border: 1px solid currentColor; }
.sb-note-add { color: var(--muted); font-size: 12px; opacity: .7; }
tr:hover .sb-note-add { opacity: 1; text-decoration: underline; }
.sb-note-in { min-width: 220px; padding: 4px 8px; }
.ord-important { margin: 0 0 14px; padding: 12px 14px; border-radius: var(--radius); background: var(--warn-bg); color: var(--warn); border: 2px solid currentColor; }
.ord-important.empty { padding: 0; border: 0; background: none; }
.ord-important-text { white-space: pre-wrap; font-size: 15px; font-weight: 600; margin-top: 6px; color: var(--text); }
.ord-important textarea { color: var(--text); }
.pill.skill { font-size: 11px; background: var(--info-bg); color: var(--primary); margin-top: 3px; }
.pill.skill.own { outline: 1px solid currentColor; }
details.mc { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
details.mc > summary { padding: 8px 10px; cursor: pointer; list-style: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
details.mc > summary::after { content: ' ▾'; color: var(--muted); }
details.mc .mc-list { display: flex; flex-direction: column; gap: 2px; padding: 6px 10px 10px; border-top: 1px solid var(--border); max-height: 320px; overflow: auto; }
input.ro { background: var(--bg-soft, #f3f5f8); color: var(--muted, #555); font-weight: 600; pointer-events: none; }

/* ===== Cockpit nach Themen ===== */
.c-blue { --sc: var(--c-blue); --sbg: var(--c-blue-bg); } .c-violet { --sc: var(--c-violet); --sbg: var(--c-violet-bg); }
.c-teal { --sc: var(--c-teal); --sbg: var(--c-teal-bg); } .c-amber { --sc: var(--c-amber); --sbg: var(--c-amber-bg); }
.c-green { --sc: var(--c-green); --sbg: var(--c-green-bg); } .c-rose { --sc: var(--c-rose); --sbg: var(--c-rose-bg); }
.dash-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 14px; } .dash-head h1 { margin: 0 0 2px; }
.dash-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 18px; position: sticky; top: 0; z-index: 5; padding: 8px 0; background: var(--bg); }
.dash-jump a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-weight: 600; font-size: 13px; box-shadow: var(--shadow); }
.dash-jump a > i:first-child { color: var(--sc); }
.dash-jump a:hover { border-color: var(--sc); }
.dash-jump a > i:last-child { color: var(--ok); }
.dash-todo { background: var(--sc); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 11px; line-height: 18px; }
.dash-sec { background: linear-gradient(180deg, var(--sbg) 0, rgba(255,255,255,0) 140px), var(--surface-2); border: 1px solid var(--border); border-top: 4px solid var(--sc); border-radius: 16px; padding: 16px; margin-bottom: 20px; scroll-margin-top: 64px; }
.dash-sec-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.dash-sec-head h2 { margin: 0; color: var(--text); font-size: 18px; }
.dash-sec-ic { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 12px; background: var(--sc); color: #fff; font-size: 21px; box-shadow: 0 4px 10px rgba(0,0,0,.08); flex-shrink: 0; }
.dash-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-bottom: 14px; }
.dash-stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); color: var(--text); }
a.dash-stat:hover { border-color: var(--sc); }
.dash-stat .v { font-size: 26px; font-weight: 700; color: var(--sc); font-variant-numeric: tabular-nums; line-height: 1.1; }
.dash-stat .l { font-size: 12px; color: var(--muted); }
.dash-stat.attn { background: #fff8ec; border-color: #f3d49a; } .dash-stat.attn .v { color: var(--warn); }
.dash-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-bottom: 14px; }
.dash-type { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--tc); color: var(--text); }
.dash-type:hover { box-shadow: var(--shadow); }
.dash-type strong { display: block; } .dash-type-ic { display: inline-flex; width: 36px; height: 36px; border-radius: 10px; align-items: center; justify-content: center; font-size: 18px; color: var(--tc); background: color-mix(in srgb, var(--tc) 12%, white); }
.dash-card { box-shadow: none; }
.dash-card-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px; border-bottom: 1px solid var(--border); background: var(--surface); }
.dash-card-head > i { color: var(--sc); font-size: 17px; } .dash-card-head h3 { margin: 0; flex: 1; font-size: 14px; }
.dash-card.attn { border-color: #f3d49a; } .dash-card.attn .dash-card-head > i { color: var(--warn); }
.empty i { color: var(--ok); }
.alert.row > i { font-size: 18px; }

/* ===== Besetzung mit Dringlichkeitsstufen (Cockpit oben) ===== */
.lv-red { --lv: #c62f2f; --lv-bg: #fde7e7; --lv-bd: #f3b4b4; }
.lv-orange { --lv: #c96a05; --lv-bg: #fff0dc; --lv-bd: #f5cf98; }
.lv-yellow { --lv: #8a6d00; --lv-bg: #fff9d9; --lv-bd: #eadb8c; }
.bes-panel { --sc: var(--c-rose); background: var(--surface); border: 1px solid var(--border); border-top: 5px solid #c62f2f; border-radius: 16px; padding: 16px; margin-bottom: 18px; box-shadow: var(--shadow); scroll-margin-top: 64px; }
.bes-panel .dash-sec-ic { background: #c62f2f; }
.bes-panel.hot .dash-sec-ic { animation: besPulse 1.6s ease-in-out infinite; }
@keyframes besPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(198,47,47,.45); } 50% { box-shadow: 0 0 0 8px rgba(198,47,47,0); } }
@media (prefers-reduced-motion: reduce) { .bes-panel.hot .dash-sec-ic { animation: none; } }
.bes-levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; margin-bottom: 14px; }
.bes-level { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 12px; background: var(--lv-bg); border: 1px solid var(--lv-bd); color: var(--text); }
.bes-level > i { font-size: 24px; color: var(--lv); }
.bes-level strong { display: block; color: var(--lv); font-size: 15px; } .bes-level .small { color: var(--muted); }
.bes-lv-num { font-size: 30px; font-weight: 800; color: var(--lv); text-align: right; line-height: 1; font-variant-numeric: tabular-nums; }
.bes-lv-num small { display: block; font-size: 11px; font-weight: 600; color: var(--muted); margin-top: 4px; }
.bes-level.zero { background: var(--surface-2); border-color: var(--border); } .bes-level.zero > i, .bes-level.zero strong, .bes-level.zero .bes-lv-num { color: #9aabbf; }
.bes-group { margin-top: 10px; scroll-margin-top: 80px; }
.bes-group-head { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--lv); padding: 6px 2px; }
.bes-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 120px auto; gap: 14px; align-items: center; padding: 10px 12px; margin-bottom: 6px; border-radius: 10px; background: var(--surface); border: 1px solid var(--lv-bd); border-left: 6px solid var(--lv); }
.bes-row.lv-red { background: #fff6f6; }
.bes-when { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; } .bes-when span { font-size: 13px; }
.bes-until { color: var(--lv); font-weight: 700; }
.bes-what { min-width: 0; }
.bes-open { display: flex; flex-direction: column; align-items: center; text-align: center; } .bes-num { font-size: 22px; font-weight: 800; color: var(--lv); line-height: 1; }
.bes-allgood { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 12px; background: var(--ok-bg); color: var(--ok); } .bes-allgood > i { font-size: 28px; }
@media (max-width: 760px) { .bes-row { grid-template-columns: 1fr auto; } .bes-what { grid-column: 1 / -1; grid-row: 2; } .bes-act { grid-column: 1 / -1; } }

/* Besetzung: kompakte Ampel-Leiste + Seitenfenster */
.bes-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); border-left: 6px solid var(--ok); box-shadow: var(--shadow); }
.bes-bar.warn { border-left-color: #c96a05; } .bes-bar.hot { border-left-color: #c62f2f; background: linear-gradient(90deg, #fff3f3, var(--surface) 45%); }
.bes-bar-ic { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 11px; font-size: 20px; color: #fff; background: var(--ok); flex-shrink: 0; }
.bes-bar.warn .bes-bar-ic { background: #c96a05; } .bes-bar.hot .bes-bar-ic, .bes-drawer .bes-bar-ic { background: #c62f2f; }
.bes-bar.hot .bes-bar-ic { animation: besPulse 1.6s ease-in-out infinite; }
.bes-bar-text { flex: 1; min-width: 220px; display: flex; flex-direction: column; } .bes-bar-text .small { color: var(--muted); overflow-wrap: anywhere; } .bes-bar-text b { color: var(--text); }
.bes-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.bes-chip { gap: 6px; padding: 6px 10px; border-radius: 999px; background: var(--lv-bg); border-color: var(--lv-bd); color: var(--lv); font-weight: 600; }
.bes-chip:hover { background: var(--lv-bg); filter: brightness(.97); border-color: var(--lv); }
.bes-chip .n { font-size: 16px; font-weight: 800; } .bes-chip .l { font-size: 12px; }
.bes-chip.zero { background: var(--surface-2); border-color: var(--border); color: #9aabbf; }
.bes-drawer-bg { position: fixed; inset: 0; z-index: 120; background: rgba(20,45,75,0); transition: background .2s; }
.bes-drawer-bg.open { background: rgba(20,45,75,.35); }
.bes-drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(620px, 100vw); background: var(--bg); box-shadow: -10px 0 30px rgba(20,45,75,.2); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .25s ease; }
.bes-drawer-bg.open .bes-drawer { transform: none; }
.bes-drawer header { display: flex; align-items: center; gap: 12px; padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 12px; background: var(--surface); border-bottom: 1px solid var(--border); }
.bes-drawer header h2 { margin: 0; font-size: 17px; }
.bes-tabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.bes-tabs button { padding: 5px 10px; border-radius: 999px; font-size: 13px; }
.bes-tabs button span { font-weight: 800; }
.bes-tabs button[class*="lv-"] { color: var(--lv); }
.bes-tabs button.active { background: var(--primary-2); border-color: var(--primary-2); color: #fff; }
.bes-tabs button.active[class*="lv-"] { background: var(--lv); border-color: var(--lv); }
.bes-list { flex: 1; overflow-y: auto; padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px)); }
.bes-drawer .bes-row { grid-template-columns: 112px minmax(0, 1fr) 76px; }
.bes-drawer .bes-act { grid-column: 2 / -1; justify-self: end; margin-top: -4px; }
@media (max-width: 560px) { .bes-drawer .bes-row { grid-template-columns: 1fr auto; } .bes-drawer .bes-what { grid-column: 1 / -1; grid-row: 2; } .bes-drawer .bes-act { grid-column: 1 / -1; } }

/* Positionen markieren, sperren, Bewerbungen */
.sb-sel { width: 30px; text-align: center; }
.sb-sel input { width: 16px; height: 16px; accent-color: var(--primary-2); cursor: pointer; }
.sb-selected td { background: var(--info-bg) !important; box-shadow: inset 0 1px 0 var(--primary-2), inset 0 -1px 0 var(--primary-2); }
.sb-locked td { background: repeating-linear-gradient(135deg, var(--surface-2) 0 8px, var(--surface) 8px 16px); color: var(--muted); }
.sb-locked td:first-child, .sb-locked .sb-lockic { color: var(--text); }
.sb-lockic { display: inline-flex; vertical-align: -2px; margin-left: 4px; color: #8a5a00; }
.sb-hasapply td { background: #eaf6ee; }
.sb-apply { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 3px 8px; border-radius: 6px; background: #d9f0e1; color: #1d6b3a; font-weight: 600; font-size: 13px; }
.sb-apply button { padding: 2px 8px; }
.sb-selbar { position: sticky; bottom: 8px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 2px; padding: 10px 12px; border-radius: var(--radius); background: var(--primary); color: #fff; box-shadow: 0 6px 18px rgba(20,45,75,.25); }
.sb-selbar button { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.35); }
.sb-selbar button:hover { background: rgba(255,255,255,.26); }
.sb-selbar button.danger { background: #c62f2f; border-color: #c62f2f; color: #fff; }
.sb-selbar button.link { background: none; border-color: transparent; text-decoration: underline; }

/* Monatsplan (Objektschutz / Interventionsdienst) */
.mg-nav { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.mg-nav button { border: 0; background: transparent; padding: 5px 9px; border-radius: 999px; }
.mg-nav button:hover { background: var(--info-bg); }
.mg-month { min-width: 150px; text-align: center; font-size: 16px; }
.mg-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.mg-seg button { border: 0; border-radius: 0; background: var(--surface); padding: 6px 12px; font-size: 13px; }
.mg-seg button.on { background: var(--primary); color: #fff; }
.mg-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.mg-sum b { color: var(--text); font-size: 15px; } .mg-sum .bad b { color: #c62f2f; } .mg-sum .ok b { color: #1d7a45; }
.mg-legend { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mg-legend .lg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-left: 8px; border: 1px solid var(--border); }
.lg.asg { background: #e3f1e8; } .lg.sub { background: #ece7fb; } .lg.open { background: #fde3e3; } .lg.we { background: var(--surface-2); }
.mg-wrap { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); max-height: 70vh; }
table.mg { border-collapse: separate; border-spacing: 0; font-size: 12px; width: max-content; min-width: 100%; }
table.mg th, table.mg td { padding: 0; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
table.mg tr:first-child th { position: sticky; top: 0; z-index: 3; background: var(--surface); }
table.mg .mg-lab { position: sticky; left: 0; z-index: 2; background: var(--surface); text-align: left; padding: 5px 10px; min-width: 190px; max-width: 240px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 1px 0 0 var(--border); }
table.mg tr:first-child .mg-lab { z-index: 4; }
.mg-time { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--primary); }
.mg-pos { color: var(--text); }
tr.mg-first:not(:nth-child(2)) > * { border-top: 2px solid var(--border-strong, #b9c8da); }
.mg-d { width: 64px; min-width: 64px; text-align: center; padding: 4px 0 !important; cursor: pointer; font-weight: 500; }
.mg-d span { display: block; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.mg-d b { font-size: 14px; font-variant-numeric: tabular-nums; }
table.mg .mon { border-left: 2px solid var(--border-strong, #b9c8da); }
.mg-d:hover { background: var(--info-bg) !important; }
table.mg .we, table.mg .hol { background: var(--surface-2); }
table.mg th.hol b { color: #c62f2f; }
table.mg th.today { background: var(--primary) !important; color: #fff; } table.mg th.today span { color: #dbe8f7; }
table.mg .sel { box-shadow: inset 2px 0 0 var(--primary-2), inset -2px 0 0 var(--primary-2); }
.mg-c { height: 30px; max-width: 64px; font-size: 11.5px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 3px !important; cursor: pointer; }
.mg-c.none { cursor: default; background-image: radial-gradient(var(--border) 1px, transparent 1px); background-size: 6px 6px; }
.mg-c.asg { background: #e3f1e8; color: #164f2d; font-weight: 600; }
.mg-c.asg.subm, .mg-c.sub { background: #ece7fb; color: #4b2f99; font-weight: 600; }
.mg-c.open { background: #fde3e3; color: #b42323; font-weight: 700; }
.mg-c.miss { color: var(--muted); }
.mg-c.locked { background-image: repeating-linear-gradient(135deg, rgba(0,0,0,.06) 0 4px, transparent 4px 8px); }
.mg-c .i-lock, .mg-c i { font-size: 10px; margin-right: 2px; }
.mg-c:not(.none):hover { outline: 2px solid var(--primary-2); outline-offset: -2px; }
.mg-foot td, .mg-foot th { position: sticky; bottom: 0; background: var(--surface); text-align: center; font-weight: 700; padding: 4px 0 !important; cursor: pointer; }
.mg-foot th.mg-lab { text-align: left; color: var(--muted); }
.mg-foot td.bad { color: #b42323; background: #fdf0f0; } .mg-foot td.ok { color: #1d7a45; }
.mg-ap { font-size: 10px; font-weight: 600; color: var(--primary-2); }
.mg-detail { scroll-margin-top: 70px; }
.mg-detail .day-head { gap: 8px; }
@media (max-width: 640px) { table.mg .mg-lab { min-width: 120px; max-width: 130px; } .mg-legend { margin-left: 0; } .mg-month { min-width: 120px; } }

/* Warteliste */
.pill.wl { background: #fff1d6; color: #8a5a00; border-color: #f0c66b; }
.sb-wl { margin-top: 10px; padding: 10px 12px; border: 1px dashed #e0a93a; border-radius: var(--radius); background: var(--warn-bg); }
.sb-wl-head { margin-bottom: 6px; color: #8a5a00; }
.sb-wl-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sb-wl-table td { padding: 5px 6px; border-top: 1px solid #f3e2bd; }
.wl-opt { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.wl-opt:has(input:checked) { border-color: var(--primary-2); background: var(--info-bg); }

/* Auftragsformular: Schnellanlage und Mitarbeiter als Verantwortliche */
.sel-plus { display: flex; gap: 6px; align-items: center; } .sel-plus select { flex: 1; min-width: 0; } .sel-plus button { white-space: nowrap; }
.le-list { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow: auto; }
.le-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; text-align: left; padding: 9px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.le-row:hover:not(:disabled) { border-color: var(--primary-2); background: var(--info-bg); }
.le-row:disabled { opacity: .6; cursor: not-allowed; }
.sb-tel { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-left: 4px; border-radius: 50%; background: #e3f1e8; color: #1d7a45; vertical-align: middle; }
.sb-tel:hover { background: #1d7a45; color: #fff; }

/* Ziehen & Ablegen */
.sb-draggable { cursor: grab; } .sb-draggable:active { cursor: grabbing; }
.sb-grip { color: var(--muted); margin-right: 4px; opacity: .55; } .sb-draggable:hover .sb-grip { opacity: 1; color: var(--primary-2); }
tr.dragging, td.dragging { opacity: .45; }
.mg-c[draggable=true] { cursor: grab; }
body.is-dragging [data-drop] { transition: box-shadow .1s; }
body.is-dragging tr[data-drop] td, body.is-dragging .mg-c[data-drop] { box-shadow: inset 0 0 0 1px rgba(36,104,182,.25); }
tr.drag-over td { background: #dcebfb !important; box-shadow: inset 0 2px 0 var(--primary-2), inset 0 -2px 0 var(--primary-2) !important; }
.mg-c.drag-over, .sb-head.drag-over { background: #dcebfb !important; outline: 2px dashed var(--primary-2); outline-offset: -3px; }

/* Abrechnungsstatus je Auftrag und Monat */
.bill-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 10px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.bill-bar .mg-nav { border: 0; padding: 0; } .bill-bar .mg-month { min-width: 130px; font-size: 15px; }
.bill-sum { font-size: 13px; color: var(--muted); } .bill-sum b { color: var(--text); } .bill-sum b.ok { color: #1d7a45; } .bill-sum b.bad { color: #c96a05; }
.bill-sum i { width: 14px; height: 14px; vertical-align: -2px; margin-right: 2px; }
.bill-cell { white-space: nowrap; }
.bill-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; vertical-align: middle; margin-right: 6px; background: #c9d3df; }
.bill-dot.green { background: #22a05a; } .bill-dot.orange { background: #e8a23a; }
.bill-btn { position: relative; padding: 5px 8px; margin-right: 4px; border: 1px solid var(--border); background: var(--surface-2); color: #9aa8b9; border-radius: 7px; line-height: 1; }
.bill-btn:hover:not(:disabled) { border-color: var(--primary-2); color: var(--primary-2); }
.bill-btn.on { background: #e3f1e8; border-color: #8fd0a9; color: #1d7a45; }
.bill-btn:disabled { opacity: .6; cursor: not-allowed; }
.bill-n { position: absolute; top: -6px; right: -6px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 8px; background: #e8a23a; color: #fff; font-size: 10px; font-weight: 700; line-height: 15px; text-align: center; }
/* Abrechnung je Auftrag */
.rc-head { gap: 10px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.rc-table td { vertical-align: middle; }
.rc-table tr.rc-day td { background: var(--surface-2); font-weight: 600; font-size: 13px; padding-top: 8px; padding-bottom: 8px; }
.rc-table input.rc-t { width: 96px; padding: 5px 6px; }
.rc-table input.rc-b { width: 70px; padding: 5px 6px; }
.rc-table tr.changed input.rc-t, .rc-table tr.changed input.rc-b { border-color: #e0a100; background: var(--warn-bg); }
.rc-table tr.removed td { color: var(--muted); background: var(--surface-2); }
.rc-table tr.removed strong { text-decoration: line-through; }
.rc-stats { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.rc-stats .pill { font-size: 11px; }
.rc-plus { color: var(--ok); } .rc-minus { color: var(--bad); }
.rc-foot { position: sticky; bottom: 0; display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin-top: 12px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 -4px 16px rgba(20, 40, 80, .08); }
.rs-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.rs-tile { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; background: var(--surface-2); }
.rs-tile .rs-n { font-size: 28px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.rs-tile.bad .rs-n { color: var(--bad); } .rs-tile.warn .rs-n { color: var(--warn); }
.rc-table input.rc-t.bad { border-color: var(--bad); background: var(--bad-bg); }
.rc-foot { padding-right: 84px; }
/* Abrechnung kompakt (passt auf übliche Bildschirme), sonst sichtbarer Scrollbalken unten */
.rc-table { font-size: 13px; }
.rc-table th, .rc-table td { padding: 7px 8px; }
.rc-table th { white-space: nowrap; }
.rc-table input.rc-t { width: 64px; padding: 5px 6px; text-align: center; }
.rc-table input.rc-b { width: 54px; padding: 5px 6px; text-align: center; }
.rc-table .rc-pos { font-weight: 500; }
.rc-table .pill { font-size: 11px; padding: 1px 7px; }
.rc-table td:last-child { width: 1%; white-space: nowrap; }
.rc-x { padding: 4px 7px; }
.rc-wrap { scrollbar-width: auto; scrollbar-color: #9fb3cc var(--surface-2); }
.rc-wrap::-webkit-scrollbar { height: 12px; }
.rc-wrap::-webkit-scrollbar-track { background: var(--surface-2); }
.rc-wrap::-webkit-scrollbar-thumb { background: #9fb3cc; border-radius: 6px; border: 2px solid var(--surface-2); }
.rc-table th:nth-child(5) { white-space: normal; line-height: 1.2; }
.rc-table input.rc-b { width: 50px; }
.rc-wrap::-webkit-scrollbar { width: 12px; }
.rc-table td:last-child, .rc-table th:last-child { position: sticky; right: 0; background: var(--surface); box-shadow: -1px 0 0 var(--border); }
.rc-table tr.removed td:last-child { background: var(--surface-2); }
.rc-table tr.rc-day td:last-child { position: static; box-shadow: none; background: var(--surface-2); }
.rc-table tr:first-child th:last-child { z-index: 3; }
.rc-foot > .row { gap: 12px; align-items: center; }
.rc-hscroll { overflow-x: auto; overflow-y: hidden; height: 16px; max-width: 100%; scrollbar-width: auto; scrollbar-color: #9fb3cc var(--surface-2); }
.rc-hscroll > div { height: 1px; }
.rc-hscroll::-webkit-scrollbar { height: 14px; } .rc-hscroll::-webkit-scrollbar-track { background: var(--surface-2); border-radius: 7px; }
.rc-hscroll::-webkit-scrollbar-thumb { background: #9fb3cc; border-radius: 7px; border: 2px solid var(--surface-2); }
/* Monatsplan: Hilfe, Mitarbeiterliste, Feld-Menü, Scrollbalken unten */
.mg-help { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin: 8px 0 14px; padding: 10px 14px; background: var(--info-bg); border-radius: 10px; font-size: 13px; color: var(--text); }
.mg-help i { width: 15px; height: 15px; vertical-align: -3px; color: var(--primary-2); }
.plan-layout.with-panel { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 14px; align-items: start; }
.plan-layout > #shiftList { min-width: 0; }
.emp-panel { position: sticky; top: 12px; max-height: calc(100vh - 24px); display: flex; flex-direction: column; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); }
.emp-panel .ep-head { display: flex; justify-content: space-between; align-items: center; }
.emp-panel .ep-list { overflow: auto; display: flex; flex-direction: column; gap: 3px; min-height: 120px; }
.emp-panel .ep-item { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); cursor: grab; font-size: 13px; user-select: none; }
.emp-panel .ep-item:hover { border-color: var(--primary-2); background: var(--primary-soft); }
.emp-panel .ep-item.armed { border-color: var(--primary-2); background: var(--primary-2); color: #fff; }
.emp-panel .ep-item i { width: 14px; height: 14px; opacity: .5; flex: none; }
.emp-panel .ep-armed { background: var(--warn-bg); border-radius: 8px; padding: 8px; font-size: 12px; }
.emp-panel .ep-tip { font-size: 12px; }
body.arming .mg-c[data-drop] { cursor: copy; }
body.arming .mg-c.open[data-drop] { outline: 2px dashed var(--primary-2); outline-offset: -3px; }
.cell-menu { position: fixed; z-index: 60; width: 270px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px rgba(20, 40, 80, .2); padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.cell-menu .cm-head { font-size: 12px; color: var(--muted); }
.cell-menu .cm-who { padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.cell-menu > button { text-align: left; justify-content: flex-start; }
.cell-menu .cm-move { display: flex; gap: 6px; } .cell-menu .cm-move select { flex: 1; min-width: 0; padding: 6px 8px; }
.cell-menu button.link { background: none; border: 0; color: var(--primary-2); padding: 4px 0; }
.hs-bar { position: fixed; bottom: 0; z-index: 40; overflow-x: auto; overflow-y: hidden; height: 18px; background: var(--surface); border-top: 1px solid var(--border); scrollbar-width: auto; scrollbar-color: #9fb3cc var(--surface-2); }
.hs-bar > div { height: 1px; }
.hs-bar::-webkit-scrollbar { height: 14px; } .hs-bar::-webkit-scrollbar-thumb { background: #9fb3cc; border-radius: 7px; border: 2px solid var(--surface); }
.mg-wrap { scrollbar-width: auto; scrollbar-color: #9fb3cc var(--surface-2); }
.mg-wrap::-webkit-scrollbar { height: 14px; } .mg-wrap::-webkit-scrollbar-thumb { background: #9fb3cc; border-radius: 7px; border: 2px solid var(--surface-2); }
.ce-list { display: flex; flex-direction: column; gap: 4px; max-height: 55vh; overflow: auto; }
.ce-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: left; padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); width: 100%; }
.ce-item:hover { border-color: var(--primary-2); background: var(--primary-soft); }
.ce-item.hard { opacity: .7; }
.ce-item .ce-hint { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 900px) { .plan-layout.with-panel { grid-template-columns: 1fr; } .emp-panel { position: static; max-height: 320px; } }
/* Lohnübersicht (Akte → Lohn) */
.wg-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.wg-tile { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; background: var(--surface-2); }
.wg-tile.ok { background: var(--ok-bg); border-color: #b6e3c6; } .wg-tile.warn { background: var(--warn-bg); border-color: #f1d9a8; }
.wg-tile .wg-n { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 2px 0; }
.wg-table tr.wg-abgerechnet td { background: var(--ok-bg); }
.wg-table tr.wg-geplant td { color: var(--muted); }
/* Monatsplan Objekte: größere Felder und Team-Leiste */
table.mg { font-size: 13px; }
.mg-d { width: 88px; min-width: 88px; }
.mg-d b { font-size: 16px; }
.mg-c { height: 46px; max-width: 88px; font-size: 13px; line-height: 1.15; }
.mg-c .mg-ln { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.mg-c .mg-fn { display: block; font-size: 11px; font-weight: 500; opacity: .8; overflow: hidden; text-overflow: ellipsis; }
table.mg .mg-lab { min-width: 210px; max-width: 260px; padding: 6px 12px; font-size: 13px; }
.team-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 12px; margin-bottom: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); position: sticky; top: 0; z-index: 5; }
.team-strip .ts-label { font-weight: 700; color: var(--primary); margin-right: 4px; display: inline-flex; align-items: center; gap: 4px; }
.team-strip .ts-chip { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border: 1px solid #b6e3c6; background: #e3f1e8; color: #164f2d; border-radius: 999px; font-weight: 600; font-size: 13px; cursor: grab; user-select: none; }
.team-strip .ts-chip i { width: 13px; height: 13px; opacity: .55; }
.team-strip .ts-chip small { font-weight: 500; opacity: .7; }
.team-strip .ts-chip:hover { border-color: var(--primary-2); }
.team-strip .ts-chip.armed { background: var(--primary-2); color: #fff; border-color: var(--primary-2); }
.team-strip .ts-out { display: none; margin-left: auto; font-size: 12px; color: var(--bad); font-weight: 600; }
body.is-dragging .team-strip .ts-out { display: inline; }
.team-strip.drag-over { outline: 2px dashed var(--bad); background: var(--bad-bg); }
.team-strip .ts-armed { flex-basis: 100%; font-size: 12px; background: var(--warn-bg); border-radius: 8px; padding: 6px 10px; }
.tp-list { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow: auto; margin: 4px 0; }
.tp-item { display: flex; align-items: center; gap: 6px; text-align: left; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); width: 100%; }
.tp-item:hover { border-color: var(--primary-2); background: var(--primary-soft); }
.tp-item.hard { opacity: .65; }
.td-list { max-height: 60vh; overflow: auto; }
.td-row { display: flex; align-items: center; gap: 8px; padding: 7px 4px; border-bottom: 1px solid var(--border); }
.td-row.in { background: var(--ok-bg); }
.m-sub { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }

/* Team-Kennzeichnung an Aufträgen */
.pill.team-pill { background: var(--c-violet-bg, #efe9ff); color: var(--c-violet, #6d28d9); font-weight: 600; }

/* Schicht-Formular: Auftrag/Ort fest, Zusatzoptionen eingeklappt */
.sh-ctx { display: flex; gap: 6px; align-items: center; padding: 8px 12px; margin-bottom: 12px; border-radius: 10px; background: var(--c-blue-bg); color: var(--c-blue); }
.sh-more { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 10px; }
.sh-more > summary { cursor: pointer; font-weight: 600; color: var(--c-blue); margin-bottom: 10px; }

/* Konditionen für Subunternehmer */
.sub-terms { display: grid; gap: 10px; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin-top: 8px; background: var(--surface, transparent); }
.sub-terms .st-title { font-weight: 700; }
.st-list { display: grid; gap: 6px; margin-bottom: 6px; }
.st-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px auto auto; gap: 8px; align-items: center; }
.st-row .st-unit { font-size: 12px; color: var(--muted); white-space: nowrap; min-width: 120px; }
@media (max-width: 560px) { .st-row { grid-template-columns: minmax(0, 1fr) 90px; } .st-row .st-unit { min-width: 0; } }
.sub-terms-card { margin-bottom: 12px; }
.st-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 8px 0 0; }
.st-dl dt { color: var(--muted); font-size: 13px; } .st-dl dd { margin: 0; }
.st-dl .pre { white-space: pre-wrap; }

/* Logo-Feld und Logos */
.logo-field { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.logo-prev { width: 120px; height: 64px; border: 1px dashed var(--border); border-radius: 10px; display: flex; align-items: center; justify-content: center; background: repeating-conic-gradient(#f1f4f8 0 25%, #fff 0 50%) 0 0 / 14px 14px; overflow: hidden; flex-shrink: 0; }
.logo-prev img { max-width: 100%; max-height: 100%; object-fit: contain; }
td.logo-cell { width: 56px; } td.logo-cell img { max-width: 48px; max-height: 28px; object-fit: contain; display: block; }
.brand-row { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 40px; height: 40px; border-radius: 10px; background: #fff; display: inline-flex; align-items: center; justify-content: center; padding: 4px; flex-shrink: 0; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.brand-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sidebar.branded { background: linear-gradient(185deg, color-mix(in srgb, var(--sb1) 92%, #fff) 0%, var(--sb1) 55%, color-mix(in srgb, var(--sb1) 80%, #000) 100%); }
.sidebar.branded nav a.active { box-shadow: inset 3px 0 0 var(--sb2); }
.sidebar.branded nav a.active > span:first-child { background: var(--sb2); color: var(--sb-on2); }
.idc-preview-box { margin-top: 16px; padding: 14px; border-radius: var(--radius); background: color-mix(in srgb, var(--border) 35%, transparent); display: grid; gap: 8px; justify-items: center; }
.idc-preview-box > .muted { justify-self: start; }

/* Digitaler Dienstausweis */
.idc-wrap { display: flex; justify-content: center; }
.idc { position: relative; width: 100%; max-width: 380px; border-radius: 22px; overflow: hidden; background: #fff; color: #14202e; box-shadow: 0 18px 40px -12px rgba(15,30,50,.45), 0 0 0 1px rgba(15,30,50,.06); isolation: isolate; font-variant-numeric: tabular-nums; }
.idc.preview { max-width: 300px; font-size: 13px; }
.idc-top { display: flex; align-items: center; gap: 12px; padding: 18px 18px 22px; background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--c1) 70%, #fff) 0%, var(--c1) 45%, color-mix(in srgb, var(--c1) 75%, #000) 100%); color: var(--on1); }
.idc-logo { width: 58px; height: 58px; border-radius: 14px; background: #fff; padding: 6px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.idc-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.idc-ini { font-weight: 800; font-size: 20px; color: var(--c1); }
.idc-co { display: grid; min-width: 0; } .idc-co strong { font-size: 1.08em; line-height: 1.2; overflow-wrap: anywhere; }
.idc-co span { font-size: .78em; letter-spacing: .14em; text-transform: uppercase; opacity: .85; margin-top: 3px; }
.idc-stripe { height: 10px; margin-top: -10px; position: relative; z-index: 1; background: linear-gradient(100deg, var(--c2) 0 62%, transparent 62% 64%, var(--c2) 64% 70%, transparent 70% 72%, var(--c2) 72% 76%, transparent 76%); }
.idc-body { padding: 16px 18px 6px; display: grid; gap: 12px; }
.idc-name { display: grid; line-height: 1.1; } .idc-name .fn { font-size: 1.15em; color: #4a5a6c; } .idc-name .ln { font-size: 1.75em; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; overflow-wrap: anywhere; }
.idc-status { display: inline-flex; align-items: center; gap: 8px; justify-self: start; font-size: .86em; font-weight: 600; padding: 6px 12px; border-radius: 999px; }
.idc-status.in { background: #e3f6e9; color: #146c34; } .idc-status.out { background: #eef1f5; color: #586779; }
.idc-status .dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.idc-status.in .dot { animation: idcPulse 1.6s ease-out infinite; box-shadow: 0 0 0 0 rgba(20,108,52,.5); }
.idc-data { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; margin: 0; }
.idc-data dt { font-size: .7em; text-transform: uppercase; letter-spacing: .1em; color: #6a7a8c; } .idc-data dd { margin: 2px 0 0; font-weight: 700; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .98em; overflow-wrap: anywhere; }
.idc-miss { font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-weight: 500; color: #b45309; font-size: .85em; }
.idc-qr { display: grid; justify-items: center; gap: 4px; padding: 12px; border-radius: 16px; border: 1px solid #e3e8ee; background: #fff; }
.idc-qr svg { width: 100%; max-width: 200px; height: auto; } .idc.preview .idc-qr svg { max-width: 120px; }
.idc-code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-weight: 700; letter-spacing: .18em; }
.idc-hint { font-size: .72em; color: #6a7a8c; }
.idc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 18px 14px; margin-top: 8px; border-top: 3px solid var(--c2); font-size: .78em; color: #4a5a6c; }
.idc-live { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; letter-spacing: .14em; color: var(--c2); filter: saturate(1.2); }
.idc-live .pulse { width: 8px; height: 8px; border-radius: 50%; background: #dc2626; animation: idcBlink 1s steps(2, start) infinite; }
.idc-holo { position: absolute; inset: 0; pointer-events: none; z-index: 2; mix-blend-mode: soft-light; background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.75) 45%, rgba(170,220,255,.5) 50%, rgba(255,230,170,.5) 55%, transparent 65%); background-size: 260% 100%; animation: idcHolo 4.5s linear infinite; }
@keyframes idcHolo { from { background-position: 130% 0; } to { background-position: -130% 0; } }
@keyframes idcPulse { 0% { box-shadow: 0 0 0 0 rgba(20,108,52,.5); } 100% { box-shadow: 0 0 0 9px rgba(20,108,52,0); } }
@keyframes idcBlink { to { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .idc-holo { animation-duration: 12s; } }

/* ===== Einstellungen je Objekt / Auftrag ===== */
.scope-sec { margin-bottom: 14px; padding: 6px 16px 10px; }
.scope-sec h2 { font-size: 16px; margin: 10px 0 4px; }
.scope-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 320px); gap: 8px 20px; align-items: center; padding: 12px 0; border-top: 1px solid var(--border); }
.scope-row:first-of-type { border-top: 0; }
.scope-row.own .scope-l label { color: var(--primary); }
.scope-l label { font-weight: 600; margin: 0; }
.scope-c { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.scope-c select, .scope-c input, .scope-c textarea { width: 100%; }
.scope-save { position: sticky; bottom: 0; display: flex; gap: 12px; align-items: center; background: var(--bg); padding: 12px 0; border-top: 1px solid var(--border); }
@media (max-width: 700px) { .scope-row { grid-template-columns: 1fr; } }

/* Kopf der Auftragsseite: Titel, Hauptknöpfe, „Weitere“-Menü */
.ord-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 6px; }
.ord-head h1 { flex: 1 1 260px; min-width: 0; }
.ord-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ord-more { position: relative; }
.ord-more > summary { list-style: none; }
.ord-more > summary::-webkit-details-marker { display: none; }
.ord-more[open] > summary { background: #e4edf8; }
.ord-more-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 250px; display: flex; flex-direction: column; gap: 2px; padding: 6px;
  background: #fff; border: 1px solid #d3deeb; border-radius: 10px; box-shadow: 0 10px 30px rgba(15, 45, 85, .16); }
.ord-more-menu > button, .ord-more-menu > a.btn { width: 100%; justify-content: flex-start; border: 0; background: transparent; padding: 9px 12px; }
.ord-more-menu > button:hover, .ord-more-menu > a.btn:hover { background: #f0f5fb; }
.ord-more-menu > [hidden] { display: none !important; }
@media (max-width: 640px) { .ord-more[open] { flex-basis: 100%; } .ord-more-menu { position: static; margin-top: 6px; min-width: 0; } }
/* Datensicherung überspringen (Rückfrage auf eigene Gefahr) */
.bk-due { align-items: center; gap: 10px; flex-wrap: wrap; }
.bk-skip { display: flex; flex-direction: column; gap: 10px; max-width: 560px; }
.bk-skip .alert { margin: 0; }
.bk-skip-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.bk-skip-ok { align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.bk-skip-ok input { margin-top: 3px; flex: none; }
