/* ==========================================
   CSS Styling: TeamSync Light Glassmorphism
   ========================================== */

:root {
    /* Color Palette */
    --primary: #6366f1; /* Indigo */
    --primary-hover: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.15);
    
    --bg-base: #f1f5f9;
    --text-primary: #0f172a; /* Slate 900 */
    --text-secondary: #334155; /* Slate 700 */
    --text-muted: #64748b; /* Slate 500 */
    
    /* Status Colors */
    --todo-color: #3b82f6; /* Blue */
    --todo-bg: rgba(59, 130, 246, 0.12);
    --progress-color: #f59e0b; /* Amber */
    --progress-bg: rgba(245, 158, 11, 0.12);
    --done-color: #10b981; /* Emerald */
    --done-bg: rgba(16, 185, 129, 0.12);
    --overdue-color: #ef4444; /* Rose */
    --overdue-bg: rgba(239, 68, 68, 0.1);
    
    /* Priority Badge Colors */
    --prio-high-text: #dc2626;
    --prio-high-bg: #fee2e2;
    --prio-med-text: #d97706;
    --prio-med-bg: #fef3c7;
    --prio-low-text: #475569;
    --prio-low-bg: #e2e8f0;

    /* Glassmorphism Specs */
    --glass-bg: rgba(255, 255, 255, 0.45);
    --glass-border: rgba(255, 255, 255, 0.55);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
    --card-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.03);
    --border-radius-lg: 20px;
    --border-radius-md: 12px;
    --border-radius-sm: 8px;
    
    /* Fonts */
    --font-family: 'Outfit', 'Sarabun', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* --- Ambient Animated Background --- */
.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    overflow: hidden;
    background: radial-gradient(circle at 50% 50%, #eff6ff 0%, #eef2ff 50%, #f5f3ff 100%);
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.5;
    z-index: -1;
}

.blob-1 {
    top: -10%;
    left: 10%;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, #c7d2fe 0%, #818cf8 100%);
    animation: floatBlob 25s infinite alternate ease-in-out;
}

.blob-2 {
    bottom: 10%;
    right: 5%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #fbcfe8 0%, #f472b6 100%);
    animation: floatBlob 20s infinite alternate-reverse ease-in-out 2s;
}

.blob-3 {
    top: 40%;
    left: 35%;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, #bfdbfe 0%, #60a5fa 100%);
    animation: floatBlob 30s infinite alternate ease-in-out 4s;
}

@keyframes floatBlob {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(50px, 40px) scale(1.1); }
    100% { transform: translate(-30px, -50px) scale(0.9); }
}

/* --- Glass Class Helper --- */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

/* --- Layout Grid --- */
.app-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* --- Sidebar Style --- */
.sidebar {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
}

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

.logo-icon {
    background: linear-gradient(135deg, var(--primary) 0%, #818cf8 100%);
    color: white;
    width: 42px;
    height: 42px;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.logo-area h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex-grow: 1;
}

.nav-btn {
    background: transparent;
    border: none;
    outline: none;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    color: var(--text-secondary);
    font-family: var(--font-family);
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
}

.nav-btn i {
    width: 20px;
    height: 20px;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.6);
    color: var(--primary);
    transform: translateX(4px);
}

.nav-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.sidebar-footer {
    margin-top: auto;
}

.action-btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: var(--border-radius-md);
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.25);
    transition: all 0.3s ease;
}

.action-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
}

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

/* --- Main Content Layout --- */
.main-content {
    padding: 2rem 2.5rem;
    overflow-y: auto;
    max-height: 100vh;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.header-info h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.header-info p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
    color: white;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.profile-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

/* --- Statistics Dashboard --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(31, 38, 135, 0.08);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon i {
    width: 24px;
    height: 24px;
}

.icon-blue { background: rgba(59, 130, 246, 0.12); color: #2563eb; }
.icon-yellow { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.icon-green { background: rgba(16, 185, 129, 0.12); color: #059669; }
.icon-red { background: rgba(239, 68, 68, 0.12); color: #dc2626; }

.stat-card.overdue {
    background: rgba(254, 242, 242, 0.45);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.stat-info h3 {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
}

.text-red {
    color: #dc2626;
}

/* --- Dashboard Panels --- */
.dashboard-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.section-card {
    border-radius: var(--border-radius-lg);
    padding: 1.75rem;
    height: 100%;
}

.section-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-card h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-card h2 i {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--glass-border);
    padding: 0.5rem 0.85rem;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: white;
    color: var(--primary);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

/* Workload list */
.members-workload {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.member-workload-card {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--border-radius-md);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.member-card-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #818cf8 100%);
    color: white;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: var(--card-shadow);
}

.member-card-info {
    flex-grow: 1;
}

.member-card-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}

.member-card-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.member-card-count {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.progress-container {
    background: rgba(0, 0, 0, 0.05);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, #10b981 100%);
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* Deadlines Panel */
.deadline-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.deadline-item {
    padding: 0.85rem;
    background: rgba(255, 255, 255, 0.4);
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    transition: all 0.2s ease;
}

.deadline-item:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: translateX(3px);
}

.deadline-item-left {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    overflow: hidden;
}

.deadline-item-title {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.deadline-item-assignee {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.deadline-badge {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 6px;
    white-space: nowrap;
}

.deadline-badge.overdue-pill {
    background: #fee2e2;
    color: #dc2626;
}

.deadline-badge.soon-pill {
    background: #fffbeb;
    color: #b45309;
}

.deadline-badge.normal-pill {
    background: #f1f5f9;
    color: #475569;
}

/* --- Master Task Table Section --- */
.table-section {
    width: 100%;
}

.table-header-controls {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.search-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-sm);
    padding: 0.5rem 0.85rem;
    flex-grow: 1;
    min-width: 250px;
    gap: 0.5rem;
}

.search-box i {
    color: var(--text-muted);
    width: 16px;
    height: 16px;
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font-family);
    font-size: 0.9rem;
    color: var(--text-primary);
    width: 100%;
}

.filter-bar select {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-sm);
    padding: 0.5rem 1rem;
    font-family: var(--font-family);
    font-size: 0.85rem;
    color: var(--text-secondary);
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.filter-bar select:hover {
    border-color: var(--primary);
}

.table-wrapper {
    overflow-x: auto;
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.master-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    background: rgba(255, 255, 255, 0.2);
}

.master-table th {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.5);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.master-table td {
    padding: 1rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    vertical-align: middle;
}

.master-table tbody tr {
    transition: background-color 0.2s ease;
}

.master-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

.badge {
    display: inline-block;
    padding: 0.3rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    text-align: center;
}

.status-todo { background: var(--todo-bg); color: var(--todo-color); }
.status-in-progress { background: var(--progress-bg); color: var(--progress-color); }
.status-done { background: var(--done-bg); color: var(--done-color); }

.prio-high { background: var(--prio-high-bg); color: var(--prio-high-text); }
.prio-medium { background: var(--prio-medium-bg); color: var(--prio-medium-text); }
.prio-low { background: var(--prio-low-bg); color: var(--prio-low-text); }

.action-icon-group {
    display: flex;
    gap: 0.5rem;
}

.action-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.6);
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.action-icon-btn i {
    width: 16px;
    height: 16px;
}

.action-icon-btn.edit-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.action-icon-btn.delete-btn:hover {
    background: var(--overdue-bg);
    color: var(--overdue-color);
}

/* --- Member Kanban View Layout --- */
.member-selector-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.75rem;
    border-radius: var(--border-radius-lg);
    margin-bottom: 2rem;
}

.selector-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.selector-left label {
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.selector-left label i {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.selector-left select {
    background: white;
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-sm);
    padding: 0.5rem 1.5rem 0.5rem 1rem;
    font-family: var(--font-family);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary);
    outline: none;
    cursor: pointer;
    box-shadow: var(--card-shadow);
}

.member-stats {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    background: rgba(255, 255, 255, 0.5);
    padding: 0.4rem 0.85rem;
    border-radius: 20px;
}

/* Kanban Board Columns */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    align-items: start;
    height: calc(100vh - 250px);
}

.kanban-column {
    border-radius: var(--border-radius-lg);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    max-height: 100%;
}

.column-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

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

.dot-todo { background-color: var(--todo-color); }
.dot-progress { background-color: var(--progress-color); }
.dot-done { background-color: var(--done-color); }

.column-header h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    flex-grow: 1;
}

.task-count {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
}

.count-todo { background: var(--todo-bg); color: var(--todo-color); }
.count-progress { background: var(--progress-bg); color: var(--progress-color); }
.count-done { background: var(--done-bg); color: var(--done-color); }

.tasks-container {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    overflow-y: auto;
    flex-grow: 1;
    min-height: 150px;
    padding: 0.25rem;
}

/* Kanban cards dragover styling */
.tasks-container.drag-over {
    background: rgba(99, 102, 241, 0.05);
    border: 2px dashed rgba(99, 102, 241, 0.3);
    border-radius: var(--border-radius-md);
}

/* Kanban Card */
.task-card {
    background: white;
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(0, 0, 0, 0.04);
    padding: 1.1rem;
    box-shadow: var(--card-shadow);
    cursor: grab;
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.2s ease, border-color 0.2s ease;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.task-card:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
    border-color: rgba(99, 102, 241, 0.2);
}

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

.task-card.dragging {
    opacity: 0.4;
    transform: scale(0.95);
    border: 2px dashed var(--primary);
}

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

.card-priority {
    padding: 0.2rem 0.5rem;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
}

.card-actions {
    display: flex;
    gap: 0.2rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

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

.card-action-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.2rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-action-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.card-action-btn.edit:hover { color: var(--primary); }
.card-action-btn.delete:hover { color: var(--overdue-color); }

.card-action-btn i {
    width: 14px;
    height: 14px;
}

.task-card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.task-card p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    padding-top: 0.75rem;
    font-size: 0.75rem;
}

.card-deadline {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--text-muted);
    font-weight: 500;
}

.card-deadline.alert-overdue {
    color: var(--overdue-color);
    font-weight: 700;
}

.card-deadline.alert-overdue i {
    animation: pulseRed 2s infinite;
}

@keyframes pulseRed {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.card-deadline i {
    width: 14px;
    height: 14px;
}

.card-assignee-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #818cf8 100%);
    color: white;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
}

.add-task-inline-btn {
    background: rgba(255, 255, 255, 0.5);
    border: 1px dashed var(--glass-border);
    border-radius: var(--border-radius-md);
    padding: 0.75rem;
    font-family: var(--font-family);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}

.add-task-inline-btn:hover {
    background: white;
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: var(--card-shadow);
}

.add-task-inline-btn i {
    width: 16px;
    height: 16px;
}

/* --- Modals Overlay --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
}

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

.modal-card {
    width: 90%;
    max-width: 520px;
    border-radius: var(--border-radius-lg);
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
    padding: 2rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.modal-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
}

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

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

.close-btn i {
    width: 20px;
    height: 20px;
}

/* Modal Form Styles */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group label .required {
    color: var(--overdue-color);
}

.form-group input, 
.form-group textarea, 
.form-group select {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--border-radius-sm);
    padding: 0.75rem;
    font-family: var(--font-family);
    font-size: 0.9rem;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus, 
.form-group textarea:focus, 
.form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

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

.inline-input-btn {
    display: flex;
    gap: 0.5rem;
}

.inline-input-btn input {
    flex-grow: 1;
}

.inline-input-btn button {
    padding: 0 1.25rem;
    white-space: nowrap;
}

.input-tip {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.btn-cancel {
    background: rgba(0, 0, 0, 0.04);
    border: none;
    color: var(--text-secondary);
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-sm);
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-cancel:hover {
    background: rgba(0, 0, 0, 0.08);
}

.btn-submit {
    background: var(--primary);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-sm);
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-submit:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

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

.animate-slide-up {
    animation: slideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Member List elements inside Management Modal */
.member-list-section {
    margin-top: 1.5rem;
}

.member-list-section h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.member-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.member-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.02);
    padding: 0.6rem 1rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.member-list-item-name {
    font-weight: 500;
    font-size: 0.9rem;
}

.member-list-item button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.member-list-item button:hover {
    background: var(--overdue-bg);
    color: var(--overdue-color);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .app-container {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        display: none; /* In a full responsive scenario, we would have a top drawer. Keeping it simple. */
    }
    
    .main-content {
        padding: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-content {
        grid-template-columns: 1fr;
    }
    
    .kanban-board {
        grid-template-columns: 1fr;
        height: auto;
    }
}
