/* ================================================
   GanttFlow v3 — Full Design System
   Themes · Chart Styles · Members · Export
   ================================================ */

/* ═══ CSS Custom Properties (Dark Theme — Default) ═══ */
:root, [data-theme="dark"] {
    --bg-primary: #0a0a0f;
    --bg-secondary: #111118;
    --bg-tertiary: #1a1a2e;
    --bg-card: #14142a;
    --bg-card-hover: #1c1c38;
    --bg-input: #181830;
    --bg-surface: #0e0e1a;

    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b8;
    --text-muted: #5e5e75;
    --text-accent: #c4b5fd;

    --accent-primary: #8b5cf6;
    --accent-secondary: #6366f1;
    --accent-light: #a78bfa;
    --accent-glow: rgba(139, 92, 246, 0.2);
    --accent-glow-strong: rgba(139, 92, 246, 0.4);

    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;

    --border-subtle: rgba(255, 255, 255, 0.05);
    --border-medium: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(139, 92, 246, 0.25);

    --bar-opacity: 1;
    --bar-radius: 6px;
    --grid-border: 1px solid var(--border-subtle);

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

    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 24px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 40px var(--accent-glow);

    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 400ms cubic-bezier(0.16, 1, 0.3, 1);

    --cell-width: 54px;
    --cell-height: 50px;
    --task-label-width: 220px;
    --header-height: 56px;
    --footer-height: 36px;

    color-scheme: dark;
}

/* ═══ Light Theme ═══ */
[data-theme="light"] {
    --bg-primary: #f5f6fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #eef0f6;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f1f8;
    --bg-input: #f0f1f8;
    --bg-surface: #fafbff;

    --text-primary: #1a1a2e;
    --text-secondary: #555570;
    --text-muted: #8888a0;
    --text-accent: #6366f1;

    --accent-glow: rgba(99, 102, 241, 0.12);
    --accent-glow-strong: rgba(99, 102, 241, 0.25);

    --border-subtle: rgba(0, 0, 0, 0.06);
    --border-medium: rgba(0, 0, 0, 0.1);
    --border-accent: rgba(99, 102, 241, 0.2);

    --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.1);
    --shadow-glow: 0 0 30px var(--accent-glow);

    color-scheme: light;
}

/* ═══ Reset & Base ═══ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    transition: background 0.4s ease, color 0.3s ease;
}
input, button, textarea { font-family: inherit; border: none; outline: none; }
a { color: var(--accent-light); text-decoration: none; }
[data-theme="light"] a { color: var(--accent-secondary); }
.hidden { display: none !important; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(128,128,128,0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(128,128,128,0.35); }

/* ================================================
   SPLASH SCREEN
   ================================================ */
.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #07070d;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.splash-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.splash-content {
    text-align: center;
    animation: splashIn 0.8s ease-out;
}

@keyframes splashIn {
    from { opacity: 0; transform: scale(0.9) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.splash-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    background: linear-gradient(145deg, #16162a, #1a1a2e);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    margin-bottom: 1.5rem;
    box-shadow: 0 0 60px rgba(139, 92, 246, 0.25);
    animation: splashFloat 3s ease-in-out infinite;
}

@keyframes splashFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.splash-title {
    font-size: 2.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #f0f0f5, #a78bfa, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
    margin-bottom: 0.3rem;
}

.splash-by {
    font-size: 1rem;
    color: #6b6b80;
    font-weight: 400;
    margin-bottom: 2rem;
}

.splash-brand {
    color: #a78bfa;
    font-weight: 600;
}

.splash-loader {
    width: 180px;
    height: 3px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    margin: 0 auto;
    overflow: hidden;
}

.splash-loader-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #a78bfa);
    border-radius: 3px;
    animation: splashLoad 1.8s ease-in-out forwards;
}

@keyframes splashLoad {
    0% { width: 0%; }
    40% { width: 60%; }
    80% { width: 90%; }
    100% { width: 100%; }
}

/* ================================================
   FOOTER
   ================================================ */
.app-footer {
    height: var(--footer-height);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
    font-size: 0.72rem;
    color: var(--text-muted);
    position: relative;
    z-index: 1;
}

.app-footer a {
    color: var(--accent-light);
    font-weight: 600;
    transition: color var(--transition-fast);
}

.app-footer a:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

[data-theme="light"] .app-footer a { color: var(--accent-secondary); }

/* ================================================
   SETUP SCREEN
   ================================================ */
.setup-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 2rem;
}

.setup-container {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 540px;
    width: 100%;
    animation: fadeInUp 0.7s var(--transition-smooth);
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

.logo-area { margin-bottom: 2.5rem; }

.logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: linear-gradient(145deg, var(--bg-tertiary), var(--bg-card));
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-glow);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.logo-title {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-light), var(--accent-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
}

.logo-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-top: 0.25rem;
    letter-spacing: 0.06em;
}

/* Project Cards */
.existing-projects { margin-bottom: 1.5rem; text-align: left; }

.section-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    text-align: center;
}

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

.project-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.project-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm), 0 0 20px var(--accent-glow);
}

.project-card-info { display: flex; flex-direction: column; gap: 0.15rem; text-align: left; }
.project-card-name { font-size: 0.92rem; font-weight: 600; }
.project-card-meta { font-size: 0.75rem; color: var(--text-muted); }
.project-card-actions { display: flex; gap: 0.35rem; }

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.btn-icon:hover { color: var(--text-primary); background: var(--bg-tertiary); border-color: var(--border-medium); }

.btn-delete-project:hover {
    color: var(--danger) !important;
    background: rgba(239, 68, 68, 0.1) !important;
}

.divider-or { text-align: center; margin: 1.25rem 0; position: relative; }
.divider-or::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--border-medium); }
.divider-or span { position: relative; z-index: 1; background: var(--bg-primary); padding: 0 1rem; font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* Setup Card */
.setup-card {
    background: linear-gradient(145deg, rgba(20, 20, 42, 0.85), rgba(26, 26, 46, 0.6));
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    padding: 2rem;
    text-align: left;
    box-shadow: var(--shadow-lg);
}

[data-theme="light"] .setup-card {
    background: rgba(255,255,255,0.85);
}

.setup-heading { font-size: 1.12rem; font-weight: 700; margin-bottom: 0.3rem; }
.setup-desc { color: var(--text-secondary); font-size: 0.82rem; margin-bottom: 1.5rem; }

.date-inputs { display: flex; align-items: flex-end; gap: 0.75rem; margin-bottom: 1.5rem; }

.input-group { flex: 1; }
.input-group label { display: block; font-size: 0.7rem; font-weight: 600; color: var(--text-muted); margin-bottom: 0.35rem; text-transform: uppercase; letter-spacing: 0.1em; }

.input-group input[type="date"],
.input-group input[type="text"] {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: var(--bg-input);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.88rem;
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.input-group input:focus { border-color: var(--accent-primary); box-shadow: 0 0 0 3px var(--accent-glow); }
.input-group input::placeholder { color: var(--text-muted); }
.input-group input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.6); cursor: pointer; }
[data-theme="light"] .input-group input[type="date"]::-webkit-calendar-picker-indicator { filter: none; }

.input-separator { color: var(--text-muted); padding-bottom: 0.3rem; }

/* Buttons */
.btn-primary {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
    color: white; font-size: 0.92rem; font-weight: 600;
    border-radius: var(--radius-md); cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 15px var(--accent-glow);
    width: 100%; justify-content: center;
}

.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 30px var(--accent-glow-strong); }
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-primary.loading { pointer-events: none; opacity: 0.7; }

.btn-primary-sm {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
    color: white; font-size: 0.8rem; font-weight: 600;
    border-radius: var(--radius-sm); cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary-sm:hover { transform: translateY(-1px); box-shadow: 0 4px 12px var(--accent-glow); }

.btn-ghost {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    background: transparent; color: var(--text-secondary);
    font-size: 0.8rem; font-weight: 500;
    border-radius: var(--radius-sm); cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid var(--border-subtle);
}

.btn-ghost:hover { color: var(--text-primary); background: var(--bg-tertiary); border-color: var(--border-medium); }

/* BG Orbs */
.bg-decoration { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.bg-orb { position: absolute; border-radius: 50%; filter: blur(120px); opacity: 0.12; }
.bg-orb-1 { width: 500px; height: 500px; background: var(--accent-primary); top: -15%; left: -10%; animation: orbMove1 22s ease-in-out infinite; }
.bg-orb-2 { width: 400px; height: 400px; background: #6366f1; bottom: -15%; right: -10%; animation: orbMove2 28s ease-in-out infinite; }
.bg-orb-3 { width: 300px; height: 300px; background: #a78bfa; top: 50%; left: 50%; transform: translate(-50%, -50%); animation: orbMove3 18s ease-in-out infinite; }

[data-theme="light"] .bg-orb { opacity: 0.06; }

@keyframes orbMove1 { 0%, 100% { transform: translate(0, 0); } 33% { transform: translate(40px, 60px); } 66% { transform: translate(-20px, 40px); } }
@keyframes orbMove2 { 0%, 100% { transform: translate(0, 0); } 33% { transform: translate(-50px, -30px); } 66% { transform: translate(30px, -50px); } }
@keyframes orbMove3 { 0%, 100% { transform: translate(-50%, -50%) scale(1); } 50% { transform: translate(-50%, -50%) scale(1.2); } }

/* ================================================
   APP SCREEN
   ================================================ */
.app-screen { min-height: 100vh; display: flex; flex-direction: column; animation: fadeInUp 0.4s ease; }

.app-header {
    height: var(--header-height);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 1rem;
    background: var(--bg-secondary);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky; top: 0; z-index: 100;
}

.header-left { display: flex; align-items: center; gap: 0.6rem; }
.header-logo { display: flex; align-items: center; gap: 0.5rem; }

.header-title {
    font-size: 0.95rem; font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-light));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.header-date-range {
    font-size: 0.72rem; color: var(--text-muted);
    padding: 0.25rem 0.6rem; background: var(--bg-tertiary);
    border-radius: 6px; border: 1px solid var(--border-subtle); white-space: nowrap;
}

.header-right { display: flex; align-items: center; gap: 0.4rem; }

/* Task Panel */
.task-panel {
    padding: 0.75rem 1.25rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
}

.task-panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.task-panel-header h3 { font-size: 0.88rem; font-weight: 600; }

.task-count {
    font-size: 0.72rem; color: var(--text-muted);
    background: var(--bg-tertiary); padding: 0.15rem 0.55rem;
    border-radius: var(--radius-full);
}

.task-input-row { display: flex; gap: 0.4rem; margin-bottom: 0.5rem; }

.task-input-row input {
    flex: 1; padding: 0.5rem 0.75rem;
    background: var(--bg-input); border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm); color: var(--text-primary);
    font-size: 0.85rem;
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.task-input-row input:focus { border-color: var(--accent-primary); box-shadow: 0 0 0 3px var(--accent-glow); }
.task-input-row input::placeholder { color: var(--text-muted); }

.btn-add {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
    color: white; border-radius: var(--radius-sm); cursor: pointer;
    transition: all var(--transition-fast); flex-shrink: 0;
}

.btn-add:hover { transform: scale(1.05); box-shadow: 0 4px 15px var(--accent-glow); }
.btn-add:active { transform: scale(0.95); }

.btn-add-sm {
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
    color: white; border-radius: var(--radius-sm); cursor: pointer;
    transition: all var(--transition-fast); flex-shrink: 0;
}

/* Task Chips */
.task-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; min-height: 14px; }

.task-chip {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    background: var(--bg-tertiary); border: 1px solid var(--border-medium);
    border-radius: var(--radius-full); font-size: 0.76rem;
    cursor: grab; transition: all var(--transition-fast); user-select: none;
}

.task-chip:hover { background: var(--bg-card-hover); border-color: var(--border-accent); transform: translateY(-1px); }
.task-chip:active { cursor: grabbing; }
.task-chip.dragging { opacity: 0.4; transform: scale(0.9); }

.chip-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.chip-label { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chip-remove {
    display: flex; align-items: center; justify-content: center;
    width: 15px; height: 15px; border-radius: 50%;
    background: transparent; color: var(--text-muted);
    cursor: pointer; transition: all var(--transition-fast); font-size: 0.6rem;
}

.chip-remove:hover { background: rgba(239, 68, 68, 0.2); color: var(--danger); }

/* ================================================
   GANTT CHART
   ================================================ */
.gantt-wrapper {
    flex: 1;
    overflow: auto;
    padding: 1rem;
    position: relative;
}

.gantt-container { min-width: max-content; }

.loading-state { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; color: var(--text-muted); font-size: 0.88rem; }
.spinner { width: 32px; height: 32px; border: 3px solid var(--border-medium); border-top-color: var(--accent-primary); border-radius: 50%; margin: 0 auto 0.75rem; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; }
.empty-icon { color: var(--text-muted); margin-bottom: 0.6rem; }
.empty-title { font-size: 1rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.3rem; }
.empty-desc { font-size: 0.8rem; color: var(--text-muted); max-width: 250px; line-height: 1.5; }

/* Gantt Table */
.gantt-table { border-collapse: separate; border-spacing: 0; width: max-content; }
.gantt-table thead { position: sticky; top: 0; z-index: 10; }
.gantt-table th { padding: 0; font-weight: 500; }

.gantt-header-month {
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-medium);
    border-right: var(--grid-border);
    padding: 0.4rem 0.5rem;
    font-size: 0.68rem; font-weight: 700;
    color: var(--accent-light); text-transform: uppercase;
    letter-spacing: 0.1em; text-align: center;
}

[data-theme="light"] .gantt-header-month { color: var(--accent-secondary); }

.gantt-header-month.task-label-header {
    position: sticky; left: 0; z-index: 15;
    width: var(--task-label-width); min-width: var(--task-label-width);
    text-align: left; padding-left: 0.75rem;
    background: var(--bg-tertiary);
}

.gantt-header-day {
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border-medium);
    border-right: var(--grid-border);
    width: var(--cell-width); min-width: var(--cell-width);
    height: 44px; text-align: center; vertical-align: middle;
}

.gantt-header-day.task-label-header {
    position: sticky; left: 0; z-index: 15;
    width: var(--task-label-width); min-width: var(--task-label-width);
    text-align: left; padding-left: 0.75rem;
    background: var(--bg-secondary);
    font-size: 0.72rem; color: var(--text-muted);
}

.day-num { display: block; font-size: 0.82rem; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.day-name { display: block; font-size: 0.58rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; }

.gantt-header-day.weekend { background: rgba(139, 92, 246, 0.03); }
[data-theme="light"] .gantt-header-day.weekend { background: rgba(99, 102, 241, 0.04); }
.gantt-header-day.today { background: rgba(139, 92, 246, 0.1); border-bottom-color: var(--accent-primary); }
.gantt-header-day.today .day-num { color: var(--accent-light); }

/* Task Label */
.gantt-task-label {
    position: sticky; left: 0; z-index: 5;
    background: var(--bg-primary);
    border-right: 2px solid var(--border-medium);
    border-bottom: var(--grid-border);
    padding: 0 0.5rem;
    width: var(--task-label-width); min-width: var(--task-label-width);
    height: var(--cell-height);
}

.task-label-inner { display: flex; align-items: center; gap: 0.4rem; height: 100%; }
.task-label-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.task-label-text { font-size: 0.8rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }

.task-label-members {
    display: flex;
    margin-left: auto;
    flex-shrink: 0;
}

.member-avatar {
    width: 22px; height: 22px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.55rem; font-weight: 700;
    color: white;
    margin-left: -4px;
    border: 2px solid var(--bg-primary);
    cursor: pointer;
    transition: transform var(--transition-fast);
    flex-shrink: 0;
}

.member-avatar:hover { transform: scale(1.15); z-index: 2; }
.member-avatar:first-child { margin-left: 0; }

.member-avatar-add {
    background: var(--bg-tertiary);
    border-color: var(--bg-primary);
    color: var(--text-muted);
    font-size: 0.7rem;
}

.member-avatar-add:hover { color: var(--accent-light); background: var(--bg-card-hover); }

.task-label-delete {
    display: flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 4px;
    background: transparent; color: var(--text-muted);
    cursor: pointer; opacity: 0;
    transition: all var(--transition-fast); flex-shrink: 0;
}

.gantt-table tbody tr:hover .task-label-delete { opacity: 1; }
.task-label-delete:hover { background: rgba(239, 68, 68, 0.12); color: var(--danger); }

/* Gantt Cells */
.gantt-cell {
    border-right: var(--grid-border);
    border-bottom: var(--grid-border);
    width: var(--cell-width); min-width: var(--cell-width);
    height: var(--cell-height);
    position: relative;
    transition: background var(--transition-fast);
    cursor: pointer;
}

.gantt-cell.weekend { background: rgba(139, 92, 246, 0.02); }
[data-theme="light"] .gantt-cell.weekend { background: rgba(99, 102, 241, 0.03); }
.gantt-cell.today { background: rgba(139, 92, 246, 0.04); }
.gantt-cell.drag-over { background: rgba(139, 92, 246, 0.12) !important; box-shadow: inset 0 0 0 2px rgba(139, 92, 246, 0.4); }
.gantt-cell.has-bar { cursor: default; }
.gantt-cell:not(.has-bar):hover { background: rgba(128, 128, 128, 0.05); }

/* Task Bars */
.task-bar {
    position: absolute;
    top: 9px; left: 3px; right: 3px; bottom: 9px;
    border-radius: var(--bar-radius);
    display: flex; align-items: center; justify-content: center;
    color: white; cursor: grab;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), filter var(--transition-fast);
    overflow: hidden; z-index: 2;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    opacity: var(--bar-opacity);
}

.task-bar:hover { transform: scaleY(1.12); box-shadow: 0 4px 16px rgba(0,0,0,0.25); filter: brightness(1.08); z-index: 3; }

.task-bar.bar-start { left: 3px; right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.task-bar.bar-middle { left: 0; right: 0; border-radius: 0; }
.task-bar.bar-end { left: 0; right: 3px; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.task-bar.bar-single { left: 3px; right: 3px; }

.bar-remove {
    position: absolute; top: 50%; right: 3px; transform: translateY(-50%);
    width: 15px; height: 15px; border-radius: 50%;
    background: rgba(0,0,0,0.25); color: white;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; opacity: 0;
    transition: opacity var(--transition-fast); font-size: 0.5rem; font-weight: 700; z-index: 4;
}

.task-bar:hover .bar-remove { opacity: 1; }
.bar-remove:hover { background: rgba(239, 68, 68, 0.8); }

.drag-ghost {
    position: fixed; pointer-events: none; z-index: 1000;
    padding: 0.3rem 0.7rem; border-radius: 8px;
    font-size: 0.76rem; font-weight: 600; color: white;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
    transform: translate(-50%, -50%); opacity: 0.9;
}

/* ═══ Chart Style: Classic ═══ */
.chart-classic { --bar-radius: 2px; --grid-border: 1px solid var(--border-medium); }
.chart-classic .task-bar { box-shadow: none; }
.chart-classic .task-bar:hover { transform: scaleY(1.05); box-shadow: 0 2px 8px rgba(0,0,0,0.15); filter: none; }

/* ═══ Chart Style: Pastel ═══ */
.chart-pastel { --bar-radius: 20px; --bar-opacity: 0.7; }
.chart-pastel .task-bar { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.chart-pastel .task-bar:hover { transform: scaleY(1.08); opacity: 1; }
.chart-pastel .gantt-cell { border-right: 1px solid rgba(0,0,0,0.03); border-bottom: 1px solid rgba(0,0,0,0.03); }
[data-theme="dark"] .chart-pastel .gantt-cell { border-right: 1px solid rgba(255,255,255,0.03); border-bottom: 1px solid rgba(255,255,255,0.03); }

/* ═══ Chart Style: Minimal ═══ */
.chart-minimal { --bar-radius: 4px; }
.chart-minimal .task-bar { top: 15px; bottom: 15px; box-shadow: none; }
.chart-minimal .task-bar:hover { transform: none; box-shadow: 0 1px 4px rgba(0,0,0,0.1); filter: none; }
.chart-minimal .gantt-cell { border-right: none; border-bottom: 1px solid var(--border-subtle); }
.chart-minimal .gantt-header-day { border-right: none; }
.chart-minimal .gantt-header-month { border-right: none; }

/* Compact rows */
.compact-rows { --cell-height: 38px; }
.compact-rows .task-bar { top: 7px; bottom: 7px; }

/* ================================================
   SIDEBARS
   ================================================ */
.sidebar-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(3px);
    z-index: 199;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.settings-sidebar, .members-sidebar {
    position: fixed; top: 0; right: 0;
    width: 320px; height: 100vh;
    background: var(--bg-card);
    border-left: 1px solid var(--border-medium);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    display: flex; flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s var(--transition-smooth);
}

.settings-sidebar.open, .members-sidebar.open { transform: translateX(0); }

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

.sidebar-header h3 { font-size: 1rem; font-weight: 700; }

.sidebar-body {
    flex: 1; overflow-y: auto;
    padding: 1rem 1.25rem;
}

.sidebar-section { margin-bottom: 1.5rem; }
.sidebar-section-title { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 0.75rem; }
.sidebar-hint { font-size: 0.75rem; color: var(--text-muted); line-height: 1.5; }

/* Style Selector Cards */
.style-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }

.style-card {
    display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
    padding: 0.75rem; background: var(--bg-input);
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-md); cursor: pointer;
    transition: all var(--transition-normal);
    font-size: 0.75rem; font-weight: 500; color: var(--text-secondary);
}

.style-card:hover { border-color: var(--border-accent); background: var(--bg-card-hover); }
.style-card.active { border-color: var(--accent-primary); color: var(--accent-light); box-shadow: 0 0 15px var(--accent-glow); }

.style-preview {
    width: 100%; height: 40px;
    position: relative; border-radius: 4px;
    background: var(--bg-primary);
    overflow: hidden;
}

.style-preview .sp-bar {
    position: absolute; height: 6px; border-radius: 3px;
}

/* Modern preview */
.style-preview-modern .sp-1 { top: 6px; left: 10%; width: 45%; background: linear-gradient(90deg, #8b5cf6, #7c3aed); }
.style-preview-modern .sp-2 { top: 17px; left: 25%; width: 55%; background: linear-gradient(90deg, #3b82f6, #2563eb); }
.style-preview-modern .sp-3 { top: 28px; left: 15%; width: 40%; background: linear-gradient(90deg, #10b981, #059669); }

/* Classic preview */
.style-preview-classic .sp-bar { border-radius: 1px; }
.style-preview-classic .sp-1 { top: 6px; left: 5%; width: 50%; background: #4a90d9; }
.style-preview-classic .sp-2 { top: 17px; left: 20%; width: 60%; background: #d97706; }
.style-preview-classic .sp-3 { top: 28px; left: 10%; width: 35%; background: #059669; }

/* Pastel preview */
.style-preview-pastel .sp-bar { border-radius: 10px; opacity: 0.65; }
.style-preview-pastel .sp-1 { top: 6px; left: 10%; width: 45%; background: #c4b5fd; }
.style-preview-pastel .sp-2 { top: 17px; left: 20%; width: 55%; background: #fca5a5; }
.style-preview-pastel .sp-3 { top: 28px; left: 5%; width: 40%; background: #86efac; }

/* Minimal preview */
.style-preview-minimal .sp-bar { height: 4px; border-radius: 2px; }
.style-preview-minimal .sp-1 { top: 8px; left: 10%; width: 50%; background: var(--text-muted); }
.style-preview-minimal .sp-2 { top: 18px; left: 30%; width: 45%; background: var(--text-muted); opacity: 0.7; }
.style-preview-minimal .sp-3 { top: 28px; left: 15%; width: 35%; background: var(--text-muted); opacity: 0.5; }

/* Toggle Switch */
.toggle-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.82rem; color: var(--text-primary);
    cursor: pointer; position: relative;
}

.toggle-row input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; }

.toggle-slider {
    width: 38px; height: 20px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    position: relative;
    transition: background var(--transition-normal);
    flex-shrink: 0;
    border: 1px solid var(--border-medium);
}

.toggle-slider::after {
    content: '';
    position: absolute; top: 2px; left: 2px;
    width: 14px; height: 14px;
    background: var(--text-muted); border-radius: 50%;
    transition: all var(--transition-normal);
}

.toggle-row input:checked + .toggle-slider { background: var(--accent-primary); border-color: var(--accent-primary); }
.toggle-row input:checked + .toggle-slider::after { left: 20px; background: white; }

/* Member List in Sidebar */
.member-add-row {
    display: flex; gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.member-add-row input[type="text"] {
    flex: 1; padding: 0.45rem 0.65rem;
    background: var(--bg-input); border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm); color: var(--text-primary);
    font-size: 0.82rem;
}

.member-add-row input[type="text"]:focus { border-color: var(--accent-primary); box-shadow: 0 0 0 3px var(--accent-glow); }
.member-add-row input[type="text"]::placeholder { color: var(--text-muted); }

.member-add-row input[type="color"] {
    width: 30px; height: 30px;
    border: none; border-radius: var(--radius-sm);
    cursor: pointer; background: transparent;
    padding: 0;
}

.member-list { display: flex; flex-direction: column; gap: 0.35rem; }

.member-empty { font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; padding: 0.5rem 0; }

.member-item {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 0.6rem;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.member-item:hover { background: var(--bg-card-hover); }

.member-item-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.65rem; font-weight: 700; color: white; flex-shrink: 0;
}

.member-item-name { font-size: 0.82rem; font-weight: 500; flex: 1; }

.member-item-remove {
    display: flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 4px;
    background: transparent; color: var(--text-muted);
    cursor: pointer; transition: all var(--transition-fast);
    opacity: 0;
}

.member-item:hover .member-item-remove { opacity: 1; }
.member-item-remove:hover { background: rgba(239, 68, 68, 0.12); color: var(--danger); }

/* Member Assign Popover */
.member-popover {
    position: fixed; z-index: 250;
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    min-width: 160px;
    animation: popIn 0.15s ease;
}

@keyframes popIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

.member-popover-list { display: flex; flex-direction: column; gap: 0.2rem; }

.member-popover-item {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0.4rem 0.5rem; border-radius: 6px;
    font-size: 0.78rem; cursor: pointer;
    transition: background var(--transition-fast);
    color: var(--text-primary); background: transparent;
}

.member-popover-item:hover { background: var(--bg-card-hover); }
.member-popover-item.assigned { background: rgba(139, 92, 246, 0.1); }
.member-popover-item.assigned::after { content: '✓'; margin-left: auto; color: var(--accent-light); font-size: 0.7rem; }

/* ================================================
   EXPORT MODAL
   ================================================ */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(5px);
    display: flex; align-items: center; justify-content: center;
    z-index: 250;
    animation: fadeIn 0.2s ease;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.25s ease;
}

@keyframes scaleIn { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }

.export-modal-card {
    width: 90%; max-width: 480px;
    padding: 1.5rem;
}

.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1.25rem;
}

.modal-header h3 { font-size: 1.05rem; font-weight: 700; }

.export-options {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.export-option {
    display: flex; flex-direction: column; align-items: center;
    gap: 0.35rem; padding: 1.25rem 0.75rem;
    background: var(--bg-input);
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-md); cursor: pointer;
    transition: all var(--transition-normal);
    color: var(--text-primary);
}

.export-option:hover {
    border-color: var(--accent-primary);
    background: var(--bg-card-hover);
    box-shadow: 0 0 15px var(--accent-glow);
    transform: translateY(-2px);
}

.export-option-icon { color: var(--accent-light); margin-bottom: 0.15rem; }
.export-option-title { font-size: 0.95rem; font-weight: 700; }
.export-option-desc { font-size: 0.68rem; color: var(--text-muted); text-align: center; line-height: 1.4; }

.export-progress { text-align: center; padding: 2rem 0; color: var(--text-muted); font-size: 0.85rem; }

/* ================================================
   TOAST
   ================================================ */
.toast {
    position: fixed; bottom: calc(var(--footer-height) + 1rem); left: 50%;
    transform: translateX(-50%) translateY(16px);
    padding: 0.55rem 1rem;
    background: var(--bg-card); border: 1px solid var(--border-medium);
    border-radius: var(--radius-md); font-size: 0.8rem;
    color: var(--text-primary); box-shadow: var(--shadow-lg);
    z-index: 300; opacity: 0;
    transition: all var(--transition-normal); pointer-events: none;
    backdrop-filter: blur(8px);
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { border-color: rgba(239, 68, 68, 0.3); color: #fca5a5; }
[data-theme="light"] .toast.error { color: #dc2626; }
.toast.success { border-color: rgba(16, 185, 129, 0.3); color: #6ee7b7; }
[data-theme="light"] .toast.success { color: #059669; }

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 640px) {
    .date-inputs { flex-direction: column; gap: 0.75rem; }
    .input-separator { display: none; }
    .setup-card { padding: 1.5rem; }
    .logo-title { font-size: 2rem; }
    .task-panel { padding: 0.5rem 0.75rem; }
    .gantt-wrapper { padding: 0.5rem; }
    .header-date-range { display: none; }
    .settings-sidebar, .members-sidebar { width: 280px; }
    .export-options { grid-template-columns: 1fr; }
    .header-right .btn-ghost span { display: none; }
    :root {
        --task-label-width: 130px;
        --cell-width: 42px;
        --cell-height: 42px;
    }
}
