/* ==========================================================================
   ZenPlan - Premium Glassmorphism Dark Mode Design System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
    /* Color Palette */
    --bg-main: #080c14;
    --bg-card: rgba(17, 25, 44, 0.65);
    --bg-card-hover: rgba(25, 36, 61, 0.8);
    --bg-sidebar: rgba(10, 16, 30, 0.85);
    --border-color: rgba(255, 255, 255, 0.06);
    --border-color-hover: rgba(255, 255, 255, 0.12);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;

    /* Accents (Gradients & Glows) */
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --accent-purple: #a855f7;
    --accent-pink: #ec4899;
    
    --grad-primary: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    --grad-purple: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    --grad-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --grad-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --grad-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    
    --glow-cyan: 0 0 15px rgba(6, 182, 212, 0.4);
    --glow-purple: 0 0 15px rgba(168, 85, 247, 0.4);
    --glow-success: 0 0 15px rgba(16, 185, 129, 0.4);

    /* Priority Colors */
    --priority-high: #f43f5e;
    --priority-medium: #fbbf24;
    --priority-low: #10b981;

    /* Fonts */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;

    /* Shadows & Transitions */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Layout */
    --sidebar-width: 260px;
    --header-height: 80px;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    overflow-x: hidden;
    background-image: 
        radial-gradient(at 10% 20%, rgba(6, 182, 212, 0.05) 0px, transparent 50%),
        radial-gradient(at 90% 80%, rgba(168, 85, 247, 0.05) 0px, transparent 50%);
    background-attachment: fixed;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

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

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.logo-icon {
    width: 38px;
    height: 38px;
    background: var(--grad-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--glow-cyan);
}

.logo-icon span {
    font-weight: 700;
    font-size: 1.25rem;
    color: #fff;
    font-family: var(--font-heading);
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: var(--grad-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

.nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.02);
}

.nav-item.active {
    color: #fff;
    background: rgba(6, 182, 212, 0.1);
    border-color: rgba(6, 182, 212, 0.15);
    box-shadow: inset 0 0 12px rgba(6, 182, 212, 0.05);
}

.nav-item.active .material-symbols-outlined {
    color: var(--accent-cyan);
    text-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.mini-stats {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.mini-stats-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--grad-primary);
    border-radius: 10px;
    transition: width var(--transition-normal);
}

/* Main Content Area Styling */
.main-content {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.header-title-container h1 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 600;
}

.header-title-container p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition-fast);
    font-family: var(--font-heading);
    font-size: 0.9rem;
    color: var(--text-primary);
}

.btn-primary {
    background: var(--grad-primary);
    color: #fff;
    box-shadow: var(--glow-cyan);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-color);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-color-hover);
}

.btn-danger {
    background: var(--grad-danger);
    color: #fff;
}
.btn-danger:hover {
    transform: translateY(-2px);
}

.btn-icon-only {
    padding: 0.65rem;
    border-radius: 10px;
}

/* Card Styling - Glassmorphism */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    transition: var(--transition-normal);
}

.glass-card:hover {
    border-color: var(--border-color-hover);
    background: var(--bg-card-hover);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Tab Panels */
.tab-panel {
    display: none;
    animation: fadeIn var(--transition-normal);
    flex-grow: 1;
}

.tab-panel.active {
    display: flex;
    flex-direction: column;
}

/* Dashboard Tab Styles */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.blue { background: rgba(59, 130, 246, 0.1); color: var(--accent-blue); }
.stat-icon.purple { background: rgba(168, 85, 247, 0.1); color: var(--accent-purple); }
.stat-icon.warning { background: rgba(251, 191, 36, 0.1); color: var(--priority-medium); }
.stat-icon.success { background: rgba(16, 185, 129, 0.1); color: var(--priority-low); }

.stat-info .stat-val {
    font-size: 1.75rem;
    font-weight: 700;
    font-family: var(--font-heading);
    line-height: 1.2;
}

.stat-info .stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.dashboard-details {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.chart-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2.5rem;
}

.circular-chart-container {
    position: relative;
    width: 160px;
    height: 160px;
    margin-bottom: 1.5rem;
}

.circular-chart {
    display: block;
    margin: 10px auto;
    max-width: 100%;
    max-height: 100%;
}

.circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 2.8;
}

.circle {
    fill: none;
    stroke: url(#cyan-blue-grad);
    stroke-width: 2.8;
    stroke-linecap: round;
    transition: stroke-dasharray 0.6s ease;
}

.chart-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
}

.chart-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.chart-subtitle {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Urgent Tasks list */
.urgent-tasks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.urgent-tasks-header h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
}

.urgent-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.urgent-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    transition: var(--transition-fast);
}

.urgent-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.urgent-info-left {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.urgent-item-title {
    font-weight: 500;
    font-size: 0.95rem;
}

.urgent-item-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.urgent-badge-days {
    background: rgba(239, 68, 68, 0.15);
    color: #f43f5e;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.75rem;
}

/* Tree View Tab Styles */
.tree-actions {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    align-items: center;
}

.tree-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    overflow-y: auto;
    flex-grow: 1;
}

.tree-node-list {
    list-style: none;
    padding-left: 0;
}

.tree-node-item {
    margin-bottom: 0.5rem;
}

.tree-node-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: var(--transition-fast);
}

.tree-node-content:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-color-hover);
}

/* Styling according to level/type */
.tree-node-item[data-type="epic"] > .tree-node-content {
    background: rgba(6, 182, 212, 0.03);
    border-left: 4px solid var(--accent-cyan);
}
.tree-node-item[data-type="task"] > .tree-node-content {
    background: rgba(59, 130, 246, 0.01);
    border-left: 4px solid var(--accent-blue);
}
.tree-node-item[data-type="subtask"] > .tree-node-content {
    border-left: 4px solid var(--accent-purple);
}

.tree-node-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-grow: 1;
}

.tree-toggle-btn {
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    transition: var(--transition-fast);
}

.tree-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.tree-toggle-btn.collapsed {
    transform: rotate(-90deg);
}

.tree-node-title {
    font-weight: 500;
    cursor: pointer;
}
.tree-node-title:hover {
    color: var(--accent-cyan);
}

.tree-node-item.done .tree-node-title {
    text-decoration: line-through;
    color: var(--text-muted);
}

.tree-node-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-epic { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); }
.badge-task { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.badge-subtask { background: rgba(168, 85, 247, 0.15); color: var(--accent-purple); }

.tree-node-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.tree-node-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.tree-node-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100px;
}

.tree-node-progress-val {
    font-weight: 600;
    font-size: 0.75rem;
    min-width: 30px;
    text-align: right;
}

.tree-node-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.tree-node-content:hover .tree-node-actions {
    opacity: 1;
}

.tree-node-actions .btn-icon-only {
    padding: 0.4rem;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
}

.tree-node-actions .btn-icon-only:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.tree-node-actions .btn-icon-only.btn-delete:hover {
    color: var(--priority-high);
    background: rgba(244, 63, 94, 0.1);
}

.tree-children-container {
    padding-left: 2rem;
    margin-top: 0.25rem;
    border-left: 1px dashed rgba(255, 255, 255, 0.08);
    transition: max-height var(--transition-normal), opacity var(--transition-normal);
}

.tree-children-container.collapsed {
    display: none;
}

/* Kanban Board Tab Styles */
.kanban-board-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    flex-grow: 1;
    min-height: 500px;
    overflow-x: auto;
}

.kanban-column {
    background: rgba(10, 16, 30, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    min-width: 250px;
}

.kanban-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.kanban-column-title-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.kanban-column-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot-todo { background: var(--text-muted); }
.dot-inprogress { background: var(--accent-blue); }
.dot-review { background: var(--priority-medium); }
.dot-done { background: var(--priority-low); }

.kanban-column-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
}

.kanban-column-count {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.kanban-cards-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-bottom: 2rem;
    min-height: 200px;
}

.kanban-cards-container.drag-over {
    background: rgba(255, 255, 255, 0.02);
    outline: 2px dashed rgba(6, 182, 212, 0.3);
    border-radius: 12px;
}

.kanban-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    cursor: grab;
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
    user-select: none;
}

.kanban-card:hover {
    border-color: var(--border-color-hover);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.kanban-card:active {
    cursor: grabbing;
}

.kanban-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.kanban-card-type {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
}

.kanban-card-priority {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.pri-high { background-color: var(--priority-high); box-shadow: 0 0 8px var(--priority-high); }
.pri-medium { background-color: var(--priority-medium); box-shadow: 0 0 8px var(--priority-medium); }
.pri-low { background-color: var(--priority-low); box-shadow: 0 0 8px var(--priority-low); }

.kanban-card-title {
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    color: var(--text-primary);
}

.kanban-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.kanban-card-date {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.kanban-card-date .material-symbols-outlined {
    font-size: 0.85rem;
}

.kanban-card-progress {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 600;
}

/* Timeline Tab Styles */
.timeline-filter-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.timeline-view-modes {
    display: flex;
    gap: 0.5rem;
}

.timeline-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-grow: 1;
}

.timeline-grid {
    display: flex;
    overflow-x: auto;
    flex-grow: 1;
    position: relative;
    max-height: 600px;
}

.timeline-labels-col {
    width: 250px;
    background: rgba(10, 16, 30, 0.7);
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
    position: sticky;
    left: 0;
    z-index: 10;
}

.timeline-label-header {
    height: 50px;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    background: rgba(10, 16, 30, 0.9);
}

.timeline-label-row {
    height: 50px;
    border-bottom: 1px solid var(--border-color);
    padding: 0 1rem;
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timeline-chart-col {
    flex-grow: 1;
    position: relative;
}

.timeline-chart-header {
    height: 50px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    position: sticky;
    top: 0;
    background: rgba(10, 16, 30, 0.85);
    z-index: 5;
}

.timeline-header-cell {
    border-right: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
    flex-shrink: 0;
}

.timeline-chart-row {
    height: 50px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    display: flex;
    align-items: center;
}

.timeline-grid-lines {
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    pointer-events: none;
}

.timeline-grid-line {
    border-right: 1px dashed rgba(255, 255, 255, 0.03);
    height: 100%;
    flex-shrink: 0;
}

.timeline-bar-wrapper {
    position: absolute;
    height: 28px;
    background: var(--grad-primary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.15);
    cursor: pointer;
    transition: transform var(--transition-fast), filter var(--transition-fast);
    overflow: hidden;
}

.timeline-bar-wrapper:hover {
    transform: scaleY(1.05);
    filter: brightness(1.1);
}

.timeline-bar-wrapper.epic {
    background: var(--grad-primary);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.2);
}
.timeline-bar-wrapper.task {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}
.timeline-bar-wrapper.subtask {
    background: var(--grad-purple);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.15);
}

.timeline-bar-progress-bg {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.12);
    pointer-events: none;
    z-index: 1;
}

.timeline-bar-text {
    position: relative;
    z-index: 2;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 6, 10, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    animation: fadeIn var(--transition-fast);
}

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

.modal-container {
    background: #0d1321;
    border: 1px solid var(--border-color-hover);
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    animation: slideUp var(--transition-normal);
    overflow: hidden;
}

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

.modal-header h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
}

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

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

input[type="text"],
input[type="date"],
select,
textarea {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: var(--transition-fast);
    width: 100%;
}

input[type="text"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

/* Range input styled custom */
.range-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}
input[type="range"] {
    flex-grow: 1;
    accent-color: var(--accent-cyan);
}
.range-val {
    font-weight: 700;
    font-size: 0.95rem;
    min-width: 40px;
    text-align: right;
}

/* Checklist Styling inside Modal */
.checklist-section {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    margin-top: 0.5rem;
}

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

.checklist-header h4 {
    font-size: 0.9rem;
    font-weight: 600;
}

.checklist-input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.checklist-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    list-style: none;
}

.checklist-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.checklist-item-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checklist-item-text {
    font-size: 0.85rem;
}

.checklist-item.done .checklist-item-text {
    text-decoration: line-through;
    color: var(--text-muted);
}

.checklist-item-remove {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
}

.checklist-item-remove:hover {
    color: var(--priority-high);
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-footer-right {
    display: flex;
    gap: 0.75rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* Responsive Styles */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .dashboard-details {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    body {
        padding-bottom: 80px; /* Space for mobile nav if applicable, but we keep sidebar simple */
    }
    .app-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 1.5rem;
    }
    .main-content {
        margin-left: 0;
        padding: 1.5rem;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .kanban-board-container {
        padding-bottom: 1rem;
    }
    .form-row-2 {
        grid-template-columns: 1fr;
    }
}
