/* Timeline styles — uses theme.css variables */

#panel-timeline.active {
    display: flex;
    flex-direction: column;
}

.timeline-header {
    display: flex;
    align-items: baseline;
    gap: 14px;
    padding: 24px 32px 0;
    position: relative;
    z-index: 1;
}

.timeline-header h1 {
    font-family: "Geist", system-ui, sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--cream);
    letter-spacing: -0.3px;
}

.timeline-header h1 em {
    font-style: normal;
    font-weight: 400;
    color: var(--cream-mute);
    margin-left: 4px;
}

.timeline-header .meta {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent);
    background: var(--accent-dim);
    padding: 3px 10px;
    border-radius: 4px;
}

/* Toolbar */
.toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 32px;
    position: relative;
    z-index: 1;
}

.toolbar-spacer {
    width: 16px;
}

.toolbar-label {
    font-size: 13px;
    color: var(--cream-dim);
    min-width: 160px;
    text-align: center;
    font-weight: 500;
}

.tool-btn {
    background: var(--ink-3);
    border: 1px solid var(--ink-5);
    color: var(--cream-dim);
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    transition: all 0.15s ease;
}

.tool-btn:hover {
    background: var(--ink-4);
    color: var(--cream);
    border-color: var(--cream-faint);
}

.add-btn {
    width: 32px;
    height: 32px;
    font-size: 18px;
    font-weight: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    border-color: var(--accent-dim);
}

.add-btn:hover {
    background: var(--accent-dim);
    color: var(--cream);
    border-color: var(--accent);
}

.nav-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-group {
    display: flex;
    gap: 0;
}

.zoom-btn {
    padding: 6px 12px;
    border-radius: 0;
}

.zoom-btn:first-child { border-radius: 6px 0 0 6px; }
.zoom-btn:last-child { border-radius: 0 6px 6px 0; }

.zoom-btn.active {
    background: var(--accent-dim);
    color: var(--accent-hot);
    border-color: var(--accent-dim);
}

/* Timeline container */
.timeline-container {
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    margin: 0 32px 32px;
    border: 1px solid var(--ink-5);
    border-radius: 10px;
    overflow: hidden;
    flex: 1;
    min-height: 0;
}

.timeline-scroll {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.timeline-footer {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-top: 2px solid var(--ink-5);
    background: var(--ink-3);
}

.footer-row {
    display: flex;
}
.footer-row + .footer-row {
    border-top: 1px solid var(--ink-5);
}
/* Model-bånd (iMac/MacMini/…) adskilt visuelt fra version-båndet ovenfor */
.footer-band-models .footer-row:first-child { border-top: 2px solid rgba(255, 255, 255, 0.16); }
/* Sektions-headers: hardware-fordeling delt i NY vs GAMMEL (klar hensigt, ikke faktisk sat version) */
.model-section-head { border-top: 2px solid rgba(255,255,255,.18); }
.model-section-head .summary-footer-label {
    font-size: 10.5px; font-weight: 700; letter-spacing: .04em; padding-top: 9px; padding-bottom: 2px;
    color: var(--cream, #f0ece2);
}
.model-section-ny .summary-footer-label { color: #f0937a; }
.model-section-gammel .summary-footer-label { color: #9fb0c4; }
.model-subtotal { background: rgba(255,255,255,.035); }
.model-subtotal .capacity-label { font-weight: 700; color: var(--cream, #f0ece2); }

/* ── Sammenklappelig bemandings-footer (mobil-venlig: detaljer foldet væk som standard) ──
   Klik på "Samlet bemanding"-rækken folder kapacitets-bånd, model-bånd og "i brug" ud/ind. */
.footer-toggle-row { cursor: pointer; user-select: none; }
.footer-toggle-chevron {
    display: inline-block;
    margin-right: 6px;
    font-size: 10px;
    line-height: 1;
    opacity: 0.7;
    transition: transform 0.15s ease;
    flex-shrink: 0;
}
.footer-toggle-row:hover .footer-toggle-chevron { opacity: 1; }
.timeline-footer.footer-expanded .footer-toggle-chevron { transform: rotate(90deg); }
/* Sammenklappet (standard) — skjul detalje-rækkerne; kun headline-rækken vises */
.timeline-footer:not(.footer-expanded) > #capacity-band-rows,
.timeline-footer:not(.footer-expanded) > #model-band-rows,
.timeline-footer:not(.footer-expanded) > #fcp-forecast,
.timeline-footer:not(.footer-expanded) > #migration-plan,
.timeline-footer:not(.footer-expanded) > #summary-inuse-row { display: none; }
/* Udvidet: footeren kan blive højere end skærmen (mange bånd + forecast) → begræns højden
   og lad den scrolle internt, så man kan nå bunden. "Samlet bemanding"-rækken bliver sticky. */
.timeline-footer.footer-expanded { max-height: 62vh; overflow-y: auto; }
.timeline-footer.footer-expanded .footer-toggle-row {
    position: sticky; top: 0; z-index: 3; background: var(--ink-3);
}

/* NY FORDELING — FCP-migrerings-forecast (fuld-bredde kort, ikke uge-grid) */
.fcp-forecast { padding: 12px 16px 14px; border-top: 2px solid rgba(255,255,255,.16); }
.fcp-fc-head { font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--cream, #f0ece2); margin-bottom: 8px; }
.fcp-fc-sub { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--cream-mute, #b8b2a5); font-size: 11px; margin-left: 8px; }
.fcp-fc-bar { display: flex; height: 22px; border-radius: 6px; overflow: hidden; background: rgba(255,255,255,.05); max-width: 720px; }
.fcp-fc-bar-new, .fcp-fc-bar-old { display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; }
.fcp-fc-bar-new { background: #d9482c; }
.fcp-fc-bar-old { background: #5b6675; }
.fcp-fc-legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 8px 0 10px; font-size: 11.5px; }
.fcp-fc-l-new { color: #f0937a; } .fcp-fc-l-old { color: #9fb0c4; } .fcp-fc-l-unset { color: var(--cream-mute, #b8b2a5); }
.fcp-fc-l-waste { color: #e0a24c; font-weight: 700; }
.fcp-fc-table { border-collapse: collapse; font-size: 12px; min-width: 460px; }
.fcp-fc-table th { text-align: left; padding: 3px 14px 5px 0; color: var(--cream-mute, #b8b2a5); font-weight: 600; font-size: 10.5px; border-bottom: 1px solid rgba(255,255,255,.1); }
.fcp-fc-table td { padding: 3px 14px 3px 0; color: var(--cream-dim, #cfc9bd); }
.fcp-fc-table .fcp-fc-type { color: var(--cream, #f0ece2); font-weight: 500; }
.fcp-fc-table .fcp-fc-old { color: #9fb0c4; } .fcp-fc-table .fcp-fc-new { color: #f0937a; font-weight: 700; }
.fcp-fc-waste { color: #e0a24c; font-weight: 700; font-size: 11px; }
/* Klikbare forecast-tal → popup med de konkrete kort */
.fc-click { cursor: pointer; }
.fcp-fc-table td.fc-click { text-decoration: underline dotted; text-underline-offset: 2px; }
.fc-click:hover { text-decoration: underline; filter: brightness(1.3); }

/* MIGRERINGS-PLAN — konkrete etape-trin pr. produktion (afløser "X kan flyttes") */
.migration-plan { padding: 6px 16px 14px; }
.mig-head { font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--cream, #f0ece2); margin-bottom: 10px; }
.mig-sub { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--cream-mute, #b8b2a5); font-size: 11px; margin-left: 8px; }
.mig-empty { font-size: 12px; color: var(--cream-mute, #b8b2a5); }
.mig-group-head { font-size: 11px; font-weight: 700; color: var(--cream, #f0ece2); margin: 12px 0 6px; text-transform: none; letter-spacing: .02em; }
.mig-group-head .mig-note { font-weight: 400; }
.mig-g-ready { color: #6fce9a; }
.mig-g-cand { color: #e0a24c; }
.mig-foot { font-size: 11px; color: var(--cream-mute, #b8b2a5); margin-top: 8px; font-style: italic; }
.mig-prod { border-left: 2px solid rgba(255,255,255,.12); padding: 4px 0 6px 10px; margin-bottom: 10px; }
.mig-prod-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.mig-idx { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: rgba(255,255,255,.1); color: var(--cream-mute, #b8b2a5); font-size: 10.5px; font-weight: 700; flex: 0 0 auto; }
.mig-prod-name { color: var(--cream, #f0ece2); font-weight: 600; font-size: 12.5px; }
.mig-badge { font-size: 10.5px; font-weight: 700; padding: 1px 8px; border-radius: 10px; white-space: nowrap; }
.mig-b-easy { background: rgba(76,175,120,.18); color: #6fce9a; }
.mig-b-swap { background: rgba(224,162,76,.18); color: #e0a24c; }
.mig-b-short { background: rgba(217,72,44,.2); color: #f0937a; }
.mig-steps { list-style: none; margin: 0; padding: 0; font-size: 11.5px; }
.mig-steps li { padding: 2px 0; color: var(--cream-dim, #cfc9bd); line-height: 1.45; }
.mig-steps b { color: var(--cream, #f0ece2); }
.mig-done { color: #6fce9a !important; }
.mig-wipe b { color: #9fb0c4; }
.mig-repl { color: #6fce9a; }
.mig-note { color: var(--cream-mute, #b8b2a5); font-size: 10.5px; }
.mig-warn { color: #f0937a; font-weight: 600; }

/* Kapacitets-bånd: V20/V22 udbud vs. allokeret pr. måned */
.capacity-label {
    height: 36px;
    font-size: 11px;
    font-weight: 600;
}
.capacity-grid {
    height: 36px;
}
.capacity-badge {
    position: absolute;
    top: 6px;
    height: 24px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10.5px;
    font-weight: 700;
    color: #fff;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    padding: 0 4px;
}
.capacity-badge.cap-ok    { background: rgba(45, 138, 78, 0.55); }
.capacity-badge.cap-tight { background: rgba(212, 163, 74, 0.70); }
.capacity-badge.cap-over  { background: rgba(217, 72, 44, 0.85); }
/* Klikbar celle (har ledige-maskiner-popup): cursor + diskret hover-løft. */
.capacity-badge.cap-clickable { cursor: pointer; }
.capacity-badge.cap-clickable:hover { filter: brightness(1.18); outline: 1px solid rgba(255,255,255,0.5); outline-offset: -1px; }

/* Lille "i"-mærke på ikke-grønne celler (vises kun når der er plads, sat i JS). */
.cap-info {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.28);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    font-style: italic;
    font-family: Georgia, "Times New Roman", serif;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* Hover-"info-tavle" der forklarer kapacitets-farverne + viser ugens tal. */
.cap-tooltip {
    position: fixed;
    z-index: 7000;
    background: var(--ink-2, #1c1a16);
    border: 1px solid var(--rule-2, rgba(255, 255, 255, 0.15));
    border-radius: 8px;
    padding: 9px 11px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    font-size: 11.5px;
    color: var(--cream, #f0ece2);
    pointer-events: none;
    min-width: 210px;
}
.cap-tip-title {
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--cream-mute, #b8b2a5);
    margin-bottom: 6px;
}
.cap-tip-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 0;
    opacity: 0.5;
}
.cap-tip-row.active { opacity: 1; font-weight: 600; }
.cap-tip-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.cap-tip-dot.cap-ok    { background: rgba(45, 138, 78, 0.95); }
.cap-tip-dot.cap-tight { background: rgba(212, 163, 74, 1); }
.cap-tip-dot.cap-over  { background: rgba(217, 72, 44, 1); }
.cap-tip-name { flex: 1; white-space: nowrap; }
.cap-tip-rule { color: var(--cream-mute, #b8b2a5); white-space: nowrap; }
.cap-tip-now {
    margin-top: 7px;
    padding-top: 6px;
    border-top: 1px solid var(--rule-2, rgba(255, 255, 255, 0.12));
}

.summary-footer-grid {
    flex: 1;
    position: relative;
    height: 36px;
    overflow: hidden;
}

.labels-column {
    width: 280px;
    min-width: 120px;
    background: var(--ink-2);
    border-right: none;
    overflow-y: auto;
    flex-shrink: 0;
}

.labels-resize-handle {
    width: 4px;
    cursor: col-resize;
    background: var(--ink-5);
    flex-shrink: 0;
    transition: background 0.15s ease;
    z-index: 5;
}

.labels-resize-handle:hover,
.labels-resize-handle.active {
    background: var(--accent);
}

/* Date header (fixed outside scroll) */
.timeline-date-header {
    display: flex;
    flex-shrink: 0;
    border-bottom: 1px solid var(--ink-5);
    background: var(--ink-3);
}
.date-header-label {
    width: 280px;
    min-width: 120px;
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--cream-mute);
    border-right: 1px solid var(--ink-5);
}
.date-header-grid {
    flex: 1;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 56px;
}

.label-row {
    height: 48px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    border-bottom: 1px solid var(--ink-5);
    gap: 10px;
}

.label-row:nth-child(even) {
    background: rgba(255,255,255,0.01);
}

.label-tag {
    font-size: 13px;
    font-weight: 600;
    color: var(--cream);
    font-family: "Geist", system-ui, sans-serif;
}

.label-model {
    font-size: 11px;
    color: var(--cream-mute);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Per-medlem labels i udvidet visning: stilling (primær) → navn → iMac (tertiær, mono, højre) */
.label-job {
    font-size: 13px; font-weight: 700; color: var(--cream);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 1; min-width: 0;
}
.label-person {
    font-size: 11.5px; color: var(--cream-mute);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 1; min-width: 0;
}
.label-row.grouped.nested .label-tag {
    margin-left: auto; flex-shrink: 0;
    font-size: 11px; font-weight: 600; color: var(--cream-mute);
    font-family: "Geist Mono", ui-monospace, monospace;
}

/* Company headers */
.company-header-label {
    height: 32px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 8px;
    background: var(--ink-4);
    border-bottom: 1px solid var(--ink-5);
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
    position: sticky;
    top: 0;
    z-index: 3;
}

.company-header-label:hover {
    background: var(--ink-5);
}

.company-name {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--cream-mute);
}

.grid-row.company-header-row {
    height: 32px;
    background: var(--ink-4);
    position: sticky;
    top: 0;
    z-index: 4;
}

/* Group headers */
.group-header-label {
    height: 36px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 8px;
    background: var(--ink-3);
    border-bottom: 1px solid var(--ink-5);
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
    position: sticky;
    top: 32px;
    z-index: 2;
}

.group-header-label.nested {
    padding-left: 28px;
}

.group-header-label:hover {
    background: var(--ink-4);
}

.group-chevron {
    font-size: 18px;
    color: var(--cream-mute);
    width: 16px;
    flex-shrink: 0;
    line-height: 1;
}

.group-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

.group-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--cream);
    letter-spacing: 0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.group-count {
    font-size: 11px;
    color: var(--cream-mute);
    background: var(--ink-5);
    padding: 1px 7px;
    border-radius: 10px;
    flex-shrink: 0;
    margin-left: auto;
    white-space: nowrap;
}

/* Missing-PC indicator in sidebar */
.missing-pc {
    color: #e05a3a;
    font-weight: 700;
    margin-left: 2px;
}

/* Neutralt "åbn i Produktioner"-symbol (⧉) — vises når der IKKE er et rødt fejl-tal.
   Transparent (ingen pille), dæmpet, lyser op ved hover. Klik åbner produktions-panelet. */
.group-count.gc-open {
    background: transparent;
    padding: 1px 4px;
}
.prod-open-icon {
    color: var(--cream-mute);
    opacity: 0.5;
    font-size: 13px;
    transition: opacity 0.12s ease, color 0.12s ease;
}
.group-count.gc-open:hover .prod-open-icon {
    opacity: 1;
    color: var(--accent, #e05a3a);
}


.inline-badge {
    overflow: hidden;
}

.inline-badge-inner {
    display: inline-flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 4px;
    padding: 1px 6px;
    line-height: 1.4;
    white-space: nowrap;
}

/* Dato-piller forrest i badge-labelen (start → slut), hver i egen boble + mellemrum til count-boblen */
.inline-badge-dates {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 8px;
}
.ib-date-chip {
    background: rgba(0, 0, 0, 0.45);
    border-radius: 4px;
    padding: 1px 6px;
}
.ib-date-arrow { opacity: 0.7; }

.label-row.grouped {
    padding-left: 34px;
    height: 32px;
}

.label-row.grouped.nested {
    padding-left: 46px;
}

.grid-row.group-header-row {
    height: 36px;
    background: var(--ink-3);
    position: sticky;
    top: 32px;
    z-index: 3;
}

/* Card rows (expanded computers) — thinner than default 48px */
.grid-row.card-row {
    height: 32px;
}

.card-row .booking-bar {
    height: 22px;
    top: 5px;
    font-size: 10px;
}

.card-row .booking-bar-ghost {
    height: 22px;
    top: 5px;
}

.card-row .draw-preview {
    height: 22px;
    top: 5px;
}

/* Grid area */
.grid-area {
    flex: 1;
    overflow-x: auto;
    overflow-y: auto;
    position: relative;
    background: var(--ink-2);
}

.grid-header-month-row {
    display: flex;
    height: 24px;
    min-width: 100%;
}

.grid-header-day-row {
    display: flex;
    height: 32px;
    min-width: 100%;
}

.grid-header-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--cream-mute);
    border-right: 1px solid var(--ink-5);
    flex-shrink: 0;
}

.grid-header-cell.month-cell {
    border-bottom: 1px solid var(--ink-5);
}

.grid-header-cell.today-header {
    color: var(--accent);
}

.grid-header-day-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 500;
    color: var(--cream-mute);
    border-right: 1px solid rgba(255,255,255,0.03);
    flex-shrink: 0;
}

.grid-header-day-cell.today-day {
    color: var(--accent);
    font-weight: 700;
}

.grid-header-day-cell.weekend-day {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.4);
}

.grid-cell.weekend-cell {
    background: rgba(255,255,255,0.02);
}

.grid-cell.month-divider {
    border-right: 1px solid var(--ink-5);
}

.grid-body {
    position: relative;
    min-width: 100%;
}

.grid-row {
    height: 48px;
    position: relative;
    border-bottom: 1px solid var(--ink-5);
    display: flex;
    min-width: 100%;
}

.grid-row:nth-child(even) {
    background: rgba(255,255,255,0.01);
}

.grid-cell {
    border-right: 1px solid rgba(255,255,255,0.03);
    flex-shrink: 0;
    height: 100%;
}

/* Week labels (quarter zoom) */
.grid-header-day-cell.week-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: var(--cream-dim);
    overflow: visible;
    width: auto !important;
    min-width: 14px;
    white-space: nowrap;
    z-index: 1;
    position: relative;
}

/* Crosshair */
.crosshair-line {
    display: none;
    position: absolute;
    top: 0;
    width: 1px;
    border-left: 1px dashed rgba(255,255,255,0.5);
    z-index: 4;
    pointer-events: none;
}
.crosshair-h {
    display: none;
    position: absolute;
    left: 0;
    height: 1px;
    border-top: 1px dashed rgba(255,255,255,0.5);
    z-index: 4;
    pointer-events: none;
}

/* Today line */
.today-line {
    position: absolute;
    top: 0;
    width: 2px;
    background: var(--accent);
    z-index: 50;
    pointer-events: none;
    opacity: 0.8;
}

/* Today bubble in header */
.today-bubble {
    position: fixed;
    transform: translate(-50%, -100%);
    background: var(--accent);
    color: #fff;
    border-radius: 6px 6px 0 0;
    padding: 3px 8px 2px;
    z-index: 60;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}
.today-bubble-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.2;
}
.today-bubble-time {
    font-size: 9px;
    font-weight: 500;
    line-height: 1.2;
    opacity: 0.85;
    font-variant-numeric: tabular-nums;
}

/* Booking bars */
.booking-bar {
    position: absolute;
    height: 28px;
    top: 10px;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0 8px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 1;
    transition: filter 0.15s ease, transform 0.15s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.booking-bar:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    z-index: 5;
}

.booking-bar.status-past {
    opacity: 0.5;
}

.booking-bar.status-active {
    box-shadow: 0 0 0 2px var(--accent), 0 2px 8px rgba(217,72,44,0.3);
}

.booking-bar.no-end {
    border-radius: 5px 0 0 5px;
}

/* Åben plads (frem-planlægning): hul/dæmpet bjælke over produktionens span → fremtidige
   bemandings-huller ses på tidslinjen. Baggrundsfarve (produktionens) gøres gennemsigtig. */
.member-bar--open {
    background-color: transparent !important;
    border: 1.5px dashed rgba(255,255,255,.38);
    color: var(--cream-mute, #b8b2a5) !important;
    font-style: italic;
    opacity: .85;
}
.member-bar--open:hover { opacity: 1; border-color: rgba(255,255,255,.6); }

.no-end-date {
    background-image: repeating-linear-gradient(
        135deg,
        transparent,
        transparent 6px,
        rgba(0,0,0,0.25) 6px,
        rgba(0,0,0,0.25) 10px
    ) !important;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--cream-dim);
    margin-top: 6px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    accent-color: var(--accent);
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 100;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    overflow-y: auto;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--ink-3);
    border: 1px solid var(--ink-5);
    border-radius: 12px;
    padding: 28px;
    width: 420px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    margin: auto;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--cream);
    margin-bottom: 20px;
    font-family: "Geist", system-ui, sans-serif;
}

.modal label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--cream-mute);
    margin-bottom: 6px;
    margin-top: 14px;
}

.modal label:first-of-type {
    margin-top: 0;
}

.modal input[type="text"],
.modal input[type="password"],
.modal input[type="date"],
.modal input[type="number"],
.modal select,
.modal textarea {
    width: 100%;
    background: var(--ink-2);
    border: 1px solid var(--ink-5);
    border-radius: 6px;
    padding: 8px 12px;
    color: var(--cream);
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s ease;
}

.modal input:focus,
.modal select:focus,
.modal textarea:focus {
    border-color: var(--accent);
}

.modal textarea {
    resize: vertical;
}

/* Color picker */
.color-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.15s ease;
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-swatch.active {
    border-color: var(--cream);
    box-shadow: 0 0 0 2px var(--ink-3), 0 0 0 4px var(--cream-mute);
}

/* Modal actions */
.modal-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    /* Sticky footer: knapper altid synlige selvom .modal-indhold scrolles (negative margins
       æder .modal's 28px padding → fuld bredde + klæb til bunden). bottom:-28px KOMPENSERER
       den negative margin-bottom: sticky positionerer efter MARGIN-boksen, så bottom:0 ville
       få footeren til at svæve 28px over modal-bunden (indhold synligt nedenunder). */
    position: sticky;
    bottom: -28px;
    margin: 24px -28px -28px;
    padding: 14px 28px;
    background: var(--ink-3);
    border-top: 1px solid var(--ink-5);
    z-index: 2;
}

.modal-actions-right {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid var(--ink-5);
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.15s ease;
}

.btn-cancel {
    background: var(--ink-4);
    color: var(--cream-dim);
    border-color: var(--ink-5);
}

.btn-cancel:hover {
    background: var(--ink-5);
    color: var(--cream);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-hot);
    border-color: var(--accent-hot);
}

.btn-danger {
    background: transparent;
    color: var(--accent);
    border-color: var(--accent-dim);
}

.btn-danger:hover {
    background: var(--accent-dim);
    color: var(--cream);
}

/* Sekundær knap-variant — brugt på kort-modalen (📍 Vælg, ✏️ Ret, 📦 Vis i Inventory)
   men manglede en regel → faldt tilbage til bar .btn (kun kant) og så halv-usynlig.
   Dæmpet, udfyldt knap der matcher de øvrige varianter. */
.btn-secondary {
    background: var(--ink-4, rgba(255,255,255,0.05));
    color: var(--cream);
    border-color: var(--rule-2);
}
.btn-secondary:hover {
    background: var(--ink-5);
    border-color: var(--rule-1, rgba(255,255,255,0.28));
}

/* Wide modal (step 2) */
.modal-wide {
    width: 900px;
    max-width: 95vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

/* Step indicator */
.step-indicator {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--cream-mute);
    margin-bottom: 4px;
}

/* Form row (side-by-side date fields) */
.form-row {
    display: flex;
    gap: 12px;
}
.form-col {
    flex: 1;
}

/* Picker header */
.picker-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.picker-counter {
    font-size: 14px;
    font-weight: 700;
    color: var(--cream);
    white-space: nowrap;
}

.picker-search {
    flex: 1;
    background: var(--ink-2);
    border: 1px solid var(--ink-5);
    border-radius: 6px;
    padding: 6px 12px;
    color: var(--cream);
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s ease;
}

.picker-search:focus {
    border-color: var(--accent);
}

/* Picker table wrapper */
.picker-table-wrap {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    border: 1px solid var(--ink-5);
    border-radius: 8px;
    margin-bottom: 16px;
}

/* Picker table */
.picker-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.picker-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

.picker-table th {
    background: var(--ink-4);
    color: var(--cream-mute);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 12px;
    text-align: left;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid var(--ink-5);
    white-space: nowrap;
    transition: color 0.15s ease;
}

.picker-table th:hover {
    color: var(--cream);
}

.picker-table th.sort-asc::after {
    content: " \25B2";
    font-size: 9px;
}

.picker-table th.sort-desc::after {
    content: " \25BC";
    font-size: 9px;
}

.picker-th-check {
    width: 40px;
    text-align: center !important;
}

.picker-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--ink-5);
    color: var(--cream);
}

.picker-table td:first-child {
    text-align: center;
}

.picker-table tr {
    transition: background 0.1s ease;
}

.picker-table tbody tr {
    cursor: pointer;
}

.picker-table tbody tr:hover {
    background: var(--ink-4);
}

.picker-table tbody tr.picker-selected {
    background: rgba(74, 144, 217, 0.15);
}

.picker-table tbody tr.picker-occupied {
    opacity: 0.5;
}

.picker-table tbody tr.picker-occupied.picker-selected {
    opacity: 0.8;
}

.picker-table input[type="checkbox"] {
    accent-color: var(--accent);
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.picker-availability-busy {
    font-size: 12px;
    color: var(--cream-mute);
    font-style: italic;
}

/* Error toast */
.error-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--accent-dim);
    border: 1px solid var(--accent);
    color: var(--cream);
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    z-index: 200;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Pending changes bar */
.pending-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 32px;
    background: rgba(212, 163, 74, 0.15);
    border: 1px solid rgba(212, 163, 74, 0.4);
    border-radius: 8px;
    margin: 0 32px;
    font-size: 13px;
    font-weight: 600;
    color: #d4a34a;
    z-index: 1;
    position: relative;
}

.pending-bar .btn {
    padding: 4px 14px;
    font-size: 12px;
}

.pending-bar .pending-confirm {
    margin-left: auto;
}

/* Resize handles */
.resize-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 8px;
    cursor: col-resize;
    z-index: 2;
    border-radius: 3px;
}

.resize-handle-left {
    left: 0;
}

.resize-handle-right {
    right: 0;
}

.resize-handle:hover,
.resize-handle.active {
    background: rgba(255, 255, 255, 0.25);
}

/* Selected booking */
.booking-bar.selected {
    box-shadow: 0 0 0 2px var(--cream), 0 0 0 4px rgba(255, 248, 230, 0.3) !important;
    z-index: 6;
}

/* Dragging booking */
.booking-bar.dragging {
    opacity: 0.85;
    z-index: 10 !important;
    cursor: grabbing;
    transition: none;
}

/* Ghost bar (original position during drag) */
.booking-bar-ghost {
    position: absolute;
    height: 28px;
    top: 10px;
    border-radius: 5px;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    background: transparent !important;
    pointer-events: none;
    z-index: 0;
    box-shadow: none;
}

/* Pending bar visual */
.booking-bar.pending {
    border: 2px dashed rgba(255, 255, 255, 0.5);
    box-sizing: border-box;
}

/* Overlap warning during drag */
.booking-bar.overlap-warning {
    box-shadow: 0 0 0 2px #d9482c, 0 0 12px rgba(217, 72, 44, 0.5) !important;
}

/* Draw preview rectangle */
.draw-preview {
    position: absolute;
    top: 10px;
    height: 28px;
    border-radius: 5px;
    background: rgba(74, 144, 217, 0.3);
    border: 2px dashed rgba(74, 144, 217, 0.6);
    pointer-events: none;
    z-index: 5;
}

.badge-drag-preview {
    top: 6px;
    height: 24px;
}

/* Body class during drag */
body.timeline-dragging {
    cursor: grabbing !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

body.timeline-dragging *:not(.resize-handle) {
    cursor: grabbing !important;
}

/* Timeline context menu (duplicated from board.css for standalone macOS use) */
.timeline-context-menu {
    position: fixed;
    z-index: 200;
    background: var(--ink-3);
    border: 1px solid var(--ink-5);
    border-radius: 10px;
    padding: 6px 0;
    min-width: 160px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.timeline-context-menu .context-item {
    padding: 8px 14px;
    font-family: "Geist", system-ui, sans-serif;
    font-size: 13px;
    color: var(--cream-dim);
    cursor: pointer;
}

.timeline-context-menu .context-item:hover {
    background: var(--ink-4);
    color: var(--cream);
}

.timeline-context-menu .context-danger {
    color: var(--accent);
}

.timeline-context-menu .context-danger:hover {
    background: var(--accent);
    color: #fff8f3;
}

.timeline-context-menu .context-separator {
    height: 1px;
    background: var(--ink-5);
    margin: 4px 0;
}

/* Prod row for draw-to-create */
.grid-row.prod-row {
    cursor: crosshair;
}

/* Empty state */
.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--cream-faint);
    font-size: 14px;
    font-style: italic;
}

/* Inline overview badges (collapsed production groups) */
.inline-overview-row {
    height: 36px;
    position: relative;
    background: var(--ink-3);
}

.inline-badge {
    position: absolute;
    top: 6px;
    height: 24px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    opacity: 0.85;
    cursor: grab;
    box-sizing: border-box;
    /* Issue B: venstrestil label i bjælken (i stedet for midtpunkt), så info-bokse
       flugter ved bjælkens venstrekant frem for at "danse" ved hver midte. */
    justify-content: flex-start;
}

/* Issue C: hover-highlight hele footer-band-rækken (label + alle uge-celler),
   så man kan følge en model-række på tværs af ugerne. Kun baggrund/box-shadow
   (ingen borders) → intet reflow, scroll-sync bevares. */
.footer-row:hover { background: rgba(255, 255, 255, 0.05); }
.footer-row:hover .summary-footer-label {
    background: rgba(255, 255, 255, 0.09);
    color: var(--cream);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.footer-row:hover .summary-footer-grid { background: rgba(255, 255, 255, 0.035); }
.footer-row:hover .footer-toggle-chevron { opacity: 1; }

.inline-badge:active {
    cursor: grabbing;
}

/* Summary footer */
.summary-footer-label {
    width: 280px;
    min-width: 120px;
    height: 36px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    font-size: 12px;
    font-weight: 700;
    color: var(--cream);
    background: var(--ink-3);
    border-right: 1px solid var(--ink-5);
    box-sizing: border-box;
}
/* Navn + antal som separate spans: på desktop sidder de bare ved siden af hinanden
   (flex kollapser whitespace mellem items → antal-spanet giver selv sin lille venstre-margin).
   På mobil (se @media) vokser navnet + ellipser, mens antallet forbliver pinnet til højre. */
.summary-footer-label .sfl-name { min-width: 0; }
.summary-footer-label .sfl-count { flex: 0 0 auto; margin-left: 5px; font-variant-numeric: tabular-nums; }

.summary-footer-badge {
    position: absolute;
    top: 6px;
    height: 24px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: var(--ink-5);
    pointer-events: none;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    padding: 0 4px;
}
.summary-footer-badge .sfb-count { font-weight: 700; }
.summary-footer-badge .sfb-free { font-weight: 600; font-size: 10px; opacity: 0.8; }
.summary-footer-badge .sfb-deficit { color: #ffd9cc; opacity: 1; }
/* Farve-signal efter ledig kapacitet (samme sprog som version-båndet) */
.summary-footer-badge.cap-ok    { background: rgba(45, 138, 78, 0.55); }
.summary-footer-badge.cap-tight { background: rgba(212, 163, 74, 0.70); }
.summary-footer-badge.cap-over  { background: rgba(217, 72, 44, 0.85); }

/* ── Trin 3: Byg holdet (team-builder i projekt-wizard) ───────────────────── */
.team-intro {
    color: var(--cream-mute, #b8b2a5);
    font-size: 13px;
    line-height: 1.5;
    margin: 0 0 14px;
}
.team-rows-wrap { margin-bottom: 8px; }
.team-rows-head,
.team-row {
    display: grid;
    grid-template-columns: 1fr 0.85fr 1.1fr 0.95fr 0.95fr 28px;
    gap: 6px;
    align-items: center;
}
.team-rows-head {
    padding: 0 2px 6px;
    font-size: 11px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--cream-mute, #b8b2a5);
}
.team-row { margin-bottom: 8px; }
.team-row .team-name,
.team-row .team-role,
.team-row .team-pc,
.team-row .team-from,
.team-row .team-to {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    background: var(--field-bg, rgba(255,255,255,0.04));
    border: 1px solid var(--rule-2, rgba(255,255,255,0.14));
    border-radius: 6px;
    color: var(--cream, #efe9dd);
    font-size: 13px;
}
.team-row .team-name:focus,
.team-row .team-role:focus,
.team-row .team-pc:focus,
.team-row .team-from:focus,
.team-row .team-to:focus {
    outline: none;
    border-color: var(--accent, #c8a86a);
}
.team-row .team-from, .team-row .team-to { color-scheme: dark; font-size: 12px; }
.team-row .team-remove {
    background: transparent;
    border: none;
    color: var(--cream-mute, #b8b2a5);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    border-radius: 6px;
}
.team-row .team-remove:hover { color: var(--danger, #d9482c); }
.team-add-btn { margin-top: 4px; }

/* ── Mobil (smalle skærme): smal venstre "Computer"-kolonne så selve tidslinjen får
   plads, + momentum-scroll. På desktop/iPad uændret. Placeret sidst så @media vinder
   over basis-reglerne (samme specificitet → kilde-rækkefølge afgør; !important slår
   også JS-sat inline-bredde fra resize-håndtaget). ── */
@media (max-width: 600px) {
    .labels-column,
    .date-header-label,
    .summary-footer-label {
        width: 140px !important;
        min-width: 140px !important;
    }
    /* Drag-resize af kolonnen giver ikke mening på touch — skjul håndtaget */
    .labels-resize-handle { display: none; }
    /* Glat momentum-scroll i grid'et + scroll må IKKE chaine op i panelet
       (ellers panorerer hele viewet væk når man scroller til kanten) */
    .grid-area {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    /* Kun grid'et må scrolle vandret — panelet selv skal stå fast */
    .panel { overflow-x: hidden; }
    /* Toolbar-knapperne ombrydes i stedet for at gøre panelet bredere end skærmen */
    .toolbar {
        flex-wrap: wrap;
        padding: 8px 12px;
        gap: 6px;
    }
    .toolbar-spacer { display: none; }
    .toolbar-label { min-width: 130px; font-size: 12px; }
    .tool-btn { font-size: 12px; padding: 5px 8px; }
    /* Zoom-gruppen: kompakt + hel bredde på mobil */
    .zoom-group { order: 10; flex: 1 1 100%; display: flex; justify-content: stretch; }
    .zoom-group .tool-btn { flex: 1; text-align: center; }
    /* Søgefeltet fyldes ud */
    .board-search-wrap { order: 9; flex: 1 1 100%; }
    .board-search-wrap .board-search { width: 100%; box-sizing: border-box; }
    /* Timeline-header kompakt */
    .timeline-header { padding: 10px 12px 6px; }
    .timeline-header h1 { font-size: 18px; }
    .timeline-header h1 em { display: none; } /* "/ Timeline" skjules */

    /* Genvind de 64px containeren spildte på side-margins (32px×2) → tidslinjen får
       plads. Kun 8px luft til kanten på telefon. */
    .timeline-container { margin-left: 8px; margin-right: 8px; }

    /* Smallere label-padding giver teksten flere px i den smalle kolonne. */
    .summary-footer-label,
    .date-header-label { padding-left: 10px; padding-right: 8px; }

    /* KERNEN i overlappet: de lange footer-band-labels ("intel-iMac V22 · Sequoia -
       11.1.1 (14)") wrappede til 2-3 linjer i 140px-kolonnen → kolliderede lodret med
       naborækker + blødte ind over grid'et. Nu: navnet holdes på ÉN linje og ellipser,
       mens ANTALLET pinnes til højre, altid synligt. Tal-kolonnen bliver dermed også
       let at skanne lodret. */
    .summary-footer-label { overflow: hidden; }
    .summary-footer-label .sfl-name {
        flex: 1 1 auto;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .summary-footer-label .sfl-count { margin-left: 6px; }

    /* Sektions-headers ("HARDWARE-EGNET · NY FORDELING …") har ingen grid-celler →
       lad dem spænde over hele rækkebredden så mest mulig tekst kan læses på én linje. */
    .footer-row.model-section-head { display: block; }
    .footer-row.model-section-head .summary-footer-label {
        width: auto !important;
        min-width: 0 !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        border-right: none;
    }
    .footer-row.model-section-head .summary-footer-grid { display: none; }
}

/* ── Per-medlem bjælke: flyt (træk midten) + forlæng/forkort (træk en ende) ──
   Genbruger .resize-handle/.booking-bar. touch-action:none er KRITISK på mobil,
   ellers stjæler grid-scrollen træk-gesten før vores pointer-handlers ser den. */
.member-bar { cursor: grab; touch-action: none; }
.member-bar.dragging { cursor: grabbing; }
.member-bar .resize-handle { touch-action: none; }
.member-bar:hover .member-resize { background: rgba(255, 255, 255, 0.18); }
.member-resize:hover,
.member-resize.active { background: rgba(255, 255, 255, 0.30); }
.member-bar.no-end .resize-handle-right { right: 0; }
