/* css/styles.css */

/* ==========================================
   1. Design Tokens & CSS Variables
   ========================================== */
:root {
    /* Fonts */
    --font-primary: 'Outfit', 'Sarabun', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Shadow styles */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.16);
    --shadow-glow: 0 0 15px rgba(99, 102, 241, 0.2);

    /* Sidebar Width */
    --sidebar-width: 290px;
}

/* Dark Theme (Default) */
.dark-theme {
    --bg-app: #080b11;
    --bg-sidebar: #0f131a;
    --bg-card: rgba(20, 26, 38, 0.65);
    --bg-card-hover: rgba(28, 36, 51, 0.85);
    --bg-input: #151b26;
    --bg-modal: #0d121c;
    --border-color: rgba(255, 255, 255, 0.07);
    --border-focus: #6366f1;
    
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-dark: #0f172a;
    
    /* Accent Gradient & Status Colors */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.35);
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.12);
    --success-border: rgba(16, 185, 129, 0.25);
    
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.12);
    --warning-border: rgba(245, 158, 11, 0.25);
    
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.12);
    --info-border: rgba(59, 130, 246, 0.25);
    
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.12);
    --danger-border: rgba(239, 68, 68, 0.25);

    --priority-high: #f43f5e;
    --priority-medium: #fb923c;
    --priority-low: #38bdf8;
    
    --glass-blur: blur(16px);
    --glass-bg: rgba(15, 23, 42, 0.45);
}

/* Light Theme */
.light-theme {
    --bg-app: #f4f6fa;
    --bg-sidebar: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --bg-input: #f8fafc;
    --bg-modal: #ffffff;
    --border-color: rgba(0, 0, 0, 0.08);
    --border-focus: #4f46e5;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-dark: #0f172a;
    
    /* Accent Gradient & Status Colors */
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-glow: rgba(79, 70, 229, 0.2);
    --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    
    --success: #059669;
    --success-bg: rgba(5, 150, 105, 0.1);
    --success-border: rgba(5, 150, 105, 0.2);
    
    --warning: #d97706;
    --warning-bg: rgba(217, 119, 6, 0.1);
    --warning-border: rgba(217, 119, 6, 0.2);
    
    --info: #2563eb;
    --info-bg: rgba(37, 99, 235, 0.1);
    --info-border: rgba(37, 99, 235, 0.2);
    
    --danger: #dc2626;
    --danger-bg: rgba(220, 38, 38, 0.1);
    --danger-border: rgba(220, 38, 38, 0.2);

    --priority-high: #e11d48;
    --priority-medium: #ea580c;
    --priority-low: #0284c7;
    
    --glass-blur: blur(16px);
    --glass-bg: rgba(255, 255, 255, 0.65);
}

/* ==========================================
   2. Global Resets & Scrollbars
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-primary);
}

body {
    background-color: var(--bg-app);
    color: var(--text-primary);
    overflow-x: hidden;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

input, textarea, select, button {
    outline: none;
    border: none;
    font-family: inherit;
}

.text-muted {
    color: var(--text-muted);
}

/* ==========================================
   3. Application Layout Structure
   ========================================== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Layout */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: background-color var(--transition-normal), border-right var(--transition-normal);
}

/* Main Content Layout */
.main-content {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    padding: 32px 40px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* View Container */
.view-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    margin-top: 24px;
}

.content-view {
    display: none;
    flex-direction: column;
    gap: 28px;
    width: 100%;
    animation: fadeIn var(--transition-slow);
}

.content-view.active-view {
    display: flex;
}

/* ==========================================
   4. Sidebar UI Elements
   ========================================== */
.sidebar-header {
    margin-bottom: 28px;
}

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

.logo-icon {
    width: 42px;
    height: 42px;
    background: var(--primary-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: var(--shadow-glow);
}

.logo-icon i {
    width: 22px;
    height: 22px;
}

.logo-text {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text span {
    font-weight: 400;
    color: var(--text-primary);
    -webkit-text-fill-color: var(--text-primary);
}

/* User Switcher Panel */
.user-switcher-panel {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 20px;
}

.switcher-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.switcher-label i {
    width: 14px;
    height: 14px;
}

.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    transition: border-color var(--transition-fast);
}

.custom-select:focus {
    border-color: var(--border-focus);
}

.custom-select-wrapper::after {
    content: "▾";
    font-size: 12px;
    color: var(--text-muted);
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* Current User Badge */
.current-user-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: var(--radius-md);
    background: var(--primary-gradient);
    color: #ffffff;
    box-shadow: var(--shadow-glow);
    margin-bottom: 24px;
}

.current-user-badge .avatar {
    font-size: 24px;
    background: rgba(255, 255, 255, 0.2);
    width: 42px;
    height: 42px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.current-user-badge .info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.current-user-badge .info .name {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.current-user-badge .info .role {
    font-size: 11px;
    opacity: 0.8;
    font-weight: 400;
}

/* Sidebar Navigation Items */
.sidebar-nav {
    flex-grow: 1;
}

.sidebar-nav ul {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 15px;
    transition: all var(--transition-fast);
}

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

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

.nav-item.active a {
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary);
    box-shadow: inset 3px 0 0 0 var(--primary);
}

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

/* ==========================================
   5. Top Header Bar
   ========================================== */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 24px;
}

.welcome-section h1 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.welcome-section p {
    font-size: 14px;
    margin-top: 4px;
}

.actions-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ==========================================
   6. Buttons & Interactive Elements
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: var(--primary-gradient);
    color: #ffffff;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.45);
}

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

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}

.btn-danger:hover {
    background: var(--danger);
    color: #ffffff;
}

.btn-text {
    background: transparent;
    border: none;
}

.btn-icon {
    width: 44px;
    height: 44px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

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

.btn-icon-sm {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

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

/* ==========================================
   7. Glass Panels and Cards
   ========================================== */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
}

.glass-panel:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.12);
}

/* Metrics Cards (Supervisor Dashboard) */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.metric-card:hover {
    transform: translateY(-4px);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-md);
}

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

.card-icon i {
    width: 22px;
    height: 22px;
}

.card-icon.blue { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }
.card-icon.yellow { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.card-icon.orange { background: rgba(249, 115, 22, 0.12); color: #f97316; }
.card-icon.purple { background: rgba(168, 85, 247, 0.12); color: #a855f7; }
.card-icon.green { background: rgba(16, 185, 129, 0.12); color: #10b981; }

.card-data {
    display: flex;
    flex-direction: column;
}

.card-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.card-value {
    font-size: 26px;
    font-weight: 800;
    margin-top: 2px;
    color: var(--text-primary);
}

/* ==========================================
   8. Dashboard Charts Layout
   ========================================== */
.dashboard-charts-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 24px;
}

.chart-card {
    padding: 24px;
}

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

.chart-header h3 {
    font-size: 16px;
    font-weight: 700;
}

.chart-header i {
    color: var(--text-muted);
    width: 18px;
    height: 18px;
}

.chart-container {
    position: relative;
    height: 280px;
    width: 100%;
}

/* ==========================================
   9. Tables & Progress Lists (Dashboard)
   ========================================== */
.table-card {
    padding: 24px;
}

.table-header {
    margin-bottom: 20px;
}

.table-header h3 {
    font-size: 16px;
    font-weight: 700;
}

.flex-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.table-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

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

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

.search-box input {
    padding: 10px 12px 10px 38px;
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 13px;
    width: 220px;
    transition: all var(--transition-fast);
}

.search-box input:focus {
    border-color: var(--border-focus);
    width: 260px;
}

.filter-select {
    padding: 10px 14px;
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

/* Team Progress Rows */
.team-progress-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.progress-row {
    display: grid;
    grid-template-columns: 180px 1fr 140px;
    align-items: center;
    gap: 20px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.01);
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    transition: all var(--transition-fast);
}

.progress-row:hover {
    background: rgba(255, 255, 255, 0.02);
    border-color: var(--border-color);
}

.progress-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-user .avatar {
    font-size: 20px;
    width: 32px;
    height: 32px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-user .info {
    display: flex;
    flex-direction: column;
}

.progress-user .name {
    font-size: 14px;
    font-weight: 600;
}

.progress-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-bar-bg {
    flex-grow: 1;
    height: 8px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    overflow: hidden;
}

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

.progress-percent {
    font-size: 13px;
    font-weight: 700;
    width: 40px;
    text-align: right;
}

.progress-task-stats {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: right;
    font-weight: 500;
}

.progress-task-stats span {
    font-weight: 700;
    color: var(--success);
}

/* Master Task Table Styling */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.master-task-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.master-task-table th {
    padding: 16px;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
}

.master-task-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.master-task-table tbody tr {
    transition: background-color var(--transition-fast);
}

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

.task-title-cell {
    font-weight: 600;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-member-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.task-member-cell .avatar {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    font-size: 14px;
}

/* Priority & Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-priority-high {
    background: rgba(244, 63, 94, 0.12);
    color: var(--priority-high);
    border: 1px solid rgba(244, 63, 94, 0.2);
}

.badge-priority-medium {
    background: rgba(251, 146, 60, 0.12);
    color: var(--priority-medium);
    border: 1px solid rgba(251, 146, 60, 0.2);
}

.badge-priority-low {
    background: rgba(56, 189, 248, 0.12);
    color: var(--priority-low);
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.badge-status-todo {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid var(--warning-border);
}

.badge-status-in_progress {
    background: rgba(249, 115, 22, 0.12);
    color: #f97316;
    border: 1px solid rgba(249, 115, 22, 0.25);
}

.badge-status-in_review {
    background: var(--info-bg);
    color: var(--info);
    border: 1px solid var(--info-border);
}

.badge-status-done {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-border);
}

.action-buttons {
    display: flex;
    gap: 8px;
}

/* ==========================================
   10. Kanban Board View (Team Member)
   ========================================== */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    align-items: start;
    overflow-x: auto;
    padding-bottom: 20px;
}

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

@media (max-width: 768px) {
    .kanban-board {
        grid-template-columns: 1fr;
    }
}

.kanban-column {
    background: rgba(20, 26, 38, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 500px;
    transition: all var(--transition-fast);
}

.kanban-column.drag-over {
    background: rgba(99, 102, 241, 0.05);
    border: 1px dashed var(--primary);
    box-shadow: inset 0 0 10px rgba(99, 102, 241, 0.1);
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
}

.title-badge {
    display: flex;
    align-items: center;
    gap: 8px;
}

.title-badge h3 {
    font-size: 15px;
    font-weight: 700;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
}

.dot.yellow { background-color: var(--warning); }
.dot.orange { background-color: #f97316; }
.dot.purple { background-color: var(--info); }
.dot.green { background-color: var(--success); }

.count-badge {
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.kanban-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 400px;
}

/* Kanban Cards styling */
.task-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    cursor: grab;
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1),
                box-shadow 0.2s cubic-bezier(0.2, 0.8, 0.2, 1),
                border-color 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    user-select: none;
}

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

.task-card.dragging {
    opacity: 0.4;
    transform: scale(0.96);
    border-color: var(--primary);
}

.task-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: rgba(255, 255, 255, 0.15);
}

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

.card-priority {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-priority.high { background: rgba(244, 63, 94, 0.1); color: var(--priority-high); }
.card-priority.medium { background: rgba(251, 146, 60, 0.1); color: var(--priority-medium); }
.card-priority.low { background: rgba(56, 189, 248, 0.1); color: var(--priority-low); }

.task-card-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

.task-card-desc {
    font-size: 12px;
    color: var(--text-secondary);
    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;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.card-deadline {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
}

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

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

.card-assignee {
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-assignee .avatar {
    width: 22px;
    height: 22px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.card-assignee .name {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
}

.card-actions {
    display: flex;
    gap: 4px;
}

/* ==========================================
   11. Modals & Forms
   ========================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

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

.modal-content {
    width: 100%;
    max-width: 580px;
    padding: 32px;
    background: var(--bg-modal);
    position: relative;
}

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

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

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

.form-group label.required::after {
    content: " *";
    color: var(--danger);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 16px;
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: border-color var(--transition-fast);
    width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--border-focus);
}

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

.col-6 {
    width: calc(50% - 10px);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* ==========================================
   12. Micro-Animations
   ========================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-fade-in {
    animation: fadeIn var(--transition-slow) forwards;
}

.animate-slide-up {
    opacity: 0;
    animation: slideUp var(--transition-slow) forwards;
    animation-delay: calc(var(--delay) * 50ms);
}

.animate-scale-in {
    animation: scaleIn var(--transition-normal) cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Responsive Styles for Tablet/Mobile */
@media (max-width: 992px) {
    .sidebar {
        width: 80px;
        padding: 20px 10px;
    }
    
    .sidebar-header .logo-text,
    .user-switcher-panel,
    .current-user-badge .info,
    .sidebar-nav span,
    .sidebar-footer span {
        display: none;
    }

    .current-user-badge {
        justify-content: center;
        padding: 10px;
    }
    
    .main-content {
        margin-left: 80px;
        padding: 20px;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-charts-grid {
        grid-template-columns: 1fr;
    }
}

/* Member Management Card Styling */
.member-form {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.member-form input[type="text"] {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-size: 13px;
    transition: border-color var(--transition-fast);
}

.member-form #new-member-name {
    flex-grow: 1;
}

.member-form #new-member-avatar {
    width: 130px;
    text-align: center;
}

.member-form input[type="text"]:focus {
    border-color: var(--border-focus);
}

.member-management-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 4px;
}

.member-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.member-row:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.12);
}

.member-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.member-info .avatar {
    font-size: 20px;
    width: 32px;
    height: 32px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.member-info .name {
    font-size: 14px;
    font-weight: 600;
}

@media (max-width: 576px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .progress-row {
        grid-template-columns: 1fr;
        gap: 8px;
        text-align: left;
    }
    
    .progress-task-stats {
        text-align: left;
    }

    .form-row {
        flex-direction: column;
        gap: 16px;
    }

    .col-6 {
        width: 100%;
    }

    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .actions-section {
        width: 100%;
        justify-content: space-between;
    }
}
