/* ============================================================
   OnAirPlan – Slot-Detailseite CSS
   ============================================================ */

/* ── Slot-Sektionen ── */
.slot-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.slot-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .75rem;
}

.slot-section-header h3 {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    margin: 0;
}

/* ── Besetzung ── */
.slot-assignments {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.slot-person-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .3rem .75rem;
    border-radius: 20px;
    font-size: .82rem;
    font-weight: 500;
}

.slot-person-chip.status-bestätigt  { background: var(--success-bg); color: var(--success); }
.slot-person-chip.status-eingetragen { background: var(--warning-bg); color: var(--warning); }
.slot-person-chip.status-angeboten  { background: var(--info-bg);    color: var(--info); }
.slot-person-chip.status-abgelehnt  { background: var(--danger-bg);  color: var(--danger); }

.chip-remove {
    background: none;
    border: none;
    cursor: pointer;
    font-size: .75rem;
    opacity: .5;
    padding: 0;
    margin-left: .2rem;
    line-height: 1;
}
.chip-remove:hover { opacity: 1; }

/* ── Laufliste ── */
.rundown-list {
    display: flex;
    flex-direction: column;
    gap: .3rem;
}

.rundown-item {
    display: grid;
    grid-template-columns: 20px 62px auto 1fr auto auto auto;
    gap: .6rem;
    align-items: center;
    padding: .55rem .75rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color .15s, box-shadow .15s;
    cursor: default;
}

.rundown-item[draggable="true"] { cursor: grab; }
.rundown-item[draggable="true"]:active { cursor: grabbing; }

.rundown-item.dragging {
    opacity: .5;
    border-style: dashed;
}

.rundown-item.drag-over {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.rundown-drag {
    color: var(--text-muted);
    font-size: .85rem;
    cursor: grab;
    user-select: none;
}

.rundown-type-badge {
    font-size: .72rem;
    font-weight: 600;
    padding: .2rem .5rem;
    border-radius: 4px;
    white-space: nowrap;
}

.rundown-main {
    min-width: 0;
}

.rundown-title {
    font-size: .875rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.story-link {
    font-size: .75rem;
    color: var(--primary);
    margin-left: .4rem;
    font-weight: 400;
}

.rundown-notes {
    font-size: .75rem;
    color: var(--text-muted);
    margin-top: .15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rundown-duration {
    font-size: .82rem;
    color: var(--text-muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    min-width: 38px;
    text-align: right;
}

.rundown-status {
    min-width: 60px;
}

.rundown-actions {
    display: flex;
    gap: .25rem;
    opacity: 0;
    transition: opacity .15s;
}

.rundown-item:hover .rundown-actions {
    opacity: 1;
}

/* ── Story-Pool im Slot ── */
.slot-pool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: .5rem;
    margin-top: .5rem;
}

.slot-pool-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .65rem .75rem;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}

.slot-pool-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.slot-pool-card-title {
    font-size: .85rem;
    font-weight: 600;
    margin-bottom: .2rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.slot-pool-card-meta {
    font-size: .75rem;
    color: var(--text-muted);
}

/* ── Slot-Detail Header ── */
.slot-detail-header {
    display: flex;
    align-items: baseline;
    gap: .75rem;
    flex-wrap: wrap;
}

.slot-detail-date {
    font-size: .85rem;
    color: var(--text-muted);
}

/* ── Laufliste: Stunden ── */
.rundown-hours {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.rundown-hour {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .5rem .6rem .6rem;
    transition: border-color .15s, box-shadow .15s, background .15s;
}

.rundown-hour.active {
    border-color: var(--primary);
}

.rundown-hour.drag-target {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
    background: var(--surface-2);
}

.rundown-hour-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    cursor: pointer;
    user-select: none;
    margin-bottom: .35rem;
}

.rundown-hour-title {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    font-size: .92rem;
}

.rundown-hour-range {
    font-size: .78rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.rundown-hour-stats {
    display: flex;
    gap: .75rem;
    font-size: .78rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    margin-left: auto;
}

.rundown-hour-actions {
    display: flex;
    gap: .3rem;
}

.rundown-hour-bar {
    height: 4px;
    background: var(--surface-2);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: .5rem;
}

.rundown-hour-bar > div {
    height: 100%;
    transition: width .3s;
}

.rundown-hour-empty {
    font-size: .8rem;
    color: var(--text-muted);
    text-align: center;
    padding: .9rem .5rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
}

.rundown-time {
    font-size: .78rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.rundown-item.drag-over-below {
    border-color: var(--primary);
    box-shadow: 0 2px 0 0 var(--primary);
}

.rundown-item.drag-over {
    box-shadow: 0 -2px 0 0 var(--primary);
}

.slot-pool-card[draggable="true"] { cursor: grab; }

/* ── Einklappen, feste Zeiten, Slots ── */
.rundown-hour-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: .9rem;
    color: var(--text-muted);
    width: 1.4rem;
    padding: 0;
    line-height: 1;
}
.rundown-hour-toggle:hover { color: var(--text); }

.rundown-hour.collapsed .rundown-hour-header { margin-bottom: 0; }

.hour-stat-warn { color: var(--warning); font-weight: 600; }
.hour-stat-ok   { color: var(--success); }

.rundown-timeline {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    border-radius: var(--radius-sm);
    padding: .1rem;
    transition: background .15s, box-shadow .15s;
}

.rundown-timeline.drag-target,
.rundown-tray.drag-target {
    box-shadow: 0 0 0 2px var(--primary-light);
    background: var(--surface-2);
}

.rundown-gap {
    display: flex;
    justify-content: space-between;
    font-size: .74rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    padding: .15rem .75rem .15rem 2.2rem;
    border-left: 2px dotted var(--border);
    margin-left: .6rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.rundown-gap.overlap {
    color: var(--danger);
    border-left-color: var(--danger);
    font-weight: 600;
}
.rundown-gap.drag-over {
    background: var(--primary-light);
    color: var(--primary);
    border-left-color: var(--primary);
}

.rundown-item.placeholder {
    background: transparent;
    border-style: dashed;
    border-width: 1.5px;
}
.rundown-item.placeholder.drag-over {
    border-style: solid;
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: none;
}
.rundown-ph-hint {
    color: var(--text-muted);
    font-weight: 400;
}

.rundown-label {
    display: inline-block;
    font-size: .7rem;
    font-weight: 600;
    padding: .05rem .4rem;
    margin-right: .4rem;
    border-radius: 3px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    vertical-align: 1px;
}

.rundown-tray {
    margin-top: .5rem;
    padding: .35rem;
    border-radius: var(--radius-sm);
    background: var(--surface);
    display: flex;
    flex-direction: column;
    gap: .25rem;
    transition: background .15s, box-shadow .15s;
}
.rundown-tray-title {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    padding: 0 .25rem;
}
.rundown-tray-empty {
    font-size: .75rem;
    color: var(--text-muted);
    text-align: center;
    padding: .35rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
}

/* ── Verwaltung: Stundenvorlagen ── */
.modal.modal-wide { max-width: 860px; }

.tpl-preview {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
}
.tpl-chip {
    font-size: .75rem;
    padding: .1rem .45rem;
    border-radius: 3px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    white-space: nowrap;
}
.tpl-chip.slot {
    border-style: dashed;
    background: transparent;
}
.tpl-chip b {
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
    font-weight: 600;
}

.tpl-edit-head,
.tpl-edit-row {
    display: grid;
    grid-template-columns: 70px 80px 140px 1fr 70px 32px;
    gap: .4rem;
    align-items: center;
}
.tpl-edit-head {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    margin: .25rem 0 .3rem;
}
.tpl-edit-row { margin-bottom: .3rem; }
.tpl-edit-row input,
.tpl-edit-row select {
    width: 100%;
    min-width: 0;
    padding: .35rem .45rem;
    font-size: .85rem;
}
.tpl-edit-row.slot input:nth-of-type(2) { border-style: dashed; }

@media (max-width: 700px) {
    .tpl-edit-head { display: none; }
    .tpl-edit-row { grid-template-columns: 60px 1fr 1fr 32px; }
    .tpl-edit-row > :nth-child(4) { grid-column: 1 / 4; }
}

/* ── Besetzung: Annehmen / Ablehnen ── */
.asgn-request {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: .65rem .85rem;
    margin-bottom: .6rem;
    border-radius: var(--radius-sm);
    background: var(--warning-bg);
    border: 1px solid var(--warning);
    font-size: .88rem;
}
.asgn-request strong { display: block; color: var(--warning); }
.asgn-request span   { color: var(--text-muted); }

.slot-person-chip.is-me { outline: 1.5px solid currentColor; outline-offset: -1.5px; }
.slot-person-chip.status-abgelehnt { opacity: .75; }

.chip-status {
    font-size: .72rem;
    opacity: .8;
    margin-left: .15rem;
}
.chip-reason {
    font-size: .72rem;
    font-style: italic;
    opacity: .85;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chip-btn {
    background: var(--surface);
    border: 1px solid currentColor;
    color: inherit;
    border-radius: 3px;
    font-size: .72rem;
    padding: .05rem .4rem;
    margin-left: .2rem;
    cursor: pointer;
    line-height: 1.4;
}
.chip-btn:hover { background: var(--surface-2); }
.chip-btn.ok { font-weight: 700; }

/* Studio-Änderungen in der Laufliste */
.rundown-changed { font-size: .72rem; color: var(--warning); margin-top: .15rem; }
.rundown-audio { height: 28px; margin-top: .3rem; max-width: 100%; }
.rundown-item.rundown-gone .rundown-title { text-decoration: line-through; opacity: .6; }
.badge-entfaellt { background: var(--surface-2); color: var(--text-muted); text-decoration: line-through; }

/* Live-Vorrang */
.live-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
    flex-wrap: wrap;
    padding: .55rem .9rem;
    margin: .4rem 0 .8rem;
    border-radius: var(--radius-sm);
    font-size: .88rem;
}
.live-locked   { background: var(--danger-bg);  color: var(--danger);  border: 1px solid var(--danger); }
.live-override { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning); }
.live-info     { background: var(--surface-2);  color: var(--text-muted); border: 1px dashed var(--border); }

/* Verlauf */
.slot-log { display: flex; flex-direction: column; gap: .25rem; max-height: 65vh; overflow-y: auto; }
.slot-log-row {
    display: grid;
    grid-template-columns: 130px 22px 140px minmax(0, 1fr) auto;
    gap: .5rem;
    align-items: center;
    padding: .35rem .5rem;
    border-bottom: 1px solid var(--border);
    font-size: .85rem;
}
.slot-log-row.undone { opacity: .5; }
.slot-log-row.undone .slot-log-what { text-decoration: line-through; }
.slot-log-row small { text-decoration: none; display: inline-block; color: var(--text-muted); }
.slot-log-time { font-variant-numeric: tabular-nums; color: var(--text-muted); font-size: .78rem; }
.slot-log-who { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 700px) {
    .slot-log-row { grid-template-columns: 1fr auto; }
    .slot-log-time, .slot-log-via { display: none; }
}

/* „Dringend!“ in der App-Laufliste */
.rundown-urgent {
    border: 2px solid var(--danger);
    border-radius: var(--radius-sm);
    margin-bottom: .9rem;
    overflow: hidden;
}
.rundown-urgent-head {
    background: var(--danger);
    color: #fff;
    font-weight: 800;
    padding: .35rem .7rem;
    font-size: .88rem;
}
.rundown-urgent-head span { background: rgba(255,255,255,.25); border-radius: 999px; padding: 0 .45rem; margin-left: .3rem; }
.rundown-urgent-head small { font-weight: 400; opacity: .85; margin-left: .4rem; }
.rundown-urgent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .6rem;
    padding: .5rem .7rem;
    border-top: 1px solid var(--border);
    background: var(--danger-bg);
}
.rundown-urgent-dur { margin-left: .5rem; font-variant-numeric: tabular-nums; color: var(--text-muted); font-size: .85rem; }
.rundown-urgent-meta { font-size: .75rem; color: var(--text-muted); margin-top: .1rem; }
