/* Theme Variables */
[data-theme="dark"] {
	--bg-primary: #0d0d12;
	--bg-secondary: #16161f;
	--bg-tertiary: #1e1e2a;
	--bg-hover: #252533;
	--border-color: #2a2a3a;
	--border-light: #3a3a4a;
	--border-year: #4a4a5a;
	--text-primary: #f0f0f5;
	--text-secondary: #9090a0;
	--text-muted: #606070;
	--shadow-color: rgba(0,0,0,0.3);
	--accent-blue: #4a9eff;
	--accent-purple: #a855f7;
	--accent-pink: #ec4899;
	--accent-orange: #f97316;
	--accent-green: #22c55e;
	--accent-cyan: #06b6d4;
	--accent-yellow: #eab308;
	--accent-red: #ef4444;
	--shadow-glow: rgba(74, 158, 255, 0.15);
	--bar-text: white;
	--bar-text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

[data-theme="light"] {
	--bg-primary: #f8f9fc;
	--bg-secondary: #ffffff;
	--bg-tertiary: #f0f2f5;
	--bg-hover: #e8eaef;
	--border-color: #dde0e6;
	--border-light: #c8ccd4;
	--border-year: #a0a4ae;
	--text-primary: #1a1d24;
	--text-secondary: #5a5f6a;
	--text-muted: #8a8f9a;
	--shadow-color: rgba(0,0,0,0.1);
	--accent-blue: #2563eb;
	--accent-purple: #7c3aed;
	--accent-pink: #db2777;
	--accent-orange: #ea580c;
	--accent-green: #16a34a;
	--accent-cyan: #0891b2;
	--accent-yellow: #ca8a04;
	--accent-red: #dc2626;
	--shadow-glow: rgba(37, 99, 235, 0.2);
	--bar-text: white;
	--bar-text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

[data-theme="midnight"] {
	--bg-primary: #0a0a10;
	--bg-secondary: #0f0f18;
	--bg-tertiary: #14141f;
	--bg-hover: #1a1a28;
	--border-color: #1f1f30;
	--border-light: #2a2a40;
	--border-year: #3a3a55;
	--text-primary: #e8e8f0;
	--text-secondary: #8080a0;
	--text-muted: #505070;
	--shadow-color: rgba(0,0,0,0.5);
	--accent-blue: #6366f1;
	--accent-purple: #a855f7;
	--accent-pink: #ec4899;
	--accent-orange: #f97316;
	--accent-green: #10b981;
	--accent-cyan: #06b6d4;
	--accent-yellow: #fbbf24;
	--accent-red: #ef4444;
	--shadow-glow: rgba(99, 102, 241, 0.2);
	--bar-text: white;
	--bar-text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

[data-theme="forest"] {
	--bg-primary: #0c1410;
	--bg-secondary: #111c16;
	--bg-tertiary: #16241c;
	--bg-hover: #1e3026;
	--border-color: #243830;
	--border-light: #304840;
	--border-year: #406050;
	--text-primary: #e8f0ec;
	--text-secondary: #90a89c;
	--text-muted: #607868;
	--shadow-color: rgba(0,0,0,0.4);
	--accent-blue: #38bdf8;
	--accent-purple: #a78bfa;
	--accent-pink: #f472b6;
	--accent-orange: #fb923c;
	--accent-green: #4ade80;
	--accent-cyan: #22d3ee;
	--accent-yellow: #facc15;
	--accent-red: #f87171;
	--shadow-glow: rgba(74, 222, 128, 0.15);
	--bar-text: white;
	--bar-text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

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

body {
	font-family: 'DM Sans', sans-serif;
	background: var(--bg-primary);
	color: var(--text-primary);
	min-height: 100vh;
	overflow: hidden;
	transition: background 0.3s ease, color 0.3s ease;
}

.app-container {
	display: flex;
	flex-direction: column;
	height: 100vh;
}

.app-container.hidden {
	display: none;
}

/* Setup Screen */
.setup-screen {
	position: fixed;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 40px 20px;
	background: var(--bg-primary);
	overflow-y: auto;
	z-index: 500;
}

.setup-screen.hidden {
	display: none;
}

.setup-card {
	background: var(--bg-secondary);
	border: 1px solid var(--border-color);
	border-radius: 20px;
	padding: 40px;
	width: 100%;
	max-width: 520px;
	box-shadow: 0 20px 60px rgba(0,0,0,0.3);
	margin: auto;
}

@media (max-height: 800px) {
	.setup-screen {
		padding: 20px;
	}

	.setup-card {
		padding: 28px;
	}

	.setup-header {
		margin-bottom: 24px;
	}

	.setup-logo {
		width: 48px;
		height: 48px;
		font-size: 24px;
		margin-bottom: 16px;
	}

	.setup-title {
		font-size: 24px;
	}

	.setup-form {
		gap: 18px;
	}

	.preset-btn {
		padding: 8px 12px;
		font-size: 12px;
	}
}

@media (max-width: 540px) {
	.setup-card {
		padding: 24px;
		border-radius: 16px;
	}

	.form-row {
		grid-template-columns: 1fr;
	}

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

.setup-header {
	text-align: center;
	margin-bottom: 36px;
}

.setup-logo {
	width: 64px;
	height: 64px;
	background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
	border-radius: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 32px;
	margin: 0 auto 20px;
}

.setup-title {
	font-size: 28px;
	font-weight: 700;
	margin-bottom: 8px;
}

.setup-subtitle {
	color: var(--text-secondary);
	font-size: 15px;
}

.setup-form {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.form-group {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.form-label {
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--text-secondary);
}

.form-input, .form-select {
	width: 100%;
	padding: 14px 18px;
	background: var(--bg-primary);
	border: 1px solid var(--border-color);
	border-radius: 10px;
	color: var(--text-primary);
	font-family: inherit;
	font-size: 15px;
	transition: border-color 0.2s ease, background 0.3s ease;
}

.form-input:focus, .form-select:focus {
	outline: none;
	border-color: var(--accent-blue);
}

.form-select {
	cursor: pointer;
}

.form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.form-hint {
	font-size: 12px;
	color: var(--text-muted);
	margin-top: 4px;
}

.preset-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.preset-btn {
	padding: 10px 16px;
	background: var(--bg-tertiary);
	border: 1px solid var(--border-color);
	border-radius: 8px;
	color: var(--text-secondary);
	font-family: inherit;
	font-size: 13px;
	cursor: pointer;
	transition: all 0.15s ease;
}

.preset-btn:hover {
	background: var(--bg-hover);
	color: var(--text-primary);
	border-color: var(--border-light);
}

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

.config-summary {
	background: var(--bg-tertiary);
	border-radius: 10px;
	padding: 16px;
	margin-top: 8px;
}

.config-summary-title {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--text-muted);
	margin-bottom: 8px;
}

.config-summary-text {
	font-size: 14px;
	color: var(--text-primary);
	line-height: 1.5;
}

.config-summary-highlight {
	color: var(--accent-blue);
	font-weight: 600;
}

.setup-actions {
	margin-top: 12px;
}

.btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 14px 24px;
	border: none;
	border-radius: 10px;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
	width: 100%;
}

.btn-primary {
	background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
	color: white;
	box-shadow: 0 4px 15px var(--shadow-glow);
}

.btn-primary:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 20px var(--shadow-glow);
}

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

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

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

.btn-small {
	padding: 8px 14px;
	font-size: 13px;
	width: auto;
}

/* Header */
.app-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 24px;
	background: var(--bg-secondary);
	border-bottom: 1px solid var(--border-color);
	flex-shrink: 0;
	transition: background 0.3s ease, border-color 0.3s ease;
}

.logo {
	display: flex;
	align-items: center;
	gap: 10px;
}

.logo-icon {
	width: 36px;
	height: 36px;
	background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
}

.logo-app-name {
	font-size: 15px;
	font-weight: 400;
	color: var(--text-secondary);
}

.logo-separator {
	font-size: 18px;
	font-weight: 300;
	color: var(--border-light);
	margin: 0 2px;
}

.project-name-display {
	font-size: 18px;
	font-weight: 700;
	color: var(--text-primary);
	cursor: pointer;
	padding: 4px 8px;
	border-radius: 6px;
	transition: background 0.15s ease;
	max-width: 300px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.project-name-display:hover {
	background: var(--bg-hover);
}

.project-name-input {
	font-size: 18px;
	font-weight: 700;
	color: var(--text-primary);
	background: var(--bg-primary);
	border: 2px solid var(--accent-blue);
	border-radius: 6px;
	padding: 4px 8px;
	font-family: inherit;
	outline: none;
	display: none;
	width: 250px;
}

.project-name-input.visible {
	display: block;
}

.project-name-display.hidden {
	display: none;
}

.project-rename-btn {
	background: none;
	border: none;
	color: var(--text-muted);
	cursor: pointer;
	padding: 4px 8px;
	font-size: 14px;
	border-radius: 4px;
	opacity: 0;
	transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.project-btn {
	background: none;
	border: none;
	color: var(--text-muted);
	cursor: pointer;
	padding: 4px 8px;
	font-size: 14px;
	border-radius: 4px;
	opacity: 0;
	transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease;
}


.logo:hover .project-rename-btn {
	opacity: 1;
}

.logo:hover .project-btn {
	opacity: 1;
}

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

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

.header-actions {
	display: flex;
	gap: 10px;
	align-items: center;
}

.header-control {
	display: flex;
	align-items: center;
	gap: 8px;
	background: var(--bg-tertiary);
	padding: 6px 12px;
	border-radius: 8px;
	border: 1px solid var(--border-color);
	transition: background 0.3s ease, border-color 0.3s ease;
}

.header-control-label {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--text-muted);
}

.theme-select, .view-select {
	background: var(--bg-primary);
	border: 1px solid var(--border-color);
	border-radius: 6px;
	padding: 6px 10px;
	color: var(--text-primary);
	font-family: inherit;
	font-size: 13px;
	cursor: pointer;
	transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.theme-select:focus, .view-select:focus {
	outline: none;
	border-color: var(--accent-blue);
}

.toggle-switch {
	position: relative;
	width: 40px;
	height: 22px;
	background: var(--bg-primary);
	border-radius: 11px;
	cursor: pointer;
	transition: background 0.2s ease;
	border: 1px solid var(--border-color);
}

.toggle-switch.active {
	background: var(--accent-blue);
	border-color: var(--accent-blue);
}

.toggle-switch::after {
	content: '';
	position: absolute;
	top: 2px;
	left: 2px;
	width: 16px;
	height: 16px;
	background: var(--text-primary);
	border-radius: 50%;
	transition: transform 0.2s ease, background 0.2s ease;
}

.toggle-switch.active::after {
	transform: translateX(18px);
	background: white;
}

.zoom-btn {
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: none;
	color: var(--text-secondary);
	cursor: pointer;
	border-radius: 4px;
	transition: all 0.15s ease;
}

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

.zoom-level {
	font-family: 'JetBrains Mono', monospace;
	font-size: 12px;
	color: var(--text-secondary);
	min-width: 45px;
	text-align: center;
}

.header-separator {
	width: 1px;
	height: 24px;
	background: var(--border-color);
	margin: 0 4px;
}

/* Main Content */
.main-content {
	display: flex;
	flex: 1;
	overflow: hidden;
}

/* Task Sidebar */
.task-sidebar {
	width: 320px;
	min-width: 200px;
	max-width: 600px;
	background: var(--bg-secondary);
	border-right: none;
	display: flex;
	flex-direction: column;
	flex-shrink: 0;
	transition: background 0.3s ease;
}

.sidebar-resize-handle {
	width: 5px;
	background: var(--border-color);
	cursor: col-resize;
	flex-shrink: 0;
	transition: background 0.15s ease;
	position: relative;
}

.sidebar-resize-handle:hover,
.sidebar-resize-handle.dragging {
	background: var(--accent-blue);
}

.sidebar-resize-handle::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 3px;
	height: 40px;
	background: var(--text-muted);
	border-radius: 2px;
	opacity: 0;
	transition: opacity 0.15s ease;
}

.sidebar-resize-handle:hover::after,
.sidebar-resize-handle.dragging::after {
	opacity: 0.5;
}

.sidebar-header {
	height: 70px;
	padding: 0 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-bottom: 1px solid var(--border-color);
	background: var(--bg-tertiary);
	transition: background 0.3s ease, border-color 0.3s ease;
}

.sidebar-header-text {
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: var(--text-secondary);
}

.task-list {
	flex: 1;
	overflow-y: auto;
}

/* Work Package Row */
.wp-row {
	height: 52px;
	padding: 0 12px 0 16px;
	display: flex;
	align-items: center;
	gap: 8px;
	background: var(--bg-tertiary);
	border-bottom: 1px solid var(--border-color);
	cursor: grab;
	transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
	position: relative;
}

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

.wp-row.dragging {
	opacity: 0.9;
	box-shadow: 0 8px 24px var(--shadow-color);
	z-index: 100;
	cursor: grabbing;
}

.wp-row.drag-over-top::before {
	content: '';
	position: absolute;
	top: -2px;
	left: 0;
	right: 0;
	height: 4px;
	background: var(--accent-blue);
	border-radius: 2px;
}

.wp-row.drag-over-bottom::after {
	content: '';
	position: absolute;
	bottom: -2px;
	left: 0;
	right: 0;
	height: 4px;
	background: var(--accent-blue);
	border-radius: 2px;
}

.wp-expand {
	width: 20px;
	height: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: none;
	color: var(--text-muted);
	cursor: pointer;
	border-radius: 4px;
	transition: all 0.15s ease;
	font-size: 12px;
}

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

.wp-drag-handle {
	color: var(--text-muted);
	cursor: grab;
	padding: 4px;
	font-size: 12px;
	opacity: 0.5;
	transition: opacity 0.15s ease;
}

.wp-row:hover .wp-drag-handle {
	opacity: 1;
}

.wp-color-bar {
	width: 4px;
	height: 28px;
	border-radius: 2px;
	flex-shrink: 0;
}

.wp-info {
	flex: 1;
	min-width: 0;
}

.wp-name {
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.wp-meta {
	font-size: 11px;
	color: var(--text-muted);
	margin-top: 2px;
}

.wp-actions {
	display: flex;
	gap: 4px;
	opacity: 0;
	transition: opacity 0.15s ease;
}

.wp-row:hover .wp-actions {
	opacity: 1;
}

.icon-btn {
	width: 26px;
	height: 26px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: none;
	color: var(--text-muted);
	cursor: pointer;
	border-radius: 4px;
	transition: all 0.15s ease;
	font-size: 14px;
}

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

.icon-btn.danger:hover {
	color: var(--accent-pink);
	background: rgba(236, 72, 153, 0.1);
}

/* Task Row */
.task-row {
	height: 44px;
	padding: 0 12px 0 48px;
	display: flex;
	align-items: center;
	gap: 10px;
	border-bottom: 1px solid var(--border-color);
	cursor: grab;
	transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
	position: relative;
}

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

.task-row.hidden {
	display: none;
}

.task-row.dragging {
	background: var(--bg-tertiary);
	opacity: 0.9;
	box-shadow: 0 4px 16px var(--shadow-color);
	z-index: 100;
	cursor: grabbing;
}

.task-row.drag-over-top::before {
	content: '';
	position: absolute;
	top: -2px;
	left: 40px;
	right: 0;
	height: 4px;
	background: var(--accent-blue);
	border-radius: 2px;
}

.task-row.drag-over-bottom::after {
	content: '';
	position: absolute;
	bottom: -2px;
	left: 40px;
	right: 0;
	height: 4px;
	background: var(--accent-blue);
	border-radius: 2px;
}

.task-row.drag-over-wp {
	background: rgba(74, 158, 255, 0.1);
}

.task-drag-handle {
	color: var(--text-muted);
	cursor: grab;
	padding: 4px;
	font-size: 10px;
	opacity: 0.4;
	transition: opacity 0.15s ease;
}

.task-row:hover .task-drag-handle {
	opacity: 1;
}

.task-color-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	flex-shrink: 0;
}

.task-name {
	flex: 1;
	font-size: 13px;
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.task-dates {
	/* font-family: 'JetBrains Mono', monospace; */
	font-size: 10px;
	color: var(--text-muted);
}

.task-actions {
	display: flex;
	gap: 2px;
	opacity: 0;
	transition: opacity 0.15s ease;
}

.task-row:hover .task-actions {
	opacity: 1;
}

/* Chart Area */
.chart-area {
	flex: 1;
	overflow: auto;
	position: relative;
}

.chart-container {
	position: relative;
	min-width: max-content;
}

/* Timeline Header */
.timeline-header {
	height: 70px;
	background: var(--bg-tertiary);
	border-bottom: 1px solid var(--border-color);
	display: flex;
	flex-direction: column;
	position: sticky;
	top: 0;
	z-index: 10;
	transition: background 0.3s ease, border-color 0.3s ease;
}

.timeline-groups {
	height: 32px;
	display: flex;
	border-bottom: 1px solid var(--border-color);
}

.timeline-group {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	font-weight: 700;
	color: var(--text-primary);
	border-right: 3px solid var(--border-year);
	background: linear-gradient(180deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
	letter-spacing: 0.5px;
}

.timeline-units {
	height: 38px;
	display: flex;
}

.timeline-unit {
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: 'JetBrains Mono', monospace;
	font-size: 11px;
	color: var(--text-muted);
	border-right: 1px solid var(--border-color);
	flex-shrink: 0;
	transition: color 0.3s ease, border-color 0.3s ease;
}

.timeline-unit.group-end {
	border-right: 3px solid var(--border-year);
}

.timeline-unit.group-start {
	color: var(--text-secondary);
	font-weight: 500;
}

/* Chart Grid */
.chart-grid {
	position: relative;
}

.chart-wp-row {
	height: 52px;
	display: flex;
	position: relative;
	background: rgba(30, 30, 42, 0.3);
	border-bottom: 1px solid var(--border-color);
	transition: background 0.3s ease;
}

[data-theme="light"] .chart-wp-row {
	background: rgba(0, 0, 0, 0.02);
}

.chart-task-row {
	height: 44px;
	display: flex;
	position: relative;
	border-bottom: 1px solid var(--border-color);
}

.chart-task-row.hidden {
	display: none;
}

.chart-cell {
	height: 100%;
	border-right: 1px solid var(--border-color);
	flex-shrink: 0;
	transition: border-color 0.3s ease;
}

.chart-cell.group-end {
	border-right: 3px solid var(--border-year);
}

.chart-cell.group-start {
	background: rgba(74, 158, 255, 0.02);
}

/* Work Package Summary Bar */
.wp-bar {
	position: absolute;
	height: 10px;
	top: 50%;
	transform: translateY(-50%);
	background: var(--bar-color, var(--accent-blue));
	border-radius: 2px;
	z-index: 5;
	cursor: grab;
	transition: filter 0.15s ease;
}

.wp-bar:hover {
	filter: brightness(1.1);
}

.wp-bar.dragging {
	cursor: grabbing;
	filter: brightness(1.2);
	z-index: 100;
}

.wp-bar::before,
.wp-bar::after {
	content: '';
	position: absolute;
	bottom: -6px;
	width: 0;
	height: 0;
	border-left: 6px solid transparent;
	border-right: 6px solid transparent;
	border-top: 6px solid var(--bar-color, var(--accent-blue));
}

.wp-bar::before {
	left: 0;
}

.wp-bar::after {
	right: 0;
}

.wp-bar.no-tasks {
	opacity: 0.4;
	background: repeating-linear-gradient(
	45deg,
	var(--bar-color, var(--accent-blue)),
	var(--bar-color, var(--accent-blue)) 4px,
	transparent 4px,
	transparent 8px
	);
}

.wp-bar.no-tasks::before,
.wp-bar.no-tasks::after {
	opacity: 0.6;
}

.wp-bar-resize {
	position: absolute;
	top: -8px;
	bottom: -12px;
	width: 12px;
	cursor: ew-resize;
	z-index: 10;
}

.wp-bar-resize.left {
	left: -4px;
}

.wp-bar-resize.right {
	right: -4px;
}

/* Task Bars */
.task-bar {
	position: absolute;
	height: 24px;
	top: 50%;
	transform: translateY(-50%);
	border-radius: 4px;
	cursor: grab;
	display: flex;
	align-items: center;
	padding: 0 8px;
	font-size: 11px;
	font-weight: 500;
	color: var(--bar-text);
	user-select: none;
	transition: box-shadow 0.2s ease, transform 0.1s ease;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	z-index: 5;
}

.task-bar::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 50%);
	pointer-events: none;
}

.task-bar:hover {
	box-shadow: 0 4px 16px var(--shadow-color);
	z-index: 6;
}

.task-bar.dragging {
	cursor: grabbing;
	box-shadow: 0 8px 24px var(--shadow-color);
	z-index: 100;
	transform: translateY(-50%) scale(1.02);
}

.task-bar-resize {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 8px;
	cursor: ew-resize;
	z-index: 10;
}

.task-bar-resize.left {
	left: 0;
}

.task-bar-resize.right {
	right: 0;
}

.task-bar-resize:hover {
	background: rgba(255,255,255,0.2);
}

.task-bar-label {
	position: relative;
	z-index: 1;
	text-shadow: var(--bar-text-shadow);
}

.task-bar-label.hidden {
	display: none;
}

/* Color Picker */
.color-picker-container {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.color-presets {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.color-preset {
	width: 28px;
	height: 28px;
	border-radius: 6px;
	cursor: pointer;
	border: 2px solid transparent;
	transition: all 0.15s ease;
}

.color-preset:hover {
	transform: scale(1.1);
}

.color-preset.selected {
	border-color: var(--text-primary);
	box-shadow: 0 0 0 2px var(--bg-primary);
}

.color-custom {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.saturation-area {
	width: 100%;
	height: 120px;
	border-radius: 8px;
	position: relative;
	cursor: crosshair;
}

.saturation-area::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(to right, white, transparent);
	border-radius: 8px;
}

.saturation-area::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, black, transparent);
	border-radius: 8px;
}

.saturation-handle {
	position: absolute;
	width: 14px;
	height: 14px;
	border: 2px solid white;
	border-radius: 50%;
	transform: translate(-50%, -50%);
	box-shadow: 0 2px 4px rgba(0,0,0,0.3);
	z-index: 1;
	pointer-events: none;
}

.hue-slider {
	width: 100%;
	height: 16px;
	border-radius: 8px;
	background: linear-gradient(to right, 
	hsl(0, 100%, 50%), 
	hsl(60, 100%, 50%), 
	hsl(120, 100%, 50%), 
	hsl(180, 100%, 50%), 
	hsl(240, 100%, 50%), 
	hsl(300, 100%, 50%), 
	hsl(360, 100%, 50%)
	);
	position: relative;
	cursor: pointer;
}

.hue-handle {
	position: absolute;
	top: 50%;
	width: 8px;
	height: 20px;
	background: white;
	border-radius: 4px;
	transform: translate(-50%, -50%);
	box-shadow: 0 2px 4px rgba(0,0,0,0.3);
	pointer-events: none;
}

.color-preview-row {
	display: flex;
	align-items: center;
	gap: 12px;
}

.color-preview {
	width: 40px;
	height: 40px;
	border-radius: 8px;
	border: 2px solid var(--border-color);
}

.color-hex-input {
	flex: 1;
	padding: 10px 14px;
	background: var(--bg-primary);
	border: 1px solid var(--border-color);
	border-radius: 8px;
	color: var(--text-primary);
	font-family: 'JetBrains Mono', monospace;
	font-size: 14px;
}

.color-hex-input:focus {
	outline: none;
	border-color: var(--accent-blue);
}

.color-hex-input.invalid {
	border-color: var(--accent-red);
}


/* Modal */
.modal-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,0.7);
	backdrop-filter: blur(4px);
	z-index: 1000;
	align-items: flex-start;
	justify-content: center;
	overflow-y: auto;
	padding: 40px 20px;
}

.modal-overlay.active {
	display: flex;
}

.modal {
	background: var(--bg-secondary);
	border: 1px solid var(--border-color);
	border-radius: 16px;
	padding: 28px;
	width: 480px;
	max-width: 100%;
	box-shadow: 0 20px 60px rgba(0,0,0,0.5);
	transition: background 0.3s ease, border-color 0.3s ease;
	margin: auto 0;
}

@media (max-height: 700px) {
	.modal-overlay {
		padding: 20px;
	}

	.modal {
		padding: 20px;
	}

	.color-saturation-area {
		height: 100px;
	}

	.color-preview-large {
		min-height: 60px;
	}
}

@media (max-width: 520px) {
	.modal {
		padding: 20px;
		border-radius: 12px;
	}

	.modal-title {
		font-size: 18px;
	}

	.form-row {
		grid-template-columns: 1fr;
	}

	.color-preset-grid {
		grid-template-columns: repeat(8, 1fr);
		gap: 4px;
	}
}

.modal-title {
	font-size: 20px;
	font-weight: 700;
	margin-bottom: 24px;
}



.toggle-group {
	display: flex;
	background: var(--bg-primary);
	border-radius: 8px;
	padding: 4px;
	gap: 4px;
}

.toggle-option {
	flex: 1;
	padding: 10px 16px;
	border: none;
	border-radius: 6px;
	background: transparent;
	color: var(--text-muted);
	font-family: inherit;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.15s ease;
}

.toggle-option.active {
	background: var(--accent-blue);
	color: white;
}

.toggle-option:hover:not(.active) {
	color: var(--text-primary);
}

.manual-dates {
	display: none;
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid var(--border-color);
}

.manual-dates.visible {
	display: block;
}

.modal-actions {
	display: flex;
	gap: 12px;
	margin-top: 28px;
}

.modal-actions .btn {
	flex: 1;
}

/* Scrollbar */
::-webkit-scrollbar {
	width: 10px;
	height: 10px;
}

::-webkit-scrollbar-track {
	background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
	background: var(--bg-hover);
	border-radius: 5px;
	border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
	background: var(--border-light);
}

/* Empty State */
.empty-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 60px 20px;
	color: var(--text-muted);
}

.empty-state-icon {
	font-size: 40px;
	margin-bottom: 12px;
	opacity: 0.5;
}

.empty-state-text {
	font-size: 14px;
	margin-bottom: 20px;
}

/* Tooltip */
.tooltip {
	position: fixed;
	background: var(--bg-tertiary);
	border: 1px solid var(--border-color);
	padding: 10px 14px;
	border-radius: 8px;
	font-size: 12px;
	pointer-events: none;
	z-index: 1000;
	opacity: 0;
	transition: opacity 0.15s ease;
	box-shadow: 0 4px 12px var(--shadow-color);
	max-width: 250px;
}

.tooltip.visible {
	opacity: 1;
}

.tooltip-title {
	font-weight: 600;
	margin-bottom: 4px;
}

.tooltip-dates {
	font-family: 'JetBrains Mono', monospace;
	color: var(--text-secondary);
	font-size: 11px;
}

.tooltip-mode {
	font-size: 10px;
	color: var(--text-muted);
	margin-top: 4px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* Dropdown menu */
.dropdown-menu {
	position: absolute;
	top: 100%;
	right: 0;
	background: var(--bg-tertiary);
	border: 1px solid var(--border-color);
	border-radius: 8px;
	padding: 6px;
	min-width: 200px;
	box-shadow: 0 8px 24px var(--shadow-color);
	z-index: 100;
	display: none;
	transition: background 0.3s ease, border-color 0.3s ease;
}

.dropdown-menu.visible {
	display: block;
}

.dropdown-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	border: none;
	background: none;
	color: var(--text-primary);
	font-family: inherit;
	font-size: 13px;
	cursor: pointer;
	border-radius: 6px;
	width: 100%;
	text-align: left;
	transition: background 0.15s ease;
}

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

.dropdown-item .icon {
	font-size: 14px;
	width: 18px;
	text-align: center;
	flex-shrink: 0;
}

.dropdown-item .shortcut {
	margin-left: auto;
	color: var(--text-muted);
	font-size: 11px;
	font-family: 'JetBrains Mono', monospace;
}

.add-dropdown {
	position: relative;
}

/* Responsive styles for main app */
@media (max-width: 768px) {
	.app-header {
		padding: 10px 16px;
		flex-wrap: wrap;
		gap: 10px;
	}

	.logo {
		flex: 1;
		min-width: 200px;
	}

	.logo-app-name {
		display: none;
	}

	.logo-separator {
		display: none;
	}

	.project-name-display {
		font-size: 16px;
	}

	.header-actions {
		flex-wrap: wrap;
		gap: 8px;
	}

	.header-control {
		padding: 4px 8px;
	}

	.header-control-label {
		display: none;
	}

	.task-sidebar {
		min-width: 180px;
		width: 220px;
	}

	.task-row {
		padding-left: 32px;
	}

	.sidebar-header {
		height: 50px;
		padding: 0 12px;
	}

	.timeline-header {
		height: 60px;
	}

	.timeline-groups {
		height: 28px;
	}

	.timeline-group {
		font-size: 12px;
	}
}

.notification {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: 0 4px 20px var(--shadow-color);
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.milestone-marker {
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--milestone-color);
    transform: translateX(-50%) translateY(-50%) rotate(45deg);
    top: 50%;
    cursor: pointer;
    z-index: 5;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
