/* GU-Plantafel (Bauablauf je GU-Projekt). EventCalendar-CSS wird davor eingehaengt, diese Regeln gewinnen. */
:root { --pt-wochenende: #ebe7de; --pt-heute: #fbeed9; --pt-warn: #e67700; --pt-warn-grund: #fff6d6; --pt-warn-text: #5c4400; }
@media (prefers-color-scheme: dark) {
  :root { --pt-wochenende: #252f38; --pt-heute: #33301f; --pt-warn: #ffb020; --pt-warn-grund: #3a3214; --pt-warn-text: #f5e3a6; }
}

.plantafel { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--grund); }
.pt-kopf { flex-wrap: wrap; row-gap: 6px; padding: 8px 16px; }
.pt-kopf button { padding: 5px 10px; }
.pt-zurueck { color: var(--text); font-weight: 600; white-space: nowrap; }
.pt-projekt { font: inherit; font-weight: 600; padding: 5px 8px; border: 1px solid var(--linie); border-radius: 8px;
  background: var(--grund); color: var(--text); max-width: 320px; min-width: 0; }
.pt-titel { flex: 1; min-width: 160px; color: var(--leise); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-werkzeuge { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pt-gruppe { display: inline-flex; }
.pt-gruppe > button { background: var(--flaeche); color: var(--text); border: 1px solid var(--linie); border-radius: 0; margin-left: -1px; }
.pt-gruppe > button:first-child { border-radius: 8px 0 0 8px; margin-left: 0; }
.pt-gruppe > button:last-child { border-radius: 0 8px 8px 0; }
.pt-gruppe > button[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); position: relative; }
.pt-aktionen { gap: 6px; }
.pt-aktionen > button, .pt-aktionen > button:first-child, .pt-aktionen > button:last-child { border-radius: 8px; margin: 0; }
.pt-aktionen > button#pt-neu-projekt, .pt-aktionen > button#pt-neu-gewerk { background: var(--navy); color: #fff; border-color: var(--navy); }
@media (prefers-color-scheme: dark) {
  .pt-gruppe > button[aria-pressed="true"], .pt-aktionen > button#pt-neu-projekt, .pt-aktionen > button#pt-neu-gewerk { background: #2c4a61; border-color: #2c4a61; }
}

.pt-warnungen { background: var(--pt-warn-grund); color: var(--pt-warn-text); border-bottom: 1px solid var(--pt-warn); padding: 6px 16px; font-size: 14px;
  max-height: 25vh; overflow-y: auto; }
.pt-warnungen ul { margin: 2px 0 0; padding-left: 20px; }
.pt-warnungen .link { color: inherit; padding: 1px 0; text-align: left; text-decoration: underline dotted; }

.pt-flaeche { flex: 1; min-height: 0; position: relative; padding: 8px 8px 8px; }
.pt-tafel { height: 100%; }
.pt-leer { position: absolute; top: 45%; left: 50%; transform: translate(-50%, -50%); margin: 0; max-width: 420px; text-align: center;
  color: var(--leise); background: var(--flaeche); border: 1px solid var(--linie); border-radius: 12px; padding: 16px 20px; }

/* EventCalendar an unsere Farben anpassen (hell und dunkel) */
.plantafel .ec {
  --ec-bg-color: var(--flaeche); --ec-text-color: var(--text); --ec-border-color: var(--linie);
  --ec-today-bg-color: var(--pt-heute); --ec-highlight-color: var(--pt-wochenende);
  --ec-button-bg-color: var(--flaeche); --ec-button-text-color: var(--text); --ec-button-border-color: var(--linie);
  font-size: 13px; border-radius: 10px; overflow: hidden;
}
.plantafel .ec .ec-toolbar { display: none; }
.plantafel .ec .ec-header { font-size: 12px; }
.plantafel .ec .ec-col-head time { display: flex; flex-direction: column; align-items: center; }
.plantafel .ec .ec-col-head small { color: var(--leise); font-size: 10px; line-height: 1.1; }
.plantafel .ec .ec-col-head span { font-weight: 600; line-height: 1.2; }
.plantafel .ec .ec-col-head.ec-today span { color: var(--gold); }
.plantafel .ec .ec-week-number { font-weight: 600; }
.plantafel .ec .ec-main { --ec-col-width: minmax(var(--ec-slot-width), 1fr) !important; }
.plantafel .ec .ec-sidebar { inline-size: 190px; }
.plantafel .ec .ec-col-head { padding-inline: 0; overflow: hidden; }
/* Sehr schmale Tage (3 Monate): nur montags das Datum */
.plantafel.pt-schmal .ec .ec-col-head small { visibility: hidden; }
.plantafel.pt-schmal .ec .ec-col-head:not(.ec-mon) span { visibility: hidden; }
.plantafel.pt-schmal .ec .ec-col-head.ec-mon { overflow: visible; position: relative; z-index: 1; }
.plantafel.pt-schmal .ec .ec-col-head.ec-mon span { font-size: 10px; }
.plantafel.pt-schmal .pt-balken small { display: none; }
.plantafel .ec .ec-col-group { white-space: nowrap; overflow: hidden; text-overflow: clip; }
.plantafel .ec .ec-row-head > span { flex: 1; min-width: 0; }

/* Zeilenkoepfe */
.pt-zeilenkopf { display: flex; align-items: center; gap: 8px; width: 100%; background: none; color: var(--text); padding: 4px 6px;
  text-align: left; border-radius: 6px; }
.pt-zeilenkopf:hover { background: var(--hinweis); }
.pt-punkt { flex: none; width: 12px; height: 12px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.2); }
.pt-zeilentext { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.pt-zeilentext b, .pt-zeilentext small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-zeilentext small { color: var(--leise); font-size: 11px; }
.pt-stift { color: var(--leise); visibility: hidden; }
.pt-zeilenkopf:hover .pt-stift, .pt-zeilenkopf:focus-visible .pt-stift { visibility: visible; }
@media (hover: none) { .pt-stift { visibility: visible; } }

/* Balken */
.plantafel .ec .ec-event { border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); cursor: pointer; min-height: 30px; }
.pt-balken { position: sticky; inset-inline-start: calc(var(--ec-sidebar-width) + .18em); display: flex; flex-direction: column; min-width: 0; overflow: hidden; line-height: 1.2; padding: 1px 2px; }
.pt-balken b, .pt-balken small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-balken b { font-weight: 600; }
.pt-balken small { font-size: 11px; opacity: .85; }
.plantafel .ec .ec-event.pt-geplant { background-image: repeating-linear-gradient(-45deg, rgba(255,255,255,.34) 0 5px, transparent 5px 11px);
  opacity: .85; box-shadow: inset 0 0 0 1px rgba(0,0,0,.28); }
.plantafel .ec .ec-event.pt-fertig { opacity: .5; filter: saturate(.45); }
.plantafel .ec .ec-event.pt-warn { outline: 2.5px solid var(--pt-warn); outline-offset: 1px; }
.plantafel.pt-alle .ec .ec-event { cursor: pointer; }

/* Dialoge */
.pt-dialog { border: 1px solid var(--linie); border-radius: 12px; padding: 0; width: min(520px, calc(100% - 24px));
  background: var(--flaeche); color: var(--text); box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.pt-dialog::backdrop { background: rgba(10, 20, 30, .45); }
.pt-dialog form { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 16px; }
.pt-dialog h2 { margin: 0 0 4px; font-size: 18px; color: var(--gold); }
.pt-dialog label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--leise); flex: 1; min-width: 0; }
.pt-dialog input, .pt-dialog select { font: inherit; font-size: 15px; color: var(--text); background: var(--grund);
  border: 1px solid var(--linie); border-radius: 8px; padding: 7px 9px; width: 100%; min-width: 0; }
.pt-dialog input:focus-visible, .pt-dialog select:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.pt-dialog input[type="color"] { padding: 2px; height: 38px; width: 64px; cursor: pointer; }
.pt-zwei { display: flex; gap: 12px; }
.pt-name-farbe label:last-child { flex: none; }
.pt-dialog .fehler { margin: 0; min-height: 0; }
.pt-dialog .fehler:empty, .pt-info:empty { display: none; }
.pt-info { margin: 0; font-size: 13px; color: var(--leise); }
.pt-dialog-knoepfe { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.pt-platz { flex: 1; }
.pt-zweit { background: transparent; color: var(--text); border: 1px solid var(--linie); }
.pt-loeschen { background: transparent; color: var(--fehler); border: 1px solid var(--fehler); }
@media (prefers-color-scheme: dark) { .pt-loeschen { color: #ff8a80; border-color: #ff8a80; } }

@media (max-width: 760px) {
  .pt-kopf { padding: 6px 10px; gap: 6px; }
  .pt-zurueck { padding: 4px 2px; }
  .pt-projekt { flex: 1; max-width: none; }
  .pt-titel { order: 5; flex-basis: 100%; font-size: 12px; }
  .pt-werkzeuge { order: 4; gap: 6px; }
  .pt-kopf button { padding: 5px 8px; font-size: 14px; }
  .pt-flaeche { padding: 4px; }
  .pt-warnungen { padding: 6px 10px; font-size: 13px; }
  .plantafel .ec { font-size: 12px; }
  .plantafel .ec .ec-sidebar { inline-size: 112px; }
  .pt-lang { display: none; }
  .pt-zeilenkopf { gap: 5px; padding: 2px; }
  .pt-zwei { flex-direction: column; gap: 10px; }
  .pt-name-farbe { flex-direction: row; }
}
