:root {
    /* Color Palette */
    --bg-color: #0f172a; /* Slate 900 */
    --bg-surface: rgba(30, 41, 59, 0.7); /* Slate 800 with opacity */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    
    --primary: #3b82f6; /* Blue 500 */
    --primary-hover: #2563eb;
    
    --color-todo: #64748b;
    --color-progress: #f59e0b; /* Amber */
    --color-review: #a855f7; /* Purple */
    --color-done: #10b981; /* Emerald */
    
    --alert-red: #ef4444;
    --alert-yellow: #eab308;
    --alert-green: #22c55e;
    
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Noto Sans Lao', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.15) 0%, transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(168, 85, 247, 0.15) 0%, transparent 25%);
    background-attachment: fixed;
}

/* Utilities */
.hidden { display: none !important; }
.text-blue { color: var(--primary); }
.text-orange { color: var(--color-progress); }
.text-green { color: var(--color-done); }
.text-red { color: var(--alert-red); }

/* Glassmorphism */
.glass {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: var(--glass-shadow);
}

/* Layout */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    margin-bottom: 30px;
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.2rem;
    color: var(--primary);
}

.logo h1 { color: var(--text-primary); }

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

/* Role Switcher */
.role-switcher {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0,0,0,0.2);
    padding: 8px 15px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
}

.role-switcher select {
    background: transparent;
    color: var(--text-primary);
    border: none;
    outline: none;
    font-size: 1rem;
    cursor: pointer;
}

.role-switcher select option { background: var(--bg-color); }

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
}

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

.btn-outline:hover { background: rgba(255,255,255,0.1); }

/* Section Title */
.section-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-primary);
    border-left: 4px solid var(--primary);
    padding-left: 10px;
}

/* Manager Dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.2s ease;
}

.stat-card:hover { transform: translateY(-5px); }

.stat-icon {
    font-size: 2.5rem;
    background: rgba(255,255,255,0.05);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.stat-info h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-info p {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 5px;
}

.team-progress { padding: 25px; }

.team-progress h3 { margin-bottom: 20px; font-weight: 500; }

.member-progress { margin-bottom: 15px; }

.member-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-todo), var(--color-progress), var(--color-done));
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Kanban Board */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    align-items: start;
}

.kanban-col {
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

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

.col-header h3 { font-size: 1rem; font-weight: 600; }
.task-count {
    background: rgba(255,255,255,0.1);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
}

/* Column Colors */
.kanban-col[data-status="todo"] .col-header h3 { color: var(--color-todo); }
.kanban-col[data-status="in-progress"] .col-header h3 { color: var(--color-progress); }
.kanban-col[data-status="review"] .col-header h3 { color: var(--color-review); }
.kanban-col[data-status="done"] .col-header h3 { color: var(--color-done); }

.col-body {
    padding: 15px;
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Task Card */
.task-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 15px;
    cursor: grab;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

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

.task-card:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

.task-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.task-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.4;
}

.task-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

/* Deadline Color Coding */
.deadline-badge {
    padding: 4px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}

.deadline-overdue { background: rgba(239, 68, 68, 0.2); color: var(--alert-red); }
.deadline-soon { background: rgba(234, 179, 8, 0.2); color: var(--alert-yellow); }
.deadline-normal { background: rgba(34, 197, 94, 0.2); color: var(--alert-green); }

.task-assignee-avatar {
    width: 28px;
    height: 28px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.75rem;
}

.task-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: none;
}

.task-card:hover .task-actions { display: block; }

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
}
.btn-icon:hover { color: var(--alert-red); }

/* Modal */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    width: 100%;
    max-width: 500px;
    padding: 30px;
}

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

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}
.btn-close:hover { color: white; }

.form-group { margin-bottom: 20px; }

.form-row { display: flex; gap: 20px; }
.form-row .form-group { flex: 1; }

label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

input, textarea, select {
    width: 100%;
    padding: 12px;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: white;
    font-size: 1rem;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255,255,255,0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin { 100% { transform: rotate(360deg); } }

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

@media (max-width: 768px) {
    .kanban-board { grid-template-columns: 1fr; }
    .top-header { flex-direction: column; gap: 15px; align-items: flex-start; }
    .header-actions { width: 100%; justify-content: space-between; }
}
