:root {
  --navy: #0d2c54; --blue: #0a6fe0; --blue-l: #5ab0ff;
  --bg: #f4f6f9; --card: #ffffff; --text: #1b2533; --muted: #66758a; --line: #e3e8ef; --line2: #cfd7e2;
  --weekend: #eef1f5; --holiday: rgba(255, 196, 0, .16); --today: #e53935;
  --warn: #f59e0b; --bad: #dc2626; --ok: #16a34a;
  --label-w: 230px; --dw: 20px; --rowh: 30px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 13px/1.35 var(--font); color: var(--text); background: var(--bg); overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

/* ---------- Kopfzeile ---------- */
.top { height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 12px; background: var(--navy); color: #fff; }
.top .brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; margin-right: 8px; white-space: nowrap; }
.top .brand img { width: 30px; height: 30px; background: #fff; border-radius: 6px; padding: 2px; }
.seg { display: inline-flex; background: rgba(255,255,255,.12); border-radius: 8px; padding: 2px; }
.seg button { border: 0; background: transparent; color: #dbe6f5; padding: 5px 10px; border-radius: 6px; white-space: nowrap; }
.seg button.on { background: #fff; color: var(--navy); font-weight: 600; }
.tbtn { border: 0; background: rgba(255,255,255,.12); color: #fff; padding: 6px 10px; border-radius: 8px; white-space: nowrap; }
.tbtn:hover { background: rgba(255,255,255,.22); }
.tbtn.primary { background: var(--blue); }
.top label.chk { display: flex; align-items: center; gap: 5px; color: #dbe6f5; white-space: nowrap; }
.spacer { flex: 1; }
.presence { display: flex; gap: 4px; }
.presence span { width: 26px; height: 26px; border-radius: 50%; background: var(--blue-l); color: var(--navy); font-weight: 700; font-size: 11px; display: grid; place-items: center; border: 2px solid var(--navy); }
.userbox { position: relative; }
.menu { position: absolute; right: 0; top: 40px; background: #fff; color: var(--text); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.2); min-width: 210px; padding: 6px; z-index: 50; }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 6px; }
.menu button:hover { background: var(--bg); }
.menu .who { padding: 8px 10px; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.demo-badge { background: #fbbf24; color: #3b2a00; border-radius: 6px; padding: 2px 8px; font-weight: 700; font-size: 11px; }

/* ---------- Layout ---------- */
.top { position: fixed; top: 0; left: 0; right: 0; z-index: 30; }
.layout { display: flex; position: fixed; top: 52px; left: 0; right: 0; bottom: 0; }
#gantt { flex: 1; overflow: auto; position: relative; background: var(--card); }
#panel { width: 380px; flex: none; background: var(--card); overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
#gantt { min-width: 0; min-height: 0; }

/* ---------- Gantt ---------- */
.g { position: relative; }
.g-head { position: sticky; top: 0; z-index: 6; display: flex; background: #fff; border-bottom: 1px solid var(--line2); }
.g-corner { position: sticky; left: 0; z-index: 7; width: var(--label-w); flex: none; background: #fff; border-right: 1px solid var(--line2); padding: 6px 10px; display: flex; flex-direction: column; justify-content: flex-end; color: var(--muted); font-size: 12px; }
.g-scale { position: relative; height: 56px; flex: none; }
.g-scale div { position: absolute; overflow: hidden; white-space: nowrap; border-left: 1px solid var(--line); padding-left: 4px; font-size: 11px; color: var(--muted); }
.g-scale .mon { top: 0; height: 19px; font-weight: 600; color: var(--text); }
.g-scale .kw { top: 19px; height: 18px; border-top: 1px solid var(--line); }
.g-scale .day { top: 37px; height: 19px; border-top: 1px solid var(--line); padding: 0; text-align: center; }
.g-scale .day.we { background: var(--weekend); }
.g-scale .day.hol { background: var(--holiday); }
.g-scale .day.today { background: var(--today); color: #fff; font-weight: 700; }

.g-row { display: flex; min-height: var(--rowh); border-bottom: 1px solid var(--line); }
.g-label { position: sticky; left: 0; z-index: 5; width: var(--label-w); flex: none; background: #fff; border-right: 1px solid var(--line2); padding: 0 8px 0 10px; display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; }
.g-label .nm { overflow: hidden; text-overflow: ellipsis; flex: 1; }
.g-label .sub { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; max-width: 90px; }
.g-track { position: relative; flex: none;
  background-image:
    linear-gradient(to right, transparent calc(var(--dw) * 5), var(--weekend) calc(var(--dw) * 5)),
    linear-gradient(to right, var(--line) 1px, transparent 1px);
  background-size: calc(var(--dw) * 7) 100%, var(--dw) 100%; }
.zoom-s .g-track { background-image: linear-gradient(to right, transparent calc(var(--dw) * 5), var(--weekend) calc(var(--dw) * 5)), linear-gradient(to right, var(--line) 1px, transparent 1px); background-size: calc(var(--dw) * 7) 100%, calc(var(--dw) * 7) 100%; }

.g-row.sec .g-label { font-weight: 700; color: var(--navy); background: #eef3fa; }
.g-row.sec .g-track { background: #eef3fa; }
.g-row.sec.bl .g-label { background: var(--navy); color: #fff; }
.g-row.sec.bl .g-track { background: #dfe7f2; }
.g-row.sec .cnt { font-weight: 400; color: var(--muted); font-size: 11px; }
.g-row.sec.bl .cnt { color: #b9c9df; }
.g-row.kol .g-label { padding-left: 16px; }
.g-row.kol .g-label .ico { width: 14px; height: 14px; }
.g-row.worker .g-label { padding-left: 26px; }
.g-row.worker.solo .g-label { padding-left: 16px; }
.g-row.worker .tag { width: 4px; align-self: stretch; margin: 4px 0; border-radius: 2px; flex: none; }
.g-row.worker .badge { font-size: 10px; font-weight: 700; background: #e7ecf3; color: var(--navy); border-radius: 4px; padding: 1px 4px; }
.g-row.dim { opacity: .45; filter: grayscale(.7); }
.g-row.dim:hover { opacity: .75; }
.g-row.drop-ok .g-label, .g-row.drop-ok .g-track { background-color: #dbeafe !important; }
.g-row.drop-ok { outline: 2px solid var(--blue); outline-offset: -2px; }
.g-row.newrow .g-label { color: var(--blue); font-weight: 600; background: #f0f7ff; }
.g-row.newrow .g-track { background-color: #f7fbff; cursor: crosshair; }
.g-row.newrow .hint { position: absolute; left: 8px; top: 7px; color: #8aa7cc; font-size: 12px; pointer-events: none; white-space: nowrap; }
.g-row.project .g-label { padding-left: 10px; cursor: pointer; }
.g-row.project .dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.g-row.project.past { opacity: .6; }
.g-row.sel .g-label { background: #fff7d6; }
.collapse { border: 0; background: none; padding: 0 2px; color: inherit; font-size: 11px; width: 16px; }

.overlay { position: absolute; top: 0; bottom: 0; pointer-events: none; z-index: 1; }
.overlay .hol { position: absolute; top: 0; bottom: 0; background: var(--holiday); }
.overlay .todayline { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--today); opacity: .8; }

/* ---------- Balken ---------- */
.bar { position: absolute; z-index: 2; height: 22px; border-radius: 5px; color: #fff; font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 4px; padding: 0 6px; white-space: nowrap; overflow: clip; cursor: grab; box-shadow: 0 1px 2px rgba(0,0,0,.18); user-select: none; touch-action: none; }
.bar.light { color: #13213a; }
.bar .txt { overflow: hidden; text-overflow: ellipsis; position: relative; z-index: 2; text-shadow: 0 0 2px rgba(0,0,0,.25); }
.bar.light .txt { text-shadow: 0 0 2px rgba(255,255,255,.6); }
.bar .ic { position: relative; z-index: 2; flex: none; width: 15px; height: 15px; display: grid; place-items: center; background: #fff; border-radius: 50%; }
.bar .ic svg { width: 11px; height: 11px; }
.bar { border: 1.5px solid var(--bc, rgba(0,0,0,.3)); }
.bar .pz { position: absolute; top: 0; bottom: 0; z-index: 1; background: var(--card); }
.bar .ov { position: absolute; top: 0; bottom: 0; z-index: 1;
  background: repeating-linear-gradient(-45deg, var(--bad) 0 4px, #fff 4px 6px), var(--bad);
  background: repeating-linear-gradient(-45deg, rgba(220,38,38,1) 0 4px, rgba(255,255,255,.9) 4px 7px); }
.bar .h { position: absolute; top: 0; bottom: 0; width: 7px; z-index: 3; cursor: ew-resize; }
.bar .h.l { left: 0; } .bar .h.r { right: 0; }
.bar.ro { cursor: pointer; }
.bar.ro .h { display: none; }
.bar.assign { height: 20px; border-radius: 4px; opacity: .95; }
.bar.conflict { outline: 2px solid var(--bad); outline-offset: 1px; }
.bar.selected { outline: 2px solid #111; outline-offset: 1px; z-index: 3; }
.bar.dragging { opacity: .8; cursor: grabbing; z-index: 9; box-shadow: 0 6px 16px rgba(0,0,0,.3); }
.bar.draft { background: repeating-linear-gradient(45deg, #5ab0ff 0 6px, #7cc0ff 6px 12px); color: var(--navy); border: 2px dashed var(--navy); }
.bar .cnt { background: rgba(0,0,0,.25); border-radius: 8px; padding: 0 5px; font-size: 11px; position: relative; z-index: 2; }
.dragtip { position: fixed; z-index: 100; background: var(--navy); color: #fff; padding: 4px 8px; border-radius: 6px; font-size: 12px; pointer-events: none; white-space: nowrap; }

/* ---------- Panel ---------- */
.pn { padding: 14px 16px 30px; }
.pn h2 { margin: 0 0 4px; font-size: 16px; color: var(--navy); }
.pn h3 { margin: 18px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.pn .sub { color: var(--muted); margin-bottom: 10px; }
.fld { display: grid; grid-template-columns: 112px 1fr; align-items: center; gap: 6px; margin-bottom: 7px; }
.fld > span { color: var(--muted); font-size: 12px; }
.fld.ta { align-items: start; } .fld.ta > span { padding-top: 6px; }
.in { width: 100%; border: 1px solid var(--line2); border-radius: 7px; padding: 6px 8px; background: #fff; min-width: 0; }
.in:focus { outline: 2px solid var(--blue-l); border-color: var(--blue); }
.in:disabled { background: #f6f7f9; color: #555; }
textarea.in { resize: vertical; min-height: 54px; }
.row2 { display: flex; gap: 6px; align-items: center; }
.row2 .in { flex: 1; }
.btn { border: 1px solid var(--line2); background: #fff; padding: 6px 12px; border-radius: 7px; }
.btn:hover { background: var(--bg); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.danger { color: var(--bad); border-color: #f3c2c2; }
.btn.sm { padding: 3px 8px; font-size: 12px; }
.btn.x { border: 0; background: none; color: var(--muted); padding: 2px 6px; font-size: 16px; line-height: 1; }
.btn.x:hover { color: var(--bad); }
.btns { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.pause { display: grid; grid-template-columns: 1fr 1fr auto; gap: 5px; margin-bottom: 5px; align-items: center; }
.pause .note { grid-column: 1 / 3; }
.pause-swatch { display: inline-block; width: 26px; height: 12px; vertical-align: middle; border-radius: 3px; background: #fff; border: 1.5px solid #1e88e5; }
.status { border-radius: 9px; padding: 10px 12px; margin: 10px 0 4px; display: flex; gap: 10px; align-items: flex-start; }
.status svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.status b { display: block; }
.status.under { background: #fff7e6; color: #8a5300; border: 1px solid #fcd9a0; }
.status.over { background: #fdecec; color: #8f1d1d; border: 1px solid #f5bcbc; }
.status.ok { background: #eaf8ef; color: #155c2e; border: 1px solid #bfe6cc; }
.status.none { background: var(--bg); color: var(--muted); }
.meter { height: 7px; background: #e5e9ef; border-radius: 4px; overflow: hidden; margin-top: 6px; position: relative; }
.meter i { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 4px; }
.meter b { position: absolute; top: -2px; bottom: -2px; width: 2px; background: #333; left: 90.9%; }
.alist { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.aitem { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; align-items: center; padding: 6px 8px; border-bottom: 1px solid var(--line); cursor: pointer; }
.aitem:last-child { border-bottom: 0; }
.aitem:hover { background: var(--bg); }
.aitem.on { background: #fff7d6; }
.aitem small { color: var(--muted); display: block; }
.empty { color: var(--muted); padding: 10px; text-align: center; }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.legend div { display: flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.help { color: var(--muted); font-size: 12px; line-height: 1.5; }
.help li { margin-bottom: 4px; }
.ro-note { background: var(--bg); border-radius: 8px; padding: 8px 10px; color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.asel { background: #f0f7ff; border: 1px solid #cfe3fb; border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }

/* ---------- Dialog ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(13,44,84,.45); z-index: 80; display: grid; place-items: center; padding: 16px; }
.modal { background: #fff; border-radius: 14px; width: min(920px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal header { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); gap: 12px; }
.modal header h2 { margin: 0; font-size: 17px; color: var(--navy); flex: 1; }
.tabs { display: flex; gap: 2px; padding: 0 18px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 12px; border-bottom: 2px solid transparent; color: var(--muted); white-space: nowrap; }
.tabs button.on { color: var(--navy); border-bottom-color: var(--blue); font-weight: 600; }
.modal .body { padding: 16px 18px; overflow-y: auto; }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px; border-bottom: 1px solid var(--line2); }
table.t td { padding: 4px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t .in { padding: 4px 6px; }
.addbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; background: var(--bg); padding: 10px; border-radius: 10px; margin-bottom: 14px; }
.addbar .in { width: auto; flex: 1; min-width: 130px; }
input[type=color].in { padding: 1px 2px; height: 30px; width: 46px; flex: none; }

/* ---------- Login ---------- */
.login { height: 100%; display: grid; place-items: center; background: linear-gradient(160deg, var(--navy), #174a8a); padding: 16px; }
.login form { background: #fff; padding: 28px; border-radius: 16px; width: min(380px, 100%); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.login img { width: 64px; display: block; margin: 0 auto 10px; }
.login h1 { text-align: center; margin: 0 0 4px; color: var(--navy); font-size: 22px; }
.login p { text-align: center; color: var(--muted); margin: 0 0 18px; }
.login .in { margin-bottom: 10px; padding: 9px 10px; }
.login .btn { width: 100%; padding: 9px; }
.login .err { color: var(--bad); text-align: center; min-height: 18px; margin-top: 8px; }
.login .users button { display: flex; width: 100%; justify-content: space-between; margin-bottom: 6px; }

#toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 6px; align-items: center; }
#toast div { background: #1f2937; color: #fff; padding: 8px 14px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
#toast div.err { background: var(--bad); }

@media (max-width: 900px) {
  :root { --label-w: 150px; }
  .top { overflow-x: auto; }
  .top .brand span { display: none; }
  #panel { position: fixed; right: 0; bottom: 0; top: 52px; width: min(360px, 100%); z-index: 40; box-shadow: -10px 0 30px rgba(0,0,0,.2); transform: translateX(100%); transition: transform .2s; }
  #panel.open { transform: none; }
}
.bar.foreign { opacity: .55; }
.bar.dragging { pointer-events: none; }

.bar .lbl { background: inherit; border-radius: 3px; padding: 0 3px; margin-left: -3px; position: sticky; left: calc(var(--label-w) + 4px); display: flex; align-items: center; gap: 4px; min-width: 0; z-index: 2; }
.g-row.kol .nm { flex: none; max-width: 120px; }
.g-row.kol .sub { flex: 1; min-width: 0; }
.pause .in[type=date] { min-width: 0; padding: 6px 4px; }
@media (max-width: 900px) { .g-label .sub { display: none; } }

.bar .pz.auto { background: var(--card); }
.bar.deleted { background-image: repeating-linear-gradient(90deg, transparent 0 8px, rgba(255,255,255,.25) 8px 9px); color: #3a4657; font-style: italic; }
.g-label .grip { cursor: grab; color: #9aa8bb; font-size: 12px; letter-spacing: -2px; margin-left: -12px; padding: 0 2px; user-select: none; touch-action: none; }
.g-label .grip:hover { color: var(--navy); }
.g-row.worker .badge.sa { background: #e0f2e9; color: #155c2e; }
.g-row.reorder-before { box-shadow: inset 0 3px 0 var(--blue); }
.g-row.reorder-after { box-shadow: inset 0 -3px 0 var(--blue); }
.g-row.dragrow { opacity: .5; }
.lasso { position: absolute; z-index: 8; border: 1.5px dashed var(--blue); background: rgba(10,111,224,.08); pointer-events: none; }
.bar.ghost { opacity: .6; pointer-events: none; border: 2px dashed var(--navy); z-index: 9; }
.pastebar { position: fixed; z-index: 150; left: 50%; transform: translateX(-50%); top: 60px; background: var(--navy); color: #fff; padding: 6px 14px; border-radius: 8px; font-size: 13px; box-shadow: 0 6px 20px rgba(0,0,0,.25); }

/* ===== v3: Personaleinsatzplan / Grobplan-BZP ===== */
.top { overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.top .brand { flex-direction: row; }
.top .brand small { display: block; font-weight: 500; font-size: 10px; color: #9fb6d6; margin-left: -2px; align-self: flex-end; margin-bottom: 4px; }
.tbadge { background: #dc2626; color: #fff; border-radius: 9px; padding: 0 6px; font-size: 11px; margin-left: 2px; }
.panel-resize { width: 6px; flex: none; cursor: col-resize; background: var(--line2); border-left: 1px solid var(--line2); }
.panel-resize:hover { background: var(--blue-l); }
.colresize { position: absolute; right: -4px; top: 0; bottom: 0; width: 8px; cursor: col-resize; z-index: 8; }
.colresize:hover { background: rgba(10,111,224,.25); }
.g-corner { position: sticky; }
.secspan { position: absolute; top: 7px; height: 16px; border: 1.5px solid #5b7397; border-radius: 8px; background: rgba(13,44,84,.06); overflow: clip; display: flex; align-items: center; }
.secspan span { position: sticky; left: calc(var(--label-w) + 6px); font-size: 10.5px; font-weight: 700; color: var(--navy); padding: 0 6px; white-space: nowrap; }
.g-row.sec.pnew .g-label { background: #fff4e0; color: #8a5300; }
.g-row.sec.pnew .g-track { background: #fffaf0; }
.g-row.sec.pdone .g-label { background: #eef0f3; color: #66758a; }
.fpmark { width: 15px; height: 15px; color: var(--blue); flex: none; }
.fpmark svg { width: 15px; height: 15px; }
.bar.alarm { box-shadow: 0 0 0 2px #dc2626; }
.bar.flash { animation: flash 1s ease-in-out 3; z-index: 6; }
@keyframes flash { 0%, 100% { box-shadow: 0 1px 2px rgba(0,0,0,.18); filter: none; } 50% { box-shadow: 0 0 0 4px #fde047, 0 0 22px 8px rgba(250,204,21,.95); filter: brightness(1.25); } }
.fpask { display: flex; gap: 10px; align-items: center; justify-content: space-between; background: #eef5ff; border: 1px solid #cfe3fb; border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.fpask > div { display: grid; grid-template-columns: 20px 1fr; column-gap: 8px; align-items: center; color: var(--navy); }
.fpask svg { width: 20px; height: 20px; grid-row: span 2; color: var(--blue); }
.fpask small { color: var(--muted); grid-column: 2; }
.btn.danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.chip { display: inline-block; border-radius: 6px; padding: 1px 7px; font-size: 11px; font-weight: 700; }
.chip.red { background: #fde2e2; color: #a11b1b; } .chip.amber { background: #fff1d6; color: #8a5300; } .chip.green { background: #dcf3e4; color: #155c2e; }
.ci.err { border-color: var(--bad) !important; background: #fff1f1; }

/* Dialoge */
.modal-bg.dlg { z-index: 110; }
.modal.wide { width: min(1180px, 100%); }
.modal .body { min-height: 0; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.dlg-ic svg { width: 26px; height: 26px; display: block; }
.dlg.alarm .modal header { background: #fdecec; border-bottom-color: #f5bcbc; border-radius: 14px 14px 0 0; }
.dlg.alarm .modal header h2 { color: #a11b1b; }
.dlg.alarm .modal { box-shadow: 0 0 0 3px #dc2626, 0 20px 60px rgba(0,0,0,.35); }
.dlg.newproj .modal { width: min(560px, 100%); }
.dlg.newproj .dlg-ic { color: var(--blue); }
.npcard { border: 1px solid var(--line2); border-radius: 12px; padding: 12px 14px; margin-top: 10px; background: #fbfdff; }
.np-h { display: flex; align-items: center; gap: 8px; font-size: 16px; color: var(--navy); margin-bottom: 8px; }
.np-h i { width: 14px; height: 14px; border-radius: 4px; }
.np-h span { margin-left: auto; font-size: 12px; color: var(--muted); }
.npcard dl { display: grid; grid-template-columns: 120px 1fr; gap: 4px 10px; margin: 0; }
.npcard dt { color: var(--muted); font-size: 12px; } .npcard dd { margin: 0; }
.dlist { padding-left: 18px; line-height: 1.6; } .dlist li { margin-bottom: 6px; }
.todo-wrap { overflow: auto; }
table.fpt { font-size: 12px; } table.fpt td, table.fpt th { white-space: nowrap; }
table.fpt tr.late td { background: #fff5f5; } table.fpt tr.done td { color: #7c8a9c; background: #f3fbf5; }
.ci { border: 1px solid transparent; background: #fffbe6; border-radius: 4px; padding: 3px 5px; width: 100%; min-width: 0; font-size: 12px; }
.ci:hover { border-color: #e6d58a; } .ci:focus { outline: 2px solid var(--blue-l); background: #fff; border-color: var(--blue); }
.ci:disabled { background: transparent; color: inherit; }
.ci.num { text-align: right; }
.bulk-wrap { overflow: auto; max-height: 52vh; border: 1px solid var(--line); border-radius: 8px; }
.bulk-t td { padding: 2px 3px; } .bulk-t .rn { color: var(--muted); text-align: right; font-size: 11px; }
.bulk-t th { position: sticky; top: 0; background: #fff; z-index: 1; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.pgrid fieldset { border: 1px solid var(--line2); border-radius: 10px; padding: 8px 12px 10px; margin: 0; }
.pgrid legend { font-weight: 700; color: var(--navy); padding: 0 4px; }
.pgrid .fld { grid-template-columns: 80px 1fr; }
.chk2 { display: flex; gap: 6px; align-items: center; margin: 5px 0; }

/* ===== Feinplan-BZP ===== */
.fp-overlay { position: fixed; inset: 0; z-index: 60; background: var(--card); }
.fp-standalone { position: fixed; inset: 0; background: var(--card); }
.fp { display: flex; flex-direction: column; height: 100%; }
.fp-top { flex: none; height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 12px; background: #13294b; color: #fff; overflow-x: auto; overflow-y: hidden; }
.fp-top .brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; white-space: nowrap; }
.fp-top .brand img { width: 30px; height: 30px; background: #fff; border-radius: 6px; padding: 2px; }
.fp-title { display: flex; flex-direction: column; line-height: 1.2; min-width: 120px; max-width: 360px; overflow: hidden; flex: 0 1 auto; }
.fp-title b, .fp-title small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-title small { color: #b9c9df; white-space: nowrap; }
.fp-title small i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin: 0 3px 0 2px; }
.fp-top .chk { display: flex; align-items: center; gap: 5px; color: #dbe6f5; white-space: nowrap; flex: none; }
.fp-top .chk select { color: var(--text); max-width: 150px; }
.fp-top > * { flex-shrink: 0; }
.in.sm { padding: 3px 6px; width: auto; }
.fp-banner { flex: none; padding: 7px 14px; display: flex; gap: 8px; align-items: center; font-size: 13px; }
.fp-banner svg { width: 18px; height: 18px; flex: none; }
.fp-banner.warn { background: #fff7e6; color: #8a5300; border-bottom: 1px solid #fcd9a0; }
.fp-banner.info { background: var(--bg); color: var(--muted); }
.fp-main { flex: 1; overflow: auto; min-height: 120px; position: relative; }
.fp-split { flex: none; height: 6px; cursor: row-resize; background: var(--line2); }
.fp-split:hover { background: var(--blue-l); }
.fp-bottom { flex: none; height: 34%; display: flex; flex-direction: column; min-height: 90px; background: #fff; }
.fp-bottom .tabs { flex: none; padding: 0 12px; }
.fp-tabbody { flex: 1; overflow: auto; padding: 8px 12px 16px; }
.fp-tbar { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.fpg .g-label.fp-cells, .fpg .fp-corner { width: var(--fpw); padding: 0; }
.fp-cols, .fp-cells { display: flex; align-items: center; gap: 0 !important; }
.fp-corner { justify-content: flex-end; }
.fp-cols .fc { font-weight: 700; color: var(--navy); font-size: 11px; padding: 4px; white-space: nowrap; overflow: hidden; }
.fc { flex: none; padding: 0 3px; overflow: hidden; display: flex; align-items: center; height: 100%; font-size: 12px; }
.fc.grip { width: 18px; justify-content: center; }
.fc.nr { justify-content: flex-end; color: var(--muted); }
.fc .row2 { width: 100%; gap: 3px; }
.fc .ci.lk { flex: 0 0 76px; padding: 3px 1px; } .fc .ci.dt { flex: 1; padding: 3px 2px; }
.fp-row { min-height: 34px; }
.fp-row .g-label { border-right: 1px solid var(--line2); }
.fp-row.sel .g-label, .fp-row.sel .fc .ci { background-color: #fff3bf; }
.fp-row.missrow .fc.team { background: #fff1f1; }
.fp-row.total .g-label { background: #eef3fa; }
.fp-row.total .g-track { background-color: #f6f9fd; }
.fp-track { background-image: linear-gradient(to right, var(--line) 1px, transparent 1px) !important; background-size: var(--dw) 100% !important; }
.fpg .overlay .sun { position: absolute; top: 0; bottom: 0; background: rgba(120,130,145,.16); }
.fpg .overlay .hol { background: rgba(220,38,38,.13); }
.fpg .overlay .pzcol { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(90deg, transparent 0 6px, rgba(13,44,84,.04) 6px 7px); border-left: 1px dashed #9fb3cc; border-right: 1px dashed #9fb3cc; }
.bar.total-bar { height: 18px; }
.bar.missing { outline: 2px dashed var(--bad); outline-offset: 1px; }
.sym { position: absolute; top: 2px; transform: translateX(-50%); z-index: 4; font-size: 13px; line-height: 1; color: #13294b; pointer-events: auto; text-shadow: 0 0 2px #fff, 0 0 2px #fff; }
.sym.ausl { color: #dc2626; top: 20px; font-size: 11px; }
.sym.done { color: var(--ok); }
.teambtn { width: 100%; text-align: left; border: 1px dashed #b9c6d8; background: #fff; border-radius: 5px; padding: 3px 6px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.teambtn.miss { border-color: var(--bad); color: var(--bad); background: #fff6f6; font-weight: 600; }
.teambtn:hover:not(:disabled) { border-style: solid; border-color: var(--blue); }
.teampop { position: fixed; z-index: 130; width: 300px; max-height: 60vh; display: flex; flex-direction: column; background: #fff; border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.28); border: 1px solid var(--line2); }
.tp-head { padding: 10px 12px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; } .tp-head small { color: var(--muted); }
.tp-body { overflow: auto; padding: 4px 6px; }
.tp-g { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; margin: 8px 6px 2px; }
.tp-i { display: flex; gap: 8px; align-items: center; padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.tp-i:hover { background: var(--bg); } .tp-i .busy { margin-left: auto; color: #b45309; font-size: 11px; }
.tp-foot { padding: 8px 12px; border-top: 1px solid var(--line); text-align: right; }
.fp-empty { padding: 18px; color: var(--muted); position: sticky; left: 0; width: min(100vw, 700px); }
.fp-add { position: sticky; left: 0; display: flex; gap: 8px; align-items: center; padding: 8px 10px; width: min(100vw, 900px); }
.prog { position: relative; width: 100%; height: 16px; background: #e8edf3; border-radius: 4px; overflow: hidden; border: 1px solid #d3dbe6; }
.prog i { position: absolute; left: 0; top: 0; bottom: 0; background: #86efac; }
.prog span { position: relative; display: block; text-align: center; font-size: 10.5px; line-height: 14px; color: #0d2c54; font-weight: 800; }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ===== Druck ===== */
#printroot { display: none; }
@media print {
  body.printing { overflow: visible !important; height: auto !important; background: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.printing > *:not(#printroot) { display: none !important; }
  body.printing #printroot { display: block; }
  #printroot .g-head, #printroot .g-label, #printroot .g-corner { position: static !important; }
  #printroot .g-row { break-inside: avoid; }
  #printroot .h, #printroot .colresize { display: none; }
  #printroot .bar { box-shadow: none; }
  #printroot table { break-inside: auto; } #printroot tr { break-inside: avoid; }
}
.pr-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; border-bottom: 2px solid var(--navy); padding-bottom: 6px; }
.pr-head img { width: 40px; } .pr-head h1 { margin: 0; font-size: 18px; color: var(--navy); } .pr-head .pr-date { margin-left: auto; text-align: right; font-size: 11px; color: var(--muted); }
.pr-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 11px; }
.pr-legend span { display: flex; align-items: center; gap: 4px; } .pr-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.pr-legend i.gapsw, .gapsw { background: #fff; border: 1.5px solid #1e88e5; }
.pr-h2 { font-size: 14px; color: var(--navy); margin: 14px 0 6px; }
.pr-t { font-size: 10px; }
.menu { position: fixed; right: 12px; top: 48px; }

.hrs { display: flex; gap: 2px; } .hrs .in { width: 42px; padding: 3px 2px; text-align: center; }

.bar .lbl.out { background: none !important; color: #0d1b2e; }
.bar .lbl.out .txt { text-shadow: 0 0 3px #fff, 0 0 3px #fff; color: #0d1b2e; }
.bar { overflow: visible; }
.bar > .pz, .bar > .ov { border-radius: 0; }
.bar { padding-left: 1px; }
.bar .lbl { flex: none; }

/* ===== v4 ===== */
.indent { display: flex; align-items: center; width: 100%; gap: 2px; }
.indent .collapse { color: var(--navy); }
.ci.grp { font-weight: 700; background: #eef3fa; color: var(--navy); }
.fp-row.grp .g-label { background: #f4f7fb; }
.fp-row.grp.lvl0 .g-label { background: #e6edf7; }
.fp-row.grp .g-track { background-color: #fafcff; }
.sumbar { position: absolute; top: 12px; height: 7px; background: #334e73; z-index: 2; }
.sumbar.total { background: #0d2c54; }
.sumbar i { position: absolute; left: 0; top: 0; bottom: 0; background: #22c55e; }
.sumbar::before, .sumbar::after { content: ""; position: absolute; top: 7px; width: 0; height: 0; border-top: 7px solid #334e73; }
.sumbar.total::before, .sumbar.total::after { border-top-color: #0d2c54; }
.sumbar::before { left: 0; border-right: 7px solid transparent; }
.sumbar::after { right: 0; border-left: 7px solid transparent; }
.sumlbl { position: absolute; top: 9px; z-index: 2; font-size: 11px; color: var(--navy); white-space: nowrap; }
.sumlbl b { background: #dcfce7; color: #14532d; border-radius: 4px; padding: 0 4px; }
.beg { gap: 2px !important; }
.beg .ci.lk { flex: 0 0 70px; }
.beg .ci.pn { flex: 0 0 34px; text-align: center; }
.beg .ci.lag { flex: 0 0 42px; }
.beg .cdt { font-size: 11px; color: var(--muted); white-space: nowrap; }
.beg .btn.pick { padding: 0 3px; font-size: 13px; }
.fp-banner.pick { background: #e0f2fe; color: #075985; border-bottom: 1px solid #bae6fd; }
.fp-row.picking .g-label, .fp-row.picking .g-track { cursor: crosshair; }
.fp-row.picking:hover .g-label { background: #e0f2fe; }
.bar.pickable { outline: 2px dashed #0ea5e9; outline-offset: 1px; }
.fp-h4 { margin: 10px 0 6px; font-size: 12px; color: var(--navy); text-transform: uppercase; letter-spacing: .03em; }
small.grp { display: block; color: var(--muted); font-size: 10.5px; }
.chip.blue { background: #dbeafe; color: #1e40af; }
.search { min-width: 230px; }
.nusearch { position: relative; }
.nusearch .in { width: 360px; }
.nuhits { position: absolute; z-index: 20; top: 100%; left: 0; width: 360px; background: #fff; border-radius: 8px; box-shadow: 0 10px 28px rgba(0,0,0,.18); max-height: 260px; overflow: auto; }
.nuhits:empty { display: none; }
.nuhit { display: flex; gap: 8px; align-items: center; width: 100%; text-align: left; border: 0; background: none; padding: 7px 10px; }
.nuhit:hover { background: var(--bg); }
.tp-nu { border: 0; background: none; width: 100%; text-align: left; }
.colorin { width: 42px; padding: 1px 2px; height: 28px; }
.pv-wrap { display: grid; grid-template-columns: 280px 1fr; gap: 14px; min-height: 60vh; }
.pv-opts { display: flex; flex-direction: column; gap: 10px; overflow: auto; max-height: 70vh; }
.pv-opts fieldset { border: 1px solid var(--line2); border-radius: 10px; padding: 8px 12px 10px; margin: 0; }
.pv-opts legend { font-weight: 700; color: var(--navy); padding: 0 4px; }
.pv-opts .fld { grid-template-columns: 80px 1fr; }
.pv-right { display: flex; flex-direction: column; min-width: 0; }
.pv-bar { display: flex; gap: 10px; align-items: baseline; margin-bottom: 6px; }
.pv-area { flex: 1; background: #d8dee7; border-radius: 10px; overflow: auto; padding: 12px; max-height: 70vh; }
.pv-page { background: #fff; box-shadow: 0 4px 18px rgba(0,0,0,.25); overflow: hidden; margin: 0 auto; position: relative; }
.pv-inner { position: absolute; left: 0; top: 0; padding: 8mm; pointer-events: none; }
.pv-inner .g-head, .pv-inner .g-label, .pv-inner .g-corner { position: static !important; }
.pv-inner .h, .pv-inner .colresize { display: none; }
@media (max-width: 800px) { .pv-wrap { grid-template-columns: 1fr; } }
.fp-add .btn { white-space: nowrap; flex: none; }
.fc.act { gap: 0; }
.fc.act .btn.x { padding: 2px 5px; }

/* ===== v5: neutrale Mitarbeiter, Bauleiter-Gruppen mit Baustellen ===== */
.editors { display: flex; flex-wrap: wrap; gap: 4px; }
.echip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line2); border-radius: 14px; padding: 2px 8px 2px 4px; font-size: 12px; cursor: pointer; background: #fff; }
.echip.on { background: #e0ecff; border-color: #9cc0f5; color: var(--navy); }
.g-row.project.ingrp .g-label { padding-left: 22px; background: #fbfcfe; font-weight: 600; }
.g-row.worker.nested .g-label { padding-left: 38px; }
.g-row.kol.nested .g-label { padding-left: 30px; background: #f2f6fb; }
.g-row.sec.pool .g-label { background: #3f5675; }
.badge.lent { background: #fff1d6; color: #8a5300; max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
.badge.free { background: #dcfce7; color: #14532d; }
/* v6 */
.g-row.sec.nusec .g-label { background: #6b4a1f; color: #fff; }
.g-row.sec.nusec .g-track { background: #f4ead9; }
.g-row.sec.nusec .cnt { color: #e6d2b0; }
.g-row.worker.nu .g-label { background: #eef3fa; font-weight: 700; color: var(--navy); }
.g-row.worker.nu .g-track { background-color: #eef3fa; }
.g-row.worker.nu .g-label .ico { width: 14px; height: 14px; flex: none; }
.g-row.plane .g-label { background: #fffaf0; }
.g-row.plane .g-track { background: #fffdf8; }
.bar.foreign { opacity: .8; }
.ctxmenu { position: fixed; z-index: 3000; background: #fff; border: 1px solid #c9d3e0; border-radius: 8px; box-shadow: 0 8px 24px rgba(20,40,70,.18); padding: 4px; min-width: 220px; font-size: 13px; }
.ctxmenu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 12px; border-radius: 5px; cursor: pointer; color: var(--ink, #1d2b3a); }
.ctxmenu button:hover:not(:disabled) { background: #eef3fa; }
.ctxmenu button:disabled { color: #a8b3c2; cursor: default; }
.ctxmenu button.danger { color: #b3261e; }
.ctxmenu hr { border: 0; border-top: 1px solid #e3e8ef; margin: 4px 0; }
.ctxmenu .ttl { padding: 5px 12px 4px; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
.hrs input.in { width: 34px; text-align: center; padding: 3px 2px; }
.hrs-fill { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; margin: 0 0 10px; font-size: 12px; color: var(--muted); }
.hrs-fill input { width: 46px; }
.hrs-fill .btn { padding: 3px 8px; font-size: 12px; }
.hrs input.in.hl { outline: 2px solid #5ab0ff; }
.bar.busyx { color: #4a5668; font-style: italic; }
.bar.busyx .lbl { color: #4a5668; }
.modal-bg.welcome { z-index: 140; animation: wfade .25s ease; }
.modal-bg.welcome.out { opacity: 0; transition: opacity .25s; }
.wbox { background: #fff; border-radius: 16px; padding: 28px 34px 24px; width: min(420px, 92vw); text-align: center; box-shadow: 0 20px 60px rgba(13,44,84,.3); animation: wpop .3s ease; }
.wbox img { width: 64px; height: 64px; }
.wbox h2 { margin: 10px 0 2px; color: var(--navy); font-size: 24px; }
.wbox .wdate { color: var(--muted); margin-bottom: 18px; }
.wstats { display: flex; gap: 10px; justify-content: center; margin-bottom: 20px; }
.wstats div { flex: 1; background: #f4f7fb; border-radius: 10px; padding: 10px 6px; font-size: 12px; color: var(--muted); }
.wstats b { display: block; font-size: 22px; color: var(--navy); }
.wstats b.warn { color: var(--bad); }
.wbox .btn { min-width: 140px; }
@keyframes wfade { from { opacity: 0; } to { opacity: 1; } }
@keyframes wpop { from { transform: scale(.92); opacity: 0; } to { transform: none; opacity: 1; } }
.t.rules tr.newrule td, .fpt tr.newrule td { background: #f5f9ff; }
.t.rules .ci.kw, .fpt .ci.kw { min-width: 180px; }
.ci.zust { min-width: 130px; }
.fp-row.sel .fp-cells { box-shadow: inset 3px 0 0 var(--blue); }
.fp-row .fp-cells .fc.nr, .fp-row .fp-cells .fc.grip { cursor: grab; }
/* Handy / Tablet */
html.mobile, html.mobile body { touch-action: pan-x pan-y; }
html.mobile #gantt { touch-action: pan-x pan-y; -webkit-user-select: none; user-select: none; }
html.mobile .bar.selected { touch-action: none; }
html.mobile .bar.selected .h { width: 14px; }
html.mobile .fpask, html.mobile .grip, html.mobile .fpmark { display: none !important; }
html.mobile .tbtn, html.mobile .seg button { min-height: 36px; }
@media (max-width: 520px) { :root { --label-w: 112px; } .g-label { font-size: 12px; padding: 0 4px 0 6px; } .top .brand span, .top .brand small { display: none; } }
.cwlist { max-height: 50vh; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.cwi { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.cwi input { width: 20px; height: 20px; }
.cwi span { flex: 1; }
.cwi small { font-size: 11px; color: var(--muted); }
.cwi small.free { color: #166534; } .cwi small.busy { color: #9a3412; }
.cwi[hidden] { display: none; }
html.mobile .modal-bg { padding: 8px; }
html.mobile .modal { max-height: calc(100dvh - 16px); min-width: 0; max-width: 100%; }
html.mobile .modal .body { overflow: auto; padding: 12px; }
html.mobile .dlg-foot { padding: 10px 12px; }
html.mobile .dlg-foot .btn { min-height: 40px; }
/* Neue Tätigkeit */
.na { display: flex; flex-direction: column; gap: 10px; }
.na .seg.na-tabs { display: flex; background: #eef1f5; border-radius: 9px; padding: 3px; }
.na .seg.na-tabs button { flex: 1; min-height: 36px; border: 0; border-radius: 7px; background: transparent; color: #4a586b; font-weight: 600; font-size: 13px; cursor: pointer; }
.na .seg.na-tabs button.on { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.na-exist, .na-neu { display: flex; flex-direction: column; gap: 6px; }
.na-exist[hidden], .na-neu[hidden] { display: none; }
.na-list { display: flex; flex-direction: column; gap: 4px; max-height: 32vh; overflow: auto; }
.na-p { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.na-p span { flex: 1; } .na-p small { color: var(--muted); font-weight: 400; }
.na-p.on, .na-c.on { border-color: var(--blue); background: #eef5ff; color: #0a4fa8; }
.na-p[hidden], .na-c[hidden] { display: none; }
.na .fld { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.na .fld span { font-size: 12px; font-weight: 600; color: #2f3b4c; width: auto; }
.na-dur { display: flex; align-items: center; gap: 8px; } .na-dur span { flex: 1; font-size: 13px; font-weight: 600; }
.na-dur .btn { width: 44px; height: 40px; font-size: 18px; justify-content: center; }
.na-whol { font-size: 12px; font-weight: 600; color: #2f3b4c; }
.na-who { display: flex; flex-wrap: wrap; gap: 6px; max-height: 26vh; overflow: auto; }
.na-c { min-height: 36px; padding: 0 12px; border-radius: 18px; border: 1px solid #cfd7e2; background: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.modal-bg.nact .modal { width: min(520px, 100%); }
/* Handy: Fenster kommen von unten */
html.mobile .modal-bg.dlg { align-items: end; padding: 0; }
html.mobile .modal-bg.dlg .modal { width: 100%; max-width: 100%; border-radius: 16px 16px 0 0; max-height: calc(100dvh - 12px); }
html.mobile .modal-bg.dlg .dlg-foot .btn { flex: 1; justify-content: center; min-height: 46px; }
html.mobile .top { gap: 6px; padding: 0 8px; }
/* Handy: Griff zum Verbreitern der Namensspalte */
html.mobile .colresize { right: -12px; width: 26px; touch-action: none; display: flex; align-items: center; justify-content: center; background: transparent; }
html.mobile .colresize::after { content: ''; width: 6px; height: 28px; border-radius: 3px; background: #9fb3cc; box-shadow: 0 0 0 2px #fff; }
html.mobile .g-corner { overflow: visible; }
