/* ============================================
   YouTube Production Studio - Design System v2
   Complete - every class used by components is defined
   ============================================ */

:root {
    --primary: #ff0000;
    --primary-hover: #cc0000;
    --primary-light: rgba(255, 0, 0, 0.12);

    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #242424;
    --bg-hover: #2a2a2a;

    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-muted: #808080;

    --border: #333333;
    --border-light: #444444;

    --success: #00c853;
    --warning: #ffa726;
    --error: #f44336;
    --info: #2196f3;

    --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 25px rgba(0, 0, 0, 0.5);

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    --z-sidebar: 100;
    --z-modal: 1000;
    --z-toast: 1100;
    --z-teleprompter: 1200;
}

[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f7f7f7;
    --bg-tertiary: #ececec;
    --bg-hover: #f0f0f0;
    --text-primary: #0f0f0f;
    --text-secondary: #606060;
    --text-muted: #909090;
    --border: #e0e0e0;
    --border-light: #d0d0d0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow: hidden;
}

#app {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ---------- Scrollbars ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============ SIDEBAR ============ */
.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-base, 200ms ease), left var(--transition-base, 200ms ease);
    z-index: var(--z-sidebar);
    flex-shrink: 0;
}

.sidebar.collapsed { width: 70px; }
.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .project-selector { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: var(--spacing-md, 1rem); }

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.logo { display: flex; align-items: center; gap: 0.5rem; }
.logo-icon { width: 32px; height: 32px; color: var(--primary); }
.logo-text { font-size: 1.25rem; font-weight: 700; }

.sidebar-toggle {
    background: none; border: none; color: var(--text-secondary);
    cursor: pointer; padding: 0.25rem; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    transition: all 150ms ease;
}
.sidebar-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }
.sidebar-toggle svg { width: 20px; height: 20px; }

.nav-menu { flex: 1; overflow-y: auto; padding: 0.75rem 0; }

.nav-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.7rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 150ms ease;
    border-left: 3px solid transparent;
    cursor: pointer;
    user-select: none;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active {
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border-left-color: var(--primary);
}
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }

.sidebar-footer { padding: 0.75rem 1rem; border-top: 1px solid var(--border); }

.project-selector { display: flex; flex-direction: column; gap: 0.25rem; }
.project-selector label {
    font-size: 0.7rem; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.5px;
}
.project-selector select {
    width: 100%; padding: 0.45rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    max-width: 100%;
}

/* ============ MAIN ============ */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

.top-bar {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.6rem 1.5rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.mobile-menu-toggle {
    display: none; background: none; border: none;
    color: var(--text-primary); cursor: pointer; padding: 0.25rem;
}
.mobile-menu-toggle svg { width: 24px; height: 24px; }

.breadcrumb { flex: 1; display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.breadcrumb-item { color: var(--text-secondary); font-size: 0.85rem; white-space: nowrap; }
.breadcrumb-item.active { color: var(--text-primary); font-weight: 600; }
.breadcrumb-separator { color: var(--text-muted); font-size: 0.85rem; }

.top-bar-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }

.top-project-select {
    min-width: 180px; max-width: 240px;
    padding: 0.4rem 0.6rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.8rem;
    cursor: pointer;
}

.autosave-status {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    transition: color 300ms ease;
    display: flex; align-items: center; gap: 0.3rem;
}
.autosave-status.saved { color: var(--success); }

.btn-icon {
    position: relative; background: none; border: none;
    color: var(--text-secondary); cursor: pointer;
    padding: 0.4rem; border-radius: var(--radius-sm);
    transition: all 150ms ease;
    display: flex; align-items: center; justify-content: center;
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-icon svg { width: 20px; height: 20px; }

.notification-badge {
    position: absolute; top: 2px; right: 2px;
    background: var(--primary); color: white;
    font-size: 0.6rem; font-weight: 700;
    padding: 1px 5px; border-radius: var(--radius-full);
    min-width: 15px; text-align: center;
}

.content-area { flex: 1; overflow-y: auto; padding: 1.5rem; scroll-behavior: smooth; }

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
    padding: 0.55rem 1rem;
    border: none; border-radius: var(--radius-md);
    font-size: 0.85rem; font-weight: 600;
    cursor: pointer; transition: all 150ms ease;
    text-decoration: none; line-height: 1.4;
    white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

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

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

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #00a844; }

.btn-danger { background: var(--error); color: white; }
.btn-danger:hover { background: #d32f2f; }

.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.75rem; border-radius: var(--radius-sm); }

.w-full { width: 100%; }

/* ============ CARDS & STATS ============ */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: border-color 200ms ease, box-shadow 200ms ease;
}
.card.hoverable:hover, .card:hover { border-color: var(--border-light); box-shadow: var(--shadow-md); }

.card-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 0.75rem; margin-bottom: 1rem; flex-wrap: wrap;
}
.card-title { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); }
.card-body { color: var(--text-secondary); }

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex; align-items: center; gap: 1rem;
}
.stat-icon {
    width: 48px; height: 48px; flex-shrink: 0;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    color: var(--primary);
    font-size: 1.4rem;
}
.stat-icon svg { width: 24px; height: 24px; }
.stat-content { flex: 1; min-width: 0; }
.stat-value { font-size: 1.4rem; font-weight: 800; color: var(--text-primary); line-height: 1.2; }
.stat-label { font-size: 0.8rem; color: var(--text-secondary); }

/* ============ GRID ============ */
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* ============ FORMS ============ */
.form-group { margin-bottom: 1rem; }
.form-label {
    display: block; margin-bottom: 0.3rem;
    font-size: 0.82rem; font-weight: 600;
    color: var(--text-secondary);
}
.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: inherit;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.form-textarea { resize: vertical; min-height: 90px; }
.form-select { cursor: pointer; }
select.form-select option { background: var(--bg-secondary); color: var(--text-primary); }

/* ============ TABLES ============ */
.table-container { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 0.7rem 0.9rem; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.84rem; }
.table th {
    background: var(--bg-tertiary);
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.72rem;
    white-space: nowrap;
}
.table td { color: var(--text-primary); }
.table tr:hover td { background: var(--bg-hover); }
.table tr:last-child td { border-bottom: none; }
.table tbody tr { cursor: default; }

/* ============ BADGES ============ */
.badge {
    display: inline-flex; align-items: center; gap: 0.25rem;
    padding: 0.18rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.68rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.4px;
    white-space: nowrap;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: rgba(0, 200, 83, 0.12); color: var(--success); }
.badge-warning { background: rgba(255, 167, 38, 0.12); color: var(--warning); }
.badge-error { background: rgba(244, 67, 54, 0.12); color: var(--error); }
.badge-info { background: rgba(33, 150, 243, 0.12); color: var(--info); }

/* ============ PROGRESS ============ */
.progress { height: 8px; background: var(--bg-tertiary); border-radius: var(--radius-full); overflow: hidden; }
.progress-bar { height: 100%; background: var(--primary); border-radius: var(--radius-full); transition: width 300ms ease; }
.progress-bar.success { background: var(--success); }
.progress-bar.warning { background: var(--warning); }
.progress-bar.error { background: var(--error); }

/* ============ MODAL ============ */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(3px);
    display: none; align-items: center; justify-content: center;
    z-index: var(--z-modal); padding: 1.5rem;
}
.modal-overlay.active { display: flex; }

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    max-width: 640px; width: 100%;
    max-height: 88vh;
    overflow: hidden;
    display: flex; flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: modalIn 180ms ease;
}
@keyframes modalIn {
    from { transform: translateY(12px) scale(0.98); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.modal-title { font-size: 1.1rem; font-weight: 700; }
.modal-close {
    background: none; border: none; color: var(--text-secondary);
    cursor: pointer; padding: 0.25rem;
    display: flex; border-radius: var(--radius-sm);
    transition: all 150ms ease;
}
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.modal-close svg { width: 20px; height: 20px; }

.modal-body { padding: 1.25rem 1.5rem; overflow-y: auto; flex: 1; }
.modal-footer {
    display: flex; justify-content: flex-end; gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* ============ TOASTS ============ */
.toast-container {
    position: fixed; top: 1rem; right: 1rem;
    z-index: var(--z-toast);
    display: flex; flex-direction: column; gap: 0.5rem;
    max-width: 360px;
}
.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    box-shadow: var(--shadow-lg);
    display: flex; align-items: center; gap: 0.75rem;
    animation: toastIn 250ms ease;
    font-size: 0.84rem;
}
@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--error); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.info { border-left: 4px solid var(--info); }
.toast-message { flex: 1; color: var(--text-primary); }
.toast-close {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; padding: 0.15rem;
    display: flex;
}
.toast-close:hover { color: var(--text-primary); }
.toast-close svg { width: 15px; height: 15px; }

/* ============ TABS ============ */
.tabs {
    display: flex; gap: 0.15rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.25rem;
    overflow-x: auto;
    flex-shrink: 0;
}
.tab {
    padding: 0.6rem 1.1rem;
    background: none; border: none;
    color: var(--text-secondary);
    font-size: 0.84rem; font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 150ms ease;
    white-space: nowrap;
    font-family: inherit;
}
.tab:hover { color: var(--text-primary); background: var(--bg-hover); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.tab.active { color: var(--text-primary); border-bottom-color: var(--primary); }

/* ============ CHECKLIST ============ */
.checklist { list-style: none; }
.checklist-item {
    display: flex; align-items: flex-start; gap: 0.75rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border);
}
.checklist-item:last-child { border-bottom: none; }
.checklist-item input[type="checkbox"] {
    width: 17px; height: 17px; margin-top: 2px; flex-shrink: 0;
    cursor: pointer; accent-color: var(--primary);
}
.checklist-item label { flex: 1; cursor: pointer; font-size: 0.85rem; color: var(--text-primary); }
.checklist-item.completed label { text-decoration: line-through; color: var(--text-muted); }

/* ============ EMPTY STATE ============ */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}
.empty-state svg { width: 56px; height: 56px; margin: 0 auto 0.75rem; opacity: 0.5; display: block; }
.empty-state h3 { font-size: 1.1rem; margin-bottom: 0.4rem; color: var(--text-secondary); }
.empty-state p { font-size: 0.85rem; margin-bottom: 1.25rem; max-width: 420px; margin-left: auto; margin-right: auto; }

/* ============ PAGE HEADER & FILTERS ============ */
.page-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap;
}
.page-header h1 { font-size: 1.6rem; font-weight: 800; margin-bottom: 0.15rem; }
.page-header p { font-size: 0.85rem; }

.filters-bar {
    display: flex; gap: 0.75rem; margin-bottom: 1.25rem;
    flex-wrap: wrap; align-items: center;
}
.filters-bar .form-input { flex: 1; min-width: 200px; max-width: 340px; }
.filters-bar .form-select { width: auto; min-width: 160px; }
.view-toggle { display: flex; gap: 0.3rem; }

/* ============ PROJECTS ============ */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.project-card { cursor: pointer; height: 100%; display: flex; flex-direction: column; }
.project-card .card-body { flex: 1; display: flex; flex-direction: column; }
.project-card .card-body > .mt-md:last-child { margin-top: auto; }

.project-menu { display: flex; flex-direction: column; gap: 0.5rem; }

.project-detail .project-header { margin-bottom: 1.5rem; }
.project-header h1 { font-size: 1.7rem; font-weight: 800; }

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }

/* ============ PIPELINE ============ */
.pipeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.75rem; }
.pipeline-stage {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem;
}
.pipeline-stage-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 0.5rem;
}
.pipeline-stage-header h4 { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-secondary); }
.pipeline-stage-projects { display: flex; flex-direction: column; gap: 0.4rem; }
.pipeline-project {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.6rem;
    cursor: pointer;
    transition: border-color 150ms ease;
}
.pipeline-project:hover { border-color: var(--primary); }

/* ============ ACTIVITY / DEADLINES ============ */
.activity-list { display: flex; flex-direction: column; }
.activity-item {
    display: flex; gap: 0.75rem; align-items: flex-start;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}
.activity-item:last-child { border-bottom: none; }
.activity-item:hover .activity-message { color: var(--text-primary); }
.activity-icon {
    width: 32px; height: 32px; flex-shrink: 0;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    display: flex; align-items: center; justify-content: center;
    color: var(--primary);
}
.activity-icon svg { width: 15px; height: 15px; }
.activity-content { flex: 1; min-width: 0; }
.activity-message { font-size: 0.84rem; color: var(--text-secondary); }
.activity-time { font-size: 0.72rem; }

.deadline-list { display: flex; flex-direction: column; }
.deadline-item {
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}
.deadline-item:last-child { border-bottom: none; }
.deadline-info { min-width: 0; }
.deadline-badge {
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem; font-weight: 700;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.deadline-badge.urgent { background: var(--error); color: white; }

/* ============ TIMELINE ============ */
.timeline { position: relative; padding-left: 1.5rem; }
.timeline::before {
    content: '';
    position: absolute; left: 6px; top: 4px; bottom: 4px;
    width: 2px;
    background: var(--border);
}
.timeline-item { position: relative; padding-bottom: 1.25rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-marker {
    position: absolute; left: -1.5rem; top: 5px;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--primary);
}
.timeline-marker.completed { background: var(--success); border-color: var(--success); }
.timeline-content {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
}

/* ============ OUTLINE (planner) ============ */
.outline-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem;
}

/* ============ STORYBOARD ============ */
.storyboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.storyboard-frame { position: relative; padding: 0; overflow: hidden; }
.storyboard-frame-number {
    position: absolute; top: 0.5rem; left: 0.5rem; z-index: 2;
    background: var(--primary); color: white;
    width: 26px; height: 26px;
    border-radius: var(--radius-full);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 800;
}
.storyboard-frame-sketch {
    aspect-ratio: 16 / 9;
    background: var(--bg-tertiary);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-bottom: 1px solid var(--border);
}
.storyboard-frame-sketch img { width: 100%; height: 100%; object-fit: cover; }
.storyboard-frame-info { padding: 0.75rem; }
.placeholder { opacity: 0.5; font-style: italic; }

/* ============ TELEPROMPTER ============ */
.teleprompter-overlay {
    position: fixed; inset: 0;
    background: #000;
    z-index: var(--z-teleprompter);
    display: flex; flex-direction: column;
    color: #fff;
}
.teleprompter-toolbar {
    display: flex; align-items: center; gap: 1rem;
    padding: 0.75rem 1.5rem;
    background: #111;
    border-bottom: 1px solid #2a2a2a;
    flex-wrap: wrap;
    z-index: 2;
}
.teleprompter-toolbar label { font-size: 0.8rem; color: #aaa; display: flex; align-items: center; gap: 0.5rem; }
.teleprompter-toolbar input[type="range"] { width: 140px; accent-color: var(--primary); }
.teleprompter-toolbar input[type="number"] {
    width: 64px; padding: 0.25rem 0.4rem;
    background: #1a1a1a; border: 1px solid #333;
    border-radius: var(--radius-sm); color: white; font-size: 0.8rem;
}
.teleprompter-scroll {
    flex: 1; overflow: hidden;
    position: relative;
    display: flex; justify-content: center;
}
.teleprompter-text {
    width: min(780px, 90%);
    padding: 12vh 1.5rem 60vh;
    font-size: 1.6rem;
    line-height: 1.9;
    font-family: 'Inter', sans-serif;
    white-space: pre-wrap;
    color: #eee;
    user-select: none;
}
.teleprompter-text.mirror { transform: scaleX(-1); }
.teleprompter-start {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem;
    background: rgba(0, 0, 0, 0.5);
    z-index: 3;
}
.teleprompter-hint { font-size: 1rem; color: #aaa; }

/* ============ CHART ============ */
.chart-container {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    width: 100%;
}
.chart-container svg { width: 100%; height: auto; display: block; }
.chart-axis-label { font-size: 0.65rem; fill: var(--text-muted); }
.chart-line { fill: none; stroke: var(--primary); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart-area { fill: var(--primary-light); }
.chart-dot { fill: var(--primary); }

/* ============ UTILITIES ============ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.bg-muted { background: var(--bg-tertiary); }

.text-xs { font-size: 0.72rem; }
.text-sm { font-size: 0.84rem; }
.text-lg { font-size: 1.1rem; }
.text-xl { font-size: 1.3rem; }
.text-2xl { font-size: 1.6rem; }
.text-3xl { font-size: 2rem; }
.text-4xl { font-size: 2.6rem; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

.mb-xs { margin-bottom: 0.25rem; }
.mb-sm { margin-bottom: 0.5rem; }
.mb-md { margin-bottom: 1rem; }
.mb-lg { margin-bottom: 1.5rem; }
.mt-xs { margin-top: 0.25rem; }
.mt-sm { margin-top: 0.5rem; }
.mt-md { margin-top: 1rem; }
.mt-lg { margin-top: 1.5rem; }

.p-md { padding: 1rem; }

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.gap-xs { gap: 0.25rem; }
.gap-sm { gap: 0.5rem; }
.gap-md { gap: 1rem; }
.gap-lg { gap: 1.5rem; }

.space-y-xs > * + * { margin-top: 0.25rem; }
.space-y-sm > * + * { margin-top: 0.5rem; }
.space-y-md > * + * { margin-top: 1rem; }
.space-y-lg > * + * { margin-top: 1.5rem; }

.border-t { border-top: 1px solid var(--border); }
.p-relative { position: relative; }

.hidden { display: none !important; }

/* ============ LOADING ============ */
.loading {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    height: 100%; gap: 0.75rem; color: var(--text-muted);
}
.spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ NOTIFICATIONS PANEL ============ */
.notif-list { max-height: 320px; overflow-y: auto; }
.notif-item {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.84rem;
}
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { font-weight: 600; color: var(--text-primary); }
.notif-item .notif-time { font-size: 0.7rem; color: var(--text-muted); }

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -280px; top: 0; bottom: 0;
        transition: left 200ms ease;
        box-shadow: var(--shadow-lg);
    }
    .sidebar.mobile-open { left: 0; }
    .mobile-menu-toggle { display: flex; }
    .content-area { padding: 1rem; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .modal { max-width: 100%; margin: 0.5rem; max-height: 92vh; }
    .top-project-select { display: none; }
    .autosave-status { display: none; }
    .page-header { flex-direction: column; }
}

/* ============ KANBAN BOARD ============ */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.85rem;
    align-items: start;
    overflow-x: auto;
}
.kanban-column {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.7rem;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    transition: border-color 150ms ease, background 150ms ease;
}
.kanban-column.drag-over {
    border-color: var(--primary);
    background: var(--primary-light);
}
.kanban-column-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 0.7rem;
}
.kanban-count {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 0.1rem 0.55rem;
    font-size: 0.75rem; font-weight: 700;
    color: var(--text-secondary);
}
.kanban-column-body {
    display: flex; flex-direction: column; gap: 0.6rem;
    flex: 1;
}
.kanban-empty {
    border: 1px dashed var(--border-light);
    border-radius: var(--radius-md);
    padding: 1.5rem 0.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
}
.kanban-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.75rem;
    cursor: grab;
    transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
    user-select: none;
}
.kanban-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kanban-card.dragging { opacity: 0.4; }
.kanban-card-title { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.35rem; }
.kanban-card-meta {
    display: flex; justify-content: space-between; gap: 0.5rem;
    font-size: 0.7rem; color: var(--text-muted);
    margin-bottom: 0.4rem;
}
.kanban-card-footer {
    display: flex; justify-content: space-between;
    margin-top: 0.4rem;
}

/* ============ CALENDAR ============ */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 8px;
}
.cal-weekday {
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 0.4rem 0;
}
.cal-cell {
    min-height: 92px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.3rem;
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow: hidden;
    transition: border-color 120ms ease;
}
.cal-cell:hover { border-color: var(--border-light); }
.cal-empty { background: transparent; border-color: transparent; }
.cal-today { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.cal-day-num {
    font-size: 0.75rem; font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 2px;
}
.cal-today .cal-day-num {
    color: var(--primary);
}
.cal-event {
    font-size: 0.66rem;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
}
.cal-event:hover { filter: brightness(1.2); }
.cal-event-publish { border-left: 3px solid var(--success); }
.cal-event-milestone { border-left: 3px solid var(--warning); }
.cal-event-shoot { border-left: 3px solid var(--info); }
.cal-legend {
    display: flex; align-items: center; gap: 0.4rem;
    font-size: 0.78rem; color: var(--text-secondary);
}
.cal-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.cal-dot-publish { background: var(--success); }
.cal-dot-milestone { background: var(--warning); }
.cal-dot-shoot { background: var(--info); }

/* ============ PRINT (script export) ============ */
@media print {
    .sidebar, .top-bar, .btn, .tabs { display: none !important; }
    body { overflow: visible; }
    .main-content { overflow: visible; }
    .content-area { padding: 0; overflow: visible; }
}
