/* CSS Variables & Theme Setup */
:root {
    --primary: #6366f1; /* Indigo */
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.15);
    
    --bg-app: linear-gradient(135deg, #0b0f19 0%, #111827 50%, #1e1b4b 100%);
    --bg-panel: rgba(17, 24, 39, 0.7);
    --bg-card: rgba(31, 41, 55, 0.4);
    --bg-modal: rgba(17, 24, 39, 0.95);
    
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-hover: rgba(255, 255, 255, 0.15);
    --border-focus: rgba(99, 102, 241, 0.5);
    
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dark: #111827;
    
    --priority-high: #f43f5e; /* Rose */
    --priority-high-bg: rgba(244, 63, 94, 0.15);
    --priority-medium: #eab308; /* Amber */
    --priority-medium-bg: rgba(234, 179, 8, 0.15);
    --priority-low: #10b981; /* Emerald */
    --priority-low-bg: rgba(16, 185, 129, 0.15);
    
    --status-todo: #818cf8;
    --status-todo-bg: rgba(129, 140, 248, 0.15);
    --status-progress: #38bdf8;
    --status-progress-bg: rgba(56, 189, 248, 0.15);
    --status-done: #34d399;
    --status-done-bg: rgba(52, 211, 153, 0.15);
    
    --shadow-soft: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 15px rgba(99, 102, 241, 0.3);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.15);
    
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', 'Inter', 'Sarabun', sans-serif;
    background: var(--bg-app);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* App Container Layout */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 0 24px;
    max-width: 1600px;
    margin: 0 auto;
}

/* Premium Header styling */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-glass);
}

.header-left {
    display: flex;
    align-items: center;
}

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

.logo-icon {
    background: linear-gradient(135deg, var(--primary) 0%, #a78bfa 100%);
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    animation: pulse 2s infinite;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #ffffff, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

/* Role Selector Dropdown Container */
.role-selector-container {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    padding: 6px 16px;
    border-radius: 30px;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.role-selector-container:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-glass-hover);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.1);
}

.role-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.role-label i {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.custom-select-wrapper {
    position: relative;
}

.role-select {
    background: transparent;
    border: none;
    color: white;
    font-family: 'Inter', 'Sarabun', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    padding-right: 20px;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.role-select option {
    background: #111827;
    color: white;
}

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

/* Main Content Views */
.app-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 40px;
}

.view-section {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
}

.view-section.active {
    display: block;
}

/* View Header */
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.view-title {
    font-family: 'Outfit', 'Sarabun', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    margin-bottom: 4px;
}

.view-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.time-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #a5b4fc;
    font-weight: 500;
}

.time-badge i {
    width: 14px;
    height: 14px;
}

/* KPI Metric Cards Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 20px;
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-soft);
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
}

.metric-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-glass-hover);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3), 0 0 10px rgba(255, 255, 255, 0.05);
}

/* KPI Theme Accents */
.card-total::before { background: linear-gradient(90deg, #9ca3af, #d1d5db); }
.card-todo::before { background: var(--status-todo); }
.card-progress::before { background: var(--status-progress); }
.card-done::before { background: var(--status-done); }
.card-overdue::before { background: var(--priority-high); }

.card-total:hover { box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3), 0 0 15px rgba(209, 213, 219, 0.1); }
.card-todo:hover { box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3), 0 0 15px rgba(129, 140, 248, 0.15); }
.card-progress:hover { box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3), 0 0 15px rgba(56, 189, 248, 0.15); }
.card-done:hover { box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3), 0 0 15px rgba(52, 211, 153, 0.15); }
.card-overdue:hover { box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3), 0 0 15px rgba(244, 63, 94, 0.2); }

.metric-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    border: 1px solid var(--border-glass);
    transition: var(--transition);
}

.metric-card:hover .metric-icon {
    background: rgba(255, 255, 255, 0.07);
    color: white;
}

.card-total .metric-icon i { color: #d1d5db; }
.card-todo .metric-icon i { color: var(--status-todo); }
.card-progress .metric-icon i { color: var(--status-progress); }
.card-done .metric-icon i { color: var(--status-done); }
.card-overdue .metric-icon i { color: var(--priority-high); }

.metric-info {
    margin-bottom: 12px;
}

.metric-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 4px;
}

.metric-value {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1;
}

.metric-trend {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    padding: 3px 8px;
    border-radius: 12px;
    align-self: flex-start;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.metric-trend.danger {
    background: rgba(244, 63, 94, 0.1);
    color: var(--priority-high);
    border-color: rgba(244, 63, 94, 0.15);
}

.metric-trend .trend-percent {
    color: var(--status-done);
    font-weight: 700;
}

.badge-overdue-pulse {
    animation: subtle-pulse 1.5s infinite;
}

/* Dashboard Middle Grid */
.dashboard-middle-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 24px;
    margin-bottom: 30px;
}

.dashboard-block {
    background: var(--bg-panel);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 24px;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-soft);
}

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

.block-title {
    font-family: 'Outfit', 'Sarabun', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
}

.block-title i {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.block-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Team Progress List styling */
.team-progress-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.team-progress-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.team-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.team-member-name-badge {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    color: white;
    background: linear-gradient(135deg, var(--primary) 0%, #818cf8 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Dynamic avatar colors based on name initials */
.avatar-MK { background: linear-gradient(135deg, #4f46e5 0%, #818cf8 100%); }
.avatar-BM { background: linear-gradient(135deg, #06b6d4 0%, #22d3ee 100%); }
.avatar-BP { background: linear-gradient(135deg, #ec4899 0%, #f472b6 100%); }
.avatar-BPi { background: linear-gradient(135deg, #eab308 0%, #facc15 100%); }
.avatar-BN { background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%); }
.avatar-BJ { background: linear-gradient(135deg, #059669 0%, #34d399 100%); }
.avatar-HT { background: linear-gradient(135deg, #dc2626 0%, #f87171 100%); }
.avatar-HJ { background: linear-gradient(135deg, #d97706 0%, #fbbf24 100%); }
.avatar-HK { background: linear-gradient(135deg, #2563eb 0%, #60a5fa 100%); }
.avatar-HL { background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%); }

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

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

.progress-bar-container {
    height: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 6px;
    width: 0%;
    background: linear-gradient(90deg, var(--primary) 0%, #c084fc 100%);
    box-shadow: 0 0 8px rgba(167, 139, 250, 0.4);
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Insights Column */
.insights-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.insight-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 14px;
    transition: var(--transition);
}

.insight-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-glass-hover);
    transform: translateX(4px);
}

.insight-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.insight-icon.info {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
}

.insight-icon.warning {
    background: rgba(244, 63, 94, 0.15);
    color: var(--priority-high);
}

.insight-icon.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--priority-low);
}

.insight-text h4 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.insight-text p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* All Tasks Table Area */
.table-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.table-filters {
    display: flex;
    gap: 10px;
    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);
    pointer-events: none;
}

.search-box input {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 8px 16px 8px 36px;
    color: white;
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
    width: 220px;
}

.search-box input:focus {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-focus);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

.filter-select {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 8px 16px;
    color: white;
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    cursor: pointer;
    transition: var(--transition);
}

.filter-select:hover, .filter-select:focus {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-glass-hover);
}

.filter-select option {
    background: #111827;
    color: white;
}

/* Responsive Table */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin-top: 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
}

.tasks-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.tasks-table th {
    background: rgba(255, 255, 255, 0.02);
    padding: 14px 18px;
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-glass);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.tasks-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-glass);
    color: var(--text-main);
    vertical-align: middle;
}

.tasks-table tbody tr {
    transition: var(--transition);
}

.tasks-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.tasks-table tbody tr:last-child td {
    border-bottom: none;
}

/* Kanban Member View Specifics */
.header-actions {
    display: flex;
    gap: 12px;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-glass-hover);
}

.btn-danger {
    background: rgba(244, 63, 94, 0.15);
    color: var(--priority-high);
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
    background: var(--priority-high);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3);
}

/* Quick statistics chips */
.member-board-summary {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.summary-chip {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.summary-chip.success {
    background: rgba(16, 185, 129, 0.05);
    border-color: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.summary-chip.warning {
    background: rgba(56, 189, 248, 0.05);
    border-color: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
}

.summary-chip.danger {
    background: rgba(244, 63, 94, 0.08);
    border-color: rgba(244, 63, 94, 0.25);
    color: var(--priority-high);
    animation: flash 1.5s infinite alternate;
}

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

.summary-chip.success .chip-label,
.summary-chip.warning .chip-label,
.summary-chip.danger .chip-label {
    color: inherit;
}

.chip-val {
    font-weight: 700;
}

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

.kanban-column {
    background: rgba(17, 24, 39, 0.4);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 16px;
    min-height: 550px;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(8px);
    transition: var(--transition);
}

.kanban-column.drag-over {
    background: rgba(99, 102, 241, 0.04);
    border-color: var(--border-focus);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.1) inset;
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.column-title-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.indicator-todo { background-color: var(--status-todo); box-shadow: 0 0 8px var(--status-todo); }
.indicator-progress { background-color: var(--status-progress); box-shadow: 0 0 8px var(--status-progress); }
.indicator-done { background-color: var(--status-done); box-shadow: 0 0 8px var(--status-done); }

.column-title {
    font-family: 'Outfit', 'Sarabun', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: white;
}

.column-count {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

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

/* Kanban Card styling */
.kanban-card {
    background: rgba(31, 41, 55, 0.6);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: grab;
    user-select: none;
    position: relative;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), 
                border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.2s ease;
    box-shadow: var(--shadow-card);
}

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

.kanban-card.dragging {
    opacity: 0.4;
    transform: scale(0.96);
    box-shadow: none;
    border-style: dashed;
}

.kanban-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3), 0 0 1px rgba(255, 255, 255, 0.1);
}

/* Priority Accent Left Border */
.card-prio-high { border-left: 3px solid var(--priority-high); }
.card-prio-medium { border-left: 3px solid var(--priority-medium); }
.card-prio-low { border-left: 3px solid var(--priority-low); }

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

.card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: white;
    line-height: 1.3;
}

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

.card-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

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

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
}

.meta-item i {
    width: 12px;
    height: 12px;
}

/* Priority & Status Badges */
.badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-high { background: var(--priority-high-bg); color: #fca5a5; }
.badge-medium { background: var(--priority-medium-bg); color: #fef08a; }
.badge-low { background: var(--priority-low-bg); color: #86efac; }

.badge-todo { background: var(--status-todo-bg); color: #c7d2fe; }
.badge-progress { background: var(--status-progress-bg); color: #bae6fd; }
.badge-done { background: var(--status-done-bg); color: #a7f3d0; }

/* Overdue Badge styling */
.badge-overdue {
    background: rgba(244, 63, 94, 0.2);
    color: #fda4af;
    border: 1px solid rgba(244, 63, 94, 0.3);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    animation: flash 1s infinite alternate;
}

.badge-overdue i {
    width: 10px;
    height: 10px;
}

/* Modal Windows styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    background: var(--bg-modal);
    border: 1px solid var(--border-glass-hover);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 550px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal-box {
    transform: scale(1);
}

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

.modal-title {
    font-family: 'Outfit', 'Sarabun', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
}

.modal-title i {
    color: var(--primary);
    width: 18px;
    height: 18px;
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition);
}

.btn-close-modal:hover {
    color: white;
}

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

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

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

.col-6 {
    width: 50%;
}

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

.form-control {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: white;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-focus);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

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

.text-danger {
    color: var(--priority-high);
}

.modal-footer {
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border-glass);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.modal-footer.footer-between {
    justify-content: space-between;
}

.modal-actions-right {
    display: flex;
    gap: 12px;
}

.btn-icon-only {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Footer Styling */
.app-footer {
    text-align: center;
    padding: 24px 0;
    margin-top: auto;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-glass);
}

/* Keyframes and Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    }
    50% {
        box-shadow: 0 4px 25px rgba(139, 92, 246, 0.6);
    }
    100% {
        box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    }
}

@keyframes subtle-pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.03);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes flash {
    from {
        box-shadow: 0 0 4px rgba(244, 63, 94, 0.1);
        border-color: rgba(244, 63, 94, 0.2);
    }
    to {
        box-shadow: 0 0 10px rgba(244, 63, 94, 0.4);
        border-color: rgba(244, 63, 94, 0.5);
    }
}

/* Responsive Breakpoints */
@media (max-width: 992px) {
    .kanban-board {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .kanban-column {
        min-height: auto;
    }
    
    .kanban-cards {
        min-height: auto;
    }
    
    .dashboard-middle-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .header-right {
        width: 100%;
    }
    
    .role-selector-container {
        width: 100%;
        justify-content: space-between;
    }
    
    .view-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }
    
    .table-header-flex {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .table-filters {
        width: 100%;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .filter-select {
        flex-grow: 1;
    }
    
    .form-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .col-6 {
        width: 100%;
    }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 15, 25, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.loading-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: 0.5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

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

