/* ============================================================================
   Cockpit — Planning: kop, filters, tijdlijn (Gantt) en parkeerplaats.
   Rijhoogte 38px en datums 52px: ook in js/planning-tijdlijn.js.
   ============================================================================ */

/* Kop, tellers, tabs en filters */
.pl-kop { margin-bottom: 14px; }
.pl-tellers { display: flex; gap: 8px; flex-wrap: wrap; margin-right: auto; }
.pl-teller { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 8px; border: 1px solid var(--lijn); border-radius: var(--r-pil); background: var(--kaart); font-size: 14px; font-weight: 500; }
.pl-teller b { min-width: 28px; height: 28px; padding: 0 8px; border-radius: var(--r-pil); background: var(--papier-diep); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.pl-teller--laat:not(.is-nul) b { background: var(--negatief); color: #FFFFFF; }
.pl-teller--week:not(.is-nul) b { background: var(--inkt); color: #FFFFFF; }
.pl-teller--wacht:not(.is-nul) b { background: var(--oker-diep); color: #FFFFFF; }
.pl-teller[aria-pressed="true"] { background: var(--oker-zacht); border-color: var(--oker-diep); box-shadow: inset 0 0 0 1px var(--oker-diep); }
.pl-balk { display: flex; align-items: center; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap; margin-bottom: 12px; }
.pl-balk--filters { justify-content: flex-start; gap: 8px 10px; }
.pl-balk--filters .pl-zoek input { width: 200px; }
.pl-balk--filters .pl-vink { padding: 0 4px; }
.pl-tabs, .pl-segment { display: inline-flex; padding: 3px; border-radius: var(--r-pil); background: var(--papier-diep); }
.pl-tab, .pl-segment button { min-height: 40px; padding: 0 18px; border: 0; border-radius: var(--r-pil); background: transparent; font-size: 14.5px; font-weight: 500; }
.pl-tab[aria-current], .pl-segment button[aria-pressed="true"] { background: var(--kaart); box-shadow: 0 1px 2px #163A4526; }
.pl-segment button { padding: 0 14px; font-size: 14px; }
.gt-knoppen { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gt-strook-knop[aria-pressed="true"] { background: var(--oker-zacht); border-color: var(--oker-diep); }
.pl-keuze { position: relative; }
.pl-keuze-knop { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 1px solid var(--lijn-sterk); border-radius: var(--r-pil); background: var(--kaart); font-size: 14.5px; font-weight: 500; white-space: nowrap; }
.pl-keuze-knop svg:last-child:not(:first-child) { width: 15px; height: 15px; }
.pl-keuze.is-aan .pl-keuze-knop { background: var(--oker-zacht); border-color: var(--oker-diep); }
.pl-menu { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 220px; padding: 8px; border: 1px solid var(--lijn); border-radius: var(--r-md); background: var(--kaart); box-shadow: 0 2px 4px #163A450F, 0 24px 48px -16px #163A454D; }
.pl-keuze--rechts .pl-menu { left: auto; right: 0; }
.pl-menu-vink { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border-radius: 8px; font-size: 14.5px; cursor: pointer; }
.pl-menu-knop { display: block; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 8px; background: none; text-align: left; font-size: 14.5px; white-space: nowrap; }

/* Het vak: één vak dat in twee richtingen scrolt, met vaste datums en namen */
.gt-vak { overflow: auto; overscroll-behavior: contain; max-height: max(420px, calc(100dvh - 232px)); background: var(--kaart); border-radius: var(--r-lg); box-shadow: var(--schaduw-kaart); }
.gt-binnen { position: relative; display: grid; grid-template-columns: 290px max-content; grid-template-rows: 52px auto; width: max-content; min-width: 100%; }
.gt-as, .gt-veld { display: block; fill: none; }
.gt-vak .gt-as { position: sticky; top: 0; z-index: 3; background: var(--kaart); border-bottom: 1px solid var(--lijn); }
.gt-vak .gt-veld { user-select: none; -webkit-user-select: none; }
.gt-hoek { display: flex; align-items: center; padding: 0 12px; font-size: 13.5px; font-weight: 600; position: sticky; top: 0; left: 0; z-index: 5; background: var(--kaart); border-right: 1px solid var(--lijn); border-bottom: 1px solid var(--lijn); }
.gt-links { position: sticky; left: 0; z-index: 4; background: var(--kaart); border-right: 1px solid var(--lijn); }
.gt-naam { display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 8px 0 34px; border-bottom: 1px solid var(--lijn); font-size: 13.5px; user-select: none; -webkit-user-select: none; }
.gt-naam button { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; height: 36px; padding: 0; border: 0; background: none; border-radius: var(--r-sm); text-align: left; }
.gt-naam-tekst { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gt-naam--groep { padding-left: 10px; background: var(--papier); font-size: 14.5px; font-weight: 600; cursor: grab; }
.gt-naam--taak { cursor: grab; }
.gt-naam--taak.is-klaar { color: var(--inkt-zacht); }
.gt-naam--taak.is-archief { color: var(--inkt-zacht); font-style: italic; cursor: default; }
.gt-naam--taak.is-open { background: var(--oker-zacht); }
.gt-naam--leeg button { color: var(--inkt-zacht); }
.gt-naam--leeg svg { width: 15px; height: 15px; }
.gt-invoeg { position: absolute; z-index: 6; left: 0; right: 0; height: 3px; background: var(--oker-diep); pointer-events: none; }
.gt-invoeg[hidden] { display: none; }
.gt-uitleg { margin: 12px 2px 0; font-size: 14px; color: var(--inkt-zacht); }

/* Datums en raster */
.gt-as-groot { fill: var(--inkt, #163A45); font: 600 13px 'Work Sans', sans-serif; }
.gt-as-klein { fill: var(--inkt-zacht, #4F656D); font: 400 12px 'Work Sans', sans-serif; }
.gt-as-klein.is-vandaag { fill: #845815; font-weight: 600; }
.gt-as-lijn { stroke: #DCD6C9; }
.gt-grond { fill: #FFFDF8; }
.gt-groep-band { fill: #F3F1EC; }
.gt-weekend { fill: #163A45; fill-opacity: .045; }
.gt-raster { stroke: #DCD6C9; stroke-opacity: .6; }
.gt-nu { stroke: #B07A1F; stroke-width: 2; }
.gt-nu-merk path { fill: #B07A1F; }
.gt-leeg { fill: transparent; cursor: crosshair; touch-action: none; }

/* Balken */
.gt-item { cursor: grab; }
.gt-item .gt-vlak { fill: color-mix(in srgb, var(--stroom) 22%, #FFFDF8); }
.gt-item .gt-vol { fill: color-mix(in srgb, var(--stroom) 45%, #FFFDF8); }
.gt-item .gt-rand { fill: none; stroke: var(--stroom); stroke-width: 1.5; pointer-events: none; }
.gt-item .gt-ruit { fill: var(--stroom); stroke: var(--stroom); stroke-width: 1.5; stroke-linejoin: round; }
.gt-item .gt-streep { fill: var(--stroom); }
.gt-item .gt-lijn { stroke: var(--stroom); stroke-opacity: .35; stroke-width: 1.5; }
.gt-item .gt-vang { fill: transparent; }
.gt-tekst { fill: #163A45; font: 500 12.5px 'Work Sans', sans-serif; dominant-baseline: central; pointer-events: none; }
.gt-tekst--buiten { paint-order: stroke; stroke: #FFFDF8; stroke-width: 3px; stroke-opacity: .85; stroke-linejoin: round; }
.gt-arcering { pointer-events: none; }
.gt-arcering-lijn { stroke: #163A45; stroke-width: 3; stroke-opacity: .22; }
.gt-item.is-onzeker .gt-rand, .gt-item.is-onzeker .gt-ruit { stroke-dasharray: 4 3; }
.gt-item.is-onzeker .gt-ruit { fill: color-mix(in srgb, var(--stroom) 35%, #FFFDF8); }
.gt-item.is-onzeker .gt-lijn { stroke-dasharray: 4 3; stroke-opacity: .7; }
.gt-item.is-klaar .gt-vlak, .gt-item.is-klaar .gt-vol { fill: #E8E3D8; }
.gt-item.is-klaar .gt-rand { stroke: #848A86; }
.gt-item.is-klaar .gt-ruit { fill: #E8E3D8; stroke: #848A86; }
.gt-item.is-klaar .gt-streep { fill: #848A86; }
.gt-item.is-klaar .gt-tekst { fill: #4F656D; }
.gt-item.is-laat .gt-rand { stroke: #962F3B; stroke-width: 2.5; }
.gt-item.is-laat .gt-ruit { stroke: #962F3B; stroke-width: 3; }
.gt-item.is-archief { opacity: .5; cursor: pointer; }
.gt-item.is-open .gt-rand, .gt-item.is-gekozen .gt-rand, .gt-item.is-doel .gt-rand { stroke: #845815; stroke-width: 3; stroke-dasharray: none; }
.gt-item.is-open .gt-ruit, .gt-item.is-gekozen .gt-ruit, .gt-item.is-doel .gt-ruit { stroke: #845815; stroke-width: 3; stroke-dasharray: none; }
.gt-item.is-gekozen .gt-lijn, .gt-item.is-doel .gt-lijn, .gt-item.is-open .gt-lijn { stroke: #845815; stroke-width: 3; stroke-opacity: 1; }
.gt-span { fill: none; stroke: var(--stroom); stroke-width: 2.5; stroke-opacity: .6; pointer-events: none; }
.gt-greep { fill: transparent; cursor: ew-resize; touch-action: none; }
.gt-item, .gt-punt { touch-action: none; }
.gt-punt { cursor: crosshair; opacity: 0; transition: opacity 120ms ease-out; }
.gt-punt-vang { fill: transparent; }
.gt-punt-bol { fill: #FFFDF8; stroke: #845815; stroke-width: 2; }
.gt-item:hover .gt-punt, .gt-item.is-open .gt-punt, .gt-punt:hover { opacity: 1; }
.gt-nieuwe { fill: #F4E8D0; stroke: #845815; stroke-width: 1.5; stroke-dasharray: 4 3; pointer-events: none; }
.gt-trek { fill: none; stroke: #845815; stroke-width: 2; stroke-dasharray: 5 4; pointer-events: none; }

/* Pijlen */
.gt-pijl { cursor: pointer; }
.gt-pijl-vang { fill: none; stroke: transparent; stroke-width: 12; pointer-events: stroke; }
.gt-pijl-lijn { fill: none; stroke: #848A86; stroke-width: 1.4; stroke-linejoin: round; pointer-events: none; }
.gt-pijl-kop { fill: #848A86; }
.gt-pijl-kop--fout { fill: #962F3B; }
.gt-pijl.is-fout .gt-pijl-lijn { stroke: #962F3B; stroke-width: 1.6; }
.gt-pijl:hover .gt-pijl-lijn, .gt-pijl.is-gekozen .gt-pijl-lijn { stroke-width: 3; }
.gt-pijl-menu { position: fixed; z-index: 70; width: 290px !important; padding: 14px 16px 16px !important; border: 1px solid var(--lijn); border-radius: var(--r-md); background: var(--kaart); box-shadow: 0 2px 4px #163A450F, 0 24px 48px -16px #163A454D; font-size: 14px; line-height: 1.45; }
.gt-pijl-menu p { margin: 0 0 12px; overflow-wrap: anywhere; }

/* Slepen */
.gt-sleept, .gt-sleept * { user-select: none !important; -webkit-user-select: none !important; }
.gt-sleept--opzij *, .gt-sleept--op *, .gt-sleept--groep *, .gt-sleept--kaart * { cursor: grabbing !important; }
.gt-sleept--links *, .gt-sleept--rechts * { cursor: ew-resize !important; }
.gt-sleept--punt *, .gt-sleept--nieuw * { cursor: crosshair !important; }
.gt-sleept--punt .gt-pijl-vang { pointer-events: none; }
.pl.gt-ghost { position: fixed; z-index: 80; top: 0; left: 0; width: auto; max-width: 280px; padding: 10px 14px; border-radius: var(--r-md); border: 1px solid var(--oker-diep); background: var(--oker-zacht); font-size: 14px; font-weight: 500; pointer-events: none; box-shadow: 0 12px 24px -12px #163A4566; }
.pl.gt-tip { position: fixed; z-index: 75; width: max-content; max-width: 320px; padding: 12px 14px; border-radius: var(--r-md); background: var(--kaart); border: 1px solid var(--lijn); box-shadow: 0 2px 4px #163A450F, 0 18px 36px -16px #163A454D; font-size: 13.5px; line-height: 1.4; pointer-events: none; }
.pl.gt-tip[hidden] { display: none; }
.pl.gt-tip--label { padding: 6px 12px; background: var(--inkt); border-color: var(--inkt); color: #FFFFFF; font-weight: 500; border-radius: 8px; }
.gt-tip dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 6px 0 0; }
.gt-tip dt { color: var(--inkt-zacht); }
.gt-tip dd { margin: 0; overflow-wrap: anywhere; }
.pl.gt-tip--gsm { left: 16px !important; right: 16px; top: auto !important; bottom: 16px; width: auto; max-width: none; pointer-events: auto; }

/* Parkeerplaats */
.pl-parkeer { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px 20px; align-items: start; }
.pl-parkeer-groep { display: grid; gap: 10px; align-content: start; }
.pl-parkeer-groep h2 { display: flex; align-items: center; gap: 9px; margin: 0; min-height: 36px; font: 600 16px/1.3 var(--font-tekst); }
.pl-kaart { display: grid; gap: 6px; padding: 12px 16px 14px; border-radius: var(--r-md); background: var(--kaart); box-shadow: var(--schaduw-kaart); touch-action: pan-y; }
.pl-kaart[data-kaart] { cursor: grab; user-select: none; -webkit-user-select: none; }
.pl-kaart.is-archief { opacity: .65; }
.pl-kaart-titel { display: flex; gap: 8px; align-items: center; min-height: 32px; padding: 0; border: 0; background: none; border-radius: var(--r-sm); text-align: left; font-size: 15px; font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.pl-kaart p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--inkt-zacht); overflow-wrap: anywhere; }
.pl-kaart-sub { font-size: 13px; color: var(--inkt-zacht); }
.pl-kaart-nieuw { display: flex; align-items: center; gap: 8px; padding: 0 14px; min-height: 48px; border: 1.5px dashed var(--lijn-sterk); border-radius: var(--r-md); color: var(--inkt-zacht); }
.pl-kaart-nieuw input { flex: 1; min-width: 0; min-height: 44px; border: 0; background: transparent; font-size: 16px; color: var(--inkt); border-radius: 8px; padding: 0 6px; }
.pl-kaart-nieuw input::placeholder { color: var(--inkt-zacht); opacity: 1; }
.pl-strook { margin-top: 14px; padding: 14px 18px 18px; border-radius: var(--r-lg); background: var(--papier-diep); }
.pl-strook-uitleg { margin: 0 0 10px; font-size: 14px; color: var(--inkt-zacht); }
.pl-strook-kaarten { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.pl-strook-kaarten .pl-kaart { flex: 0 0 220px; align-content: start; border-top: 4px solid var(--stroom); }
.pl-strook-kaarten .pl-kaart p { display: none; }
.pl:has(.pl-strook) .gt-vak { max-height: max(340px, calc(100dvh - 420px)); }

@media (hover: hover) and (pointer: fine) {
  .pl-teller:hover, .pl-keuze-knop:hover { border-color: var(--inkt); }
  .pl-menu-vink:hover, .pl-menu-knop:hover { background: var(--papier); }
  .gt-naam--taak:not(.is-open):hover { background: var(--papier); }
}
@media (max-width: 1280px) { .gt-binnen { grid-template-columns: 240px max-content; } }

/* Gsm: alleen-lezen */
@media (max-width: 760px) {
  .pl-tellers { order: 3; width: 100%; }
  .pl-teller { flex: 1 1 auto; padding: 0 12px 0 6px; font-size: 13.5px; }
  .pl-kop-acties { width: auto; }
  .pl-kop-acties .pl-btn span, .pl-kop-acties .pl-keuze-knop span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .pl-kop-acties .pl-btn, .pl-kop-acties .pl-keuze-knop { width: 44px; padding: 0; justify-content: center; position: relative; }
  .pl-tabs { width: 100%; }
  .pl-tab { flex: 1; padding: 0 6px; }
  .pl-balk--filters .pl-zoek, .pl-balk--filters .pl-zoek input { width: 100%; }
  .gt-knoppen { width: 100%; }
  .gt-strook-knop { display: none; }
  .gt-vak { max-height: 74dvh; border-radius: var(--r-md); }
  .gt-binnen { grid-template-columns: 136px max-content; }
  .gt-naam { padding-left: 10px; font-size: 13px; }
  .gt-naam--groep { padding-left: 4px; font-size: 13px; }
  .gt-naam--leeg button { visibility: hidden; }
  .gt-naam .pl-label, .gt-naam .pl-aantal { display: none; }
  .gt-naam--taak, .gt-naam--groep, .gt-item { cursor: pointer; }
  .gt-punt, .gt-greep { display: none; }
  .gt-item, .gt-leeg { touch-action: auto; }
  .pl-menu { max-width: calc(100vw - 48px); }
}

/* Afdrukken: A3 liggend, enkel de bladen */
.pl-druk { display: none; }
@page planning { size: A3 landscape; margin: 10mm; }
@media print {
  body.pl-drukt { padding: 0 !important; background: #FFFFFF !important; }
  body.pl-drukt > *:not(.pl-druk) { display: none !important; }
  body.pl-drukt .pl-druk { display: block; page: planning; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .gt-blad { break-after: page; }
  .gt-blad:last-child { break-after: auto; }
  .gt-blad-kop { display: flex; justify-content: space-between; margin: 0 0 8px; font: 400 13px 'Work Sans', sans-serif; color: #163A45; }
  .gt-druk { display: block; width: 100%; height: auto; }
  .gt-druk-naam { fill: #163A45; font: 400 11.5px 'Work Sans', sans-serif; dominant-baseline: central; }
  .gt-druk-naam--groep { font-weight: 600; }
  .gt-druk-bol { fill: var(--stroom); }
}
@media (prefers-reduced-motion: reduce) { .gt-punt { transition: none; } }
