/* ==========================================================================
   WorkerFlow Custom CSS - Modern Glassmorphism Styling (Vanilla CSS)
   ========================================================================== */

/* 1. Design Tokens & Theme Setup */
:root {
    --font-primary: 'Outfit', 'Inter', 'Sarabun', -apple-system, sans-serif;
    
    /* Light Theme Color Palette */
    --bg-primary: #f4f8f5; /* soft greenish light gray */
    --bg-secondary: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --border-color: rgba(209, 225, 214, 0.8); /* soft green-gray border */
    --border-highlight: rgba(16, 185, 129, 0.1);
    
    /* Accents */
    --primary: #15803d; /* Forest Green */
    --primary-hover: #166534;
    --primary-light: rgba(21, 128, 61, 0.1);
    
    --success: #16a34a;
    --success-light: rgba(22, 163, 74, 0.1);
    --warning: #ca8a04; /* Darker Yellow/Gold for readability on light BG */
    --warning-light: rgba(202, 138, 4, 0.1);
    --info: #0d9488;
    --info-light: rgba(13, 148, 136, 0.1);
    --danger: #dc2626;
    --danger-light: rgba(220, 38, 38, 0.1);

    /* Glassmorphism settings */
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-blur: 16px;
    --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
    --hover-shadow: 0 20px 40px -15px rgba(21, 128, 61, 0.12);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius-lg: 16px;
    --border-radius-md: 12px;
    --border-radius-sm: 8px;
}

[data-theme="dark"] {
    /* Dark Theme Color Palette */
    --bg-primary: #060f0a; /* dark forest green tint */
    --bg-secondary: #0c1611;
    --text-primary: #f0fdf4; /* minty white */
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: rgba(34, 197, 94, 0.2);
    --border-highlight: rgba(255, 255, 255, 0.08);

    /* Accents */
    --primary: #22c55e; /* Bright Green */
    --primary-hover: #4ade80;
    --primary-light: rgba(34, 197, 94, 0.2);
    
    --success: #4ade80;
    --success-light: rgba(74, 222, 128, 0.15);
    --warning: #fde047; /* Yellow */
    --warning-light: rgba(253, 224, 71, 0.15);
    --info: #2dd4bf;
    --info-light: rgba(45, 212, 191, 0.15);
    --danger: #f87171;
    --danger-light: rgba(248, 113, 113, 0.15);

    /* Glassmorphism dark settings */
    --glass-bg: rgba(12, 22, 17, 0.75);
    --glass-border: rgba(255, 255, 255, 0.05);
    --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --hover-shadow: 0 20px 40px -15px rgba(34, 197, 94, 0.3);
}

/* 2. Global Resets & Basics */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: background-color 0.4s, color 0.4s;
    background-image: 
        radial-gradient(at 0% 0%, rgba(22, 163, 74, 0.03) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(202, 138, 4, 0.02) 0px, transparent 50%);
}

.text-muted { color: var(--text-muted) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-info { color: var(--info) !important; }
.hidden { display: none !important; }

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* 3. Header & Navigation */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--glass-bg);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: 0 4px 20px -10px rgba(0, 0, 0, 0.05);
}

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

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, #22c55e 100%);
    color: white;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25);
}

.logo-text h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.1;
    background: linear-gradient(to right, var(--text-primary), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text span {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Role Selector Styles */
.role-selector-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.role-toggle-wrapper {
    display: flex;
    align-items: center;
    background: var(--border-color);
    padding: 4px;
    border-radius: var(--border-radius-lg);
    gap: 6px;
}

.role-toggle-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0 8px 0 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.role-options {
    display: flex;
    gap: 2px;
}

.role-opt-btn {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: var(--border-radius-md);
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.role-opt-btn i {
    width: 16px;
    height: 16px;
}

.role-opt-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.4);
}

.role-opt-btn.active {
    background: var(--bg-secondary);
    color: var(--primary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    font-weight: 600;
}

[data-theme="dark"] .role-opt-btn.active {
    background: #1e293b;
    color: #818cf8;
}

.janitor-select-box select {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: var(--border-radius-md);
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    box-shadow: var(--card-shadow);
}

/* Header Action Tools */
.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.theme-toggle {
    background: var(--border-color);
    border: none;
    color: var(--text-secondary);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.theme-toggle:hover {
    color: var(--text-primary);
    transform: rotate(15deg);
}

.theme-toggle .moon-icon { display: none; }
[data-theme="dark"] .theme-toggle .sun-icon { display: none; }
[data-theme="dark"] .theme-toggle .moon-icon { display: block; }

.api-status-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--primary-light);
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
}

.api-status-badge .status-dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px var(--primary);
}

.api-status-badge.cloudflare-mode {
    background: var(--success-light);
    color: var(--success);
}
.api-status-badge.cloudflare-mode .status-dot {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

/* Profile Widget */
.profile-widget {
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 1px solid var(--border-color);
    padding-left: 16px;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.profile-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

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

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

.profile-widget .avatar, .profile-widget .profile-info {
    cursor: pointer;
    transition: var(--transition);
}

.profile-widget .avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.profile-widget .profile-info:hover .profile-name {
    color: var(--primary);
}

.logout-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.logout-btn:hover {
    color: var(--danger);
    background: var(--danger-light);
}

/* 4. App Container & Layout */
.app-container {
    flex: 1;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.role-view {
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: fadeIn 0.4s ease-out;
}

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

/* Sub-nav Styling */
.sub-nav {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    gap: 16px;
}

.nav-tab {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-muted);
    padding: 12px 20px;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.nav-tab i {
    width: 18px;
    height: 18px;
}

.nav-tab:hover {
    color: var(--text-primary);
}

.nav-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Tab Content Visibility */
.tab-content {
    display: none;
    flex-direction: column;
    gap: 24px;
    animation: fadeIn 0.3s ease-out;
}

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

/* 5. Facility Head Dashboard & Performance Views */
/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.05);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

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

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

.stat-icon.info { background: var(--info-light); color: var(--info); }
.stat-icon.success { background: var(--success-light); color: var(--success); }
.stat-icon.warning { background: var(--warning-light); color: var(--warning); }
.stat-icon.rating { background: rgba(253, 224, 71, 0.2); color: #eab308; }

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -1px;
}

.stat-footer {
    font-size: 0.75rem;
    font-weight: 500;
}

.rating-stars {
    display: flex;
    gap: 2px;
    color: #eab308;
}

.rating-stars i {
    width: 14px;
    height: 14px;
    fill: #eab308;
}

.rating-stars i.empty {
    fill: none;
    color: var(--border-color);
}

/* Charts Layout */
.charts-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

@media (max-width: 900px) {
    .charts-container {
        grid-template-columns: 1fr;
    }
}

.chart-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    box-shadow: var(--card-shadow);
}

.chart-box h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.chart-wrapper {
    position: relative;
    width: 100%;
    height: 300px;
}

/* Janitor Evaluation Cards */
.janitor-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.janitor-eval-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(var(--glass-blur));
    border-radius: var(--border-radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
}

.janitor-eval-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--hover-shadow);
    border-color: rgba(22, 163, 74, 0.2);
}

.eval-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.eval-card-header .avatar-lg {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #22c55e 100%);
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(22, 163, 74, 0.15);
}

.eval-header-info {
    display: flex;
    flex-direction: column;
}

.eval-header-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.eval-stars-summary {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.eval-stars-summary span {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Metric Bars */
.eval-metrics {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--bg-primary);
    padding: 16px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
}

.metric-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.metric-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.metric-bar-bg {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.metric-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 1s ease-out;
}

.metric-bar-fill.success { background: var(--success); }
.metric-bar-fill.warning { background: var(--warning); }

.eval-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 600;
}

.btn-text-primary {
    background: transparent;
    border: none;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.btn-text-primary:hover {
    background: var(--primary-light);
}

/* 6. Kanban Board Styling */
.board-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.board-info h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.kanban-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    align-items: start;
    min-height: 60vh;
}

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

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

.kanban-col {
    background: rgba(226, 232, 240, 0.25);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 80vh;
    min-height: 500px;
    overflow-y: auto;
    transition: var(--transition);
}

[data-theme="dark"] .kanban-col {
    background: rgba(15, 23, 42, 0.4);
}

/* Col title status indicators */
.col-title-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
    background: transparent;
}

.col-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.col-dot.todo { background: var(--info); }
.col-dot.in-progress { background: var(--primary); }
.col-dot.review { background: var(--warning); }
.col-dot.done { background: var(--success); }

.col-title-bar h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
}

.task-count {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--border-color);
    padding: 2px 8px;
    border-radius: 20px;
}

/* Task lists (drop targets) */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    min-height: 350px;
}

/* Drag states */
.kanban-col.drag-over {
    background: var(--primary-light);
    border-color: var(--primary);
    transform: scale(1.01);
}

/* 7. Task Cards Layout & Type Distinctions (Main vs Special) */
.task-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
    cursor: grab;
    user-select: none;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

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

.task-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    border-color: var(--border-highlight);
}

/* Task Type 1: Main Task (งานหลัก - Blue Theme) */
.task-card.task-type-main {
    border-left: 5px solid #2563eb;
}

.task-card.task-type-main .badge-type {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
}

/* Task Type 2: Special Task (งานพิเศษ - Purple Theme with glowing details) */
.task-card.task-type-special {
    border-left: 5px solid #8b5cf6;
}

.task-card.task-type-special:hover {
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 10px 20px rgba(139, 92, 246, 0.1);
}

.task-card.task-type-special .badge-type {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

/* Card Header elements */
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-priority {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
}

.badge-priority.high { background: var(--danger-light); color: var(--danger); }
.badge-priority.medium { background: var(--warning-light); color: var(--warning); }
.badge-priority.low { background: var(--success-light); color: var(--success); }

/* Card Content */
.task-card h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.task-card p {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Card Footer info */
.card-footer-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dashed var(--border-color);
    padding-top: 10px;
    margin-top: 4px;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.card-assignee, .card-due {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.card-assignee i, .card-due i {
    width: 12px;
    height: 12px;
}

.card-assignee {
    color: var(--text-secondary);
}

.card-due.overdue {
    color: var(--danger);
    font-weight: 600;
}

/* Card actions for Head of Janitor */
.card-action-bar {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 8px;
}

.btn-xs {
    padding: 4px 8px;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-xs-success {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.btn-xs-success:hover {
    background: var(--success);
    color: white;
}

/* Readonly columns for Janitors (Done Column) */
.readonly-col .task-card {
    cursor: default;
}

/* 8. Table Styling (Backlog & Recent Lists) */
.table-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

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

.table-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.table-responsive {
    overflow-x: auto;
}

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

.data-table th, .data-table td {
    padding: 14px 24px;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: rgba(248, 250, 252, 0.5);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

[data-theme="dark"] .data-table th {
    background: #1e293b;
}

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

.data-table tbody tr:hover {
    background: rgba(241, 245, 249, 0.5);
}

[data-theme="dark"] .data-table tbody tr:hover {
    background: rgba(30, 41, 59, 0.5);
}

/* Badges inside tables */
.table-status-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.table-status-badge.todo { background: var(--info-light); color: var(--info); }
.table-status-badge.in_progress { background: var(--primary-light); color: var(--primary); }
.table-status-badge.review { background: var(--warning-light); color: var(--warning); }
.table-status-badge.done { background: var(--success-light); color: var(--success); }

/* Backlog search and filter styling */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    background: rgba(248, 250, 252, 0.4);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

[data-theme="dark"] .filter-bar {
    background: rgba(15, 23, 42, 0.2);
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 260px;
}

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

.search-box input {
    width: 100%;
    padding: 10px 16px 10px 36px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: var(--border-radius-md);
    font-family: var(--font-primary);
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition);
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.form-select, .form-select-sm {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 10px 16px;
    border-radius: var(--border-radius-md);
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    box-shadow: var(--card-shadow);
}

.form-select-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* 9. Buttons & Inputs */
.btn {
    border: none;
    font-family: var(--font-primary);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--border-radius-md);
    font-size: 0.88rem;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #22c55e 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.25);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(22, 163, 74, 0.35);
}

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

.btn-secondary:hover {
    color: var(--text-primary);
    background: var(--text-muted);
}

.btn-success {
    background: var(--success);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-block {
    width: 100%;
}

/* Forms layout */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

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

.required {
    color: var(--danger);
}

.form-control, .form-control-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: var(--border-radius-md);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

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

.form-row .col {
    flex: 1;
}

.form-help-text {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* 10. Modals Layout & Glass Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.modal-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 600px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

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

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

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: 50%;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-primary);
    background: var(--border-color);
}

.modal-body {
    padding: 24px;
    max-height: 75vh;
    overflow-y: auto;
}

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

/* Detail Modal Specifics */
.detail-priority-status {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.detail-section {
    margin: 16px 0;
}

.detail-section h4 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.detail-section p {
    font-size: 0.95rem;
    line-height: 1.5;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 20px 0;
}

.detail-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.detail-item i {
    width: 18px;
    height: 18px;
    color: var(--primary);
    margin-top: 2px;
}

.detail-item h5 {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.detail-item span {
    font-size: 0.88rem;
    font-weight: 600;
}

.evaluation-detail-box {
    background: var(--success-light);
    border: 1px dashed var(--success);
    padding: 16px;
    border-radius: var(--border-radius-md);
    margin-top: 16px;
}

.evaluation-detail-box h4 {
    color: var(--success);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.evaluation-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.8rem;
    flex-wrap: wrap;
    gap: 8px;
}

.evaluation-stars-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.evaluation-feedback h5 {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.evaluation-feedback p {
    font-style: italic;
    font-size: 0.88rem;
    color: var(--text-primary);
}

/* Rating Star Picker Styling */
.star-rating-picker {
    display: flex;
    gap: 8px;
    margin: 8px 0;
}

.star-picker-icon {
    font-size: 1.75rem;
    color: var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.star-picker-icon:hover {
    transform: scale(1.15);
}

.star-picker-icon.active {
    color: #eab308;
}

.star-picker-icon.active i {
    fill: #eab308;
}

.rating-form-group {
    align-items: center;
}

.rating-helper-text {
    font-size: 0.85rem;
    font-weight: 700;
    color: #eab308;
    margin-top: 4px;
}

/* Login Modal Specifics */
.modal-login-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 420px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.login-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.login-logo {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary) 0%, #22c55e 100%);
    color: white;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 15px rgba(22, 163, 74, 0.2);
    margin-bottom: 8px;
}

.login-logo i {
    width: 24px;
    height: 24px;
}

.login-header h2 {
    font-size: 1.35rem;
    font-weight: 800;
}

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

.login-error-msg {
    background: var(--danger-light);
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 10px 14px;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
}

.login-error-msg i {
    width: 16px;
    height: 16px;
}

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.input-with-icon .form-control, .input-with-icon .form-control-select {
    padding-left: 38px;
}

.login-footer {
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* 11. Toast Notifications */
.toast-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    transform: translateY(100px) scale(0.9);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
    pointer-events: none;
    font-size: 0.88rem;
    font-weight: 500;
    backdrop-filter: blur(8px);
}

.toast-notification.show {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.toast-notification.success {
    border-left: 4px solid var(--success);
}
.toast-notification.success i {
    color: var(--success);
}

.toast-notification.warning {
    border-left: 4px solid var(--warning);
}
.toast-notification.warning i {
    color: var(--warning);
}

.toast-notification.danger {
    border-left: 4px solid var(--danger);
}
.toast-notification.danger i {
    color: var(--danger);
}

/* 12. Range Sliders & Score Badges */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    background: var(--border-color);
    height: 6px;
    border-radius: 3px;
    outline: none;
    transition: background 0.3s;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(22, 163, 74, 0.3);
    transition: transform 0.1s, background-color 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: var(--primary-hover);
}

input[type="range"]::-webkit-slider-thumb:active {
    transform: scale(1.3);
}

/* 6. Footer Layout & Styling */
.app-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 32px 16px;
    margin-top: 40px;
    text-align: center;
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.footer-school {
    font-weight: 700;
    color: var(--primary);
    font-size: 1rem;
    margin-bottom: 2px;
}

.footer-address {
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-top: 4px;
}

/* Compact styling for completed tasks */
.task-card-done-compact {
    padding: 10px 14px !important;
    min-height: auto !important;
    border-left-width: 4px !important;
}

