/* ============================================================
   STS Race Admin Dashboard - Frontend Admin Panel
   ============================================================ */

/* --- Reset & Base --- */
.rdct-admin-panel {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    border-radius: 10px;
    padding: 24px;
    color: #e2e8f0;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    width: 100%;
    box-sizing: border-box;
    min-height: 600px;
}

.rdct-admin-panel *, .rdct-admin-panel *::before, .rdct-admin-panel *::after {
    box-sizing: border-box;
}

/* --- Header --- */
.rdct-admin-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid #334155;
}

.rdct-admin-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rdct-admin-header h2::before {
    content: '⚙️';
    font-size: 1.3rem;
}

.rdct-admin-version {
    font-size: 0.75rem;
    color: #64748b;
    background: rgba(51, 65, 85, 0.5);
    padding: 3px 10px;
    border-radius: 12px;
}

/* Toolbar — single row for zoom + toggles */
.rdct-admin-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.rdct-toolbar-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rdct-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rdct-admin-header-spacer {
    flex: 1;
}

/* Settings dropdown */
.rdct-settings-wrap {
    position: relative;
}

.rdct-settings-btn {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid #334155;
    color: #94a3b8;
    padding: 6px 14px;
    font-size: 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.rdct-settings-btn:hover {
    border-color: #475569;
    color: #cbd5e1;
}

.rdct-settings-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    min-width: 220px;
    padding: 8px 0;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.rdct-settings-dropdown.rdct-settings-open {
    display: block;
}

.rdct-settings-group {
    padding: 8px 14px;
}

.rdct-settings-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.rdct-settings-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rdct-settings-input {
    background: #0f172a;
    border: 1px solid #334155;
    color: #e2e8f0;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    width: 70px;
    font-family: inherit;
}

.rdct-settings-action-btn {
    background: #3b82f6;
    border: none;
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}

.rdct-settings-action-btn:hover {
    background: #2563eb;
}

.rdct-settings-divider {
    height: 1px;
    background: #334155;
    margin: 4px 0;
}

.rdct-settings-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 14px;
    background: none;
    border: none;
    color: #cbd5e1;
    font-size: 0.85rem;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background 0.15s;
}

.rdct-settings-item:hover {
    background: rgba(51, 65, 85, 0.5);
}

.rdct-settings-item.rdct-settings-active {
    color: #4ade80;
}

.rdct-settings-item.rdct-settings-active::after {
    content: '✓';
    margin-left: auto;
    font-size: 0.75rem;
    color: #22c55e;
}

.rdct-admin-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rdct-btn-tv {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #fff;
    padding: 6px 16px;
    font-size: 0.8rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.rdct-btn-tv:hover {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    box-shadow: 0 0 12px rgba(124, 58, 237, 0.4);
}

/* --- Tabs --- */
.rdct-admin-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 2px solid #1e293b;
}

.rdct-admin-tab {
    padding: 10px 24px;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.rdct-admin-tab:hover {
    color: #cbd5e1;
    background: rgba(51, 65, 85, 0.3);
}

.rdct-admin-tab.active {
    color: #38bdf8;
    border-bottom-color: #38bdf8;
    background: rgba(56, 189, 248, 0.05);
}

.rdct-admin-tab-content {
    display: none;
}

.rdct-admin-tab-content.active {
    display: block;
}

/* --- Form Panels --- */
.rdct-admin-form-panel {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.rdct-admin-form-panel h3 {
    margin: 0 0 16px 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: #cbd5e1;
}

/* --- Form Row --- */
.rdct-admin-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.rdct-admin-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 140px;
}

.rdct-admin-field label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rdct-admin-field input,
.rdct-admin-field select {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 8px 12px;
    color: #e2e8f0;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.2s;
    width: 100%;
}

.rdct-admin-field input:focus,
.rdct-admin-field select:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.15);
}

.rdct-admin-field select option {
    background: #1e293b;
    color: #e2e8f0;
}

/* --- Buttons --- */
.rdct-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.rdct-btn-primary {
    background: #2563eb;
    color: #fff;
}

.rdct-btn-primary:hover {
    background: #1d4ed8;
}

.rdct-btn-success {
    background: #16a34a;
    color: #fff;
}

.rdct-btn-success:hover {
    background: #15803d;
}

.rdct-btn-danger {
    background: transparent;
    color: #f87171;
    border: 1px solid #7f1d1d;
    padding: 5px 12px;
    font-size: 0.8rem;
}

.rdct-btn-danger:hover {
    background: rgba(239, 68, 68, 0.15);
}

.rdct-btn-edit {
    background: transparent;
    color: #fbbf24;
    border: 1px solid #78350f;
    padding: 5px 12px;
    font-size: 0.8rem;
}

.rdct-btn-edit:hover {
    background: rgba(251, 191, 36, 0.15);
}

.rdct-btn-sm {
    padding: 5px 12px;
    font-size: 0.8rem;
}

.rdct-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- Data Table --- */
.rdct-admin-table-wrap {
    overflow-x: auto;
    border: 1px solid #334155;
    border-radius: 8px;
}

.rdct-admin-table {
    width: 100%;
    border-collapse: collapse;
}

.rdct-admin-table thead {
    background: rgba(51, 65, 85, 0.5);
}

/* 1d. Sticky table header */
.rdct-admin-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #1e293b;
    box-shadow: 0 1px 0 #334155;
}

.rdct-admin-table th {
    padding: 10px 14px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    border-bottom: 1px solid #334155;
    white-space: nowrap;
}

.rdct-admin-table td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(51, 65, 85, 0.4);
    font-size: 0.9rem;
    color: #e2e8f0;
    vertical-align: middle;
}

.rdct-admin-table tbody tr {
    transition: background 0.15s;
}

.rdct-admin-table tbody tr:hover {
    background: rgba(51, 65, 85, 0.3);
}

/* --- Finished race rows --- */
.rdct-admin-table tbody tr.rdct-past {
    display: none;
}

/* --- Divider between active and finished --- */
.rdct-admin-table tbody tr.rdct-finished-divider {
    display: none;
}

/* --- Muted category rows --- */
.rdct-admin-table tbody tr.rdct-muted {
    opacity: 0.35;
    filter: grayscale(80%);
}

.rdct-admin-table tbody tr.rdct-muted td {
    color: #64748b;
}

.rdct-admin-table tbody tr.rdct-cat-muted {
    opacity: 0.5;
    filter: grayscale(60%);
}

.rdct-admin-table .rdct-actions {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
}

/* --- Countdown in admin table --- */
.rdct-admin-countdown {
    font-family: 'Consolas', 'SF Mono', monospace;
    font-weight: 600;
    font-size: 0.85rem;
}

.rdct-row-progress {
    width: 100%;
    height: 3px;
    background: rgba(51, 65, 85, 0.4);
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden;
}

.rdct-row-progress-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 1s linear;
    width: 0%;
}

.rdct-pb-live {
    background: linear-gradient(90deg, #ef4444, #f59e0b);
}

.rdct-pb-done {
    background: #475569;
}

.rdct-pb-upcoming {
    background: transparent;
}

.rdct-admin-countdown.in-progress {
    color: #f87171;
}

.rdct-admin-countdown.upcoming {
    color: #38bdf8;
}

.rdct-admin-countdown.finished {
    color: #64748b;
}

/* --- Status badges --- */
.rdct-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.rdct-status-badge.live {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.rdct-status-badge.live::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ef4444;
    animation: admin-pulse 1.5s infinite;
}

.rdct-status-badge.upcoming {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
}

.rdct-status-badge.finished {
    background: rgba(100, 116, 139, 0.2);
    color: #64748b;
}

@keyframes admin-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* --- Delay Buffer Panel --- */
.rdct-admin-delay-panel {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 14px 20px;
    margin-bottom: 24px;
}

.rdct-admin-delay-panel label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #94a3b8;
    white-space: nowrap;
}

.rdct-admin-delay-panel input[type="number"] {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 6px 10px;
    color: #e2e8f0;
    font-size: 0.9rem;
    width: 70px;
    font-family: inherit;
    text-align: center;
}

.rdct-admin-delay-panel input[type="number"]:focus {
    outline: none;
    border-color: #38bdf8;
}

.rdct-admin-clock {
    margin-left: auto;
    font-family: 'Consolas', 'SF Mono', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    color: #38bdf8;
}

/* --- Toast notification --- */
.rdct-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.rdct-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.rdct-toast.success {
    background: #16a34a;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.rdct-toast.error {
    background: #dc2626;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

/* --- Empty state --- */
.rdct-admin-empty {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
    font-size: 0.95rem;
}

/* --- Edit modal overlay --- */
.rdct-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.rdct-modal {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 24px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.rdct-modal h3 {
    margin: 0 0 20px 0;
    color: #fff;
    font-size: 1.1rem;
}

.rdct-modal .rdct-admin-field {
    margin-bottom: 14px;
}

.rdct-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}

.rdct-btn-cancel {
    background: transparent;
    color: #94a3b8;
    border: 1px solid #475569;
}

.rdct-btn-cancel:hover {
    background: rgba(71, 85, 105, 0.3);
}

/* --- Duplicate row form --- */
.rdct-admin-table .rdct-duplicate-row td {
    padding: 6px 8px;
    background: rgba(37, 99, 235, 0.08);
    border-bottom: 2px solid #2563eb;
}

.rdct-duplicate-row input,
.rdct-duplicate-row select {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 4px;
    padding: 5px 8px;
    color: #e2e8f0;
    font-size: 0.85rem;
    font-family: inherit;
    width: 100%;
}

/* --- Responsive --- */

/* ═══ Visual Timeline ═══ */
.rdct-timeline {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 12px 16px 8px 16px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

.rdct-tl-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rdct-tl-btn {
    background: rgba(51, 65, 85, 0.5);
    border: 1px solid #475569;
    color: #cbd5e1;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    font-family: inherit;
    padding: 0;
    line-height: 1;
}

.rdct-tl-btn:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: #38bdf8;
    color: #fff;
}

.rdct-tl-btn-fit {
    width: auto;
    padding: 0 10px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.rdct-tl-zoom-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
    min-width: 28px;
    text-align: center;
}

.rdct-tl-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #475569 transparent;
}

.rdct-tl-scroll::-webkit-scrollbar {
    height: 6px;
}

.rdct-tl-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.rdct-tl-scroll::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 3px;
}

.rdct-tl-inner {
    position: relative;
    min-width: 100%;
}

.rdct-tl-labels {
    position: relative;
    height: 18px;
    margin-bottom: 4px;
}

.rdct-tl-label {
    position: absolute;
    transform: translateX(-50%);
    font-size: 0.65rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    white-space: nowrap;
    user-select: none;
}

.rdct-tl-gridline {
    position: absolute;
    top: 18px;
    width: 1px;
    height: calc(100%);
    background: rgba(51, 65, 85, 0.4);
    pointer-events: none;
}

.rdct-tl-track {
    position: relative;
    height: 36px;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 4px;
    overflow: visible;
}

.rdct-tl-block {
    position: absolute;
    top: 3px;
    height: 30px;
    border-radius: 3px;
    cursor: pointer;
    transition: filter 0.15s, transform 0.15s;
    overflow: hidden;
    opacity: 0.85;
    z-index: 2;
}

.rdct-tl-block:hover {
    opacity: 1;
    filter: brightness(1.2);
    transform: scaleY(1.1);
    z-index: 5;
}

.rdct-tl-block-label {
    display: block;
    padding: 0 6px;
    font-size: 0.65rem;
    font-weight: 600;
    color: #fff;
    line-height: 30px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.rdct-tl-muted {
    opacity: 0.25;
    filter: grayscale(80%);
}

.rdct-tl-muted:hover {
    opacity: 0.5;
    filter: grayscale(40%) brightness(1.2);
}

/* Now marker */
.rdct-tl-now {
    position: absolute;
    top: -2px;
    width: 2px;
    height: calc(100% + 4px);
    background: #ef4444;
    z-index: 10;
    pointer-events: none;
    transition: left 0.3s linear;
}

.rdct-tl-now::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -4px;
    width: 10px;
    height: 10px;
    background: #ef4444;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
    animation: tl-now-pulse 2s infinite;
}

.rdct-tl-now-label {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.55rem;
    font-weight: 700;
    color: #ef4444;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

@keyframes tl-now-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Row highlight on click-to-scroll */
.rdct-admin-table tbody tr.rdct-highlight {
    background: rgba(56, 189, 248, 0.15) !important;
    transition: background 0.3s ease;
}

/* --- Row colour coding by category type --- */
.rdct-admin-table tbody tr.rdct-row-race {
    border-left: 3px solid #3b82f6;
}

.rdct-admin-table tbody tr.rdct-row-satellite {
    border-left: 3px solid #f59e0b;
}

.rdct-admin-table tbody tr.rdct-row-operational {
    border-left: 3px solid #64748b;
}

.rdct-admin-table tbody tr.rdct-row-break {
    border-left: 3px solid #22c55e;
}

/* --- Category type badges --- */
.rdct-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.rdct-type-race {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.rdct-type-satellite {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.rdct-type-operational {
    background: rgba(100, 116, 139, 0.2);
    color: #94a3b8;
}

.rdct-type-break {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

/* --- Notes column --- */
.rdct-notes-val {
    font-size: 0.8rem;
    color: #cbd5e1;
    cursor: pointer;
}

.rdct-notes-empty {
    color: #475569;
    cursor: pointer;
}

.rdct-inline-edit-notes {
    cursor: pointer;
    max-width: 180px;
}

.rdct-inline-edit-notes:hover .rdct-inline-val {
    color: #38bdf8;
}

.rdct-notes-input {
    width: 160px !important;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .rdct-admin-panel {
        padding: 14px;
    }

    .rdct-admin-header {
        gap: 8px;
    }

    .rdct-admin-header h2 {
        font-size: 1.2rem;
    }

    .rdct-admin-form-row {
        flex-direction: column;
    }

    .rdct-admin-field {
        min-width: 100%;
    }

    .rdct-admin-tab {
        padding: 8px 14px;
        font-size: 0.8rem;
    }

    .rdct-admin-delay-panel {
        flex-wrap: wrap;
    }

    .rdct-admin-clock {
        margin-left: 0;
        width: 100%;
        text-align: center;
    }

    .rdct-admin-table th,
    .rdct-admin-table td {
        padding: 8px 10px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .rdct-admin-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* --- Subtitle panel --- */
.rdct-admin-subtitle-panel {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 12px 20px;
    margin-bottom: 24px;
}

.rdct-admin-subtitle-panel label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #94a3b8;
    white-space: nowrap;
}

.rdct-admin-subtitle-panel input[type="text"] {
    flex: 1;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 8px 12px;
    color: #e2e8f0;
    font-size: 0.9rem;
    font-family: inherit;
}

.rdct-admin-subtitle-panel input[type="text"]:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.15);
}

/* --- Day filter pills --- */
.rdct-day-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
    padding: 0;
}

.rdct-day-pill {
    padding: 6px 16px;
    border: 1px solid #334155;
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.6);
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.rdct-day-pill:hover {
    border-color: #475569;
    color: #cbd5e1;
    background: rgba(51, 65, 85, 0.4);
}

.rdct-day-pill.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.rdct-day-pill-today {
    border-color: #16a34a;
    color: #4ade80;
}

.rdct-day-pill-today:hover {
    border-color: #22c55e;
    color: #4ade80;
    background: rgba(22, 163, 74, 0.15);
}

.rdct-day-pill-today.active {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
}

/* --- Inline time editing --- */
.rdct-inline-edit {
    cursor: pointer;
    position: relative;
}

.rdct-inline-edit:hover .rdct-inline-val {
    color: #38bdf8;
    text-decoration: underline;
    text-decoration-style: dashed;
    text-underline-offset: 3px;
}

.rdct-inline-input {
    background: #0f172a !important;
    border: 1px solid #38bdf8 !important;
    border-radius: 4px !important;
    padding: 4px 6px !important;
    color: #e2e8f0 !important;
    font-size: 0.85rem !important;
    font-family: inherit !important;
    width: 110px !important;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.rdct-inline-saving {
    color: #fbbf24;
    font-style: italic;
}

@media (max-width: 768px) {
    .rdct-admin-subtitle-panel {
        flex-wrap: wrap;
    }

    .rdct-admin-subtitle-panel input[type="text"] {
        min-width: 100%;
    }

    .rdct-day-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }

    .rdct-day-pill {
        flex-shrink: 0;
    }
}

/* ═══ TV Mode Overlay ═══ */
.rdct-tv-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #020617 0%, #0f172a 40%, #020617 100%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    padding: 32px 48px;
    box-sizing: border-box;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #e2e8f0;
    overflow-y: auto;
}

.rdct-tv-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
    flex-shrink: 0;
}

.rdct-tv-subtitle {
    font-size: 1.6rem;
    font-weight: 300;
    color: #94a3b8;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.rdct-tv-clock {
    font-family: 'Consolas', 'SF Mono', monospace;
    font-size: 2rem;
    font-weight: 600;
    color: #38bdf8;
}

.rdct-tv-close {
    background: rgba(51, 65, 85, 0.5);
    border: 1px solid #475569;
    color: #94a3b8;
    font-size: 1.4rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rdct-tv-close:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
    color: #f87171;
}

.rdct-tv-body {
    display: flex;
    gap: 40px;
    flex: 1;
    min-height: 0;
    margin-bottom: 32px;
}

.rdct-tv-current {
    flex: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.rdct-tv-next {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 40px;
    border-left: 1px solid #1e293b;
}

.rdct-tv-label {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 12px;
}

.rdct-tv-event-name {
    font-size: 3.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 16px;
    line-height: 1.1;
}

.rdct-tv-next-name {
    font-size: 2rem;
}

.rdct-tv-countdown {
    font-family: 'Consolas', 'SF Mono', monospace;
    font-size: 5rem;
    font-weight: 700;
    color: #38bdf8;
    margin-bottom: 20px;
    line-height: 1;
}

.rdct-tv-countdown.rdct-tv-live {
    color: #f87171;
    animation: tv-pulse-text 2s infinite;
}

.rdct-tv-next-cd {
    font-size: 2.5rem;
    color: #38bdf8;
}

@keyframes tv-pulse-text {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.rdct-tv-progress-wrap {
    width: 100%;
    height: 8px;
    background: rgba(51, 65, 85, 0.5);
    border-radius: 4px;
    margin-bottom: 16px;
    overflow: hidden;
}

.rdct-tv-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ef4444, #f59e0b);
    border-radius: 4px;
    transition: width 1s linear;
}

.rdct-tv-times {
    font-size: 1.1rem;
    color: #94a3b8;
}

/* Remaining events list */
.rdct-tv-remaining {
    flex-shrink: 0;
    border-top: 1px solid #1e293b;
    padding-top: 16px;
}

.rdct-tv-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rdct-tv-list-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid #1e293b;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 0.85rem;
}

.rdct-tv-list-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.rdct-tv-list-name {
    color: #e2e8f0;
    font-weight: 600;
}

.rdct-tv-list-time {
    color: #64748b;
}

.rdct-tv-list-cd {
    font-family: 'Consolas', 'SF Mono', monospace;
    color: #38bdf8;
    font-weight: 600;
    font-size: 0.8rem;
}

/* TV Mode responsive */

/* ═══ Checkbox column ═══ */
.rdct-th-check,
.rdct-td-check {
    width: 32px;
    text-align: center;
    padding: 10px 6px !important;
}

.rdct-td-check input[type="checkbox"],
.rdct-th-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #2563eb;
}

/* ═══ Drag handle ═══ */
.rdct-th-drag,
.rdct-td-drag {
    width: 28px;
    text-align: center;
    padding: 10px 4px !important;
}

.rdct-drag-handle {
    cursor: grab;
    color: #475569;
    font-size: 1rem;
    user-select: none;
    line-height: 1;
    transition: color 0.15s;
}

.rdct-drag-handle:hover {
    color: #94a3b8;
}

.rdct-admin-table tbody tr.rdct-dragging {
    opacity: 0.4;
}

.rdct-admin-table tbody tr.rdct-drag-over {
    border-top: 2px solid #38bdf8;
}

/* ═══ Bulk action bar ═══ */
.rdct-bulk-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.3);
    border-radius: 8px;
    padding: 12px 20px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.rdct-bulk-bar label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #94a3b8;
    white-space: nowrap;
}

.rdct-bulk-bar input[type="number"] {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 6px 10px;
    color: #e2e8f0;
    font-size: 0.85rem;
    text-align: center;
    font-family: inherit;
}

.rdct-bulk-bar input[type="number"]:focus {
    outline: none;
    border-color: #38bdf8;
}

.rdct-bulk-count {
    font-size: 0.85rem;
    font-weight: 600;
    color: #38bdf8;
}

.rdct-bulk-sep {
    color: #334155;
    font-size: 1rem;
    user-select: none;
}

/* 3b. Keyboard focus highlight */
.rdct-admin-table tbody tr.rdct-kb-focus {
    outline: 2px solid #38bdf8;
    outline-offset: -2px;
    background: rgba(56, 189, 248, 0.08);
}

/* Conflict detection — overlapping race highlight */
.rdct-conflict-banner {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: #fbbf24;
}

.rdct-admin-table tbody tr.rdct-conflict {
    border-left: 3px solid #f59e0b;
}

.rdct-admin-table tbody tr.rdct-conflict td:first-child {
    position: relative;
}

.rdct-admin-table tbody tr.rdct-conflict td:first-child::before {
    content: '⚠️';
    position: absolute;
    top: 50%;
    left: -18px;
    transform: translateY(-50%);
    font-size: 0.7rem;
}

/* 3b. Shortcut help overlay */
.rdct-shortcut-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rdct-shortcut-panel {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 24px;
    max-width: 560px;
    width: 90vw;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.rdct-shortcut-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.rdct-shortcut-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #fff;
}

.rdct-shortcut-close {
    background: none;
    border: none;
    color: #64748b;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
}

.rdct-shortcut-close:hover {
    color: #f87171;
}

.rdct-shortcut-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
}

.rdct-shortcut-section h4 {
    margin: 0 0 8px 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rdct-shortcut-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: #cbd5e1;
    margin-bottom: 6px;
}

.rdct-shortcut-row kbd {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-family: inherit;
    color: #e2e8f0;
    min-width: 22px;
    text-align: center;
}

.rdct-shortcut-row span {
    color: #94a3b8;
}

/* ═══ Notification toggle ═══ */

/* ═══ Weather widget ═══ */
.rdct-weather-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 10px 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.rdct-weather-select {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 6px 10px;
    color: #e2e8f0;
    font-size: 0.8rem;
    font-family: inherit;
}

.rdct-weather-select:focus {
    outline: none;
    border-color: #38bdf8;
}

.rdct-weather-data {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: #94a3b8;
}

.rdct-wx-icon {
    font-size: 1.4rem;
    line-height: 1;
}

.rdct-wx-temp {
    font-size: 1.1rem;
    font-weight: 700;
    color: #e2e8f0;
}

.rdct-wx-feels {
    font-size: 0.75rem;
    color: #64748b;
}

.rdct-wx-cond {
    font-weight: 600;
    color: #cbd5e1;
}

.rdct-wx-wind {
    color: #94a3b8;
}

.rdct-wx-humid {
    color: #64748b;
}

.rdct-wx-venue {
    font-weight: 600;
    color: #38bdf8;
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .rdct-weather-bar {
        padding: 8px 14px;
        gap: 8px;
    }
    .rdct-weather-data {
        gap: 8px;
        font-size: 0.8rem;
    }
    .rdct-wx-feels, .rdct-wx-humid {
        display: none;
    }
}

/* ═══ Notification toggle ═══ */

/* ═══ PDF import profile selector ═══ */
.rdct-pdf-profile-desc {
    font-size: 0.8rem;
    color: #94a3b8;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid #1e293b;
    border-radius: 6px;
    padding: 10px 14px;
    line-height: 1.5;
    min-height: 40px;
}

.rdct-import-date-btn {
    background: rgba(51, 65, 85, 0.5);
    border: 1px solid #475569;
    color: #64748b;
    opacity: 0.5;
    transition: all 0.15s;
}

.rdct-import-date-btn.rdct-import-date-active {
    background: rgba(37, 99, 235, 0.2);
    border-color: #3b82f6;
    color: #93c5fd;
    opacity: 1;
}

/* ═══ Category icon management ═══ */
.rdct-cat-icon-cell {
    width: 80px;
    text-align: center;
}

.rdct-cat-icon-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.rdct-cat-icon-preview {
    width: 60px;
    height: 30px;
    object-fit: contain;
    border-radius: 4px;
    background: rgba(15, 23, 42, 0.4);
}

.rdct-cat-icon-label {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #64748b;
}

.rdct-cat-no-icon {
    font-size: 0.75rem;
    color: #475569;
    font-style: italic;
}

.rdct-icon-upload-label {
    cursor: pointer !important;
}

/* ═══ Notification toggle ═══ */
.rdct-btn-notify {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid #334155;
    color: #94a3b8;
    padding: 6px 14px;
    font-size: 0.8rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.rdct-btn-notify:hover {
    border-color: #475569;
    color: #cbd5e1;
}

.rdct-btn-notify.rdct-notify-active {
    background: rgba(34, 197, 94, 0.15);
    border-color: #22c55e;
    color: #4ade80;
}

/* TV Mode responsive */
@media (max-width: 900px) {
    .rdct-tv-overlay {
        padding: 16px 20px;
    }

    .rdct-tv-body {
        flex-direction: column;
        gap: 24px;
    }

    .rdct-tv-next {
        padding-left: 0;
        border-left: none;
        border-top: 1px solid #1e293b;
        padding-top: 20px;
    }

    .rdct-tv-event-name {
        font-size: 2rem;
    }

    .rdct-tv-countdown {
        font-size: 3rem;
    }

    .rdct-tv-next-name {
        font-size: 1.4rem;
    }

    .rdct-tv-next-cd {
        font-size: 1.8rem;
    }
}

/* ══════════════════════════════════════════════════════
   SESSION 1: RACE AWARENESS (v2.0)
   ══════════════════════════════════════════════════════ */

/* 1a. Ending soon — amber pulse on row */
@keyframes rdct-amber-pulse {
    0%   { background: rgba(245, 158, 11, 0.0); }
    50%  { background: rgba(245, 158, 11, 0.15); }
    100% { background: rgba(245, 158, 11, 0.0); }
}

.rdct-admin-table tbody tr.rdct-ending-soon {
    animation: rdct-amber-pulse 1.5s ease-in-out infinite;
}

.rdct-admin-table tbody tr.rdct-ending-soon .rdct-admin-countdown {
    color: #f59e0b !important;
    font-weight: 700;
}

.rdct-admin-table tbody tr.rdct-ending-soon .rdct-row-progress-bar {
    background: linear-gradient(90deg, #f59e0b, #ef4444) !important;
}

/* 1b. Next up highlight — cyan left accent */
.rdct-admin-table tbody tr.rdct-next-up {
    border-left: 3px solid #22d3ee;
    background: rgba(34, 211, 238, 0.05);
}

.rdct-admin-table tbody tr.rdct-next-up .rdct-admin-countdown {
    color: #22d3ee !important;
}

/* 2a/2b. Toggle buttons (auto-scroll, sound) */
.rdct-btn-toggle {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid #334155;
    color: #94a3b8;
    padding: 6px 14px;
    font-size: 0.8rem;
    border-radius: 6px;
    transition: all 0.2s;
    cursor: pointer;
}

.rdct-btn-toggle:hover {
    border-color: #475569;
    color: #cbd5e1;
}

.rdct-btn-toggle.rdct-toggle-active {
    background: rgba(34, 197, 94, 0.15);
    border-color: #22c55e;
    color: #4ade80;
}

