/* ============================================================
   Rundown Panel
   ============================================================ */

.rundown-panel {
    position: fixed;
    z-index: 210; /* above task-detail-panel (200) */
    width: 300px;
    height: 100vh;
    top: 0;
    background: #f8fafc;
    border-left: 1px solid #e2e8f0;
    box-shadow: -2px 0 16px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    transition: right 0.2s ease, left 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
    overflow: hidden;
}

.rundown-hidden {
    pointer-events: none;
    opacity: 0;
    transform: translateX(100%);
}

/* ── Position variants ── */
.rundown-pos-right {
    right: 0;
}

.rundown-pos-left-of-detail {
    right: 0;
}

.rundown-pos-above-detail {
    right: 0;
    width: 480px; /* match detail panel width */
    height: 50vh;
    bottom: auto;
}

.rundown-pos-above-sidebar {
    left: 0;
    right: auto;
    height: 50vh;
    border-left: none;
    border-right: 1px solid #e2e8f0;
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.06);
}

.rundown-pos-float {
    right: auto;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    height: auto;
    max-height: 50vh;
}

.rundown-pos-float .rundown-body {
    flex: 0 1 auto;
    max-height: calc(50vh - 84px);
    min-height: 0;
}

.rundown-pos-float .rundown-resize-handle {
    display: none;
}

.rundown-dragging {
    transition: none !important;
    cursor: grabbing;
    user-select: none;
}

.rundown-resizing {
    transition: none !important;
    user-select: none;
}

/* ── Header ── */
.rundown-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-bottom: 1px solid #e2e8f0;
    background: white;
    flex-shrink: 0;
    cursor: grab;
}
.rundown-header button {
    cursor: pointer;
}

.rundown-drag-handle {
    cursor: grab;
    padding: 2px 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
}
.rundown-drag-handle:hover {
    background: #f1f5f9;
}
.rundown-dragging .rundown-drag-handle {
    cursor: grabbing;
}

.rundown-title {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
}

.rundown-btn {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.rundown-btn:hover {
    background: #f1f5f9;
    color: #475569;
}

.rundown-pos-btn {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
}
.rundown-pos-btn:hover {
    background: #eff6ff;
    color: #2563eb;
    border-color: #bfdbfe;
}

/* ── Tabs ── */
.rundown-tabs {
    display: flex;
    gap: 2px;
    padding: 6px 10px;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.rundown-tab {
    flex: 1;
    padding: 4px 8px;
    border: none;
    border-radius: 6px;
    background: transparent;
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    text-align: center;
}
.rundown-tab:hover {
    background: #f1f5f9;
    color: #1e293b;
}
.rundown-tab.active {
    background: #3b82f6;
    color: white;
}

/* ── Body ── */
.rundown-body {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;
}

/* ── Task row ── */
.rundown-task-row {
    font-size: 12px;
}

/* ── Group ── */
.rundown-group:last-child {
    margin-bottom: 0;
}

/* ── Resize handle (top-right) ── */
.rundown-resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    width: 16px;
    height: 16px;
    cursor: n-resize;
    z-index: 10;
}
.rundown-resize-handle::after {
    content: '';
    position: absolute;
    top: 3px;
    right: 3px;
    width: 6px;
    height: 6px;
    border-top: 2px solid #cbd5e1;
    border-right: 2px solid #cbd5e1;
    border-radius: 0 2px 0 0;
}
.rundown-resize-handle:hover::after {
    border-color: #64748b;
}

/* ── Position menu ── */
.rundown-pos-menu {
    position: absolute;
    top: 40px;
    right: 36px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 20;
    padding: 4px;
    min-width: 180px;
}

.rundown-pos-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    background: transparent;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}
.rundown-pos-menu-item:hover {
    background: #f1f5f9;
}

/* ── Scrollbar ── */
.rundown-body::-webkit-scrollbar {
    width: 5px;
}
.rundown-body::-webkit-scrollbar-track {
    background: transparent;
}
.rundown-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
.rundown-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
