/* ===== RESET & FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

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

:root {
    --bg-primary: #0b0e17;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.7);
    --bg-card-hover: rgba(31, 41, 55, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --bg-modal-overlay: rgba(0, 0, 0, 0.6);
    --surface: #1f2937;
    --surface-light: #374151;
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);

    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;

    --accent-gradient: linear-gradient(135deg, #8b5cf6, #06b6d4);
    --accent-purple: #8b5cf6;
    --accent-cyan: #06b6d4;
    --accent-pink: #ec4899;

    --priority-low: #22c55e;
    --priority-medium: #f59e0b;
    --priority-high: #f97316;
    --priority-critical: #ef4444;

    --status-todo: #6366f1;
    --status-progress: #f59e0b;
    --status-done: #22c55e;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(139, 92, 246, 0.15);

    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== LIGHT MODE ===== */
[data-theme="light"] {
    --bg-primary: #eef2ff;
    /* Soft indigo backing */
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.85);
    /* Glassy white */
    --bg-card-hover: rgba(255, 255, 255, 1);
    --bg-glass: rgba(255, 255, 255, 0.6);
    --bg-modal-overlay: rgba(17, 24, 39, 0.4);
    --surface: #e0e7ff;
    /* Deeper indigo surface */
    --surface-light: #c7d2fe;
    --border: rgba(99, 102, 241, 0.15);
    /* Tinted border */
    --border-hover: rgba(99, 102, 241, 0.3);

    --text-primary: #1e1b4b;
    /* Deep rich text instead of pure black */
    --text-secondary: #4338ca;
    /* Indigo secondary text */
    --text-muted: #6b7280;

    --accent-gradient: linear-gradient(135deg, #4f46e5, #ec4899);
    /* Poppier gradient in light mode */
    --accent-purple: #6366f1;

    --shadow-sm: 0 1px 3px rgba(99, 102, 241, 0.08);
    --shadow-md: 0 4px 20px rgba(99, 102, 241, 0.12);
    --shadow-lg: 0 8px 40px rgba(99, 102, 241, 0.16);
    --shadow-glow: 0 0 30px rgba(236, 72, 153, 0.15);
    /* Pinkish glow */
}

/* Light mode element overrides */
[data-theme="light"] .sidebar {
    background: #ffffff;
    border-right-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .topbar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
}

[data-theme="light"] .nav-item.active {
    background: rgba(139, 92, 246, 0.08);
}

[data-theme="light"] .task-card {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .task-card:hover {
    border-color: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .login-card {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .login-input {
    background: #f3f4f6;
    border-color: rgba(0, 0, 0, 0.1);
    color: #111827;
}

[data-theme="light"] .login-bg::before {
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
}

[data-theme="light"] .modal {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .search-box {
    background: #f3f4f6;
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .search-box input {
    color: #111827;
}

[data-theme="light"] .filter-dropdown {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .filter-dropdown button:hover,
[data-theme="light"] .filter-dropdown button.active {
    background: #f3f4f6;
}

[data-theme="light"] .chart-card,
[data-theme="light"] .dashboard-team-overview,
[data-theme="light"] .activity-panel {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .stat-card {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .donut-center {
    background: #ffffff;
}

[data-theme="light"] .team-member-card,
[data-theme="light"] .team-overview-card {
    background: #f9fafb;
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .epm-body-wrapper {
    background: #ffffff;
}

[data-theme="light"] .team-panel {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .card-context-menu {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .card-context-menu button:hover {
    background: #f3f4f6;
}

[data-theme="light"] .sidebar-footer {
    border-top-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .sidebar-header {
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea {
    background: #f3f4f6;
    border-color: rgba(0, 0, 0, 0.1);
    color: #111827;
}

[data-theme="light"] .toast {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
    color: #111827;
}

.theme-toggle {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    transition: all var(--transition);
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
    transform: rotate(20deg);
}

html {
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    transition: background var(--transition), color var(--transition);
}

/* ===== LAYOUT ===== */
.app {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 0;
    z-index: 100;
    transition: transform var(--transition-slow);
}

.sidebar-header {
    padding: 28px 24px 20px;
    border-bottom: 1px solid var(--border);
}

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

.sidebar-logo .logo-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: var(--shadow-glow);
}

.sidebar-logo h1 {
    font-size: 1.2rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-logo .logo-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    -webkit-text-fill-color: var(--text-muted);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    min-height: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent-gradient);
    border-radius: 0 4px 4px 0;
    opacity: 0;
    transition: opacity var(--transition);
}

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

.nav-item.active {
    background: rgba(139, 92, 246, 0.1);
    color: var(--text-primary);
}

.nav-item.active::before {
    opacity: 1;
}

.nav-item .nav-icon {
    font-size: 1.15rem;
    width: 24px;
    text-align: center;
}

.nav-item .nav-badge {
    margin-left: auto;
    background: var(--accent-purple);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 22px;
    text-align: center;
}

.nav-section-title {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    padding: 20px 16px 8px;
    font-weight: 600;
}

.sidebar-data {
    display: contents;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-bar-track {
    height: 4px;
    background: var(--surface);
    border-radius: 4px;
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--accent-gradient);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== MAIN AREA ===== */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-primary);
}

/* ===== TOP BAR ===== */
.topbar {
    position: relative;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    border-bottom: 1px solid var(--border);
    background: rgba(11, 14, 23, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    min-height: 68px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px;
}

.topbar-title h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.topbar-title p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box input {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 16px 10px 40px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    width: 260px;
    transition: all var(--transition);
    outline: none;
}

.search-box input:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
    width: 320px;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box .search-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
}

.filter-btn,
.add-task-btn {
    border: none;
    border-radius: var(--radius-md);
    padding: 10px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition);
}

.filter-btn {
    background: var(--surface);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.filter-btn:hover {
    background: var(--surface-light);
    color: var(--text-primary);
}

.filter-btn.active {
    border-color: var(--accent-purple);
    color: var(--accent-purple);
}

.add-task-btn {
    background: var(--accent-gradient);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 12px rgba(139, 92, 246, 0.3);
}

.add-task-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}

.add-task-btn:active {
    transform: translateY(0);
}

/* ===== FILTER DROPDOWN ===== */
.filter-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 8px;
    min-width: 200px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    z-index: 50;
    display: none;
}

.filter-dropdown.show {
    display: block;
    animation: slideDown 0.2s ease;
}

.filter-section-title {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 8px 12px 4px;
    font-weight: 600;
}

.filter-dropdown button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
}

.filter-dropdown button:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.filter-dropdown button.active {
    color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.1);
}

.filter-container {
    position: relative;
}

/* ===== CONTENT VIEWS ===== */
.content {
    flex: 1;
    overflow: auto;
    padding: 24px 32px;
}

.content::-webkit-scrollbar {
    width: 6px;
}

.content::-webkit-scrollbar-track {
    background: transparent;
}

.content::-webkit-scrollbar-thumb {
    background: var(--surface-light);
    border-radius: 3px;
}

/* ===== BOARD VIEW ===== */
.view {
    display: none;
}

.view.active {
    display: block;
}

.board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    height: 100%;
    min-height: calc(100vh - 160px);
}

.column {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

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

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

.column-dot.todo {
    background: var(--status-todo);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
}

.column-dot.progress {
    background: var(--status-progress);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.column-dot.done {
    background: var(--status-done);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

.column-title {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.column-count {
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 10px;
}

.column-body {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 200px;
}

.column-body::-webkit-scrollbar {
    width: 4px;
}

.column-body::-webkit-scrollbar-thumb {
    background: var(--surface-light);
    border-radius: 2px;
}

.column-body.drag-over {
    background: rgba(139, 92, 246, 0.05);
    border: 2px dashed rgba(139, 92, 246, 0.3);
    border-radius: var(--radius-md);
}

/* ===== TASK CARD ===== */
.task-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    cursor: grab;
    transition: all var(--transition);
    position: relative;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: visible;
    border-left: 3px solid var(--border);
}

.task-card:has(.task-priority-badge.low) {
    border-left-color: var(--priority-low);
}

.task-card:has(.task-priority-badge.medium) {
    border-left-color: var(--priority-medium);
}

.task-card:has(.task-priority-badge.high) {
    border-left-color: var(--priority-high);
}

.task-card:has(.task-priority-badge.critical) {
    border-left-color: var(--priority-critical);
}

.task-card:has(.card-context-menu.show) {
    z-index: 100;
}

.task-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.task-card:hover:has(.task-priority-badge.low) {
    border-left-color: var(--priority-low);
}

.task-card:hover:has(.task-priority-badge.medium) {
    border-left-color: var(--priority-medium);
}

.task-card:hover:has(.task-priority-badge.high) {
    border-left-color: var(--priority-high);
}

.task-card:hover:has(.task-priority-badge.critical) {
    border-left-color: var(--priority-critical);
}

.task-card.dragging {
    opacity: 0.5;
    transform: rotate(2deg) scale(0.98);
}

.task-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.task-card-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.task-priority-badge {
    font-size: 0.55rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

.task-priority-badge.low {
    background: rgba(34, 197, 94, 0.15);
    color: var(--priority-low);
}

.task-priority-badge.medium {
    background: rgba(245, 158, 11, 0.15);
    color: var(--priority-medium);
}

.task-priority-badge.high {
    background: rgba(249, 115, 22, 0.15);
    color: var(--priority-high);
}

.task-priority-badge.critical {
    background: rgba(239, 68, 68, 0.15);
    color: var(--priority-critical);
}

.task-card-menu {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    font-size: 1rem;
    transition: all var(--transition);
    line-height: 1;
}

.task-card-menu:hover {
    background: var(--surface);
    color: var(--text-primary);
}

.task-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
}

.task-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.task-card-title {
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    flex: 1;
    min-width: 0;
}

.task-card-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0;
}

.task-due-date {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.task-due-date.overdue {
    color: var(--priority-critical);
}

.task-due-date .due-icon {
    font-size: 0.7rem;
}

.task-card-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--transition);
}

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

.task-action-btn {
    background: var(--surface);
    border: none;
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.task-action-btn:hover {
    color: var(--text-primary);
    background: var(--surface-light);
}

.task-action-btn.delete:hover {
    color: var(--priority-critical);
}

.gantt-row:hover .project-actions {
    opacity: 1 !important;
}

/* Card context menu */
.card-context-menu {
    position: absolute;
    top: 40px;
    right: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px;
    min-width: 140px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    display: none;
}

.card-context-menu.show {
    display: block;
    animation: slideDown 0.15s ease;
}

.card-context-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    cursor: pointer;
    border-radius: 6px;
    transition: all var(--transition);
}

.card-context-menu button:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.card-context-menu button.danger:hover {
    color: var(--priority-critical);
}

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

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

.empty-state p {
    font-size: 0.8rem;
    line-height: 1.5;
}

/* ===== DASHBOARD VIEW ===== */
.dashboard {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
}

.stat-card.total::before {
    background: var(--accent-gradient);
}

.stat-card.completed::before {
    background: var(--status-done);
}

.stat-card.in-progress::before {
    background: var(--status-progress);
}

.stat-card.overdue::before {
    background: var(--priority-critical);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card-icon {
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.stat-card.total .stat-card-value {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card.completed .stat-card-value {
    color: var(--status-done);
}

.stat-card.in-progress .stat-card-value {
    color: var(--status-progress);
}

.stat-card.overdue .stat-card-value {
    color: var(--priority-critical);
}

.stat-card-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Dashboard charts area */
.dashboard-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    backdrop-filter: blur(10px);
}

.chart-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-card-title .chart-icon {
    font-size: 1.1rem;
}

/* Priority bars */
.priority-bars {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.priority-bar-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.priority-bar-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

.priority-bar-label .label-name {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.priority-bar-label .label-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.priority-bar-label .label-count {
    font-weight: 600;
    color: var(--text-primary);
}

.priority-bar-track {
    height: 8px;
    background: var(--surface);
    border-radius: 4px;
    overflow: hidden;
}

.priority-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.priority-bar-fill.low {
    background: var(--priority-low);
}

.priority-bar-fill.medium {
    background: var(--priority-medium);
}

.priority-bar-fill.high {
    background: var(--priority-high);
}

.priority-bar-fill.critical {
    background: var(--priority-critical);
}

/* Completion ring */
.completion-ring-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
}

.ring-wrapper {
    position: relative;
    width: 160px;
    height: 160px;
}

.ring-wrapper svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ring-bg {
    fill: none;
    stroke: var(--surface);
    stroke-width: 8;
}

.ring-fill {
    fill: none;
    stroke: url(#gradient);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.ring-percentage {
    font-size: 2rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.ring-legend {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend-dot.todo {
    background: var(--status-todo);
}

.legend-dot.progress {
    background: var(--status-progress);
}

.legend-dot.done {
    background: var(--status-done);
}

/* Recent activity */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.activity-panel {
    max-width: 800px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.dashboard-team-overview {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.team-overview-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 16px;
}

.team-overview-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: var(--bg-glass);
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.team-overview-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.team-overview-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.team-overview-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.team-overview-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-overview-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.team-email-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 2px 4px;
    border-radius: 4px;
    opacity: 0;
    transition: all var(--transition);
    line-height: 1;
    flex-shrink: 0;
}

.team-overview-card:hover .team-email-btn {
    opacity: 0.7;
}

.team-email-btn:hover {
    opacity: 1 !important;
    background: var(--accent);
    transform: scale(1.15);
}

.team-overview-stats {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.team-overview-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    min-width: 160px;
}

.team-overview-counts {
    display: flex;
    gap: 6px;
}

.toc-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    min-width: 24px;
    text-align: center;
}

.toc-badge.todo {
    background: rgba(99, 102, 241, 0.15);
    color: var(--status-todo);
}

.toc-badge.progress {
    background: rgba(245, 158, 11, 0.15);
    color: var(--status-progress);
}

.toc-badge.done {
    background: rgba(34, 197, 94, 0.15);
    color: var(--status-done);
}

.toc-badge.overdue {
    background: rgba(239, 68, 68, 0.15);
    color: var(--priority-critical);
}

.team-overview-bar {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--surface);
    display: flex;
    overflow: hidden;
}

.tob-seg {
    height: 100%;
    transition: width 0.6s ease;
}

.tob-seg.done {
    background: var(--status-done);
}

.tob-seg.progress {
    background: var(--status-progress);
}

.tob-seg.todo {
    background: var(--status-todo);
}

.tob-seg.empty {
    background: var(--surface-light);
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.activity-icon-wrap.created {
    background: rgba(99, 102, 241, 0.15);
    color: var(--status-todo);
}

.activity-icon-wrap.moved {
    background: rgba(245, 158, 11, 0.15);
    color: var(--status-progress);
}

.activity-icon-wrap.completed {
    background: rgba(34, 197, 94, 0.15);
    color: var(--status-done);
}

.activity-icon-wrap.deleted {
    background: rgba(239, 68, 68, 0.15);
    color: var(--priority-critical);
}

.activity-text {
    flex: 1;
}

.activity-text p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.activity-text p strong {
    color: var(--text-primary);
    font-weight: 600;
}

.activity-text .activity-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-modal-overlay);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

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

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 500px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95) translateY(10px);
    transition: transform var(--transition);
}

.modal-overlay.show .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px 0;
}

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

.modal-close {
    background: var(--surface);
    border: none;
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

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

.modal-body {
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

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

.form-group input,
.form-group textarea,
.form-group select {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    outline: none;
    transition: all var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.custom-select {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--transition);
}

.custom-select.active {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.custom-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    flex-direction: column;
}

.custom-options.show {
    display: flex;
}

.custom-option {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.custom-option:last-child {
    border-bottom: none;
}

.custom-option:hover {
    background: var(--bg-glass);
}

.custom-option input[type="checkbox"] {
    accent-color: var(--accent-purple);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

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

.form-group select {
    cursor: pointer;
}

.form-group select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

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

.modal-footer {
    padding: 0 28px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-cancel,
.btn-save {
    border: none;
    border-radius: var(--radius-sm);
    padding: 12px 24px;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-cancel {
    background: var(--surface);
    color: var(--text-secondary);
}

.btn-cancel:hover {
    background: var(--surface-light);
    color: var(--text-primary);
}

.btn-save {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 2px 12px rgba(139, 92, 246, 0.3);
}

.btn-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}

/* Confirm modal */
.confirm-modal .modal {
    width: 380px;
    text-align: center;
}

.confirm-message {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    padding: 8px 0;
}

.confirm-modal .modal-footer {
    justify-content: center;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 12px 24px;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-danger:hover {
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
}

/* ===== TOAST ===== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    min-width: 280px;
}

.toast.removing {
    animation: toastOut 0.3s ease forwards;
}

.toast-icon {
    font-size: 1.1rem;
}

.toast.success .toast-icon {
    color: var(--status-done);
}

.toast.error .toast-icon {
    color: var(--priority-critical);
}

.toast.info .toast-icon {
    color: var(--accent-cyan);
}

/* ===== ANIMATIONS ===== */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

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

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

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

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(40px);
    }
}

@keyframes fadeInCard {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

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

.task-card {
    animation: fadeInCard 0.3s ease;
}

/* ===== LOGIN SCREEN ===== */
.login-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    background: var(--bg-primary);
}

.login-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(6, 182, 212, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(236, 72, 153, 0.08) 0%, transparent 50%);
    background-size: cover;
}

.login-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: gridPulse 8s ease-in-out infinite;
}

@keyframes gridPulse {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.7;
    }
}

.login-card {
    position: relative;
    background: rgba(17, 24, 39, 0.8);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    animation: fadeInCard 0.5s ease;
}

.login-logo {
    text-align: center;
    margin-bottom: 36px;
}

.login-logo-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.4));
}

.login-logo h1 {
    font-size: 1.8rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-logo p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.login-field {
    margin-bottom: 20px;
}

.login-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-field input {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    outline: none;
    transition: all var(--transition);
}

.login-field input:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.login-field input::placeholder {
    color: var(--text-muted);
}

.login-error {
    color: var(--priority-critical);
    font-size: 0.8rem;
    min-height: 20px;
    margin-bottom: 8px;
    text-align: center;
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all var(--transition);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(139, 92, 246, 0.4);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.login-arrow {
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.login-btn:hover .login-arrow {
    transform: translateX(4px);
}


/* ===== SIDEBAR USER ===== */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

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

.sidebar-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

.sidebar-logout-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    flex-shrink: 0;
}

.sidebar-logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--priority-critical);
}

.sidebar-action-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    flex-shrink: 0;
}

.sidebar-action-btn:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
    color: var(--accent-purple);
}


/* ===== ASSIGNEE CHIP ===== */
.assignee-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
}

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

.assignee-name {
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-weight: 500;
}


/* ===== TEAM VIEW ===== */
.team-panel {
    max-width: 700px;
}

.team-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.team-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.team-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.team-member-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all var(--transition);
    backdrop-filter: blur(10px);
}

.team-member-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.team-member-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

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

.team-member-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.you-badge {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
}

.team-member-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.team-remove-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    opacity: 0;
}

.team-member-card:hover .team-remove-btn {
    opacity: 1;
}

.team-remove-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--priority-critical);
}

.team-member-actions {
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity var(--transition);
}

.team-member-card:hover .team-member-actions {
    opacity: 1;
}

.team-reset-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.team-reset-btn:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.3);
    color: var(--accent-purple);
}

/* ===== TASK DETAIL MODAL ===== */
.task-detail-modal {
    width: min(580px, 92vw);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.task-detail-modal .modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
}

.task-detail-modal .modal-header h3 {
    flex: 1;
    font-size: 1.15rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 12px;
}

.detail-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.detail-edit-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 4px;
}

.detail-edit-btn:hover {
    background: var(--surface-light);
    color: var(--accent-purple);
    border-color: var(--accent-purple);
}

.task-detail-body {
    overflow-y: auto;
    flex: 1;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 0 !important;
}

/* Task Info */
.task-detail-info {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.detail-description {
    font-size: 0.88rem;
    line-height: 1.65;
    color: var(--text-secondary);
    margin-bottom: 16px;
    white-space: pre-wrap;
}

.detail-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.detail-meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 14px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.detail-meta-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.detail-meta-value {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.detail-status-dot.todo {
    background: var(--status-todo);
    box-shadow: 0 0 6px rgba(139, 92, 246, 0.4);
}

.detail-status-dot.progress {
    background: var(--status-progress);
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}

.detail-status-dot.done {
    background: var(--status-done);
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
}

.detail-assignee-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

/* Comments Section */
.task-detail-comments {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 200px;
}

.comments-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 24px 12px;
}

.comments-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}

.comments-count {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--surface);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.comments-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 24px 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 280px;
    min-height: 80px;
}

.comments-list::-webkit-scrollbar {
    width: 4px;
}

.comments-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.comments-empty,
.comments-loading {
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
    padding: 24px 0;
}

.comment-item {
    display: flex;
    gap: 10px;
    animation: fadeInCard 0.25s ease;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    margin-top: 2px;
}

.comment-content {
    flex: 1;
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0 var(--radius-md) var(--radius-md) var(--radius-md);
    padding: 10px 14px;
}

.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
    gap: 8px;
}

.comment-author {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
}

.comment-time {
    font-size: 0.68rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.comment-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.comment-delete-btn {
    background: none;
    border: 1px solid transparent;
    color: var(--text-muted);
    width: 24px;
    height: 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all var(--transition);
    padding: 0;
}

.comment-item:hover .comment-delete-btn {
    opacity: 1;
}

.comment-delete-btn:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--priority-critical);
}

.comment-text {
    font-size: 0.84rem;
    line-height: 1.5;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
}

/* Comment Input */
.comment-input-area {
    display: flex;
    gap: 10px;
    padding: 12px 24px 20px;
    border-top: 1px solid var(--border);
    align-items: flex-start;
}

.comment-input-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    margin-top: 4px;
}

.comment-input-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comment-input-wrapper textarea {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.84rem;
    resize: none;
    outline: none;
    transition: all var(--transition);
    min-height: 60px;
}

.comment-input-wrapper textarea:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

.comment-input-wrapper textarea::placeholder {
    color: var(--text-muted);
}

.comment-send-btn {
    align-self: flex-end;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px 18px;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.25);
}

.comment-send-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.35);
}

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

.send-arrow {
    font-size: 1rem;
    transition: transform 0.2s ease;
}

.comment-send-btn:hover .send-arrow {
    transform: translateX(3px);
}

/* Comment badge on task cards */
.task-comment-badge {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 2px 6px;
    border-radius: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.task-card:hover .task-comment-badge {
    color: var(--accent-purple);
    border-color: rgba(139, 92, 246, 0.3);
    background: rgba(139, 92, 246, 0.08);
}

.comment-icon {
    font-size: 0.7rem;
    line-height: 1;
}

/* Light mode overrides for comments */
[data-theme="light"] .task-detail-modal {
    background: #ffffff;
}

[data-theme="light"] .comment-content {
    background: #f3f4f6;
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .comment-input-wrapper textarea {
    background: #f3f4f6;
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .detail-meta-item {
    background: #f3f4f6;
    border-color: rgba(0, 0, 0, 0.06);
}


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

    .dashboard-charts {
        grid-template-columns: 1fr;
    }

    .board {
        grid-template-columns: 1fr;
        gap: 16px;
        min-height: auto;
    }

    .column {
        max-height: 400px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        z-index: 200;
        box-shadow: var(--shadow-lg);
    }

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

    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 199;
    }

    .sidebar-backdrop.show {
        display: block;
    }

    .menu-toggle {
        display: block;
    }

    .topbar {
        padding: 12px 16px;
    }

    .content {
        padding: 16px;
    }

    .search-box input {
        width: 180px;
    }

    .search-box input:focus {
        width: 220px;
    }

    .topbar-actions {
        gap: 8px;
    }

    .filter-btn span:not(.filter-icon) {
        display: none;
    }

    .add-task-btn span:last-child {
        display: none;
    }

    .dashboard {
        grid-template-columns: 1fr 1fr;
    }

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

@media (max-width: 480px) {
    .dashboard {
        grid-template-columns: 1fr;
    }

    .completion-ring-container {
        flex-direction: column;
        gap: 20px;
    }
}

/* ===== EMAIL PREVIEW MODAL ===== */
.email-preview-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeInBg 0.2s ease;
}

.email-preview-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: scaleIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

.epm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.epm-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.epm-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

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

.epm-info {
    padding: 12px 24px;
    background: rgba(99, 102, 241, 0.1);
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
}

.epm-info p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.epm-fields {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.epm-field {
    display: flex;
    align-items: center;
    gap: 12px;
}

.epm-field span {
    width: 60px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.epm-field input {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    transition: all var(--transition);
}

.epm-field input:focus {
    border-color: var(--accent-purple);
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.epm-body-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: var(--surface);
}

.epm-body-wrapper * {
    box-sizing: border-box;
}

.epm-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
}

.epm-btn {
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.epm-btn.primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
}

.epm-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

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

.epm-btn.secondary:hover {
    background: var(--surface);
    border-color: var(--text-muted);
}

/* ===== PROJECTS / GANTT TIMELINE ===== */

.dash-project-card:hover {
    transform: translateY(-2px) !important;
    box-shadow: var(--shadow-md) !important;
    border-color: var(--border-hover) !important;
}

.task-project-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

/* Custom horizontal scroll for tasks in project card */
.custom-scrollbar::-webkit-scrollbar {
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--surface-light);
    border-radius: 3px;
}

.color-picker {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.color-option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 2px solid transparent;
    transition: transform 0.2s;
}

.color-option.active {
    border-color: #fff;
    transform: scale(1.1);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4);
}

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