* { 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; }
/* PDF-Fenster (2026-07-29): MUSS über die Karten-Leiste (.card-drawer, z-index 60),
   aus der es geöffnet wird — sonst öffnet es unsichtbar dahinter. */
#modal-pdf { z-index: 120; }
.modal-pdf { width: min(1000px, 96vw); height: 88vh; max-height: 88vh;
             display: flex; flex-direction: column; overflow: hidden; }
.pdf-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; }
.pdf-frame-wrap { flex: 1; min-height: 0; border: 1px solid #dfe1e6; border-radius: 8px;
                  overflow: auto; background: #f4f5f7; }
.pdf-frame-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }
.pdf-msg { padding: 18px; font-size: .9rem; color: #44546f; }
.pdf-msg.error { color: #c9372c; }
.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.grp-sonderauftrag { border-left-color: #519839; }
.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.grp-sonderauftrag .grp-avatar { background: #dcf0d8; }
.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-delete-btn { font-size: .78rem; border: 1px solid #f0b8b2; background: #fff;
                     color: #c9372c; border-radius: 6px; padding: 5px 10px; cursor: pointer; }
.drawer-delete-btn:hover { background: #ffece8; }
.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; }

/* Sonderanfertigung im Positions-Editor: Name breit, Stunden schmal */
.edit-custom-row .ec-name { flex: 1; }
.edit-custom-row .ec-hours { width: 84px; flex: 0 0 84px; }

/* Mehrfach-RAL: Farbe breit, Gebinde schmal; Zeilenabstand wie Produkt-Zeilen */
.paint-colors-box .pc-rows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.paint-colors-box .pc-color { flex: 1; }
.paint-colors-box .pc-amount { width: 72px; flex: 0 0 72px; }
.paint-colors-box .pc-add { width: auto; }

/* 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; }
/* Pause-Stempeln (2026-07-22): bernstein = Pause möglich, blau = Pause läuft */
.track-btn.track-pause { background: #b3730d; }
.track-btn.track-pause:hover { background: #96600b; }
.track-btn.track-pause.running { background: #0c66e4; }
.track-btn.track-pause.running:hover { background: #0a54bd; }
.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; flex-direction: column; gap: 6px; }
.track-row-main { 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; }
/* Auswahlraster Stunden (0–12) + Minuten (5er-Schritte) statt Tippen (2026-07-22) */
.hm-picker { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.hm-picker select { border: 1px solid #dfe1e6; border-radius: 8px; padding: 8px 6px;
                    font-size: .85rem; background: #fff; }
.hm-lbl { font-size: .72rem; color: #5e6c84; }
/* „Rest"-Knopf: trägt die noch offene Zeit in die Zeile ein (2026-07-29) */
.hm-rest { border: 1px solid #dfe1e6; background: #f4f5f7; color: #44546f;
           border-radius: 8px; padding: 7px 10px; font-size: .78rem; cursor: pointer;
           white-space: nowrap; }
.hm-rest:hover { background: #e9ebef; }
.track-row .track-hours { width: 84px; border: 1px solid #dfe1e6; border-radius: 8px;
                          padding: 8px; font-size: .9rem; text-align: right; }
.track-row .track-note { border: 1px solid #e8870b; background: #fff9f0; border-radius: 8px;
                         padding: 8px; font-size: .82rem; }
.track-sum { margin-top: 12px; font-size: .9rem; font-weight: 600; color: #216e4e; }
.track-sum.over { color: #c9372c; }
#track-add-row { margin-top: 12px; }

/* Zeiterfassungs-Overlays (Start-Erinnerung / harte Sperre / Endzeit nachtragen) */
.track-overlay { position: fixed; inset: 0; z-index: 1200; display: flex;
                 align-items: center; justify-content: center; padding: 20px;
                 background: rgba(9, 30, 66, .55); }
.track-overlay[hidden] { display: none; }  /* sonst überstimmt display:flex das hidden-Attribut */
.track-overlay.hard { background: rgba(9, 30, 66, .82); }
.track-overlay-panel { background: #fff; border-radius: 14px; padding: 26px 24px;
                       width: 100%; max-width: 420px; text-align: center;
                       box-shadow: 0 10px 30px rgba(9, 30, 66, .35); }
.track-overlay-panel h3 { margin: 0 0 8px; font-size: 1.15rem; color: #172b4d; }
.track-overlay-panel p { margin: 0 0 18px; color: #44546f; font-size: .9rem; line-height: 1.5; }
.track-overlay-panel .track-btn { margin-bottom: 10px; }
.track-overlay-panel input[type="datetime-local"] { width: 100%; border: 1px solid #dfe1e6;
                       border-radius: 8px; padding: 10px; font-size: .95rem; margin-bottom: 16px; }
.track-endfix-actions { display: flex; flex-direction: column; gap: 8px; }
/* Nachtrags-Dialog „Stunden zuordnen" (2026-07-29): braucht mehr Breite als die
   schmalen Erinnerungs-Overlays und linksbündigen Text für die Auftragszeilen. */
.track-dist-panel { max-width: 620px; text-align: left; max-height: 88vh; overflow-y: auto; }
.track-dist-panel .track-net { margin-bottom: 10px; }
.track-dist-panel .track-endfix-actions { margin-top: 14px; }

/* --- Büro-Auswertung (Zeiten) --- */
.ts-view { max-width: 980px; margin: 12px auto; padding: 0 12px 40px; }
.ts-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-bottom: 14px; }
.ts-filter label { display: flex; flex-direction: column; font-size: .72rem; color: #5e6c84; gap: 3px; }
.ts-filter input, .ts-filter select { border: 1px solid #dfe1e6; border-radius: 8px; padding: 6px 8px; font-size: .85rem; }
.ts-print-head { font-size: 1.05rem; font-weight: 700; color: #172b4d; margin-bottom: 10px; }
.ts-print-head span { font-weight: 400; color: #5e6c84; font-size: .9rem; }
.ts-tiles { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.ts-tile { background: #fff; border: 1px solid #dfe1e6; border-radius: 10px; padding: 10px 16px; min-width: 130px; }
.ts-tile span { display: block; font-size: .72rem; color: #5e6c84; }
.ts-tile b { font-size: 1.15rem; color: #172b4d; }
.ts-orders { margin-bottom: 14px; font-size: .84rem; }
.ts-orders summary { cursor: pointer; color: #44546f; }
.ts-orders ul { margin: 6px 0 0; padding-left: 18px; columns: 2; }
.ts-day { background: #fff; border: 1px solid #dfe1e6; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.ts-day-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: .88rem; }
.ts-day-times { color: #5e6c84; font-size: .8rem; }
.ts-day-net { margin-left: auto; color: #216e4e; font-weight: 600; font-size: .82rem; }
.ts-day-dist { color: #44546f; font-weight: 600; font-size: .82rem; }
.ts-day-dist.over { color: #c9372c; }
/* Plausibilität der Tagessumme (2026-08-12): mehrere Zeiträume je Datum sind
   erlaubt — eine unrealistische Summe soll trotzdem ins Auge fallen. */
.ts-day-multi { background: #eef2f7; color: #44546f; border-radius: 6px;
                padding: 1px 7px; font-size: .74rem; font-weight: 600; }
.ts-day-warn { background: #fff4e6; color: #8a4b00; border: 1px solid #e8870b;
               border-radius: 6px; padding: 1px 7px; font-size: .74rem; font-weight: 600; }
.ts-day-warn.bad { background: #ffebe6; color: #c9372c; border-color: #c9372c; }
.ts-entries { margin: 8px 0 0; padding-left: 18px; font-size: .82rem; color: #172b4d; }
.ts-entries li { margin: 2px 0; }
.ts-edit-times { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 10px; }
.ts-edit-times label { display: flex; flex-direction: column; font-size: .72rem; color: #5e6c84; gap: 3px; }
.ts-edit-times input { border: 1px solid #dfe1e6; border-radius: 8px; padding: 6px 8px; font-size: .9rem; }
.ts-edit-actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.ts-edit-actions .rush-btn { width: auto; margin-top: 0; flex: 1; }

/* Korrektur-Modal: Live-Vorschau „Bisher → Neu" (Zeitoptimierung sichtbar machen) */
.ts-edit-preview { background: #f7f8f9; border: 1px solid #dfe1e6; border-radius: 10px;
  padding: 8px 12px; margin-bottom: 10px; font-size: .84rem; }
.ts-edit-preview table { width: 100%; border-collapse: collapse; }
.ts-edit-preview th { text-align: left; font-weight: 600; color: #5e6c84; font-size: .72rem;
  padding: 2px 8px 4px 0; }
.ts-edit-preview td { padding: 3px 8px 3px 0; color: #172b4d; vertical-align: top; }
.ts-edit-preview td.lbl { color: #5e6c84; width: 90px; }
.ts-edit-preview .ts-prev-old { color: #5e6c84; }
.ts-edit-preview tr.changed .ts-prev-old { text-decoration: line-through; }
.ts-edit-preview tr.changed td.new { font-weight: 600; }
.ts-delta { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 10px;
  font-size: .72rem; font-weight: 700; }
.ts-delta.up { background: #dcfff1; color: #216e4e; }
.ts-delta.down { background: #ffecea; color: #c9372c; }
.ts-fit-ok { color: #216e4e; font-weight: 600; }
.ts-fit-open { color: #974f0c; }
.ts-fit-over { color: #c9372c; font-weight: 700; }
.ts-edit-warns { margin: 8px 0 0; padding-left: 18px; color: #c9372c; font-size: .8rem; }
.ts-edit-warns li { margin: 2px 0; }
/* Nach dem Speichern: den korrigierten Tag in der Liste kurz aufblinken lassen */
.ts-day.flash { animation: tsFlash 1.8s ease-out 1; }
@keyframes tsFlash { 0% { background: #fff7d6; } 100% { background: #fff; } }

/* Clockodo-Verknüpfung im Karten-Drawer (Stufe 2) */
.cl-status { font-size: .82rem; margin: 2px 0 8px; color: #44546f; }
.cl-status.ok { color: #216e4e; font-weight: 600; }
.cl-status.sug { color: #974f0c; }
.cl-lbl { display: flex; flex-direction: column; gap: 3px; font-size: .72rem; color: #5e6c84; margin-bottom: 8px; }
.cl-lbl select { border: 1px solid #dfe1e6; border-radius: 8px; padding: 6px 8px; font-size: .88rem; }
.cl-check { display: flex; align-items: center; gap: 6px; font-size: .82rem; color: #172b4d; margin-bottom: 10px; }
.cl-actions { display: flex; align-items: center; gap: 10px; }
.cl-actions .rush-btn { width: auto; margin-top: 0; }

/* Clockodo-Übertragung (Vorschau + Übertragen) */
#view-clockodo .ts-filter .rush-btn { width: auto; margin-top: 0; }
.cs-day { background: #fff; border: 1px solid #dfe1e6; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.cs-day-head { font-size: .88rem; margin-bottom: 6px; }
.cs-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.cs-table th { text-align: left; color: #5e6c84; font-weight: 600; padding: 3px 8px; border-bottom: 1px solid #eef0f2; }
.cs-table td { padding: 3px 8px; border-bottom: 1px solid #f4f5f7; color: #172b4d; }
.cs-b { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: .72rem; font-weight: 600; }
.cs-b.ok { background: #dcfff1; color: #216e4e; }
.cs-b.skip { background: #eef0f2; color: #5e6c84; }
.cs-b.block { background: #ffecea; color: #c9372c; }

/* Druck: nur den Report (Zeitnachweis) drucken -> „Als PDF speichern" */
@media print {
  body * { visibility: hidden; }
  #view-timesheets .ts-report, #view-timesheets .ts-report * { visibility: visible; }
  #view-timesheets .ts-report { position: absolute; left: 0; top: 0; width: 100%; }
  .no-print { display: none !important; }
  .ts-day, .ts-tile { border-color: #bbb; break-inside: avoid; }
}

/* Stufe 4 (Kundentermin 2026-07-14): Crew-Wochentage (C3), Pause (C4), Nachrang (C1) */
.crew-wd { display: inline-flex; gap: 2px; }
.crew-wd-btn {
  padding: 1px 5px; font-size: .7rem; border: 1px solid #dfe1e6; border-radius: 4px;
  background: #fff; color: #5e6c84; cursor: pointer; opacity: .45;
}
.crew-wd-btn.on { opacity: 1; color: #172b4d; font-weight: 600; border-color: #8590a2; }
.crew-wd-ro { font-size: .72rem; color: #5e6c84; }
.crew-break { font-size: .78rem; color: #5e6c84; white-space: nowrap; }
.crew-break .crew-brk { width: 52px; }
/* Zeitlich begrenzte Aushilfe: „hilft aus von–bis" — eigene Zeile im Chip
   (Muster .crew-link), nur bei manuell gepflegten MA ohne Clockodo-Verknüpfung.
   Datumsfelder sind flexibel und BRECHEN UM statt über den Chip hinauszulaufen
   (Chromes Date-Input hat eine sture Mindestbreite). */
.crew-range { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center;
              gap: 4px 5px; margin-top: 4px; padding-top: 4px;
              border-top: 1px dashed #ebecf0; min-width: 0; }
.crew-range-lbl { font-size: .72rem; color: #5e6c84; white-space: nowrap; flex: 0 0 auto; }
.crew-range input[type="date"] { flex: 1 1 96px; width: auto; min-width: 0; max-width: 100%;
                                 border: 1px solid #dfe1e6; border-radius: 6px;
                                 padding: 2px 4px; font-size: .72rem; color: #172b4d;
                                 background: #fff; font-family: inherit; }
.crew-range input[type="date"]::-webkit-calendar-picker-indicator { margin: 0; padding: 0; }
/* Zeitraum gesetzt -> blau markieren, damit die Befristung sofort ins Auge fällt */
.crew-range.set .crew-range-lbl { color: #0055cc; font-weight: 600; }
.crew-range.set input[type="date"] { background: #e9f2ff; border-color: #85b8ff; }
.crew-range-clear, .crew-brk-clear { border: none; background: none; color: #ae2a19;
                    cursor: pointer; font-size: .9rem; line-height: 1; padding: 0 4px; }
/* Sicherheitsnetz-Pille: vor dem Verknüpfen gesetzte Pause wirkt weiter -> blau markieren */
.crew-break.set { color: #0055cc; font-weight: 600; }
/* C1: überfällige, ans Ende gestellte Aufträge in der Timeline abdunkeln */
.vis-item.deferred { opacity: .55; filter: saturate(.6); }

/* A4 (Kundentermin 2026-07-14): Zeiterfassung mobil — greift NUR <=640px,
   Desktop bleibt unverändert. 16px-Inputs verhindern den iOS-Auto-Zoom. */
.track-logout { display: block; margin: 18px auto 0; }
@media (max-width: 640px) {
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  .tab { padding: 12px 14px; min-height: 44px; }
  .track-view input,
  .track-view select,
  .login-panel input { font-size: 16px; min-height: 44px; }
  .track-view .track-btn, .login-panel .rush-btn { min-height: 48px; font-size: 16px; }
  .track-row-main { flex-wrap: wrap; }
  .track-row-main .track-card-sel { flex-basis: 100%; }
  .track-row-main .track-hours { width: 110px; }
  #track-save { position: sticky; bottom: 8px; width: 100%; min-height: 48px; }
  .track-logout { width: 100%; min-height: 44px; }
  .track-overlay-panel input { font-size: 16px; }
}

/* Pause beim Tagesabschluss selbst einplanen (Kundenwunsch 2026-07-20) */
.track-break-plan { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem;
  color: #5e6c84; margin-top: 8px; }
.track-break-plan input { width: 64px; }

/* Farben-Bestellwesen (Reiter "Farben", Kundenwunsch 2026-07-20) */
.colors-table td, .colors-table th { vertical-align: top; }
.colors-table .paint-stock { width: 72px; }
.colors-table .colors-actions { white-space: nowrap; }

/* Anhänge im Drawer: manuelles Anheften per LS-Nummer (edit_cards) */
.att-item { display: inline-flex; align-items: center; gap: 2px; margin: 0 6px 6px 0; }
.att-add-row { display: flex; gap: 6px; margin-top: 8px; }
.att-add-row .att-nr { flex: 1; min-width: 0; border: 1px solid #dfe1e6; border-radius: 6px;
                       padding: 6px 8px; font-size: .84rem; }
.colors-table details summary { cursor: pointer; color: #44546f; }
.colors-order { color: #c9372c; }
.colors-ok { color: #216e4e; }
.colors-nocolor td { background: #fffaf0; }
#view-colors .ts-filter b { font-size: 1rem; }
#view-colors { background: #fff; border-radius: 12px; margin: 14px 20px; padding: 12px 16px;
  box-shadow: 0 2px 6px rgba(9,30,66,.18); color: #172b4d; }
#view-colors .ts-filter { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
#view-colors .crew-hint { color: #5e6c84; }

/* Mobile-Feinschliff Zeiterfassung (2026-07-21, Live-Screenshot-Befund):
   Header quetschte sich (Titel/Badge/Abmelden abgeschnitten), Untertitel fraß Platz. */
@media (max-width: 640px) {
  header { flex-wrap: wrap; gap: 4px 10px; padding: 10px 12px; }
  header h1 { font-size: 1.05rem; white-space: nowrap; }
  header .sub { display: none; } /* Untertitel auf dem Handy ausblenden (überstimmt Alt-Regel) */
  .header-actions { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
  #user-badge { max-width: 44vw; overflow: hidden; text-overflow: ellipsis; }
  .header-actions .tool-btn { padding: 6px 10px; font-size: .8rem; }

  .track-view { margin: 10px auto; }
  .track-status { font-size: 1rem; text-align: center; }
  .track-break-plan { display: flex; justify-content: center; width: 100%; margin-top: 10px; }
}
/* Guard: display:flex darf das hidden-Attribut nie überstimmen (Learnings!) */
.track-break-plan[hidden] { display: none; }

/* Persönliche Begrüßung in der Zeiterfassung (2026-07-21) */
.track-greeting { color: #fff; font-size: 1.45rem; font-weight: 800; text-align: center;
  margin: 14px 0 4px; letter-spacing: .01em; text-shadow: 0 1px 2px rgba(9,30,66,.25); }
.track-greeting[hidden] { display: none; }
@media (max-width: 640px) {
  .track-greeting { font-size: 1.55rem; margin-top: 6px; }
}

/* Web-Push-Erinnerungen (2026-07-21): Karte im Zeiterfassungs-Tab */
/* Urlaub & Krankmeldung (Stufe C 2026-07-21) */
.track-absence { text-align: left; }
.track-absence[hidden] { display: none; } /* Guard wie track-push (Learnings!) */
.track-absence h3 { margin: 0 0 10px; font-size: 1rem; color: #172b4d; }
#track-absence-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
#track-absence-form[hidden] { display: none; } /* Guard: display:flex überstimmt hidden */
#track-absence-form select, #track-absence-form input[type="text"] {
  border: 1px solid #dfe1e6; border-radius: 8px; padding: 9px; font-size: .9rem; width: 100%; }
.track-absence-dates { display: flex; gap: 10px; }
.track-absence-dates label { flex: 1; font-size: .82rem; color: #5e6c84; }
.track-absence-dates input { width: 100%; border: 1px solid #dfe1e6; border-radius: 8px;
                             padding: 8px; font-size: .9rem; }
.absence-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
               padding: 8px 0; border-bottom: 1px solid #f0f1f4; font-size: .88rem; flex-wrap: wrap; }
.absence-row:last-child { border-bottom: none; }
.absence-info { color: #172b4d; }
.absence-badge { border-radius: 999px; padding: 3px 10px; font-size: .75rem; font-weight: 600; }
.absence-badge.pending { background: #fff7e6; color: #8a5b00; border: 1px solid #f0c674; }
.absence-badge.approved { background: #eaf6ef; color: #216e4e; border: 1px solid #b3dfc6; }
.absence-badge.declined { background: #ffedeb; color: #c9372c; border: 1px solid #f3b7b0; }
.absence-actions { display: inline-flex; gap: 6px; }
.absence-withdraw, .absence-approve, .absence-decline { padding: 6px 10px; font-size: .8rem; }

/* Büro: offene Urlaubsanträge über der Zeiten-Auswertung */
.ts-absences { background: #fff; border: 1px solid #dfe1e6; border-radius: 12px;
               padding: 16px 18px; margin-bottom: 14px; box-shadow: 0 2px 6px rgba(9,30,66,.08); }
.ts-absences[hidden] { display: none; }
.ts-absences h3 { margin: 0 0 8px; font-size: 1rem; color: #172b4d; }

/* „Mein Konto" — Resturlaub/Überstunden/Stundenübersicht (Stufe B 2026-07-21) */
.track-account { text-align: left; }
.track-account[hidden] { display: none; } /* Guard wie track-push (Learnings!) */
.track-account h3 { margin: 0 0 10px; font-size: 1rem; color: #172b4d; }
.track-account-status { background: #fff7e6; border: 1px solid #f0c674; color: #8a5b00;
                        border-radius: 8px; padding: 8px 10px; font-size: .82rem; margin-bottom: 10px; }
.track-account-status[hidden] { display: none; }
.track-account-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
                       gap: 10px; }
.track-tile { background: #f7f8fa; border: 1px solid #e6e8ec; border-radius: 10px;
              padding: 12px 10px; text-align: center; }
.track-tile-icon { font-size: 1.2rem; }
.track-tile-value { font-size: 1.05rem; font-weight: 700; color: #172b4d; margin-top: 2px; }
.track-tile-label { font-size: .78rem; color: #5e6c84; margin-top: 2px; }
.track-tile-sub { font-size: .72rem; color: #8590a2; margin-top: 4px; }

/* „Meine letzten Tage" — Selbst-Korrektur Start/Ende/Pause (Kundenwunsch 2026-07-21) */
.track-days { text-align: left; }
.track-days[hidden] { display: none; } /* Guard wie track-push (Learnings!) */
.track-days h3 { margin: 0 0 10px; font-size: 1rem; color: #172b4d; }
.track-day-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
                 padding: 8px 0; border-bottom: 1px solid #f0f1f4; font-size: .9rem; }
.track-day-row:last-child { border-bottom: none; }
.track-day-info { color: #172b4d; }
.track-day-edit { padding: 6px 10px; }
.track-day-lock { font-size: .95rem; cursor: help; }
.track-days-hint { margin-top: 10px; font-size: .8rem; }
.track-dayedit-field { display: block; text-align: left; font-size: .85rem; color: #5e6c84;
                       margin-bottom: 10px; }
.track-dayedit-field[hidden] { display: none; } /* Guard: display:block überstimmt sonst hidden */

.track-push { text-align: center; }
.track-push[hidden] { display: none; } /* Guard wie track-break-plan (Learnings!) */
.track-push-status { font-weight: 600; margin-bottom: 8px; }
.track-push-hint { margin-top: 8px; font-size: .85rem; color: #5e6c84; }
.track-push-hint[hidden] { display: none; }
