:root[data-theme="dark"] {
    --bg-base: #0f111a;
    --bg-panel: rgba(25, 28, 41, 0.65);
    --bg-glass: rgba(35, 39, 56, 0.4);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-primary: #f0f2f5;
    --text-secondary: #a0a6b5;
    
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #3b82f6;
    --tertiary: #10b981;
    --danger: #ef4444;
    
    --priority-low: #10b981;
    --priority-med: #f59e0b;
    --priority-high: #ef4444;
    --priority-urg: #9333ea;
    
    --font-main: 'Outfit', sans-serif;
    
    --shadow-sm: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.3), 0 4px 6px -2px rgba(0,0,0,0.15);
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(59, 130, 246, 0.08), transparent 25%);
    background-size: cover;
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    box-shadow: var(--shadow-glass);
}
.glass-modal {
    background: var(--bg-panel);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    box-shadow: var(--shadow-glass);
    padding: 24px;
    width: 90%;
    max-width: 500px;
    transform: scale(0.95);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.large-modal { max-width: 700px; }
.extra-large-modal { max-width: 900px; }

/* Overlays */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.overlay.active {
    opacity: 1;
    pointer-events: all;
}
.overlay.active .glass-modal {
    transform: scale(1);
    opacity: 1;
}

/* Layout */
.app-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: 100vh;
    gap: 24px;
    padding: 24px;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    gap: 32px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px;
}
.logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}
.brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* User Profile */
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-glass);
    border-radius: 12px;
    border: 1px solid var(--border-glass);
}
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), var(--tertiary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    color: white;
}
.user-info h4 { margin: 0; font-size: 1rem; }
.user-info p { margin: 0; font-size: 0.8rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }

/* Navigation */
.nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 12px;
    margin-bottom: 12px;
}
.nav-header h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 1px;
}
.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.nav-item {
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}
.nav-item:hover { background: var(--bg-glass); }
.nav-item.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.topbar {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}
.topbar h2 { font-size: 1.5rem; font-weight: 600;}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: white; box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); transform: translateY(-2px); }
.btn-secondary { background: var(--bg-glass); color: var(--text-primary); border: 1px solid var(--border-glass); }
.btn-secondary:hover:not(:disabled) { background: rgba(255,255,255,0.1); }
.btn-tertiary { background: rgba(16, 185, 129, 0.15); color: var(--tertiary); border: 1px solid rgba(16, 185, 129, 0.3); }
.btn-danger { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.2rem;
}
.icon-btn:hover { background: var(--bg-glass); color: var(--text-primary); }
.btn.icon-only { padding: 10px; border-radius: 50%; width: 42px; height: 42px; }

/* Utilities */
.w-full { width: 100%; }
.mt-4 { margin-top: 1rem; }
.mt-auto { margin-top: auto; }
.mb-2 { margin-bottom: 0.5rem; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.p-4 { padding: 1rem; }

/* Board & Tasks */
.board-container {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
}
.board-container::-webkit-scrollbar { width: 6px; }
.board-container::-webkit-scrollbar-thumb { background: var(--border-glass); border-radius: 4px; }

.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 24px;
}

.task-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}
.task-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.3);
    border-color: rgba(99, 102, 241, 0.4);
}
.task-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary);
}
.task-card[data-priority="low"]::before { background: var(--priority-low); }
.task-card[data-priority="medium"]::before { background: var(--priority-med); }
.task-card[data-priority="high"]::before { background: var(--priority-high); }
.task-card[data-priority="urgent"]::before { background: var(--priority-urg); }

.task-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px;}
.task-title { font-size: 1.15rem; font-weight: 600; color: var(--text-primary); }
.task-subtitle { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 16px; }

.task-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-glass);
    padding-top: 12px;
}
.task-dates {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.task-dates span { display: flex; align-items: center; gap: 4px; }
.members-avatars { display: flex; }
.members-avatars .avatar { width: 28px; height: 28px; font-size: 0.8rem; margin-left: -8px; border: 2px solid var(--bg-panel); }
.members-avatars .avatar:first-child { margin-left: 0; }

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    text-align: center;
    border: 1px dashed var(--border-glass);
    border-radius: 16px;
}
.empty-state i { font-size: 3rem; margin-bottom: 16px; opacity: 0.5; }

/* Modals & Forms */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-glass);
}
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}
.form-group.full-width { grid-column: 1 / -1; }
.form-group label { font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }

input, select, textarea {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}
select option { background: var(--bg-base); }

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-glass);
}

/* Detail Modal Specifics */
.flex-modal .modal-body-split {
    display: flex;
    gap: 24px;
    height: 60vh;
    min-height: 400px;
}
.task-info-side {
    width: 300px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.task-comments-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
}
.info-block { padding: 16px; }
.info-block h4 { font-size: 0.9rem; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 12px; letter-spacing: 0.5px; border-bottom: 1px solid var(--border-glass); padding-bottom: 8px; }
.date-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.date-row i { font-size: 1.5rem; color: var(--primary); }

.comments-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px;
    padding-right: 8px;
}
.comment {
    display: flex;
    gap: 12px;
    background: rgba(0,0,0,0.2);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border-glass);
}
.comment-content { flex: 1; }
.comment-header { display: flex; justify-content: space-between; margin-bottom: 4px; }
.comment-author { font-weight: 600; font-size: 0.9rem; }
.comment-time { font-size: 0.75rem; color: var(--text-secondary); }
.comment-text { font-size: 0.95rem; line-height: 1.4; white-space: pre-wrap; word-break: break-word;}

.comment-input-area {
    border-top: 1px solid var(--border-glass);
    padding-top: 16px;
}
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 8px;
}
.badge.low { background: rgba(16, 185, 129, 0.2); color: var(--priority-low); }
.badge.medium { background: rgba(245, 158, 11, 0.2); color: var(--priority-med); }
.badge.high { background: rgba(239, 68, 68, 0.2); color: var(--priority-high); }
.badge.urgent { background: rgba(147, 51, 234, 0.2); color: var(--priority-urg); }

/* Custom checkboxes for members */
.checkbox-list { display: flex; flex-direction: column; gap: 8px; max-height: 150px; overflow-y: auto; padding: 8px; background: rgba(0,0,0,0.2); border-radius: 8px; border: 1px solid var(--border-glass); }
.checkbox-item { display: flex; align-items: center; gap: 8px; cursor: pointer; }

/* Login Modal */
.login-modal { text-align: center; }
.login-modal h2 { margin-bottom: 8px; }
.login-modal p { color: var(--text-secondary); margin-bottom: 24px; }
.role-selector { display: flex; flex-direction: column; gap: 12px; }
.login-notes { margin-top: 24px; font-size: 0.8rem; color: var(--text-secondary); opacity: 0.7; }

/* Responsive basics */
@media (max-width: 768px) {
    .app-layout { grid-template-columns: 1fr; }
    .sidebar { display: none; /* simple hidden for mobile mockup */ }
    .flex-modal .modal-body-split { flex-direction: column; height: auto; }
    .task-info-side { width: 100%; }
}
