/* ========================================
   Video Project Manager - Design System
   ======================================== */

/* CSS Variables - Dark Theme (Default) */
:root,
[data-theme="dark"] {
    /* Background Colors */
    --color-bg-primary: #0a0a1a;
    --color-bg-secondary: #12122a;
    --color-bg-card: #1a1a3a;
    --color-bg-elevated: #222250;
    --color-bg-hover: #2a2a5a;

    /* Accent Colors */
    --color-accent: #ef6c00;
    --color-accent-hover: #ff7043;
    --color-accent-glow: rgba(239, 108, 0, 0.3);

    /* Status Colors */
    --color-success: #10b981;
    --color-success-bg: rgba(16, 185, 129, 0.15);
    --color-warning: #f59e0b;
    --color-warning-bg: rgba(245, 158, 11, 0.15);
    --color-danger: #ef4444;
    --color-danger-bg: rgba(239, 68, 68, 0.15);
    --color-info: #3b82f6;
    --color-info-bg: rgba(59, 130, 246, 0.15);

    /* Text Colors */
    --color-text-primary: #f8fafc;
    --color-text-secondary: #94a3b8;
    --color-text-muted: #64748b;
    --color-text-inverse: #0f172a;

    /* Border Colors */
    --color-border: rgba(148, 163, 184, 0.15);
    --color-border-hover: rgba(148, 163, 184, 0.3);

    /* Editor Colors (for Gantt lanes) */
    --editor-color-1: #6366f1;
    --editor-color-2: #ec4899;
    --editor-color-3: #14b8a6;
    --editor-color-4: #f97316;
    --editor-color-5: #8b5cf6;
    --editor-color-6: #06b6d4;

    /* Gantt specific */
    --color-weekend-bg: rgba(100, 116, 139, 0.1);
    --color-saturday: #60a5fa;
    --color-sunday: #f87171;
    --color-month-border: rgba(239, 108, 0, 0.5);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px var(--color-accent-glow);

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* Light Theme */
[data-theme="light"] {
    /* Background Colors */
    --color-bg-primary: #f8fafc;
    --color-bg-secondary: #f1f5f9;
    --color-bg-card: #ffffff;
    --color-bg-elevated: #e2e8f0;
    --color-bg-hover: #e2e8f0;

    /* Accent Colors */
    --color-accent: #e65100;
    --color-accent-hover: #f57c00;
    --color-accent-glow: rgba(230, 81, 0, 0.2);

    /* Status Colors */
    --color-success: #059669;
    --color-success-bg: rgba(5, 150, 105, 0.12);
    --color-warning: #d97706;
    --color-warning-bg: rgba(217, 119, 6, 0.12);
    --color-danger: #dc2626;
    --color-danger-bg: rgba(220, 38, 38, 0.12);
    --color-info: #2563eb;
    --color-info-bg: rgba(37, 99, 235, 0.12);

    /* Text Colors */
    --color-text-primary: #0f172a;
    --color-text-secondary: #475569;
    --color-text-muted: #64748b;
    --color-text-inverse: #f8fafc;

    /* Border Colors */
    --color-border: rgba(15, 23, 42, 0.1);
    --color-border-hover: rgba(15, 23, 42, 0.2);

    /* Gantt specific */
    --color-weekend-bg: rgba(100, 116, 139, 0.08);
    --color-saturday: #2563eb;
    --color-sunday: #dc2626;
    --color-month-border: rgba(230, 81, 0, 0.4);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px var(--color-accent-glow);
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background gradient effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(239, 108, 0, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(255, 138, 80, 0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

[data-theme="light"] body::before {
    background:
        radial-gradient(ellipse at 20% 20%, rgba(239, 108, 0, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(255, 138, 80, 0.04) 0%, transparent 50%);
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-accent-hover);
}

/* ========================================
   Typography
   ======================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-text-primary);
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

h4 {
    font-size: 1.125rem;
}

.text-muted {
    color: var(--color-text-muted);
}

.text-secondary {
    color: var(--color-text-secondary);
}

/* ========================================
   Layout
   ======================================== */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--color-bg-secondary);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform var(--transition-normal);
}

.sidebar-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--color-border);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text-primary);
}

.sidebar-logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #ef6c00, #ff8a50);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    color: white;
    box-shadow: 0 2px 8px rgba(239, 108, 0, 0.3);
}

.sidebar-nav {
    flex: 1;
    padding: var(--spacing-md);
    overflow-y: auto;
}

.nav-section {
    margin-bottom: var(--spacing-lg);
}

.nav-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    padding: var(--spacing-sm) var(--spacing-md);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: var(--spacing-xs);
}

.nav-item:hover {
    background: var(--color-bg-hover);
    color: var(--color-text-primary);
}

.nav-item.active {
    background: var(--color-accent);
    color: white;
}

.nav-item-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
}

.header {
    height: 64px;
    background: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-xl);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(10px);
}

.header-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.content-area {
    flex: 1;
    padding: var(--spacing-xl);
    overflow-y: auto;
}

/* ========================================
   Cards
   ======================================== */
.card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: var(--color-border-hover);
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: var(--spacing-lg);
}

.card-footer {
    padding: var(--spacing-md) var(--spacing-lg);
    border-top: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--color-accent), #ff8a50);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--color-bg-elevated);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--color-bg-hover);
    border-color: var(--color-border-hover);
}

.btn-danger {
    background: var(--color-danger);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--color-bg-hover);
    color: var(--color-text-primary);
}

.btn-sm {
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: 0.8125rem;
}

.btn-lg {
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: 1rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-md);
}

/* ========================================
   Form Elements
   ======================================== */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-sm);
}

.form-label.required::after {
    content: ' *';
    color: var(--color-danger);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.9375rem;
    font-family: inherit;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-glow);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--color-text-muted);
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--spacing-sm) center;
    background-size: 18px;
    padding-right: var(--spacing-xl);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-hint {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin-top: var(--spacing-xs);
}

/* ========================================
   Badges
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.badge-primary {
    background: var(--color-accent-glow);
    color: var(--color-accent-hover);
}

.badge-success {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.badge-warning {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.badge-danger {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

.badge-info {
    background: var(--color-info-bg);
    color: var(--color-info);
}

/* Status Badges */
.status-todo {
    background: var(--color-bg-elevated);
    color: var(--color-text-secondary);
}

.status-editing {
    background: var(--color-info-bg);
    color: var(--color-info);
}

.status-review {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.status-fixing {
    background: rgba(236, 72, 153, 0.15);
    color: #ec4899;
}

.status-delivered {
    background: var(--color-success-bg);
    color: var(--color-success);
}

/* Priority Badges */
.priority-low {
    background: var(--color-bg-elevated);
    color: var(--color-text-muted);
}

.priority-mid {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.priority-high {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

/* ========================================
   Tables
   ======================================== */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table th,
.table td {
    padding: var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.table th {
    background: var(--color-bg-secondary);
    font-weight: 600;
    color: var(--color-text-secondary);
    white-space: nowrap;
}

.table tbody tr {
    transition: background var(--transition-fast);
}

.table tbody tr:hover {
    background: var(--color-bg-hover);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table-actions {
    display: flex;
    gap: var(--spacing-xs);
}

/* ========================================
   Tabs
   ======================================== */
.tabs {
    display: flex;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-lg);
}

.tab {
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab:hover {
    color: var(--color-text-primary);
    background: var(--color-bg-hover);
}

.tab.active {
    color: white;
    background: var(--color-accent);
}

/* ========================================
   Modal
   ======================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform var(--transition-normal);
}

/* Fullscreen modal */
.modal.modal-fullscreen {
    width: calc(100vw - 40px);
    max-width: none;
    height: calc(100vh - 40px);
    max-height: none;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
}

.modal-fullscreen .modal-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--color-bg-hover);
    color: var(--color-text-primary);
}

.modal-body {
    padding: var(--spacing-lg);
}

.modal-footer {
    padding: var(--spacing-md) var(--spacing-lg);
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
}

/* ========================================
   Gantt Chart Styles
   ======================================== */
.gantt-container {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    max-width: 100%;
    width: 100%;
    overflow: hidden;
}

.gantt-controls {
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.gantt-period-buttons {
    display: flex;
    gap: var(--spacing-xs);
    background: var(--color-bg-secondary);
    padding: var(--spacing-xs);
    border-radius: var(--radius-md);
}

.gantt-period-btn {
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: 0.8125rem;
    font-weight: 500;
    background: transparent;
    border: none;
    color: var(--color-text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.gantt-period-btn:hover {
    color: var(--color-text-primary);
}

.gantt-period-btn.active {
    background: var(--color-accent);
    color: white;
}

.gantt-chart {
    min-height: 400px;
    position: relative;
    width: fit-content;
    min-width: 100%;
}

.gantt-header {
    display: flex;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
    position: sticky;
    top: 0;
    z-index: 10;
    width: fit-content;
    min-width: 100%;
}

.gantt-lane-header {
    width: 280px;
    min-width: 280px;
    max-width: 280px;
    flex-shrink: 0;
    padding: var(--spacing-md);
    border-right: 2px solid var(--color-border);
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    background: var(--color-bg-secondary);
    box-sizing: border-box;
    position: sticky;
    left: 0;
    z-index: 20;
}

.gantt-timeline-header {
    flex: 1;
    display: flex;
    overflow-x: auto;
}

.gantt-date-cell {
    min-width: 40px;
    padding: var(--spacing-sm);
    text-align: center;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    border-right: 1px solid var(--color-border);
}

.gantt-date-cell.today {
    background: var(--color-accent-glow);
    color: var(--color-accent);
    font-weight: 600;
}

.gantt-date-cell.weekend {
    background: rgba(0, 0, 0, 0.2);
}

.gantt-body {
    display: flex;
    flex-direction: column;
}

.gantt-lane {
    display: flex;
    min-height: 60px;
    border-bottom: 1px solid var(--color-border);
}

.gantt-lane:last-child {
    border-bottom: none;
}

.gantt-lane-label {
    width: 200px;
    min-width: 200px;
    padding: var(--spacing-md);
    border-right: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: var(--color-bg-secondary);
}

.gantt-lane-color {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
}

.gantt-lane-name {
    font-weight: 500;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gantt-lane-content {
    flex: 1;
    position: relative;
    min-height: 60px;
}

.gantt-item {
    position: absolute;
    height: 28px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: var(--radius-md);
    padding: 0 var(--spacing-sm);
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 500;
    color: white;
    cursor: pointer;
    transition: all var(--transition-fast);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    z-index: 5;
}

.gantt-item:hover {
    transform: translateY(-50%) scale(1.02);
    box-shadow: var(--shadow-lg);
    z-index: 10;
}

.gantt-milestone {
    position: absolute;
    width: 12px;
    height: 12px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    border-radius: 2px;
    z-index: 6;
}

.gantt-milestone.material {
    background: #3b82f6;
}

.gantt-milestone.review {
    background: #f59e0b;
}

.gantt-milestone.delivery {
    background: #10b981;
}

.gantt-milestone.publish {
    background: #ec4899;
}

/* Draggable milestone styles */
.draggable-milestone {
    cursor: grab;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.draggable-milestone:hover {
    transform: translateY(-50%) rotate(45deg) scale(1.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.draggable-milestone.dragging {
    cursor: grabbing;
    opacity: 0.6;
}

/* Custom highlight cell (for specific days/dates) */
.gantt-minor-cell.custom-highlight {
    background: rgba(251, 191, 36, 0.25);
}

.gantt-minor-cell.custom-highlight-red {
    background: rgba(239, 68, 68, 0.2);
}

/* Today line */
.gantt-today-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--color-danger);
    z-index: 15;
}

.gantt-today-line::before {
    content: '今日';
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--color-danger);
    background: var(--color-bg-card);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--color-text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
}

.empty-state-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-sm);
}

/* ========================================
   Search & Filters
   ======================================== */
.search-bar {
    position: relative;
    max-width: 300px;
}

.search-input {
    padding-left: 40px;
}

.search-icon {
    position: absolute;
    left: var(--spacing-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
}

.filters {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.filter-label {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

/* ========================================
   Editor Colors/Avatars
   ======================================== */
.editor-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
}

.editor-color-picker {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--spacing-xs);
    max-width: 400px;
}

.color-option {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    cursor: pointer;
    border: 3px solid transparent;
    transition: all var(--transition-fast);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.color-option:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.color-option.selected {
    border-color: white;
    box-shadow: 0 0 0 3px var(--color-accent), 0 2px 8px rgba(0, 0, 0, 0.3);
}

.color-option.selected::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* ========================================
   Toast Notifications
   ======================================== */
.toast-container {
    position: fixed;
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.toast {
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md) var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-success {
    border-left: 4px solid var(--color-success);
}

.toast-error {
    border-left: 4px solid var(--color-danger);
}

.toast-warning {
    border-left: 4px solid var(--color-warning);
}

.toast-info {
    border-left: 4px solid var(--color-info);
}

/* ========================================
   Loading States
   ======================================== */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.skeleton {
    background: linear-gradient(90deg,
            var(--color-bg-elevated) 0%,
            var(--color-bg-hover) 50%,
            var(--color-bg-elevated) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ========================================
   Utility Classes
   ======================================== */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-sm {
    gap: var(--spacing-sm);
}

.gap-md {
    gap: var(--spacing-md);
}

.gap-lg {
    gap: var(--spacing-lg);
}

.mt-sm {
    margin-top: var(--spacing-sm);
}

.mt-md {
    margin-top: var(--spacing-md);
}

.mt-lg {
    margin-top: var(--spacing-lg);
}

.mb-md {
    margin-bottom: var(--spacing-md);
}

.mb-lg {
    margin-bottom: var(--spacing-lg);
}

.hidden {
    display: none !important;
}

.visible {
    visibility: visible !important;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .gantt-lane-header,
    .gantt-lane-label {
        width: 150px;
        min-width: 150px;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0 var(--spacing-md);
    }

    .content-area {
        padding: var(--spacing-md);
    }

    .tabs {
        overflow-x: auto;
        white-space: nowrap;
    }

    .modal {
        width: 95%;
        margin: var(--spacing-md);
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ========================================
   Login Page Specific
   ======================================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
}

.login-card {
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.login-logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--color-accent), #ec4899);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto var(--spacing-md);
}

/* ========================================
   Theme Toggle
   ======================================== */
.theme-toggle {
    position: relative;
}

.theme-toggle-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    cursor: pointer;
    font-size: 1.125rem;
    transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
    background: var(--color-bg-hover);
    color: var(--color-text-primary);
}

.theme-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: var(--spacing-xs);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 140px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition-fast);
    z-index: 100;
}

.theme-toggle.open .theme-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.theme-option {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.theme-option:first-child {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.theme-option:last-child {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.theme-option:hover {
    background: var(--color-bg-hover);
    color: var(--color-text-primary);
}

.theme-option.active {
    color: var(--color-accent);
}

/* ========================================
   Improved Gantt Chart - 1 Video Per Row
   ======================================== */

/* Major/Minor time axis headers */
.gantt-time-axis {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
    position: sticky;
    top: 0;
    z-index: 20;
}

.gantt-major-row,
.gantt-minor-row {
    display: flex;
}

.gantt-major-row {
    border-bottom: 1px solid var(--color-border);
}

.gantt-major-cell {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    border-right: 2px solid var(--color-month-border);
    background: var(--color-bg-secondary);
    text-align: center;
}

.gantt-minor-cell {
    flex-shrink: 0;
    padding: 2px;
    font-size: 0.625rem;
    text-align: center;
    border-right: 1px solid var(--color-border);
    box-sizing: border-box;
}

/* Weekday colors */
.gantt-minor-cell.saturday {
    color: var(--color-saturday);
}

.gantt-minor-cell.sunday {
    color: var(--color-sunday);
}

.gantt-minor-cell.today {
    background: var(--color-accent-glow);
    color: var(--color-accent);
    font-weight: 600;
}

/* Row-based layout (1 video = 1 row) */
.gantt-row {
    display: flex;
    min-height: 48px;
    border-bottom: 1px solid var(--color-border);
    transition: background var(--transition-fast);
    width: fit-content;
    min-width: 100%;
}

.gantt-row:hover {
    background: var(--color-bg-hover);
}

.gantt-row.archived {
    opacity: 0.5;
}

.gantt-row-label {
    width: 280px;
    min-width: 280px;
    max-width: 280px;
    padding: var(--spacing-sm) var(--spacing-md);
    border-right: 2px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: var(--color-bg-secondary);
    position: sticky;
    left: 0;
    z-index: 20;
    overflow: hidden;
}

.gantt-visibility-toggle {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.gantt-visibility-toggle:hover {
    background: var(--color-bg-hover);
    color: var(--color-text-primary);
}

.gantt-row-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.gantt-row-title {
    font-weight: 500;
    font-size: 0.8125rem;
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.gantt-row-title:hover {
    color: var(--color-accent);
}

.gantt-row-badges {
    display: flex;
    gap: var(--spacing-xs);
    align-items: center;
    flex-wrap: nowrap;
}

.gantt-row-badges .badge {
    font-size: 0.625rem;
    padding: 1px 6px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 60px;
    max-width: 80px;
}

.gantt-row-content {
    flex: 1;
    position: relative;
    min-height: 48px;
    z-index: 5;
}

/* Weekend stripes in row content (always gray) */
.gantt-weekend-stripe {
    position: absolute;
    top: 0;
    bottom: 0;
    background: var(--color-weekend-bg);
    pointer-events: none;
    z-index: 1;
}

/* Custom highlight stripe (distinct color from weekend) */
.gantt-highlight-stripe {
    position: absolute;
    top: 0;
    bottom: 0;
    background: rgba(251, 191, 36, 0.25);
    pointer-events: none;
    z-index: 2;
}

/* Today line */
.gantt-today-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--color-danger);
    z-index: 20;
    pointer-events: none;
}

.gantt-today-line::before {
    content: '今日';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.5625rem;
    font-weight: 600;
    color: var(--color-danger);
    background: var(--color-bg-card);
    padding: 1px 4px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

/* Grid lines */
.gantt-grid-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--color-border);
    pointer-events: none;
    z-index: 2;
}

.gantt-grid-line.month-start {
    width: 2px;
    background: var(--color-month-border);
}

/* Video bar container in row */
.gantt-bar-container {
    position: absolute;
    height: 24px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 4;
    min-width: 8px;
    display: flex;
}

.gantt-bar-container:hover {
    transform: translateY(-50%) scale(1.03);
    box-shadow: var(--shadow-md);
    z-index: 5;
}

/* Bar segment (split color) */
.gantt-bar-segment {
    height: 100%;
}

.gantt-bar-segment:only-child {
    border-radius: 20px;
}

/* Bar with left dot (editor) and main bar (destination) */
.gantt-bar-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    align-self: center;
    margin-right: -4px;
    z-index: 1;
    box-shadow: 0 0 0 2px var(--color-bg-card);
}

.gantt-bar-main {
    height: 14px;
    border-radius: 0 20px 20px 0;
    flex-grow: 1;
    align-self: center;
}

/* Legacy single-color bar */
.gantt-bar {
    position: absolute;
    height: 24px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 4;
    min-width: 8px;
}

.gantt-bar:hover,
.gantt-bar-container:hover {
    transform: translateY(-50%) scale(1.03);
    box-shadow: var(--shadow-md);
    z-index: 5;
}

.gantt-bar-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.75rem;
    white-space: nowrap;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    z-index: 100;
    margin-bottom: var(--spacing-xs);
}

.gantt-bar:hover .gantt-bar-tooltip,
.gantt-bar-container:hover .gantt-bar-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Milestones */
.gantt-milestone {
    position: absolute;
    width: 10px;
    height: 10px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    border-radius: 2px;
    z-index: 11;
    cursor: pointer;
}

.gantt-milestone.material {
    background: #3b82f6;
}

.gantt-milestone.review {
    background: #f59e0b;
}

.gantt-milestone.delivery {
    background: #10b981;
}

.gantt-milestone.publish {
    background: #ec4899;
}

/* Milestones on bar - reduced saturation for visibility */
.gantt-milestone.on-bar {
    filter: saturate(0.3) brightness(1.5);
    opacity: 0.8;
}

/* Zoom buttons */
.gantt-zoom-buttons {
    display: flex;
    gap: var(--spacing-xs);
    background: var(--color-bg-secondary);
    padding: var(--spacing-xs);
    border-radius: var(--radius-md);
}

.zoom-btn {
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--color-border);
    background: var(--color-bg-card);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--color-text-secondary);
}

.zoom-btn:hover {
    background: var(--color-bg-hover);
    border-color: var(--color-border-hover);
}

.zoom-btn.active {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: white;
}

/* Admin archive toggle */
.gantt-admin-toggle {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-md);
    background: var(--color-bg-elevated);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
}

.gantt-admin-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--color-accent);
}

/* gantt-lane-header is now defined once at line ~850 */

/* Override old lane label to match new width */
.gantt-lane-label {
    width: 280px;
    min-width: 280px;
    max-width: 280px;
    background: var(--color-bg-secondary);
    position: relative;
    z-index: 15;
}

/* Ensure items don't overlap label */
.gantt-lane-content,
.gantt-row-content {
    overflow: hidden;
}

/* ========================================
   Icon Button Styles
   ======================================== */
.btn-icon-left {
    display: inline-flex;
    align-items: center;
    margin-right: var(--spacing-xs);
}

.btn-icon-left svg {
    width: 16px;
    height: 16px;
}

.nav-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.nav-item-icon svg {
    width: 18px;
    height: 18px;
}

.sidebar-logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo-icon svg {
    width: 24px;
    height: 24px;
}

.filter-icon {
    display: flex;
    align-items: center;
    color: var(--color-text-muted);
}

.filter-icon svg {
    width: 16px;
    height: 16px;
}

/* ========================================
   Gantt Control Row (Sticky)
   ======================================== */
.gantt-controls {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--color-bg-card);
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--color-border);
}

.gantt-control-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

/* View mode tabs (Current/Archive) */
.gantt-view-tabs {
    display: flex;
    gap: var(--spacing-xs);
    background: var(--color-bg-secondary);
    padding: var(--spacing-xs);
    border-radius: var(--radius-md);
}

.gantt-tab {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: 0.8125rem;
    font-weight: 500;
    background: transparent;
    border: none;
    color: var(--color-text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.gantt-tab svg {
    width: 14px;
    height: 14px;
}

.gantt-tab:hover {
    color: var(--color-text-primary);
}

.gantt-tab.active {
    background: var(--color-accent);
    color: white;
}

/* Date range display */
.gantt-date-range {
    font-size: 0.8125rem;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--color-bg-elevated);
    border-radius: var(--radius-sm);
}

/* ========================================
   Gantt Legend
   ======================================== */
.gantt-legend {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-sm);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--color-border);
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    transform: rotate(45deg);
}

.legend-dot.material {
    background: #3b82f6;
}

.legend-dot.review {
    background: #f59e0b;
}

.legend-dot.publish {
    background: #ec4899;
}

.legend-bar {
    width: 24px;
    height: 8px;
    border-radius: 4px;
    background: #8b5cf6;
}

/* ========================================
   Mobile Menu Button
   ======================================== */
.mobile-menu-btn {
    display: none;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 1024px) {

    /* Show mobile menu button */
    .mobile-menu-btn {
        display: flex !important;
    }

    /* Sidebar as overlay on mobile */
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        height: 100vh;
        z-index: 100;
        transition: left var(--transition-normal);
    }

    .sidebar.open {
        left: 0;
    }

    /* Main content takes full width */
    .main-content {
        margin-left: 0;
        width: 100%;
    }

    /* Gantt responsive */
    .gantt-row-label {
        width: 180px;
        min-width: 180px;
        max-width: 180px;
    }

    .gantt-lane-label,
    .gantt-lane-header {
        width: 180px;
        min-width: 180px;
        max-width: 180px;
    }

    .gantt-row-title {
        max-width: 100px;
    }

    /* Compact controls */
    .gantt-control-row {
        gap: var(--spacing-sm);
    }

    .gantt-legend {
        gap: var(--spacing-md);
    }

    .legend-item {
        font-size: 0.6875rem;
    }

    /* Header adjustments */
    .header-title {
        font-size: 1rem;
    }

    .header-actions {
        gap: var(--spacing-sm);
    }

    .header-actions .btn-primary span:not(.btn-icon-left) {
        display: none;
    }
}

@media (max-width: 640px) {

    /* Even smaller label area */
    .gantt-row-label {
        width: 140px;
        min-width: 140px;
        max-width: 140px;
    }

    .gantt-lane-label,
    .gantt-lane-header {
        width: 140px;
        min-width: 140px;
        max-width: 140px;
    }

    .gantt-row-title {
        max-width: 80px;
    }

    /* Stack controls vertically */
    .gantt-control-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .gantt-period-buttons {
        width: 100%;
        justify-content: center;
    }

    .filter-group {
        width: 100%;
    }

    .filter-group .form-select {
        width: 100% !important;
    }

    .gantt-nav-buttons {
        width: 100%;
        justify-content: center;
    }

    /* Legend horizontal scroll */
    .gantt-legend {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: var(--spacing-xs);
    }

    /* Smaller cell width */
    .gantt-chart {
        --cell-width: 28px;
    }
}

/* Gantt horizontal scroll wrapper */
.gantt-scroll-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: calc(100vw - 330px);
    /* account for sidebar + padding */
}

.gantt-scroll-wrapper::-webkit-scrollbar {
    height: 8px;
}

.gantt-scroll-wrapper::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 4px;
}

.gantt-scroll-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}

/* Admin toggle icon alignment */
.gantt-admin-toggle span {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.gantt-admin-toggle svg {
    width: 14px;
    height: 14px;
}

/* Theme toggle icon fix */
.theme-toggle-btn svg {
    width: 20px;
    height: 20px;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.theme-option svg {
    width: 16px;
    height: 16px;
}

/* ========================================
   Gantt Empty State
   ======================================== */
.gantt-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-2xl);
    text-align: center;
    min-height: 300px;
}

.gantt-empty-state .empty-state-icon {
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-md);
}

.gantt-empty-state .empty-state-icon svg {
    width: 48px;
    height: 48px;
}

.gantt-empty-state .empty-state-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-sm);
}

.gantt-empty-state .empty-state-desc {
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-lg);
}

.gantt-empty-state .btn svg {
    width: 16px;
    height: 16px;
    margin-right: var(--spacing-xs);
}

/* ========================================
   Delivery Player Styles
   ======================================== */

/* Registration UI */
.delivery-registration {
    max-width: 600px;
    margin: 0 auto;
}

/* Review UI - Main Layout */
.delivery-review {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: var(--spacing-lg);
    height: calc(100vh - 180px);
    min-height: 500px;
}

@media (max-width: 1024px) {
    .delivery-review {
        grid-template-columns: 1fr;
        height: auto;
    }
}

/* Player Section */
.delivery-player-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    min-width: 0;
}

.delivery-video-wrapper {
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

.delivery-video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Timeline */
.delivery-timeline-wrapper {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-bg-elevated);
    border-radius: var(--radius-md);
}

.delivery-timeline {
    flex: 1;
    height: 24px;
    position: relative;
    cursor: pointer;
    border-radius: var(--radius-sm);
    overflow: visible;
}

.delivery-timeline-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--color-bg-hover);
    border-radius: 3px;
    transform: translateY(-50%);
}

.delivery-playhead {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--color-accent);
    border-radius: 2px;
    z-index: 10;
    pointer-events: none;
    box-shadow: 0 0 4px var(--color-accent);
}

.delivery-markers {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.delivery-marker {
    position: absolute;
    top: 50%;
    width: 8px;
    height: 8px;
    background: var(--color-warning);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    pointer-events: auto;
    transition: all var(--transition-fast);
    z-index: 5;
}

.delivery-marker:hover {
    transform: translate(-50%, -50%) scale(1.3);
    box-shadow: 0 0 6px var(--color-warning);
}

.delivery-marker.resolved {
    background: var(--color-success);
    opacity: 0.5;
}

.delivery-time-display {
    font-size: 0.75rem;
    font-family: monospace;
    color: var(--color-text-secondary);
    white-space: nowrap;
}

/* Comments Section */
.delivery-comments-section {
    display: flex;
    flex-direction: column;
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    overflow: hidden;
}

.delivery-comments-header {
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
}

.delivery-comments-tabs {
    display: flex;
    gap: var(--spacing-xs);
}

.delivery-tab {
    padding: var(--spacing-xs) var(--spacing-md);
    background: transparent;
    border: none;
    color: var(--color-text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.delivery-tab:hover {
    background: var(--color-bg-hover);
    color: var(--color-text-primary);
}

.delivery-tab.active {
    background: var(--color-accent);
    color: white;
}

.delivery-comments-list {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-sm);
}

.delivery-comments-empty {
    padding: var(--spacing-xl);
    text-align: center;
}

/* Comment Item */
.delivery-comment {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-bg-elevated);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-sm);
    border-left: 3px solid var(--color-warning);
    transition: all var(--transition-fast);
}

.delivery-comment:hover {
    background: var(--color-bg-hover);
}

.delivery-comment.resolved {
    opacity: 0.6;
    border-left-color: var(--color-success);
}

.delivery-comment-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
}

.delivery-comment-timecode {
    background: var(--color-accent);
    color: white;
    border: none;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.6875rem;
    font-family: monospace;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.delivery-comment-timecode:hover {
    transform: scale(1.05);
    box-shadow: 0 0 4px var(--color-accent);
}

.delivery-comment-author {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.delivery-comment-body {
    font-size: 0.875rem;
    color: var(--color-text-primary);
    line-height: 1.5;
    margin-bottom: var(--spacing-xs);
    white-space: pre-wrap;
}

.delivery-comment-actions {
    display: flex;
    gap: var(--spacing-xs);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.delivery-comment:hover .delivery-comment-actions {
    opacity: 1;
}

/* Comment Input */
.delivery-comment-input {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    border-top: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
}

.delivery-timecode-badge {
    align-self: flex-start;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--color-accent-glow);
    color: var(--color-accent);
    font-family: monospace;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
}

.delivery-comment-input textarea {
    resize: none;
}

.delivery-comment-input .btn {
    align-self: flex-end;
}

.btn-xs {
    padding: 2px 8px;
    font-size: 0.6875rem;
}

/* ========================================
   Delivery Review Component (New Classes)
   ======================================== */

.delivery-review-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    width: 100%;
}

@media (max-width: 1000px) {
    .delivery-review-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
    }
}

.delivery-player-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.video-player-wrapper {
    position: relative;
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    /* Set a reasonable aspect ratio that doesn't cut off video */
    aspect-ratio: 16 / 9;
    width: 100%;
}

.video-player-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-player-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Timecode input wrapper */
.timecode-input-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
}

.timecode-separator {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.timecode-digit {
    font-family: monospace;
    font-size: 1rem;
    padding: var(--spacing-xs) var(--spacing-sm);
}

/* Version Selector Bar */
.version-selector-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
}

.version-selector-bar select {
    font-weight: 600;
    background: var(--color-bg-card);
}

.btn-danger-text {
    color: var(--color-danger);
}

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

.player-error-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-error-content {
    text-align: center;
    color: var(--color-text-primary);
}

/* Timeline */
.timeline-container {
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    cursor: pointer;
}

.timeline-bar {
    position: relative;
    height: 24px;
    background: var(--color-bg-hover);
    border-radius: var(--radius-sm);
    overflow: visible;
}

.timeline-playhead {
    position: absolute;
    top: -4px;
    bottom: -4px;
    width: 3px;
    background: var(--color-accent);
    border-radius: 2px;
    z-index: 10;
    box-shadow: 0 0 6px var(--color-accent);
    pointer-events: none;
}

.timeline-marker {
    position: absolute;
    top: 50%;
    width: 10px;
    height: 10px;
    background: var(--color-warning);
    border: 2px solid var(--color-bg-secondary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 5;
    transition: all var(--transition-fast);
}

.timeline-marker:hover {
    transform: translate(-50%, -50%) scale(1.3);
    box-shadow: 0 0 8px var(--color-warning);
}

.timeline-marker.resolved {
    background: var(--color-success);
    opacity: 0.5;
}

.timeline-time {
    display: flex;
    justify-content: space-between;
    margin-top: var(--spacing-xs);
    font-size: 0.75rem;
    font-family: monospace;
    color: var(--color-text-secondary);
}

/* Comment Input Section */
.comment-input-section {
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    border: 1px solid var(--color-border);
}

/* Comment Panel */
.delivery-comment-section {
    display: flex;
    flex-direction: column;
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    overflow: hidden;
    max-height: 70vh;
}

.comment-panel-header {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border);
}

.comment-tabs {
    display: flex;
    gap: var(--spacing-xs);
}

.comment-tab {
    padding: var(--spacing-xs) var(--spacing-md);
    background: transparent;
    border: none;
    color: var(--color-text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.comment-tab:hover {
    background: var(--color-bg-hover);
    color: var(--color-text-primary);
}

.comment-tab.active {
    background: var(--color-accent);
    color: white;
}

.comment-list {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-sm);
}

.empty-state-sm {
    padding: var(--spacing-xl);
    text-align: center;
}

/* Comment Item */
.comment-item {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-bg-elevated);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-sm);
    border-left: 3px solid var(--color-warning);
    transition: all var(--transition-fast);
}

.comment-item:hover {
    background: var(--color-bg-hover);
}

.comment-item.resolved {
    opacity: 0.6;
    border-left-color: var(--color-success);
}

.comment-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
    flex-wrap: wrap;
}

.comment-timecode {
    background: var(--color-accent);
    color: white;
    border: none;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.6875rem;
    font-family: monospace;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.comment-timecode:hover {
    transform: scale(1.05);
    box-shadow: 0 0 4px var(--color-accent);
}

.comment-author {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.comment-date {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
    margin-left: auto;
}

.comment-body {
    font-size: 0.875rem;
    color: var(--color-text-primary);
    line-height: 1.5;
    margin-bottom: var(--spacing-xs);
    white-space: pre-wrap;
}

.comment-actions {
    display: flex;
    gap: var(--spacing-xs);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

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

/* Registration Form */
.delivery-registration {
    max-width: 600px;
    margin: 0 auto;
}

.alert-info {
    background: var(--color-info-bg);
    border-left: 3px solid var(--color-info);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
}

.alert-danger {
    background: var(--color-danger-bg);
    border-left: 3px solid var(--color-danger);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
}

.alert-success {
    background: var(--color-success-bg);
    border-left: 3px solid var(--color-success);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
}

/* ========================================
   Calendar View
   ======================================== */

.calendar-container {
    padding: var(--spacing-md);
}

.calendar-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.calendar-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--color-border);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.calendar-weekday-header {
    background: var(--color-bg-secondary);
    padding: var(--spacing-sm);
    text-align: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

.calendar-weekday-header:first-child {
    color: var(--color-danger);
}

.calendar-weekday-header:last-child {
    color: #3b82f6;
}

.calendar-day {
    background: var(--color-bg-card);
    min-height: 100px;
    padding: var(--spacing-xs);
    position: relative;
}

.calendar-day.empty {
    background: var(--color-bg-secondary);
}

.calendar-day.weekend {
    background: var(--color-weekend-bg);
}

.calendar-day.today {
    background: rgba(59, 130, 246, 0.1);
}

.calendar-day.today .calendar-day-number {
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-day-number {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
}

.calendar-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    max-height: 70px;
}

.calendar-event {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 4px 2px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.7rem;
    transition: background var(--transition-fast);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
}

.calendar-event:hover {
    background: var(--color-bg-hover);
}

.calendar-event.material {
    border-left: 3px solid #3b82f6;
}

.calendar-event.review {
    border-left: 3px solid #f59e0b;
}

.calendar-event.publish {
    border-left: 3px solid #ec4899;
}

.event-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.event-dest-bar {
    width: 4px;
    min-height: 100%;
    border-radius: 2px;
    flex-shrink: 0;
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
}

.event-title {
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-legend {
    display: flex;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-md);
    padding: var(--spacing-sm);
}

/* ========================================
   Past Schedule Component
   ======================================== */
.past-schedule-container {
    padding: var(--spacing-md);
}

.past-schedule-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-sm);
}

.past-schedule-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.past-schedule-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.past-schedule-item:hover {
    background: var(--color-bg-hover);
    border-color: var(--color-accent);
}

.past-schedule-item-title {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--color-text-primary);
    margin-bottom: 2px;
}

.past-schedule-item-meta {
    display: flex;
    gap: var(--spacing-sm);
    font-size: 0.75rem;
    color: var(--color-text-tertiary);
    flex-wrap: wrap;
    align-items: center;
}

/* Month Group (collapsible) */
.month-group {
    margin-bottom: var(--spacing-xs);
}

.month-group-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.month-group-header:hover {
    background: var(--color-bg-hover);
}

.month-group-toggle {
    font-size: 0.75rem;
    color: var(--color-text-tertiary);
}

.month-group-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--color-text-primary);
}

.month-group-count {
    font-size: 0.75rem;
    color: var(--color-text-tertiary);
    background: var(--color-bg-card);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

.month-group-content {
    margin-top: var(--spacing-xs);
    margin-left: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}