/* Drehplanung (pc-shoot-planner)
   Shares the card, button and filter classes of the Produktions-OS; only the
   shoot-specific layout lives here. */

.rd-sp {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* The filter bar carries more controls than the Jahresplanung one, where
   `.rd-rp__search` is `flex: 1` (basis 0) and therefore collapses here. Give it
   a real basis so the field stays readable instead of shrinking to an ellipsis. */
.rd-sp .rd-rp__search {
    flex: 1 1 300px;
    min-width: 240px;
    max-width: 460px;
}

.rd-sp .rd-rp__filters {
    row-gap: 10px;
}

/* ---- KPI tiles ---- */
.rd-sp__kpis {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.rd-sp__kpi {
    background: #fff;
    border: 1px solid #e7ecf3;
    border-left: 3px solid #cbd5e1;
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rd-sp__kpi--confirmed {
    border-left-color: #16a34a;
}

.rd-sp__kpi--requested {
    border-left-color: #d97706;
}

.rd-sp__kpi--unplanned {
    border-left-color: #4a6cf7;
}

.rd-sp__kpi--overdue {
    border-left-color: #dc2626;
}

.rd-sp__kpi-value {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
}

.rd-sp__kpi-label {
    font-size: 12px;
    color: #64748b;
}

/* ---- Zu planen ---- */
.rd-sp__unplanned {
    display: flex;
    flex-direction: column;
}

.rd-sp__unplanned-row {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr) 150px auto auto;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    border-top: 1px solid #f1f5f9;
    font-size: 13px;
}

.rd-sp__unplanned-row.is-risk {
    background: #fff7f7;
}

.rd-sp__unplanned-title {
    font-weight: 600;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rd-sp__unplanned-meta,
.rd-sp__unplanned-release {
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rd-sp__risk-badge {
    background: #fee2e2;
    color: #b91c1c;
    border-radius: 999px;
    padding: 2px 9px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.rd-sp__risk-badge--reshoot {
    background: #fef3c7;
    color: #b45309;
}

/* Drehprotokoll */
.rd-sp__protocol {
    display: flex;
    flex-direction: column;
}

.rd-sp__protocol-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid #f1f5f9;
    font-size: 13px;
}

.rd-sp__protocol-head {
    grid-column: 1 / -1;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.rd-sp__protocol-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    color: #1e293b;
}

.rd-sp__protocol-effect {
    flex: none;
    font-size: 11px;
    color: #94a3b8;
}

.rd-sp__protocol-effect--done {
    color: #16a34a;
}

.rd-sp__protocol-effect--reshoot {
    color: #b45309;
}

.rd-sp__protocol-choice {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.rd-sp__result {
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
    padding: 3px 12px;
    font-family: inherit;
    font-size: 12px;
    color: #64748b;
    cursor: pointer;
}

.rd-sp__result:hover:not(:disabled) {
    border-color: #cbd5e1;
}

.rd-sp__result--done.is-active {
    border-color: #16a34a;
    background: #16a34a;
    color: #fff;
}

.rd-sp__result--reshoot.is-active {
    border-color: #f59e0b;
    background: #f59e0b;
    color: #fff;
}

.rd-sp__result--open.is-active {
    border-color: #94a3b8;
    background: #f1f5f9;
    color: #475569;
}

.rd-sp__protocol-row input[type="text"] {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px 9px;
    font-size: 12px;
    width: 100%;
}

.rd-sp__protocol-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    padding: 12px 14px;
    border-top: 1px solid #f1f5f9;
}

.rd-sp__protocol-foot label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}

.rd-sp__protocol-foot input {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px 9px;
    font-size: 13px;
    font-weight: 400;
}

.rd-sp__protocol-debrief {
    flex: 1 1 260px;
}

@media (max-width: 1400px) {
    .rd-sp__protocol-row {
        grid-template-columns: minmax(0, 1fr) 130px;
    }

    .rd-sp__protocol-row input {
        grid-column: 1 / -1;
    }
}

/* ---- Week list ---- */
.rd-sp__weeks {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rd-sp__week-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 8px;
}

.rd-sp__week-count {
    font-size: 12px;
    font-weight: 500;
    color: #94a3b8;
}

.rd-sp__week-days {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.rd-sp__course-name {
    display: block;
    color: #1e293b;
    font-size: 12px;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rd-sp__day-courses-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.rd-sp__day {
    display: flex;
    flex-direction: column;
    gap: 7px;
    text-align: left;
    background: #fff;
    border: 1px solid #e7ecf3;
    border-left: 4px solid #cbd5e1;
    border-radius: 12px;
    padding: 12px 14px;
    cursor: pointer;
}

.rd-sp__day:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
}

.rd-sp__day--confirmed {
    border-left-color: #16a34a;
}

.rd-sp__day--requested {
    border-left-color: #d97706;
}

.rd-sp__day--shot,
.rd-sp__day--done {
    border-left-color: #6c5db6;
}

.rd-sp__day--moved {
    border-left-color: #0ea5e9;
}

.rd-sp__day--cancelled {
    border-left-color: #94a3b8;
    opacity: 0.6;
}

.rd-sp__day-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.rd-sp__day-date {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

.rd-sp__day-title {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.3;
}

.rd-sp__day-meta,
.rd-sp__day-courses {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    font-size: 12px;
    color: #64748b;
}

.rd-sp__badge {
    border-radius: 999px;
    padding: 2px 9px;
    font-size: 11px;
    font-weight: 700;
    background: #e2e8f0;
    color: #475569;
    white-space: nowrap;
}

.rd-sp__badge--confirmed {
    background: #dcfce7;
    color: #15803d;
}

.rd-sp__badge--requested {
    background: #fef3c7;
    color: #b45309;
}

.rd-sp__badge--shot,
.rd-sp__badge--done {
    background: #ede9fe;
    color: #6d28d9;
}

.rd-sp__badge--moved {
    background: #e0f2fe;
    color: #0369a1;
}

.rd-sp__badge--cancelled {
    background: #f1f5f9;
    color: #64748b;
}

/* Status badge in the detail header doubles as the status picker. */
.rd-sp__status-select {
    appearance: none;
    border: 0;
    padding: 4px 24px 4px 11px;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2364748b' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 9px center;
    align-self: flex-start;
}

.rd-sp__status-select:disabled {
    cursor: default;
    opacity: .7;
}

.rd-sp__day-prep {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #64748b;
}

.rd-sp__day-prep.is-overdue {
    color: #b91c1c;
    font-weight: 600;
}

.rd-sp__prep-bar {
    flex: 1 1 auto;
    height: 5px;
    border-radius: 999px;
    background: #eef2f7;
    overflow: hidden;
}

.rd-sp__prep-fill {
    height: 100%;
    background: var(--sp-type, #4a6cf7);
}

.rd-sp__day-crew {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.rd-sp__crew-chip {
    background: #eef2ff;
    color: #4338ca;
    border-radius: 999px;
    padding: 1px 8px;
    font-size: 11px;
}

.rd-sp__crew-empty {
    font-size: 11px;
    color: #cbd5e1;
}

/* ---- Wochenplan ---- */
.rd-sp__weekplan {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rd-sp__weeknav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rd-sp__weeknav-label {
    font-size: 13px;
    font-weight: 700;
    color: #334155;
}

.rd-sp__weekgrid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    align-items: start;
}

.rd-sp__weekcell {
    background: #fff;
    border: 1px solid #e7ecf3;
    border-radius: 12px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 120px;
}

.rd-sp__weekcell.is-weekend {
    background: #fafbfc;
}

.rd-sp__weekcell.is-today {
    border-color: #4a6cf7;
    box-shadow: 0 0 0 1px #4a6cf7 inset;
}

.rd-sp__weekcell-head {
    font-size: 12px;
    font-weight: 700;
    color: #334155;
}

.rd-sp__weekcell-empty {
    color: #cbd5e1;
    font-size: 13px;
}

.rd-sp__weekchip {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
    background: #f8fafc;
    border: 1px solid #eef2f7;
    border-left: 3px solid #cbd5e1;
    border-radius: 8px;
    padding: 6px 8px;
    cursor: pointer;
    font-size: 11px;
    color: #64748b;
}

.rd-sp__weekchip:hover {
    border-color: #4a6cf7;
}

.rd-sp__weekchip-head {
    display: flex;
    align-items: center;
    gap: 5px;
    justify-content: space-between;
}

.rd-sp__weekchip-courses {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.rd-sp__weekchip-time {
    font-weight: 700;
    color: #334155;
}

.rd-sp__weekchip-title {
    font-weight: 600;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rd-sp__weekchip-crew {
    color: #4338ca;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 1200px) {
    .rd-sp__weekgrid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Type colours — identical to the calendar chips (.rd-cal__chip--*), so a
   podcast is amber and a video shoot is blue wherever you look. One variable
   per format feeds the card edge, the icon and the preparation bar. */
.rd-sp__type--dreh {
    --sp-type: #2563eb;
}

.rd-sp__type--podcast {
    --sp-type: #d97706;
}

.rd-sp__day.rd-sp__type--dreh,
.rd-sp__day.rd-sp__type--podcast,
.rd-sp__weekchip.rd-sp__type--dreh,
.rd-sp__weekchip.rd-sp__type--podcast {
    border-left-color: var(--sp-type);
}

.rd-sp__type-icon {
    color: var(--sp-type);
    display: inline-flex;
    vertical-align: -2px;
    margin-right: 5px;
}

/* ---- Detail ---- */
.rd-sp__detail-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.rd-sp__detail-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.rd-sp__detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.rd-sp__detail-title {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
}

.rd-sp__detail-sub {
    font-size: 13px;
    color: #64748b;
    margin-top: 2px;
}

.rd-sp__detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.rd-sp__detail-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

/* Two cards that never fill a full row on their own share one. */
.rd-sp__detail-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}

/* Every row inside brings its own 14px, so the card only frames them. */
.rd-sp--detail .rd-pos__card {
    padding: 12px 0;
}

.rd-sp--detail .rd-pos__card-head {
    margin-bottom: 6px;
    padding: 0 14px;
}

.rd-sp__hint {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    border-radius: 10px;
    padding: 9px 14px;
    font-size: 13px;
}

.rd-sp__hint--conflict {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    align-items: baseline;
}

.rd-sp__conflict {
    background: #fff;
    border-radius: 999px;
    padding: 1px 9px;
    font-size: 12px;
}

.rd-sp__empty {
    padding: 12px 14px;
    font-size: 13px;
    color: #94a3b8;
}

/* ---- Courses ---- */
.rd-sp__course {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto 28px;
    gap: 10px;
    align-items: center;
    padding: 6px 14px;
    border-top: 1px solid #f1f5f9;
    font-size: 13px;
}

.rd-sp__course-times {
    display: flex;
    align-items: center;
    gap: 2px;
    /* A long course title must not squeeze the time under the picker icon. */
    flex-shrink: 0;
}

.rd-sp__course-time {
    width: 88px;
    padding: 3px 4px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
}

.rd-sp__course-time:hover:not(:disabled) {
    border-color: #e2e8f0;
    background: #f8fafc;
}

.rd-sp__course-time:focus {
    outline: none;
    border-color: #4a6cf7;
    background: #fff;
}

.rd-sp__course-len {
    width: 48px;
    padding: 2px 4px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    font-family: inherit;
    font-size: 12px;
    color: #64748b;
    text-align: right;
}

.rd-sp__course-len:hover:not(:disabled),
.rd-sp__course-len:focus {
    border-color: #e2e8f0;
    background: #f8fafc;
    outline: none;
}

.rd-sp__saved {
    font-size: 12px;
    font-weight: 600;
    color: #16a34a;
    opacity: 0;
    transition: opacity 0.2s;
}

.rd-sp__saved.is-on {
    opacity: 1;
}

.rd-sp__photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    padding: 12px 14px;
}

/* A shoot has at most two set photos: share the row, never leave a gap. */
.rd-sp__photos--row {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
}

.rd-sp__photo {
    position: relative;
    margin: 0;
}

.rd-sp__photo-open {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: none;
    cursor: zoom-in;
}

.rd-sp__photo img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f1f5f9;
}

.rd-sp__photo-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.6);
    color: #fff;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
}

.rd-sp__photo:hover .rd-sp__photo-remove {
    opacity: 1;
}

.rd-sp__photo figcaption input {
    width: 100%;
    margin-top: 4px;
    padding: 3px 6px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    font-family: inherit;
    font-size: 11px;
    color: #475569;
}

.rd-sp__photo figcaption input:hover:not(:disabled),
.rd-sp__photo figcaption input:focus {
    border-color: #e2e8f0;
    background: #f8fafc;
    outline: none;
}

.rd-pos__btn.is-busy {
    opacity: 0.6;
    pointer-events: none;
}

.rd-sp__course-title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    min-width: 0;
    padding: 0;
    border: none;
    background: none;
    font: inherit;
    text-align: left;
    color: #1e293b;
    cursor: pointer;
}

.rd-sp__course-title:hover {
    color: #4a6cf7;
}

/* Format and target group of the course, so the set knows what it is shooting. */
.rd-sp__course-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.rd-sp__course-format {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    white-space: nowrap;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

.rd-sp__course-meta {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
}

.rd-sp__course-remove {
    border: none;
    background: transparent;
    color: #cbd5e1;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
}

.rd-sp__course-remove:hover {
    color: #dc2626;
}

.rd-sp__add {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 14px;
    border-top: 1px solid #f1f5f9;
}

.rd-sp__add-hit {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    color: #334155;
    cursor: pointer;
}

.rd-sp__add-hit-meta {
    font-size: 11px;
    color: #94a3b8;
}

.rd-sp__add-hit:hover {
    border-color: #4a6cf7;
    color: #4a6cf7;
}

/* ---- Referent appearance ---- */
.rd-sp__refinfo {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
    padding: 12px 14px;
}

.rd-sp__refinfo label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}

.rd-sp__refinfo input,
.rd-sp__refinfo select {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 7px 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 400;
    color: #1e293b;
}

.rd-sp__refinfo-wide {
    grid-column: 1 / -1;
}

/* ---- "which courses were shot?" dialog ---- */
.rd-sp__shotlist {
    display: flex;
    flex-direction: column;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.rd-sp__shotpick {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
}

.rd-sp__shotpick+.rd-sp__shotpick {
    border-top: 1px solid #f1f5f9;
}

.rd-sp__shotpick-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #1e293b;
}

.rd-sp__shotpick-meta {
    font-size: 11px;
    color: #94a3b8;
}

.rd-sp__shotnote {
    font-size: 12px;
    color: #64748b;
}

/* ---- Documentation of the shoot day ---- */
.rd-sp__docu {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 14px;
}

.rd-sp__docu-entry {
    border-left: 2px solid #e2e8f0;
    padding-left: 10px;
}

.rd-sp__docu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.rd-sp__docu-meta {
    font-size: 11px;
    color: #94a3b8;
}

.rd-sp__docu-del {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: none;
    color: #cbd5e1;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
}

.rd-sp__docu-del:hover {
    color: #dc2626;
}

.rd-sp__docu-text {
    font-size: 13px;
    color: #1e293b;
}

.rd-sp__docu-add {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.rd-sp__docu-add textarea {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 7px 10px;
    font-family: inherit;
    font-size: 13px;
    color: #1e293b;
    resize: vertical;
}

/* ---- Referent picker ---- */
.rd-sp__referent {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rd-sp__ref-new {
    text-align: left;
    border: 1px dashed #cbd5e1;
    background: none;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    color: #64748b;
    cursor: pointer;
}

.rd-sp__ref-new:hover {
    border-color: #4a6cf7;
    color: #4a6cf7;
}

.rd-sp__ref-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 10px;
    margin-top: 4px;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}

/* The checkbox labels keep their inline layout, the field labels stack. */
.rd-sp__ref-form label:not(.rd-sp__newcourse-zgpick) {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}

.rd-sp__ref-form input:not([type="checkbox"]),
.rd-sp__ref-form select {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 7px 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 400;
    color: #1e293b;
    background: #fff;
}

.rd-sp__ref-error {
    font-size: 12px;
    color: #dc2626;
}

.rd-sp__ref-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Logistics is filled in place, so the fields only show their frame on demand. */
.rd-sp__logi-input {
    width: 100%;
    padding: 3px 6px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    font-family: inherit;
    font-size: 13px;
    color: #1e293b;
}

.rd-sp__logi-input:hover:not(:disabled),
.rd-sp__logi-input:focus {
    border-color: #e2e8f0;
    background: #f8fafc;
    outline: none;
}

/* Referent contract card: filed document + Drive link. */
.rd-sp__contract-file {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
}

.rd-sp__contract-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #2563eb;
    font-size: 13px;
    text-decoration: none;
}

.rd-sp__contract-name:hover {
    text-decoration: underline;
}

.rd-sp__contract-link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
    padding: 0 14px;
}

.rd-sp__contract-link-label {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}

.rd-sp__contract-link-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Aligns the URL text with the label and the filename above it. */
.rd-sp__contract-input {
    flex: 1;
    min-width: 0;
    padding-left: 0;
}

.rd-sp__contract-open {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    color: #2563eb;
    text-decoration: none;
    font-size: 15px;
}

.rd-sp__contract-open:hover {
    background: #eff6ff;
}

.rd-sp__newcourse-label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}

.rd-sp__newcourse-zg {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
}

.rd-sp__newcourse-zgpick {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 400;
    color: #334155;
    cursor: pointer;
}

/* ---- Tasks ---- */
.rd-sp__tasks {
    display: flex;
    flex-direction: column;
}

.rd-sp__task {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    align-items: center;
    padding: 5px 14px;
    border-top: 1px solid #f1f5f9;
    font-size: 13px;
}

/* Remove button only on hover, so the list stays calm. */
.rd-sp__task .rd-sp__course-remove {
    opacity: 0;
}

.rd-sp__task:hover .rd-sp__course-remove,
.rd-sp__task .rd-sp__course-remove:focus-visible {
    opacity: 1;
}

.rd-sp__task-check {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    cursor: pointer;
}

.rd-sp__task.is-done .rd-sp__task-title {
    color: #94a3b8;
    text-decoration: line-through;
}

.rd-sp__task-title {
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rd-sp__task-due {
    width: 130px;
    padding: 3px 6px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    font-family: inherit;
    font-size: 12px;
    color: #64748b;
}

.rd-sp__task-due:hover:not(:disabled),
.rd-sp__task-due:focus {
    border-color: #e2e8f0;
    background: #f8fafc;
    outline: none;
}

/* ---- Crew / logistics rows ---- */
.rd-sp__crew,
.rd-sp__logistics {
    display: flex;
    flex-direction: column;
}

.rd-sp__crew-row {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 5px 14px;
    border-top: 1px solid #f1f5f9;
    font-size: 13px;
    color: #1e293b;
}

.rd-sp__crew-role {
    color: #64748b;
    font-size: 12px;
}

/* A multi-line notes field: label aligns to the top, box is resizable. */
.rd-sp__crew-row--notes {
    align-items: start;
}

.rd-sp__logi-textarea {
    min-height: 64px;
    resize: vertical;
    line-height: 1.4;
    font-family: inherit;
}

/* Unverträglichkeiten: option chips + a free-text row. */
.rd-sp__crew-row--intol {
    align-items: start;
}

.rd-sp__intol {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.rd-sp__intol-opts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.rd-sp__intol-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    user-select: none;
}

.rd-sp__intol-chip input {
    margin: 0;
}

.rd-sp__intol-chip.is-on {
    border-color: #6366f1;
    background: #eef2ff;
    color: #3730a3;
}

/* ---- Editor form ---- */
.rd-sp__form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 12px 0;
}

.rd-sp__form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}

.rd-sp__form input,
.rd-sp__form select,
.rd-sp__form textarea {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 13px;
    font-weight: 400;
    color: #1e293b;
    font-family: inherit;
}

.rd-sp__form-wide {
    grid-column: 1 / -1;
}

/* Chips inside the dialog form must not inherit the stacked, bold form-label style. */
.rd-sp__form .rd-sp__intol-chip {
    flex-direction: row;
    font-weight: 400;
}

.rd-sp__form .rd-sp__intol-chip input {
    padding: 0;
    border: 0;
}

.rd-sp__intol-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rd-sp__form--c2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rd-sp__form--c3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Keeps the dialog from jumping between the short and the long steps. */
.rd-sp__form--wizard {
    align-content: start;
}

/* A long editor form must scroll inside the dialog, not past the screen. */
pc-shoot-planner .rd-pos__wish-modal {
    max-height: 88vh;
}

pc-shoot-planner .rd-pos__wish-modal .rd-sp__form {
    min-height: 0;
    overflow-y: auto;
}

pc-shoot-planner .rd-pos__wish-modal .rd-sp__form--wizard {
    min-height: 132px;
}

.rd-sp__wiz-steps {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.rd-sp__wiz-dot {
    width: 22px;
    height: 4px;
    border-radius: 2px;
    background: #e2e8f0;
}

.rd-sp__wiz-dot.is-done {
    background: #94a3b8;
}

.rd-sp__wiz-dot.is-active {
    background: #4a6cf7;
}

.rd-sp__wiz-count {
    margin-left: 6px;
    font-size: 11px;
    color: #94a3b8;
}

.rd-sp__wiz-blocker {
    margin-top: -4px;
    font-size: 12px;
    color: #b45309;
}

.rd-sp__refhist {
    margin: -2px 0 6px;
    padding: 0 14px;
    font-size: 11px;
    color: #64748b;
}

.rd-sp__refhist--new {
    color: #b45309;
    font-weight: 600;
}

.rd-sp__workload {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rd-sp__workload-row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) 100px auto;
    gap: 10px;
    align-items: center;
    padding: 6px 0;
    border-top: 1px solid #f1f5f9;
    font-size: 13px;
}

.rd-sp__workload-name {
    font-weight: 600;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rd-sp__workload-roles {
    color: #64748b;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rd-sp__workload-bar {
    display: block;
    height: 6px;
    border-radius: 3px;
    background: #eef2f7;
    overflow: hidden;
}

.rd-sp__workload-bar>span {
    display: block;
    height: 100%;
    border-radius: 3px;
    background: #2563eb;
}

.rd-sp__workload-days {
    color: #475569;
    font-size: 12px;
    white-space: nowrap;
}

@media (max-width: 1100px) {
    .rd-sp__kpis {
        grid-template-columns: repeat(2, 1fr);
    }

    .rd-sp__detail-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .rd-sp__detail-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .rd-sp__form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rd-sp__unplanned-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .rd-sp__unplanned-meta,
    .rd-sp__unplanned-release {
        display: none;
    }
}

/* ---- Dark mode (Produktions-OS shell) ---- */
.rd-pos--dark .rd-sp__kpi,
.rd-pos--dark .rd-sp__day {
    background: var(--d-surface);
    border-color: var(--d-border);
}

.rd-pos--dark .rd-sp__course-name,
.rd-pos--dark .rd-sp__kpi-value,
.rd-pos--dark .rd-sp__day-date,
.rd-pos--dark .rd-sp__day-title,
.rd-pos--dark .rd-sp__detail-title,
.rd-pos--dark .rd-sp__course-format {
    background: var(--d-surface-2);
    border-color: var(--d-border);
    color: var(--d-muted);
}

.rd-pos--dark .rd-sp__course-title,
.rd-pos--dark .rd-sp__task-title,
.rd-pos--dark .rd-sp__unplanned-title,
.rd-pos--dark .rd-sp__workload-name,
.rd-pos--dark .rd-sp__crew-row {
    color: var(--d-heading);
}

.rd-pos--dark .rd-sp__kpi-label,
.rd-pos--dark .rd-sp__day-meta,
.rd-pos--dark .rd-sp__day-courses,
.rd-pos--dark .rd-sp__week-head,
.rd-pos--dark .rd-sp__detail-sub,
.rd-pos--dark .rd-sp__task-due,
.rd-pos--dark .rd-sp__refhist,
.rd-pos--dark .rd-sp__workload-roles,
.rd-pos--dark .rd-sp__workload-days,
.rd-pos--dark .rd-sp__crew-role {
    color: var(--d-muted);
}

.rd-pos--dark .rd-sp__refhist--new {
    color: #fcd34d;
}

.rd-pos--dark .rd-sp__workload-bar {
    background: var(--d-border);
}

.rd-pos--dark .rd-sp__course-time {
    color: var(--d-heading);
    color-scheme: dark;
}

.rd-pos--dark .rd-sp__course-time:hover:not(:disabled) {
    border-color: var(--d-border);
    background: var(--d-elev);
}

.rd-pos--dark .rd-sp__course-time:focus {
    background: var(--d-elev);
}

.rd-pos--dark .rd-sp__course-len {
    color: var(--d-muted);
}

.rd-pos--dark .rd-sp__protocol-title {
    color: var(--d-heading);
}

.rd-pos--dark .rd-sp__wiz-dot {
    background: var(--d-border);
}

.rd-pos--dark .rd-sp__wiz-blocker {
    color: #fcd34d;
}

.rd-pos--dark .rd-sp__task-due {
    color-scheme: dark;
}

.rd-pos--dark .rd-sp__task-due:hover:not(:disabled),
.rd-pos--dark .rd-sp__task-due:focus {
    border-color: var(--d-border);
    background: var(--d-elev);
}

.rd-pos--dark .rd-sp__protocol-row,
.rd-pos--dark .rd-sp__protocol-foot {
    border-top-color: var(--d-border);
}

.rd-pos--dark .rd-sp__result {
    border-color: var(--d-border);
    background: var(--d-elev);
    color: var(--d-muted);
}

.rd-pos--dark .rd-sp__result--open.is-active {
    background: var(--d-border);
    color: var(--d-heading);
}

.rd-pos--dark .rd-sp__course-len:hover:not(:disabled),
.rd-pos--dark .rd-sp__course-len:focus {
    border-color: var(--d-border);
    background: var(--d-elev);
}

.rd-pos--dark .rd-sp__photo img {
    border-color: var(--d-border);
    background: var(--d-elev);
}

.rd-pos--dark .rd-sp__photo figcaption input {
    color: var(--d-muted);
}

.rd-pos--dark .rd-sp__photo figcaption input:hover:not(:disabled),
.rd-pos--dark .rd-sp__photo figcaption input:focus {
    border-color: var(--d-border);
    background: var(--d-elev);
}

.rd-pos--dark .rd-sp__course,
.rd-pos--dark .rd-sp__task,
.rd-pos--dark .rd-sp__crew-row,
.rd-pos--dark .rd-sp__unplanned-row,
.rd-pos--dark .rd-sp__workload-row,
.rd-pos--dark .rd-sp__add {
    border-top-color: var(--d-border);
}

.rd-pos--dark .rd-sp__unplanned-row.is-risk {
    background: rgba(220, 38, 38, 0.12);
}

.rd-pos--dark .rd-sp__logi-input {
    color: var(--d-heading);
}

.rd-pos--dark .rd-sp__logi-input:hover:not(:disabled),
.rd-pos--dark .rd-sp__logi-input:focus {
    border-color: var(--d-border);
    background: var(--d-elev);
}

.rd-pos--dark .rd-sp__ref-form {
    background: var(--d-surface-2);
    border-color: var(--d-border);
}

.rd-pos--dark .rd-sp__shotlist,
.rd-pos--dark .rd-sp__shotpick+.rd-sp__shotpick {
    border-color: var(--d-border);
}

.rd-pos--dark .rd-sp__refinfo input,
.rd-pos--dark .rd-sp__refinfo select {
    background: var(--d-surface-2);
    border-color: var(--d-border);
    color: var(--d-heading);
}

.rd-pos--dark .rd-sp__shotpick-title {
    color: var(--d-heading);
}

.rd-pos--dark .rd-sp__ref-new {
    border-color: var(--d-border);
    color: var(--d-muted);
}

.rd-pos--dark .rd-sp__add-hit,
.rd-pos--dark .rd-sp__ref-form input,
.rd-pos--dark .rd-sp__ref-form select,
.rd-pos--dark .rd-sp__form input,
.rd-pos--dark .rd-sp__form select,
.rd-pos--dark .rd-sp__form textarea {
    background: var(--d-surface-2);
    border-color: var(--d-border);
    color: var(--d-heading);
}