:root {
    --ros-bg: #000;
    --ros-panel: #151515;
    --ros-border: #9b9b9b;
    --ros-muted: #8c8c8c;
    --ros-text: #cfcfcf;
    --ros-green: #26d366;
    --ros-orange: #ff8600;
    --ros-red: #ff2b2b;
}

body {
    min-height: 100vh;
    background: #0b0b0d;
}

.app-shell {
    min-height: 100vh;
}

.sidebar {
    width: 270px;
    background: #111217;
    border-right: 1px solid rgba(255,255,255,.08);
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #ff8600, #7a3cff);
    color: white;
}

.nav-pills .nav-link {
    color: #c7c7c7;
    border-radius: 12px;
    border: 0;
}

.nav-pills .nav-link.active {
    background: #ff8600;
    color: #101010;
    font-weight: 700;
}

.login-bg {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(255,134,0,.22), transparent 34rem),
        radial-gradient(circle at bottom right, rgba(122,60,255,.18), transparent 34rem),
        #0b0b0d;
}

.auth-card {
    max-width: 460px;
    width: 100%;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(20,20,24,.92);
    backdrop-filter: blur(10px);
}

.permission-badge-owner { background: #7a3cff; }
.permission-badge-admin { background: #dc3545; }
.permission-badge-manager { background: #ff8600; color: #111; }
.permission-badge-operator { background: #0dcaf0; color: #111; }
.permission-badge-viewer { background: #6c757d; }

.calendar-provider-card {
    border: 1px solid rgba(255,255,255,.1);
    background: rgba(255,255,255,.035);
    border-radius: 18px;
}

.ros-stage {
    background: var(--ros-bg);
    color: var(--ros-text);
    font-family: Consolas, "Courier New", monospace;
    min-height: calc(100vh - 3rem);
    padding: 1.25rem 2rem 2rem;
    overflow: auto;
}

.ros-stage-isolated {
    min-height: 100vh;
    padding-top: 5rem;
    border-radius: 0;
}

.ros-frame {
    max-width: 1600px;
    margin: 0 auto;
}

.ros-display-body {
    background: var(--ros-bg);
    overflow: hidden;
}

.ros-display-body .ros-frame {
    max-width: 1820px;
}

.ros-display-toolbar {
    position: fixed;
    top: .75rem;
    left: .75rem;
    right: .75rem;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: .75rem 1rem;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 1rem;
    background: rgba(10,10,10,.86);
    backdrop-filter: blur(8px);
    transition: opacity .2s ease;
}

body.is-fullscreen .ros-display-toolbar {
    opacity: 0;
    pointer-events: none;
}

body.is-fullscreen .ros-stage-isolated {
    padding: .75rem;
}

body.is-fullscreen .ros-frame {
    max-width: none;
}

.ros-strip-label {
    display: inline-block;
    margin: .75rem 0 .35rem;
    padding: .15rem .6rem;
    font-size: .95rem;
    line-height: 1;
    color: #111;
    background: #9b9b9b;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.ros-strip-label-current {
    background: var(--ros-green);
}

.ros-strip-label-next {
    background: var(--ros-orange);
}

.ros-current-grid,
.ros-adjacent-grid {
    display: grid;
    grid-template-columns: 1.15fr .55fr 2fr;
    border: 3px solid var(--ros-border);
    background: var(--ros-panel);
}

.ros-current-grid {
    grid-template-rows: 140px 140px 280px;
}

.ros-adjacent-grid {
    grid-template-rows: 92px 118px;
    width: 82%;
    margin-left: auto;
    margin-right: auto;
}

.ros-previous-grid {
    opacity: .72;
    border-color: #626262;
}

.ros-next-grid {
    border-color: var(--ros-orange);
}

.ros-cell {
    border-right: 3px solid var(--ros-border);
    border-bottom: 3px solid var(--ros-border);
    padding: .75rem 1rem;
    position: relative;
    overflow: hidden;
}

.ros-current-grid .ros-cell:nth-child(3n),
.ros-adjacent-grid .ros-cell:nth-child(3n),
.ros-adjacent-grid .ros-cell:nth-child(5) {
    border-right: 0;
}

.ros-current-grid .ros-cell:nth-last-child(-n + 2),
.ros-adjacent-grid .ros-cell:nth-last-child(-n + 2) {
    border-bottom: 0;
}

.ros-previous-grid .ros-cell {
    border-color: #626262;
}

.ros-next-grid .ros-cell {
    border-color: var(--ros-orange);
}

.ros-label {
    color: var(--ros-muted);
    font-size: 1.1rem;
    line-height: 1;
    margin-bottom: .65rem;
}

.ros-time {
    font-size: clamp(2.6rem, 4vw, 4.8rem);
    line-height: 1;
    text-align: center;
    color: #bfbfbf;
}

.ros-duration {
    font-size: clamp(2.2rem, 3.4vw, 4rem);
    line-height: 1;
    text-align: center;
    color: #bfbfbf;
}

.ros-cue-id {
    font-size: clamp(2rem, 3.6vw, 4.2rem);
    line-height: 1;
    text-align: center;
    color: #d0d0d0;
}

.ros-countdown {
    font-size: clamp(4rem, 7vw, 9rem);
    line-height: 1;
    text-align: center;
    margin-top: 2.5rem;
    color: var(--ros-green);
}

.ros-countdown.warning { color: var(--ros-orange); }
.ros-countdown.danger { color: var(--ros-red); }

.ros-description,
.ros-crew {
    font-size: clamp(.95rem, 1.15vw, 1.25rem);
    line-height: 1.45;
    white-space: pre-wrap;
}

.ros-description {
    color: #d4d4d4;
}

.ros-large-description {
    grid-column: 2 / 4;
    grid-row: 2 / 4;
}

.ros-countdown-cell {
    grid-column: 1 / 2;
    grid-row: 3 / 4;
}

.ros-cue-cell {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
}

.ros-next-description-cell {
    grid-column: span 2;
}

.ros-adjacent-grid .ros-time {
    font-size: clamp(1.55rem, 2.3vw, 2.8rem);
}

.ros-adjacent-grid .ros-duration {
    font-size: clamp(1.45rem, 2vw, 2.5rem);
}

.ros-adjacent-grid .ros-cue-id {
    font-size: clamp(1.55rem, 2.3vw, 2.8rem);
}

.ros-adjacent-grid .ros-description,
.ros-adjacent-grid .ros-crew {
    font-size: clamp(.78rem, .85vw, 1rem);
}

@media (max-width: 992px) {
    .sidebar {
        width: 100%;
        border-right: 0;
        border-bottom: 1px solid rgba(255,255,255,.08);
    }

    .app-shell {
        flex-direction: column;
    }

    .ros-stage {
        padding: .75rem;
    }

    .ros-stage-isolated {
        padding-top: 5.25rem;
    }

    .ros-current-grid,
    .ros-adjacent-grid {
        width: 100%;
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .ros-cell,
    .ros-current-grid .ros-cell:nth-child(3n),
    .ros-adjacent-grid .ros-cell:nth-child(3n),
    .ros-adjacent-grid .ros-cell:nth-child(5) {
        border-right: 0;
        border-bottom: 3px solid var(--ros-border);
    }

    .ros-large-description,
    .ros-countdown-cell,
    .ros-cue-cell,
    .ros-next-description-cell {
        grid-column: auto;
        grid-row: auto;
    }

    .ros-countdown {
        margin-top: 1rem;
    }

    .ros-display-toolbar {
        align-items: flex-start;
    }
}
