* { box-sizing: border-box; }
body { font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
       margin: 0; background: #1d6f54; color: #172b4d; }
header { padding: 12px 20px; color: #fff; }
header h1 { margin: 0; font-size: 1.2rem; display: inline-block; }
header .sub { margin-left: 12px; opacity: .85; font-size: .85rem; }

.tabs { display: flex; gap: 6px; padding: 0 16px; }
.tab { background: rgba(0,0,0,.2); color: #fff; border: none; cursor: pointer;
       padding: 6px 16px; border-radius: 8px 8px 0 0; font-size: .9rem; }
.tab.active { background: #ebecf0; color: #172b4d; font-weight: 600; }

.board { display: flex; gap: 12px; align-items: flex-start;
         padding: 8px 16px 24px; overflow-x: auto; height: calc(100vh - 96px); }
.board[hidden] { display: none; }  /* sonst überstimmt display:flex das hidden-Attribut */

/* --- Planung: Dashboard --- */
#view-timeline { height: calc(100vh - 96px); display: flex; flex-direction: column;
                 gap: 10px; padding: 12px 16px; }
#view-timeline[hidden] { display: none; }  /* sonst überstimmt display:flex das hidden-Attribut */

.dash-caption { color: #fff; opacity: .8; font-size: .78rem; letter-spacing: .02em;
                text-transform: uppercase; }

/* Klartext-Statuszeile: das „was ist hier los" auf einen Blick */
.dash-banner { display: flex; align-items: center; gap: 10px; border-radius: 10px;
               padding: 12px 16px; font-size: .92rem; font-weight: 600; line-height: 1.35; }
.dash-banner .banner-icon { font-size: 1.2rem; }
.dash-banner.ok   { background: #e6f6ed; color: #1f5132; border-left: 5px solid #1f845a; }
.dash-banner.warn { background: #fff4e6; color: #8a4b00; border-left: 5px solid #e8870b; }
.dash-banner.bad  { background: #ffece8; color: #8a1c12; border-left: 5px solid #c9372c; }

/* Kennzahl-Karten */
.dash-kpis { display: flex; gap: 10px; flex-wrap: wrap; }
.kpi { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 12px;
       padding: 10px 16px; min-width: 150px; box-shadow: 0 2px 6px rgba(9,30,66,.18); }
.kpi-icon { font-size: 1.5rem; line-height: 1; }
.kpi-text { display: flex; flex-direction: column; }
.kpi-num { font-size: 1.35rem; font-weight: 700; color: #172b4d; line-height: 1.1; }
.kpi-label { font-size: .72rem; color: #5e6c84; }
.kpi.risk { box-shadow: 0 2px 6px rgba(201,55,44,.35); }
.kpi.risk .kpi-num { color: #c9372c; }

/* „Wie lese ich das?"-Hilfe */
.dash-help { background: rgba(255,255,255,.12); border-radius: 10px; color: #fff;
             font-size: .82rem; padding: 0 14px; }
.dash-help summary { cursor: pointer; font-weight: 600; padding: 9px 0; list-style: none; }
.dash-help summary::before { content: "▸ "; }
.dash-help[open] summary::before { content: "▾ "; }
.dash-help ul { margin: 0 0 10px; padding-left: 20px; line-height: 1.7; opacity: .95; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px;
          vertical-align: -1px; margin-right: 3px; }
.today-word { color: #d6453b; }

/* Button-Leiste über der Timeline */
.plan-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px 2px 2px; }
.tool-btn { background: #fff; border: 1px solid #dfe1e6; border-radius: 8px; padding: 6px 12px;
            cursor: pointer; font-size: .82rem; color: #172b4d; box-shadow: 0 1px 2px rgba(9,30,66,.12); }
.tool-btn:hover { background: #f4f5f7; }
.tool-btn.warn-btn { background: #ffece8; border-color: #ffb3a8; color: #8a1c12; font-weight: 600; }
.toolbar-spacer { flex: 1 1 auto; }
.tl-legend { display: flex; align-items: center; gap: 14px; color: #fff; font-size: .74rem;
             opacity: .92; white-space: nowrap; }
.tl-legend .leg { display: inline-flex; align-items: center; }
.tl-zoom { display: flex; gap: 4px; }
.zoom-btn { background: rgba(255,255,255,.85); border: 1px solid #dfe1e6; border-radius: 6px;
            min-width: 28px; padding: 5px 8px; cursor: pointer; font-size: .8rem; color: #172b4d; }
.zoom-btn:hover { background: #fff; }

/* Popups */
.modal-overlay { position: fixed; inset: 0; background: rgba(9,30,66,.5); z-index: 50;
                 display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-overlay[hidden] { display: none; }
.modal { background: #fff; color: #172b4d; border-radius: 12px; padding: 18px 20px;
         width: min(520px, 92vw); max-height: 86vh; overflow: auto; position: relative;
         box-shadow: 0 12px 48px rgba(0,0,0,.35); }
.modal.modal-wide { width: min(940px, 95vw); }
.modal h3 { margin: 0 0 12px; font-size: 1.05rem; }
.modal-close { position: absolute; top: 10px; right: 12px; border: none; background: #f4f5f7;
               color: #44546f; width: 28px; height: 28px; border-radius: 7px; cursor: pointer;
               font-size: 1.2rem; line-height: 1; }
.modal-close:hover { background: #e2e4e9; }
.help-list { margin: 0; padding-left: 20px; line-height: 1.75; font-size: .9rem; }
.help-list li { margin-bottom: 6px; }
.swatch.ok   { background: #cfe3ff; border: 1px solid #5e6c84; }
.swatch.risk { background: #ffd5cf; border: 1px solid #c9372c; }
.swatch.backlog { background: #eef2f7; border: 1px dashed #5e6c84; }

.timeline { background: #fff; border-radius: 12px; padding: 8px; flex: 1; min-height: 0;
            overflow: hidden; box-shadow: 0 2px 6px rgba(9,30,66,.18); }

/* Team-Karte in der linken Einteilungsspalte — eine konsistente Typo-Skala:
   Name .92 / Werte .8 (bold) / Labels .8 (grau) / Badge .56. */
.grp { display: flex; flex-direction: column; gap: 9px; width: 224px; min-height: 116px;
       padding: 12px 14px; background: #f7f8fa; border-left: 4px solid #c1c7d0;
       font-size: .8rem; color: #172b4d; }
.grp.grp-sauna { border-left-color: #e8870b; }
.grp.grp-general { border-left-color: #0c66e4; }
.grp-head { display: flex; align-items: center; gap: 8px; }
.grp-avatar { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 8px; background: #eef0f3;
              display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.grp.grp-sauna .grp-avatar { background: #fde7c7; }
.grp.grp-general .grp-avatar { background: #dbe9ff; }
.grp-name { flex: 1 1 auto; min-width: 0; font-size: .92rem; font-weight: 700;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grp-engpass { flex: 0 0 auto; font-size: .56rem; background: #c9372c; color: #fff; border-radius: 4px;
               padding: 2px 6px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.grp-body { display: flex; flex-direction: column; gap: 4px; }
.grp-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.grp-row > span { color: #6b778c; font-weight: 400; }
.grp-row > b { font-weight: 700; color: #172b4d; }
.grp-finish { border-top: 1px solid #e3e7ee; padding-top: 7px; margin-top: 2px; }
.grp-alerts { display: flex; flex-direction: column; gap: 2px; }
.grp-warn { color: #c9372c; font-weight: 700; font-size: .74rem; }

/* Berater (B) + unplanbar-Liste (A) */
.advice { background: #fff8e6; border: 1px solid #ffe7a3; border-radius: 10px;
          padding: 10px 14px; color: #5a4a1a; font-size: .84rem; line-height: 1.55; }
.advice:empty { display: none; }
.advice-head { font-weight: 700; margin-bottom: 4px; color: #8a6d1a; }
.advice-tip, .advice-ok { color: #1f5132; }
.advice-note { font-size: .72rem; color: #998f73; font-style: italic; margin-top: 4px; }
.unplanbar { background: #ffece8; border: 1px solid #ffb3a8; border-radius: 10px;
             padding: 10px 14px; color: #8a1c12; font-size: .82rem; }
.unplanbar ul { margin: 6px 0 0; padding-left: 18px; }
.unplanbar li { margin: 2px 0; }

/* Auftragsbalken */
.vis-item { border-radius: 6px; background-color: #cfe3ff; border-color: #5e6c84; color: #172b4d; }
.vis-item.vis-selected { box-shadow: 0 0 0 2px #0c66e4; }
.vis-item.at-risk { background-color: #ffd5cf; border-color: #c9372c; color: #601c16; }
.vis-item.at-risk .vis-item-content { font-weight: 600; }
/* eingelaufen (noch nicht gestartet) = gestrichelt; rote Füllung bei at-risk bleibt */
.vis-item.backlog { border-style: dashed; border-width: 2px; }
.vis-item.backlog:not(.at-risk) { background-color: #eef2f7; color: #5e6c84; }

/* Timeline griffiger machen */
.vis-item { min-height: 30px; box-shadow: 0 1px 2px rgba(9,30,66,.2); }
.vis-item:hover { box-shadow: 0 3px 8px rgba(9,30,66,.4); cursor: pointer; }
.vis-item .vis-item-content { padding: 4px 9px; }
.vis-panel.vis-left { border-right: 2px solid #c1c7d0; }
.vis-labelset .vis-label { background: #f4f5f7; }
.vis-labelset .vis-label .vis-inner { padding: 0; width: 100%; display: block; }
.vis-labelset .vis-label, .vis-foreground .vis-group { border-bottom: 1px solid #dfe1e6; }
.vis-time-axis .vis-grid.vis-saturday,
.vis-time-axis .vis-grid.vis-sunday { background: #f3f4f7; }
.vis-current-time { background-color: #d6453b; width: 2px; }

/* --- Team verwalten (Crew) --- */
.crew-panel { background: rgba(255,255,255,.12); border-radius: 10px; color: #fff; padding: 0 14px; }
.crew-panel summary { cursor: pointer; font-weight: 600; padding: 9px 0; list-style: none; }
.crew-panel summary::before { content: "▸ "; }
.crew-panel[open] summary::before { content: "▾ "; }
.crew-cols { display: flex; gap: 12px; flex-wrap: wrap; padding-bottom: 6px; }
.crew-col { background: #f0f1f4; border-radius: 10px; padding: 8px; flex: 1 1 240px; min-width: 210px; }
.crew-col-office { background: #f7f2e8; }
.crew-col-head { font-weight: 700; font-size: .85rem; color: #172b4d; padding: 2px 4px 8px; }
.crew-list { min-height: 36px; display: flex; flex-direction: column; gap: 6px; }
.crew-chip { display: flex; align-items: center; gap: 6px; background: #fff;
             border: 1px solid #dfe1e6; border-radius: 8px; padding: 4px 6px; }
.crew-chip.inactive { opacity: .55; border-style: dashed; }
.drag-handle { cursor: grab; color: #5e6c84; padding: 0 2px; user-select: none; font-size: 1rem; }
.crew-name { flex: 1 1 70px; min-width: 56px; border: 1px solid #dfe1e6; border-radius: 6px;
             padding: 3px 6px; font-size: .82rem; }
.crew-hours { font-size: .72rem; color: #5e6c84; white-space: nowrap; }
.crew-h { width: 48px; border: 1px solid #dfe1e6; border-radius: 6px; padding: 3px 4px; font-size: .8rem; }
.crew-active { font-size: .72rem; color: #5e6c84; white-space: nowrap; display: flex;
               align-items: center; gap: 3px; }
.crew-del { border: none; background: transparent; color: #c9372c; font-size: 1.1rem; line-height: 1;
            cursor: pointer; padding: 0 4px; }
.crew-add { margin-top: 8px; width: 100%; background: #ebecf0; border: 1px dashed #b3bac5;
            color: #44546f; border-radius: 8px; padding: 6px; cursor: pointer; font-size: .82rem; }
.crew-add:hover { background: #dfe3eb; }
.crew-hint { font-size: .74rem; opacity: .85; margin: 2px 0 10px; }

/* --- Karten-Detail-Leiste (Drawer) --- */
.plan-main { display: flex; gap: 10px; flex: 1; min-height: 0; }
#timeline { min-width: 0; }  /* erlaubt Schrumpfen, wenn die Leiste offen ist */
.card-drawer { flex: 0 0 340px; width: 340px; background: #fff; border-radius: 12px;
               box-shadow: 0 2px 6px rgba(9,30,66,.18); padding: 14px 16px 18px;
               overflow-y: auto; position: relative; color: #172b4d; }
.card-drawer[hidden] { display: none; }
.drawer-close { position: absolute; top: 8px; right: 10px; border: none; background: #f4f5f7;
                color: #44546f; width: 26px; height: 26px; border-radius: 6px; cursor: pointer;
                font-size: 1.1rem; line-height: 1; }
.drawer-close:hover { background: #e2e4e9; }
#drawer-body h3 { margin: 2px 28px 8px 0; font-size: 1rem; line-height: 1.3; }
.drawer-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.db { font-size: .72rem; background: #f4f5f7; color: #44546f; border-radius: 5px;
      padding: 2px 8px; white-space: nowrap; }
.db.pay { background: #e9f2ff; color: #0c66e4; font-weight: 600; }
.db.paint { background: #e7f0ff; color: #0079bf; }
.drawer-sec { border-top: 1px solid #ebecf0; padding: 8px 0 2px; }
.drawer-sec h4 { margin: 0 0 6px; font-size: .78rem; text-transform: uppercase;
                 letter-spacing: .03em; color: #5e6c84; }
.drawer-sec > div { font-size: .84rem; margin-bottom: 3px; }
.drawer-list { list-style: none; margin: 0; padding: 0; }
.drawer-list li { display: flex; justify-content: space-between; gap: 8px; font-size: .84rem;
                  padding: 2px 0; }
.drawer-list.checks li { display: block; }
.muted { color: #8993a4; }
.strike { text-decoration: line-through; }
.warn { color: #c9372c; font-weight: 600; }
.drawer-hint { font-size: .74rem; color: #8993a4; font-style: italic; margin-top: 12px;
               border-top: 1px dashed #dfe1e6; padding-top: 8px; }
.db.rush { background: #fde7c7; color: #9a4d00; font-weight: 600; }
.feasible-ok { color: #1f5132; font-weight: 600; margin-top: 4px; }
.feasible-late { color: #c9372c; font-weight: 600; margin-top: 4px; }
.rush-btn { margin-top: 8px; width: 100%; border: 1px solid #e8870b; background: #fff4e6;
            color: #8a4b00; border-radius: 8px; padding: 7px; cursor: pointer; font-size: .84rem;
            font-weight: 600; }
.rush-btn:hover { background: #ffe9cc; }
.rush-btn.on { background: #fff; border-color: #c9372c; color: #c9372c; }
.rush-btn:disabled { opacity: .6; cursor: default; }
.column { background: #ebecf0; border-radius: 10px; width: 290px; flex: 0 0 auto;
          max-height: 100%; display: flex; flex-direction: column; }
.column-head { display: flex; justify-content: space-between; align-items: center;
               padding: 10px 12px; font-weight: 600; font-size: .9rem; }
.col-meta { font-weight: 500; font-size: .78rem; color: #5e6c84;
            background: #fff; border-radius: 10px; padding: 2px 8px; }
.cards { padding: 0 8px 8px; overflow-y: auto; min-height: 24px; }

.card { background: #fff; border-radius: 8px; padding: 8px 10px; margin-bottom: 8px;
        box-shadow: 0 1px 0 rgba(9,30,66,.25); cursor: grab; }
.card:active { cursor: grabbing; }
.card .labels { display: flex; gap: 4px; margin-bottom: 6px; min-height: 8px; }
.card .label { width: 36px; height: 8px; border-radius: 4px; }
.card .title { font-size: .86rem; line-height: 1.3; margin-bottom: 6px; }
.card .badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { font-size: .72rem; border-radius: 4px; padding: 1px 6px; background: #f4f5f7;
         color: #44546f; white-space: nowrap; }
.badge.pay { background: #e9f2ff; color: #0c66e4; font-weight: 600; }
.badge.time { background: #e6fcf1; color: #006644; font-weight: 600; }
.badge.due.overdue { background: #ffebe6; color: #c9372c; font-weight: 600; }
.badge.check { background: #eef0f3; }

.sortable-ghost { opacity: .4; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
         background: #172b4d; color: #fff; padding: 12px 18px; border-radius: 8px;
         font-size: .9rem; max-width: 90vw; opacity: 0; pointer-events: none;
         transition: opacity .2s; box-shadow: 0 4px 12px rgba(0,0,0,.3); }
#toast.show { opacity: 1; }
#toast.error { background: #c9372c; }
#toast.ok { background: #1f845a; }


/* --- Planung: grafische Verdichtung der Timeline --- */
#view-timeline {
  min-width: 0;
}

.dash-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(156px, 1fr));
}

.kpi,
.timeline,
.card-drawer,
.modal,
.dash-banner {
  border-radius: 8px;
}

.plan-toolbar {
  min-height: 38px;
}

.tool-btn,
.zoom-btn {
  min-height: 32px;
}

.tl-legend {
  gap: 8px;
  background: rgba(9,30,66,.22);
  border-radius: 8px;
  padding: 6px 8px;
}

.timeline {
  padding: 0;
  border: 1px solid #d7dce5;
  min-height: 360px;
  box-shadow: 0 8px 24px rgba(9,30,66,.18);
}

.timeline .vis-timeline {
  border: 0;
  font-size: .78rem;
}

.timeline .vis-panel.vis-top {
  background: #f8fafc;
  border-bottom: 1px solid #cfd6e2;
}

.timeline .vis-time-axis .vis-text {
  color: #44546f;
  font-weight: 600;
  padding-top: 4px;
}

.timeline .vis-time-axis .vis-text.vis-minor {
  color: #667085;
  font-weight: 500;
}

.timeline .vis-time-axis .vis-grid.vis-minor {
  border-color: #edf0f5;
}

.timeline .vis-time-axis .vis-grid.vis-major {
  border-color: #cfd6e2;
}

.timeline .vis-time-axis .vis-grid.vis-saturday,
.timeline .vis-time-axis .vis-grid.vis-sunday {
  background: #f1f3f6;
}

.timeline .vis-panel.vis-left {
  background: #f7f8fa;
  border-right: 1px solid #b8c0cc;
}

.timeline .vis-labelset .vis-label,
.timeline .vis-foreground .vis-group {
  border-bottom: 1px solid #e3e7ee;
}

.timeline .vis-labelset .vis-label .vis-inner {
  padding: 0;
}

.grp {
  width: 232px;
  min-height: 126px;
  justify-content: center;
  background: #f7f8fa;
  border-left-width: 5px;
}

.grp-head {
  gap: 8px;
}

.grp-avatar {
  width: 30px;
  height: 30px;
  border-radius: 7px;
}

.vis-item {
  min-height: 34px;
  border-radius: 7px;
  border-width: 1px;
  box-shadow: 0 1px 2px rgba(9,30,66,.18);
  overflow: hidden;
}

.vis-item .vis-item-content {
  width: 100%;
  padding: 7px 9px;
}

.vis-item:hover {
  box-shadow: 0 6px 14px rgba(9,30,66,.28);
  transform: translateY(-1px);
}

.vis-item.vis-selected {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #0c66e4;
}

.tl-bar-title {
  display: block;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .8rem;
  font-weight: 700;
  line-height: 1.2;
}

.vis-item.at-risk {
  background-color: #ffe2de;
  border-color: #c9372c;
}

.vis-item.late-strong {
  border-left-width: 5px;
}

.vis-item.backlog:not(.at-risk) {
  background-color: #f6f8fb;
  border-color: #8792a2;
}

.vis-item.deadline-marker {
  min-height: 0;
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.vis-item.deadline-marker:hover {
  box-shadow: none;
  transform: none;
}

.vis-item.deadline-marker .vis-dot {
  width: 12px;
  height: 12px;
  margin-left: -6px;
  margin-top: -6px;
  background: #c9372c;
  border: 2px solid #fff;
  border-radius: 2px;
  box-shadow: 0 0 0 1px #c9372c, 0 2px 5px rgba(96,28,22,.35);
  transform: rotate(45deg);
}

.vis-item.selected-deadline .vis-dot {
  animation: deadline-pop .18s ease-out;
}

@keyframes deadline-pop {
  from { transform: rotate(45deg) scale(.65); opacity: .2; }
  to { transform: rotate(45deg) scale(1); opacity: 1; }
}

.vis-current-time {
  background-color: #c9372c;
  box-shadow: 0 0 0 1px rgba(201,55,44,.16);
}

@media (max-width: 900px) {
  #view-timeline {
    height: auto;
    min-height: calc(100vh - 96px);
  }

  .plan-main {
    flex-direction: column;
  }

  .timeline {
    flex: 0 0 auto;
    min-height: 460px;
  }

  .card-drawer {
    flex: 0 0 auto;
    width: 100%;
    max-height: 42vh;
  }

  .toolbar-spacer {
    display: none;
  }

  .tl-legend {
    order: 3;
    width: 100%;
    overflow-x: auto;
  }
}

@media (max-width: 640px) {
  header .sub {
    display: block;
    margin: 2px 0 0;
  }

  #view-timeline {
    padding: 10px;
    gap: 8px;
  }

  .dash-banner {
    padding: 10px 12px;
  }

  .plan-toolbar {
    align-items: stretch;
  }

  .tool-btn {
    flex: 1 1 calc(50% - 8px);
    padding: 6px 8px;
  }

  .tl-zoom {
    margin-left: auto;
  }

  .grp {
    width: 208px;
  }

  .timeline {
    min-height: 420px;
  }
}

/* --- Clockodo-Integration: Status-Pille, Verknüpfung, Urlaubsbänder --- */
.clockodo-pill { font-size: .74rem; padding: 4px 10px; border-radius: 999px;
                 white-space: nowrap; border: 1px solid transparent; }
.clockodo-pill.ok  { background: #e3fcef; color: #216e4e; border-color: #7ee2b8; }
.clockodo-pill.bad { background: #fff0ee; color: #ae2a19; border-color: #f3a59b; }

.crew-chip { flex-wrap: wrap; }
.crew-chip.linked { border-color: #7ee2b8; }
.crew-h.from-clockodo { background: #f2fbf6; border-color: #7ee2b8; }
.crew-link { flex-basis: 100%; display: flex; align-items: center; gap: 5px;
             margin-top: 4px; padding-top: 4px; border-top: 1px dashed #ebecf0; }
.crew-link-lbl { font-size: .72rem; color: #5e6c84; }
.crew-link-badge { font-size: .8rem; }
.crew-clockodo-sel { flex: 1 1 auto; min-width: 80px; border: 1px solid #dfe1e6;
                     border-radius: 6px; padding: 2px 4px; font-size: .76rem; background: #fff; }
.crew-clockodo { display: flex; align-items: center; justify-content: space-between;
                 gap: 10px; margin-top: 6px; padding-top: 8px; border-top: 1px solid #ebecf0;
                 font-size: .76rem; color: #5e6c84; flex-wrap: wrap; }
.crew-automatch { background: #e3fcef; border: 1px solid #7ee2b8; color: #216e4e;
                  border-radius: 8px; padding: 6px 12px; cursor: pointer; font-size: .8rem; }
.crew-automatch:hover { background: #c7f5dd; }
.crew-automatch:disabled { opacity: .55; cursor: default; }

/* Urlaubs-/Abwesenheitsband im Zeitstrahl (DSGVO: nur „abwesend") */
.vis-item.vis-background.absence-band {
  background: repeating-linear-gradient(45deg, rgba(201,55,44,.10),
              rgba(201,55,44,.10) 6px, rgba(201,55,44,.18) 6px, rgba(201,55,44,.18) 12px);
}

/* --- Board-Toolbar (Karte anlegen / Lexoffice) --- */
.board-toolbar { display: flex; gap: 8px; padding: 8px 16px 0; }
.board-toolbar[hidden] { display: none; }

/* --- Karten-Detail-Leiste als festes rechtes Panel (aus Board UND Planung) --- */
.card-drawer { position: fixed; top: 0; right: 0; height: 100vh; width: min(380px, 100vw);
               z-index: 60; flex: none; border-radius: 0;
               box-shadow: -4px 0 18px rgba(9,30,66,.25); }
.drawer-edit-btn { font-size: .78rem; border: 1px solid #dfe1e6; background: #f4f5f7;
                   color: #44546f; border-radius: 6px; padding: 5px 10px; cursor: pointer;
                   margin: 2px 0 6px; }
.drawer-edit-btn:hover { background: #e9ebef; }
.drawer-note { margin-top: 6px; color: #44546f; }

/* --- Karten-Formular (geteilt: Neu anlegen + Bearbeiten) --- */
.card-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.form-row { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.form-row.full { grid-column: 1 / -1; }
.form-row > label { font-size: .7rem; color: #5e6c84; text-transform: uppercase; letter-spacing: .03em; }
.form-row input, .form-row select, .form-row textarea {
  border: 1px solid #dfe1e6; border-radius: 6px; padding: 6px 8px; font-size: .86rem;
  font-family: inherit; width: 100%; }
.form-row textarea { resize: vertical; }
.form-actions { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.form-actions .rush-btn, .form-actions .tool-btn { width: auto; margin-top: 0; }
/* Im schmalen Drawer einspaltig. */
#drawer-form.card-form { grid-template-columns: 1fr; }

/* Label-Auswahl (Checkboxen mit Farbtupfer) im Karten-Formular */
.label-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 2px 0; }
.label-check { display: inline-flex; align-items: center; gap: 5px; font-size: .84rem; cursor: pointer; }
.label-check input { margin: 0; }
.label-swatch { width: 22px; height: 10px; border-radius: 3px; display: inline-block; }

/* --- Crew-Chip: Büro/Aushilfe + effektive Stundenanzeige --- */
.crew-office { font-size: .72rem; color: #5e6c84; white-space: nowrap; display: flex;
               align-items: center; gap: 3px; }
.crew-chip.office { background: #fbf7ef; border-color: #e0c98a; }
.crew-eff { font-size: .70rem; padding: 1px 6px; border-radius: 999px; white-space: nowrap; }
.crew-eff.clockodo { background: #e3fcef; color: #216e4e; border: 1px solid #7ee2b8; }
.crew-eff.office   { background: #fdf3d8; color: #8a6d1a; border: 1px solid #e0c98a; }


/* --- Login & Benutzerverwaltung ------------------------------------------ */
.login-overlay { position: fixed; inset: 0; background: #1d6f54; z-index: 200;
                 display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-overlay[hidden] { display: none; }
.login-panel { background: #fff; color: #172b4d; border-radius: 12px; padding: 26px 28px;
               width: min(360px, 92vw); box-shadow: 0 12px 48px rgba(0,0,0,.35);
               display: flex; flex-direction: column; gap: 12px; }
.login-panel h3 { margin: 0 0 4px; font-size: 1.05rem; }
.login-panel label { display: flex; flex-direction: column; gap: 4px; font-size: .82rem;
                     color: #44546f; }
.login-panel input { border: 1px solid #dfe1e6; border-radius: 8px; padding: 8px 10px;
                     font-size: .9rem; }
.login-panel .rush-btn { margin-top: 4px; }
.login-error { color: #c9372c; font-size: .8rem; min-height: 1em; }

header { display: flex; align-items: center; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
#user-badge { font-size: .8rem; opacity: .9; white-space: nowrap; }

.users-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.user-row { background: #fff; border: 1px solid #dfe1e6; border-radius: 8px; padding: 8px 10px; }
.user-row.inactive { opacity: .55; border-style: dashed; }
.user-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.user-name { font-size: .9rem; }
.user-role { font-size: .72rem; color: #5e6c84; background: #f4f5f7; border-radius: 999px;
             padding: 2px 8px; white-space: nowrap; }
.user-head .user-pass { margin-left: auto; }
.perm-checks { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; padding-top: 6px;
               border-top: 1px dashed #ebecf0; font-size: .78rem; color: #44546f; }
.perm-check { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
              cursor: pointer; }
.user-create { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.user-create input, .user-create select { border: 1px solid #dfe1e6; border-radius: 8px;
                                          padding: 6px 8px; font-size: .82rem; }


.empty-board { max-width: 460px; margin: 48px auto; background: #fff; border-radius: 12px;
               padding: 28px 30px; text-align: center; box-shadow: 0 2px 6px rgba(9,30,66,.18); }
.empty-board h2 { margin: 0 0 8px; font-size: 1.1rem; color: #172b4d; }
.empty-board p { color: #44546f; font-size: .88rem; line-height: 1.5; margin: 0 0 16px; }


/* Verknüpfte Mitarbeiter: Stunden read-only (Clockodo bzw. Fallback) */
.crew-hours-ro { font-size: .72rem; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.crew-hours-ro.clockodo { background: #e3fcef; color: #216e4e; border: 1px solid #7ee2b8; }
.crew-hours-ro.fallback { background: #fff7e6; color: #8a5b00; border: 1px solid #f0c674; }

/* Benutzer-Zeile: Mitarbeiter-Verknüpfung */
.user-emp { margin-top: 6px; padding-top: 6px; border-top: 1px dashed #ebecf0;
            font-size: .78rem; color: #44546f; }
.user-emp select { border: 1px solid #dfe1e6; border-radius: 8px; padding: 4px 8px;
                   font-size: .8rem; margin-left: 4px; }

/* --- Zeiterfassung (Mitarbeiter) --- */
.track-view { max-width: 560px; margin: 16px auto; padding: 0 12px; }
.track-note { background: #fff7e6; border: 1px solid #f0c674; color: #8a5b00;
              border-radius: 10px; padding: 14px 16px; font-size: .9rem; }
.track-panel { background: #fff; border: 1px solid #dfe1e6; border-radius: 12px;
               padding: 22px 20px; box-shadow: 0 2px 6px rgba(9,30,66,.12); text-align: center; }
.track-status { font-size: 1.05rem; color: #172b4d; margin-bottom: 18px; }
.track-actions { display: flex; justify-content: center; }
.track-btn { width: 100%; max-width: 340px; border: none; border-radius: 12px;
             padding: 18px 20px; font-size: 1.15rem; font-weight: 700; cursor: pointer; color: #fff; }
.track-btn.track-start { background: #216e4e; }
.track-btn.track-start:hover { background: #1a5940; }
.track-btn.track-end { background: #c9372c; }
.track-btn.track-end:hover { background: #a82c23; }
.track-distribute { background: #fff; border: 1px solid #dfe1e6; border-radius: 12px;
                    padding: 18px 18px; margin-top: 16px; box-shadow: 0 2px 6px rgba(9,30,66,.12); }
.track-distribute h3 { margin: 0 0 6px; font-size: 1rem; color: #172b4d; }
.track-net { font-size: .85rem; color: #44546f; margin-bottom: 12px; }
.track-rows { display: flex; flex-direction: column; gap: 10px; }
.track-row { display: flex; gap: 8px; align-items: center; }
.track-row .track-card-sel { flex: 1; min-width: 0; border: 1px solid #dfe1e6;
                             border-radius: 8px; padding: 8px; font-size: .85rem; }
.track-row .track-hours { width: 84px; border: 1px solid #dfe1e6; border-radius: 8px;
                          padding: 8px; font-size: .9rem; text-align: right; }
.track-sum { margin-top: 12px; font-size: .9rem; font-weight: 600; color: #216e4e; }
.track-sum.over { color: #c9372c; }
#track-add-row { margin-top: 12px; }
