/* ================================================================
   VN-TRACKING DASHBOARD — ULTRA-PREMIUM DESIGN SYSTEM (LIGHT/DARK)
   Crafted with Senior UI/UX Precision (Linear & Apple Aesthetic)
   ================================================================ */

/* ======================== 1. DESIGN TOKENS ======================== */
:root {
    /* LIGHT THEME (Porcelain & Slate Elegance) */
    --bg-page: #f8fafc;
    --bg-mesh: radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.05) 0px, transparent 50%),
               radial-gradient(at 100% 0%, rgba(56, 189, 248, 0.05) 0px, transparent 50%),
               radial-gradient(at 100% 100%, rgba(168, 85, 247, 0.04) 0px, transparent 50%);
    --sidebar-bg: rgba(255, 255, 255, 0.9);
    --sidebar-border: rgba(226, 232, 240, 0.8);
    --surface: #ffffff;
    --surface-hover: #f1f5f9;
    --surface-card: #ffffff;
    --surface-glass: rgba(255, 255, 255, 0.8);
    --border: #e2e8f0;
    --border-subtle: #edf2f7;
    --border-focus: rgba(99, 102, 241, 0.4);

    /* Brand Accents */
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-glow: rgba(79, 70, 229, 0.25);
    --primary-bg: #eef2ff;
    --primary-text: #3730a3;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);

    --accent-purple: #8b5cf6;
    --accent-cyan: #0ea5e9;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;

    /* Typography */
    --text: #090d16;
    --text-2: #334155;
    --text-3: #64748b;
    --text-4: #94a3b8;

    /* Radius System */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 28px;
    --radius-full: 9999px;

    /* Elevation & Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, 0.05), 0 1px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 8px 24px -4px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
    --shadow-lg: 0 20px 35px -8px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.03);
    --shadow-xl: 0 25px 50px -12px rgba(15, 23, 42, 0.15);
    --shadow-glow: 0 0 24px rgba(99, 102, 241, 0.2);

    /* Card Statuses Light */
    --card-not-started-bg: #ffffff;
    --card-not-started-border: #e2e8f0;
    --card-not-started-text: #475569;
    --card-not-started-glow: rgba(148, 163, 184, 0.15);

    --card-in-progress-bg: #fffbf5;
    --card-in-progress-border: #fed7aa;
    --card-in-progress-text: #9a3412;
    --card-in-progress-glow: rgba(245, 158, 11, 0.18);

    --card-delivered-bg: #f5fdf8;
    --card-delivered-border: #bbf7d0;
    --card-delivered-text: #166534;
    --card-delivered-glow: rgba(16, 185, 129, 0.18);

    --sidebar-w: 260px;
    --font: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --t-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --t-base: 220ms cubic-bezier(0.4, 0, 0.2, 1);
    --t-smooth: 320ms cubic-bezier(0.16, 1, 0.3, 1);
    --t-spring: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Toast Container (Top Right) */
.toast-container { position: fixed; top: 24px; right: 24px; z-index: 100000; display: flex; flex-direction: column; gap: 12px; pointer-events: none; }
.toast {
    pointer-events: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 320px;
    max-width: 440px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: slideInRight 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.toast:hover { transform: translateY(-2px); box-shadow: var(--shadow-xl); }
.toast-icon { flex-shrink: 0; width: 26px; height: 26px; border-radius: var(--radius-full); display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 800; box-shadow: var(--shadow-xs); }
.toast-success { border-left: 4px solid var(--accent-emerald); }
.toast-success .toast-icon { background: var(--accent-emerald); color: #fff; box-shadow: 0 0 12px rgba(16, 185, 129, 0.4); }
.toast-error { border-left: 4px solid var(--accent-rose); }
.toast-error .toast-icon { background: var(--accent-rose); color: #fff; box-shadow: 0 0 12px rgba(244, 63, 94, 0.4); }
.toast-warning { border-left: 4px solid var(--accent-amber); }
.toast-warning .toast-icon { background: var(--accent-amber); color: #fff; box-shadow: 0 0 12px rgba(245, 158, 11, 0.4); }
.toast-info { border-left: 4px solid var(--primary); }
.toast-info .toast-icon { background: var(--primary); color: #fff; box-shadow: 0 0 12px var(--primary-glow); }
.toast-msg { flex: 1; font-weight: 600; font-size: 0.9rem; color: var(--text); line-height: 1.45; }
.toast-close { flex-shrink: 0; background: none; border: none; color: var(--text-3); cursor: pointer; font-size: 1.15rem; padding: 2px 6px; margin-left: auto; border-radius: var(--radius-xs); transition: all var(--t-fast); }
.toast-close:hover { color: var(--text); background: var(--surface-hover); }
@keyframes slideInRight { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

html:has(body.dark-theme), body.dark-theme {
    color-scheme: dark;
    /* DARK THEME (Obsidian Space & Neon Slate) */
    --bg-page: #080c14;
    --bg-mesh: radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
               radial-gradient(at 100% 0%, rgba(56, 189, 248, 0.08) 0px, transparent 50%),
               radial-gradient(at 50% 100%, rgba(168, 85, 247, 0.07) 0px, transparent 60%);
    --sidebar-bg: rgba(13, 18, 31, 0.92);
    --sidebar-border: rgba(255, 255, 255, 0.06);
    --surface: #111726;
    --surface-hover: #192238;
    --surface-card: #121929;
    --surface-glass: rgba(17, 23, 38, 0.85);
    --border: rgba(255, 255, 255, 0.08);
    --border-subtle: rgba(255, 255, 255, 0.04);
    --border-focus: rgba(129, 140, 248, 0.5);

    --primary: #6366f1;
    --primary-hover: #818cf8;
    --primary-glow: rgba(99, 102, 241, 0.35);
    --primary-bg: rgba(99, 102, 241, 0.15);
    --primary-text: #e0e7ff;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);

    --accent-purple: #a855f7;
    --accent-cyan: #38bdf8;
    --accent-emerald: #34d399;
    --accent-amber: #fbbf24;
    --accent-rose: #fb7185;

    --text: #f8fafc;
    --text-2: #cbd5e1;
    --text-3: #94a3b8;
    --text-4: #64748b;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 40px -8px rgba(0, 0, 0, 0.75), 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 30px 60px -12px rgba(0, 0, 0, 0.9);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.3);

    /* Card Statuses Dark */
    --card-not-started-bg: #121929;
    --card-not-started-border: rgba(255, 255, 255, 0.08);
    --card-not-started-text: #cbd5e1;
    --card-not-started-glow: rgba(148, 163, 184, 0.1);

    --card-in-progress-bg: rgba(234, 88, 12, 0.08);
    --card-in-progress-border: rgba(245, 158, 11, 0.3);
    --card-in-progress-text: #fdba74;
    --card-in-progress-glow: rgba(245, 158, 11, 0.18);

    --card-delivered-bg: rgba(16, 185, 129, 0.08);
    --card-delivered-border: rgba(16, 185, 129, 0.3);
    --card-delivered-text: #86efac;
    --card-delivered-glow: rgba(16, 185, 129, 0.18);
}

/* ======================== 2. RESET & BASE ======================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
    font-size: 14px;
    scroll-behavior: smooth;
    background: var(--bg-page);
    height: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
body { 
    font-family: var(--font); 
    background: var(--bg-page); 
    background-image: var(--bg-mesh);
    background-attachment: fixed;
    color: var(--text); 
    line-height: 1.55; 
    min-height: 100vh; 
    zoom: 0.92;
    transition: background-color var(--t-smooth), color var(--t-smooth);
    overflow-x: hidden;
}
input, button, select, textarea { font-family: inherit; }
a { color: var(--primary); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--primary-hover); }
select option { background: var(--surface); color: var(--text); }
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.25);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.45); }

/* ======================== 3. SIDEBAR ======================== */
.sidebar {
    position: fixed; top: 0; left: 0;
    width: var(--sidebar-w); bottom: 0;
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex; flex-direction: column;
    z-index: 100;
    padding: 24px 16px;
    border-right: 1px solid var(--sidebar-border);
    transition: background-color var(--t-smooth), border-color var(--t-smooth);
    overflow-y: auto;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.03);
}
.sidebar::-webkit-scrollbar {
    display: none;
}

.sidebar-logo {
    font-size: 1.25rem; font-weight: 800; color: var(--text);
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 32px; padding: 4px 8px;
    letter-spacing: -0.025em;
}
.sidebar-logo img {
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
    transition: transform var(--t-spring);
}
.sidebar-logo:hover img {
    transform: scale(1.06) rotate(-2deg);
}

.version-tag {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(168, 85, 247, 0.15));
    border: 1px solid rgba(99, 102, 241, 0.35);
    color: var(--primary-hover) !important;
    padding: 1px 7px;
    border-radius: var(--radius-full);
    font-size: 10px !important;
    font-weight: 700 !important;
    letter-spacing: 0.04em;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

.nav-label {
    font-size: 0.68rem; font-weight: 800; color: var(--text-4);
    text-transform: uppercase; letter-spacing: 0.12em;
    padding: 0 12px; margin-bottom: 10px; margin-top: 22px;
}

.nav-item {
    position: relative;
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; border-radius: var(--radius-md);
    font-weight: 600; color: var(--text-2); font-size: 0.92rem;
    cursor: pointer; transition: all var(--t-fast);
    margin-bottom: 3px;
    border: 1px solid transparent;
}
.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 3.5px;
    height: 18px;
    border-radius: 0 4px 4px 0;
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary);
    transition: transform var(--t-fast);
}
.nav-item-content { display: flex; align-items: center; gap: 12px; }
.nav-item-content svg { stroke: var(--text-3); transition: stroke var(--t-fast), transform var(--t-fast); }
.nav-item:hover { background: var(--surface-hover); color: var(--text); border-color: var(--border-subtle); }
.nav-item:hover svg { stroke: var(--primary); transform: translateX(2px); }
.nav-item.active {
    background: var(--primary-bg);
    color: var(--primary);
    border-color: rgba(99, 102, 241, 0.2);
    font-weight: 700;
}
.nav-item.active::before {
    transform: translateY(-50%) scaleY(1);
}
.nav-item.active svg { stroke: var(--primary); }
.nav-badge { background: var(--primary); color: white; font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-full); box-shadow: 0 2px 6px rgba(99, 102, 241, 0.4); }

/* Custom Language Dropdown */
.custom-lang-select {
    position: relative;
    font-size: 0.82rem;
    font-weight: 700;
}
.lang-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    box-shadow: var(--shadow-xs);
    transition: all var(--t-fast);
}
.lang-trigger:hover, .custom-lang-select.open .lang-trigger {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}
.custom-lang-select.open .lang-arrow {
    transform: rotate(180deg);
}
.lang-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 72px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.95);
    transition: all var(--t-fast);
    overflow: hidden;
    backdrop-filter: blur(12px);
}
.custom-lang-select.open .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}
.lang-option {
    padding: 8px 14px;
    cursor: pointer;
    text-align: center;
    color: var(--text-2);
    font-weight: 600;
    transition: all var(--t-fast);
}
.lang-option:hover {
    background: var(--surface-hover);
    color: var(--text);
}
.lang-option.active {
    background: var(--primary-gradient);
    color: white;
    font-weight: 700;
}

.user-card {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: var(--radius-lg);
    background: var(--surface-hover); cursor: pointer;
    border: 1px solid var(--border); transition: all var(--t-base);
}
.user-card:hover {
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}
.user-avatar {
    position: relative;
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--primary-gradient); color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1rem;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}
.user-avatar::after {
    content: '';
    position: absolute;
    bottom: 0px;
    right: 0px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10b981;
    border: 2px solid var(--surface);
    box-shadow: 0 0 6px #10b981;
}
.user-info { flex: 1; overflow: hidden; }
.user-name { font-weight: 700; font-size: 0.92rem; color: var(--text); white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.user-role { font-size: 0.72rem; color: var(--text-3); text-transform: uppercase; font-weight: 700; letter-spacing: 0.05em; }

/* ======================== 4. MAIN AREA & HEADER ======================== */
.main-area {
    margin-left: var(--sidebar-w);
    padding: 32px 40px;
    min-height: 100vh;
}

.top-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 32px;
}
.header-left .welcome { font-size: 0.88rem; color: var(--text-3); margin-bottom: 4px; font-weight: 600; letter-spacing: 0.02em; }
.header-left h1 { font-size: 1.9rem; font-weight: 800; color: var(--text); letter-spacing: -0.03em; }

.header-right { display: flex; align-items: center; gap: 14px; }

/* Theme Toggle Button */
.theme-toggle {
    background: var(--surface); border: 1px solid var(--border);
    width: 42px; height: 42px; border-radius: var(--radius-full);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--text-2); transition: all var(--t-fast);
    box-shadow: var(--shadow-xs);
}
.theme-toggle:hover {
    background: var(--surface-hover);
    color: var(--primary);
    border-color: var(--primary);
    transform: rotate(15deg) scale(1.05);
}
.theme-toggle svg { width: 20px; height: 20px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 20px; border-radius: var(--radius-full);
    font-weight: 700; font-size: 0.84rem; font-family: var(--font);
    text-transform: uppercase; letter-spacing: 0.06em;
    cursor: pointer; border: 1px solid transparent;
    transition: all var(--t-fast);
    user-select: none;
}
.btn:active { transform: scale(0.97); }

.btn-outline {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text-2);
    box-shadow: var(--shadow-xs);
}
.btn-outline:hover {
    background: var(--surface-hover);
    color: var(--text);
    border-color: var(--text-3);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}
.btn-primary { 
    background: var(--primary-gradient); 
    color: white; 
    box-shadow: 0 4px 14px var(--primary-glow);
}
.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
    transform: translateY(-1px);
    color: white;
}
.btn-primary:active { transform: translateY(0); }

/* ======================== 5. TABS & CONTROLS ======================== */
.dashboard-controls {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px; flex-wrap: wrap; gap: 16px;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 18px;
}

.tab-bar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface);
    padding: 4px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
}
.tab-btn {
    padding: 8px 20px;
    border: none;
    background: transparent;
    border-radius: var(--radius-full);
    font-family: var(--font);
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-3);
    cursor: pointer;
    position: relative;
    transition: all var(--t-fast);
}
.tab-btn:hover:not(.active) {
    color: var(--text);
    background: var(--surface-hover);
}
.tab-btn.active {
    background: var(--primary-gradient);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 2px 10px var(--primary-glow);
}

.info-banner { display: flex; align-items: center; gap: 16px; font-size: 0.85rem; color: var(--text-3); font-weight: 600; }
.deadline-badge { 
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(244, 63, 94, 0.25)); 
    border: 1px solid rgba(239, 68, 68, 0.45);
    color: #f87171; 
    padding: 6px 16px; 
    border-radius: var(--radius-full); 
    font-weight: 800; 
    letter-spacing: 0.05em; 
    text-transform: uppercase; 
    font-size: 0.75rem; 
    display: inline-flex;
    align-items: center;
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.25);
    transition: all var(--t-fast);
}
.deadline-badge:hover {
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 0 24px rgba(239, 68, 68, 0.45);
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
}
.deadline-badge:active {
    transform: translateY(0);
}

.tab-content { display: none; animation: fadeIn 0.3s ease; }
.tab-content.active { display: block; }

/* ======================== 6. KANBAN BOARD ======================== */
.kanban-board {
    display: flex; gap: 24px;
    overflow-x: auto; padding-bottom: 28px;
    align-items: flex-start;
}

.kanban-column {
    flex: 1; min-width: 310px;
    display: flex; flex-direction: column; gap: 16px;
    background: rgba(255, 255, 255, 0.015);
    border-radius: var(--radius-xl);
    padding: 12px;
    border: 1px solid transparent;
    transition: background 0.2s;
}

.kanban-header {
    display: flex; align-items: center; justify-content: space-between;
    font-weight: 800; color: var(--text); font-size: 0.88rem;
    text-transform: uppercase; letter-spacing: 0.06em;
    padding: 4px 8px;
}
.kanban-header::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}
.kanban-column[data-status="not-started"] .kanban-header::before {
    background: #94a3b8;
    box-shadow: 0 0 8px rgba(148, 163, 184, 0.6);
}
.kanban-column[data-status="in-progress"] .kanban-header::before {
    background: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.8);
    animation: statusPulse 2s infinite ease-in-out;
}
.kanban-column[data-status="delivered"] .kanban-header::before {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}
@keyframes statusPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

.kanban-header .count {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-3);
    box-shadow: var(--shadow-xs);
}

.kanban-cards { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); 
    gap: 16px; 
}

.job-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-3);
    margin: 14px 0 6px;
    grid-column: 1 / -1;
}
.job-group-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Premium Card Styles */
.progress-card {
    border-radius: var(--radius-lg); padding: 18px;
    cursor: pointer; transition: all var(--t-smooth);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    position: relative;
    background: var(--surface-card);
    backdrop-filter: blur(12px);
    overflow: hidden;
}


.progress-card:hover { 
    transform: translateY(-4px); 
    box-shadow: var(--shadow-lg); 
    border-color: var(--primary);
}
.progress-card.status-in-progress:hover {
    box-shadow: var(--shadow-lg), 0 0 20px var(--card-in-progress-glow);
    border-color: rgba(245, 158, 11, 0.5);
}
.progress-card.status-delivered:hover {
    box-shadow: var(--shadow-lg), 0 0 20px var(--card-delivered-glow);
    border-color: rgba(16, 185, 129, 0.5);
}

.progress-card.status-not-started { background: var(--card-not-started-bg); border-color: var(--card-not-started-border); color: var(--card-not-started-text); }
.progress-card.status-in-progress { background: var(--card-in-progress-bg); border-color: var(--card-in-progress-border); color: var(--card-in-progress-text); }
.progress-card.status-delivered { background: var(--card-delivered-bg); border-color: var(--card-delivered-border); color: var(--card-delivered-text); }

.card-tags { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    margin-bottom: 12px; 
}
.tag {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-2);
    letter-spacing: 0.03em;
    box-shadow: var(--shadow-xs);
}

.card-comment-alarm {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #f59e0b;
    font-size: 0.78rem;
    padding: 3px 8px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: var(--radius-full);
    animation: cardAlarmPulse 2.5s infinite ease-in-out;
    margin-left: auto;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

.card-comment-alarm:hover {
    background: rgba(245, 158, 11, 0.25);
    border-color: rgba(245, 158, 11, 0.7);
    transform: scale(1.1);
}

.card-comment-alarm .alarm-count-badge {
    font-size: 0.65rem;
    font-weight: 800;
    color: #f59e0b;
}

@keyframes cardAlarmPulse {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.08); opacity: 1; filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.6)); }
}

.card-title {
    font-size: 0.98rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.45;
    color: var(--text);
    letter-spacing: -0.01em;
}

.card-worker { 
    font-size: 0.82rem; font-weight: 600; color: var(--text-3); margin-bottom: 14px; 
    display: flex; align-items: center; gap: 8px; 
}
.worker-avatar {
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--surface-hover); color: var(--text);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.62rem; font-weight: 800;
    border: 2px solid var(--surface-card);
    box-shadow: var(--shadow-xs);
}

.progress-info {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 0.72rem; font-weight: 800; margin-bottom: 6px;
    color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em;
}
.progress-track {
    height: 6px;
    background: rgba(148, 163, 184, 0.18);
    border-radius: var(--radius-full);
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.status-not-started .progress-fill { background: #94a3b8; }
.status-in-progress .progress-fill { background: linear-gradient(90deg, #f59e0b, #ea580c); box-shadow: 0 0 8px rgba(245, 158, 11, 0.5); }
.status-delivered .progress-fill { background: linear-gradient(90deg, #10b981, #059669); box-shadow: 0 0 8px rgba(16, 185, 129, 0.5); }

/* ======================== 7. FILTER DRAWER ======================== */
.drawer-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.4);
    backdrop-filter: blur(2px);
    z-index: 200; opacity: 0; visibility: hidden; transition: all var(--t-base);
}
.drawer-overlay.open { opacity: 1; visibility: visible; }

.filter-drawer {
    position: fixed; top: 0; right: -420px;
    width: 400px; max-width: 100vw; height: 100vh;
    background: var(--surface); z-index: 201;
    padding: 32px; border-left: 1px solid var(--border);
    transition: right var(--t-smooth); overflow-y: auto;
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
}
.filter-drawer.open { right: 0; }

.drawer-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.drawer-header h2 { font-size: 1.25rem; font-weight: 800; display: flex; align-items: center; gap: 12px; }
.close-btn { background: var(--surface-hover); border: none; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-2); transition: all var(--t-fast); }
.close-btn:hover { background: var(--border); color: var(--text); }

.filter-group { margin-bottom: 28px; }
.filter-group-title { font-weight: 700; font-size: 0.8rem; color: var(--text-3); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.05em; }

.filter-option {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; border-radius: var(--radius-sm);
    cursor: pointer; transition: background var(--t-fast);
    font-weight: 500; font-size: 0.95rem; color: var(--text-2);
}
.filter-option:hover { background: var(--surface-hover); color: var(--text); }
.filter-option input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; border-radius: 4px; }

/* ======================== 8. DATA TABLE ======================== */
.table-section {
    margin-top: 40px;
    background: var(--surface-card);
    border-radius: var(--radius-2xl);
    padding: 28px 32px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    backdrop-filter: blur(16px);
}
.table-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px; cursor: pointer; user-select: none;
}
.table-header h3 {
    font-size: 1.15rem; font-weight: 800; display: flex; align-items: center; gap: 12px;
    color: var(--text); letter-spacing: -0.02em;
}
.table-header h3 svg { stroke: var(--primary); }
.table-wrapper {
    overflow-x: auto; display: none;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}
.table-wrapper.open { display: block; animation: fadeIn 0.3s ease; margin-top: 20px; }

.data-table {
    width: 100%; border-collapse: collapse; font-size: 0.88rem;
    font-variant-numeric: tabular-nums;
}
.data-table th {
    text-align: left; padding: 14px 18px;
    background: var(--surface-hover);
    color: var(--text-3); font-weight: 800;
    border-bottom: 1px solid var(--border);
    text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.08em;
    position: sticky; top: 0; z-index: 1;
}
.data-table td {
    padding: 14px 18px; border-bottom: 1px solid var(--border-subtle);
    color: var(--text-2); max-width: 260px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-weight: 500; transition: background 0.15s;
}
.data-table tbody tr:hover td {
    background: var(--surface-hover);
    color: var(--text);
}

/* ======================== 9. MODALS & CHECKLISTS ======================== */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(8, 12, 20, 0.8);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    z-index: 300; display: none;
    align-items: center; justify-content: center; padding: 24px;
    animation: fadeIn 0.2s ease;
}
.modal-overlay.open { display: flex; }
.modal-content {
    background: var(--surface);
    border-radius: var(--radius-2xl);
    width: 95%; max-width: 1280px; max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl), 0 0 0 1px var(--border);
    border: 1px solid var(--border);
    animation: modalSpringIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    contain: layout paint;
}
@keyframes modalSpringIn {
    from { opacity: 0; transform: scale(0.96) translateY(12px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: flex-start;
    position: sticky; top: 0; background: var(--surface);
    z-index: 10;
}
.modal-title { font-size: 1.35rem; font-weight: 800; margin-bottom: 6px; color: var(--text); letter-spacing: -0.02em; }
.modal-worker { color: var(--text-3); font-size: 0.9rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.modal-body { padding: 32px; }

/* Checklist Grid */
.checklist-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 28px;
    align-items: stretch;
}

.step-col {
    background: var(--surface-card);
    padding: 18px 18px 16px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
    display: flex;
    flex-direction: column;
    position: relative;
    transition: border-color var(--t-fast);
}
.step-col:hover {
    border-color: var(--border-focus);
}

/* Step Header */
.step-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 10px;
}
.step-badge-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}
.step-num {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: var(--surface-hover);
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.02em;
    flex-shrink: 0;
}
.step-meta {
    display: flex;
    flex-direction: column;
}
.step-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.2;
}
.step-sub {
    font-size: 0.7rem;
    color: var(--text-3);
    font-weight: 500;
    margin-top: 2px;
    line-height: 1.2;
}
.step-count {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--surface-hover);
    color: var(--text-3);
    border: 1px solid var(--border);
    letter-spacing: 0.02em;
    white-space: nowrap;
    transition: all var(--t-fast);
}
.step-count.complete {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.35);
}

/* Thin Progress Bar per Column */
.step-progress-bar {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    margin-bottom: 14px;
    overflow: hidden;
}
.step-progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.step-col[data-step="1"] .step-progress-fill { background: linear-gradient(90deg, #6366f1, #818cf8); }
.step-col[data-step="2"] .step-progress-fill { background: linear-gradient(90deg, #3b82f6, #06b6d4); }
.step-col[data-step="3"] .step-progress-fill { background: linear-gradient(90deg, #10b981, #34d399); }

/* Task Items Container */
.step-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

/* Individual Task Row */
.task-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    transition: background var(--t-fast), border-color var(--t-fast);
    border: 1px solid transparent;
}
.task-row:hover {
    background: var(--surface-hover);
    border-color: rgba(255, 255, 255, 0.04);
}

/* Refined Platform Badges */
.platform-badge {
    font-size: 0.65rem;
    padding: 2px 7px;
    border-radius: var(--radius-xs);
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1.4;
}
.platform-badge.notion {
    background: rgba(255, 255, 255, 0.08);
    color: #f4f4f5;
    border: 1px solid rgba(255, 255, 255, 0.16);
}
.platform-badge.sheet {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.25);
}
.platform-badge.asana {
    background: rgba(244, 63, 94, 0.12);
    color: #fb7185;
    border: 1px solid rgba(244, 63, 94, 0.25);
}
.platform-badge.mikan {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

/* Check Label & Input */
.check-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-2);
    transition: color var(--t-fast);
    line-height: 1.4;
    user-select: none;
    -webkit-user-select: none;
    flex: 1;
}
.check-label:hover { color: var(--text); }
.check-label input {
    width: 17px;
    height: 17px;
    accent-color: var(--primary);
    cursor: pointer;
    border-radius: 5px;
    flex-shrink: 0;
}
.check-label .checkmark { display: none; pointer-events: none; }
.check-label input:checked ~ .action-text {
    text-decoration: line-through;
    color: var(--text-4);
    opacity: 0.7;
    transition: all var(--t-fast);
}

/* Modern Embedded Message Template Card */
.msg-template-card {
    margin: 4px 0 8px 8px;
    padding: 9px 12px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-md);
    transition: background var(--t-fast), border-color var(--t-fast);
}
.msg-template-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(99, 102, 241, 0.3);
    border-left-color: var(--primary);
}
.msg-template-card.nested {
    margin: 0;
    border-left: 3px solid #38bdf8;
}
.msg-template-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    gap: 8px;
}
.msg-template-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-3);
    display: flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 0.02em;
}
.btn-copy-action {
    padding: 3px 9px;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: var(--radius-xs);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-2);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all var(--t-fast);
}
.btn-copy-action:hover {
    background: var(--primary-bg);
    color: var(--primary);
    border-color: var(--primary);
}
.btn-copy-action.copied {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #10b981 !important;
    border-color: rgba(16, 185, 129, 0.4) !important;
}
.msg-template-body {
    font-family: inherit;
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--text);
    white-space: pre-wrap;
    user-select: all;
    opacity: 0.92;
}

/* Expandable Ask Task Accordion */
.ask-task-accordion {
    margin: 4px 0 8px 8px;
}
.ask-task-trigger {
    font-size: 0.74rem;
    font-weight: 700;
    color: #38bdf8;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all var(--t-fast);
}
.ask-task-trigger:hover {
    background: rgba(56, 189, 248, 0.14);
    border-color: rgba(56, 189, 248, 0.35);
}
.ask-task-trigger .arrow-icon {
    font-size: 0.62rem;
    transition: transform 0.2s ease;
}
.ask-task-accordion.open .arrow-icon {
    transform: rotate(180deg);
}
.ask-task-panel {
    display: none;
    margin-top: 6px;
}
.ask-task-accordion.open .ask-task-panel {
    display: block;
    animation: fadeIn 0.2s ease;
}

/* Step 1 Helpful Hint Box */
.step-hint-box {
    margin-top: auto;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.09);
    border-radius: var(--radius-md);
    font-size: 0.73rem;
    color: var(--text-3);
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.4;
}
.step-hint-box i {
    color: #f59e0b;
    margin-top: 2px;
    flex-shrink: 0;
}

/* Logtime Form */
.logtime-form { border-top: 1px solid var(--border); padding-top: 32px; }
.form-row { display: grid; gap: 20px; margin-bottom: 20px; }
.form-row.cols-4 { grid-template-columns: repeat(4, 1fr); }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 2fr; }
.form-group label {
    display: block; font-size: 0.78rem; font-weight: 800;
    color: var(--text-3); margin-bottom: 8px;
    text-transform: uppercase; letter-spacing: 0.06em;
}
.form-group input, .form-group select {
    width: 100%; padding: 12px 16px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text); border-radius: var(--radius-md);
    font-family: var(--font); font-size: 0.92rem;
    box-shadow: var(--shadow-xs);
    transition: all var(--t-fast);
}
.form-group input:focus, .form-group select:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-bg);
}

/* Custom Tag Colors */
.tag-lettering {
    background: rgba(16, 185, 129, 0.12) !important;
    color: #10b981 !important;
    border: 1px solid rgba(16, 185, 129, 0.35) !important;
}
.tag-retouch {
    background: rgba(14, 165, 233, 0.12) !important;
    color: #0ea5e9 !important;
    border: 1px solid rgba(14, 165, 233, 0.35) !important;
}
.tag-correction {
    background: rgba(244, 63, 94, 0.12) !important;
    color: #f43f5e !important;
    border: 1px solid rgba(244, 63, 94, 0.35) !important;
}
.tag-prep {
    background: rgba(245, 158, 11, 0.12) !important;
    color: #f59e0b !important;
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
}
.tag-lettering-retouch {
    background: rgba(168, 85, 247, 0.12) !important;
    color: #a855f7 !important;
    border: 1px solid rgba(168, 85, 247, 0.35) !important;
}

/* ======================== 10. CHART SECTION & METRICS ======================== */
.chart-section {
    background: var(--surface);
    border-radius: var(--radius-2xl);
    padding: 24px 28px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    width: 100%;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    position: relative;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.chart-section:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
}
.chart-section.rain-wet-rim::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 20px;
    right: 20px;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(147, 197, 253, 0.45) 20%, rgba(224, 242, 254, 0.8) 50%, rgba(147, 197, 253, 0.45) 80%, transparent);
    border-radius: 999px;
    pointer-events: none;
    box-shadow: 0 0 12px rgba(147, 197, 253, 0.5);
    z-index: 2;
    animation: wetRimPulse 3s ease-in-out infinite alternate;
}
@keyframes wetRimPulse {
    0% { opacity: 0.6; }
    100% { opacity: 1; }
}

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

.chart-title {
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.chart-title svg {
    color: var(--primary);
    filter: drop-shadow(0 0 6px var(--primary-glow));
}

.custom-chart-legend {
    display: none;
    align-items: center;
    gap: 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-2);
    margin-left: auto;
    margin-right: 20px;
}

.chart-time-controls {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-card);
    padding: 4px 6px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
}

.chart-time-controls .btn,
.chart-time-controls button {
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 6px 14px;
    border: 1px solid transparent;
    color: var(--text-2);
    background: transparent;
    cursor: pointer;
    transition: all var(--t-fast);
    line-height: 1.2;
}

.chart-time-controls .btn:hover,
.chart-time-controls button:hover {
    color: var(--text);
    background: var(--bg-hover);
}

.chart-time-controls .btn.active,
.chart-time-controls .btn.btn-primary,
.chart-time-controls button.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 10px var(--primary-glow);
}

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

.chart-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.5);
    z-index: 10;
    border-radius: var(--radius-lg);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Metrics Row */
.metrics-row { display: flex; gap: 20px; margin-bottom: 32px; }
.metric-card {
    flex: 1; background: var(--surface-card);
    border: 1px solid var(--border); border-radius: var(--radius-xl);
    padding: 24px; box-shadow: var(--shadow-sm);
    display: flex; flex-direction: column; gap: 10px;
    position: relative; overflow: hidden;
    backdrop-filter: blur(12px);
    transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
}
.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-hover);
}
.metric-card::after {
    content: '';
    position: absolute; top: 0; right: 0;
    width: 90px; height: 90px;
    background: radial-gradient(circle, var(--primary-bg) 0%, transparent 70%);
    pointer-events: none;
}
.metric-title {
    font-size: 0.78rem; font-weight: 800; color: var(--text-3);
    text-transform: uppercase; letter-spacing: 0.08em;
}
.metric-value {
    font-size: 2.6rem; font-weight: 800; color: var(--primary);
    line-height: 1; font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
}

/* Header Redesign */
.header-left { display: flex; flex-direction: column; gap: 8px; margin-bottom: 40px; }
.header-left .header-title { font-size: 1.1rem; color: var(--text-2); font-weight: 600; margin-bottom: 4px; }
.header-left .weather-time { font-size: 0.95rem; color: var(--text-3); display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.header-left h1 { font-size: 2.2rem; font-weight: 900; background: linear-gradient(135deg, var(--primary), #3b82f6); -webkit-background-clip: text; -webkit-text-fill-color: transparent; letter-spacing: -0.02em; line-height: 1.2; padding-top: 4px; }

/* Avatar styling */
.avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.user-avatar { overflow: hidden; display: flex; align-items: center; justify-content: center; }
.worker-avatar { overflow: hidden; display: flex; align-items: center; justify-content: center; }

/* Common Modal (.cp- prefix modals: Prepare PSD, Drive, Calendar, Password, Roles) */
.cp-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 12, 20, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 9998;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.cp-overlay.active {
    display: block;
    opacity: 1;
}

.cp-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -46%) scale(0.96);
    background: var(--surface);
    width: 90%;
    max-width: 480px;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl), 0 0 0 1px var(--border);
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid var(--border);
    overflow: hidden;
}
.cp-modal.active {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.cp-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 28px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.cp-modal .modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 10px;
}
.cp-modal .modal-close {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    font-size: 1.1rem;
    color: var(--text-2);
    cursor: pointer;
    transition: all var(--t-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
}
.cp-modal .modal-close:hover {
    color: var(--text);
    background: var(--surface-hover);
    border-color: var(--border-hover);
    transform: rotate(90deg);
}
.cp-modal .modal-body {
    padding: 28px;
}
.cp-modal .modal-footer {
    padding: 18px 28px;
    border-top: 1px solid var(--border);
    background: var(--surface-card);
}

/* Modal Form Inputs */
.cp-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface-card);
    color: var(--text);
    font-size: 0.92rem;
    font-family: inherit;
    outline: none;
    transition: all var(--t-fast);
}
.cp-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
    background: var(--surface);
}
.cp-input::placeholder {
    color: var(--text-3);
    opacity: 0.7;
}

.cp-modal .form-group label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

/* Softer border-radius for task modals */
.modal-content {
    border-radius: var(--radius-xl);
}

/* ======================== PROFILE SLIDE-UP PANEL ======================== */
.sidebar-footer {
    margin-top: auto;
    position: relative;
}

.profile-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.3s ease,
                margin 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    margin-bottom: 0;
    border-radius: var(--radius-xl);
}

.profile-panel.open {
    max-height: 420px;
    opacity: 1;
    margin-bottom: 10px;
}

.profile-panel-inner {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 22px 18px 18px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
}

.profile-panel-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px var(--primary-glow);
    border: 2px solid var(--surface);
}

.profile-panel-name {
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--text);
    margin-bottom: 2px;
    letter-spacing: -0.01em;
}

.profile-panel-team {
    font-size: 0.78rem;
    color: var(--text-3);
    margin-bottom: 14px;
    font-weight: 600;
}

.profile-panel-details {
    background: var(--surface-hover);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    margin-bottom: 14px;
}

.profile-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.82rem;
}
.profile-detail-row:not(:last-child) {
    border-bottom: 1px solid var(--border-subtle);
}
.profile-detail-row span:first-child {
    color: var(--text-3);
    font-weight: 600;
}
.profile-detail-row span:last-child {
    color: var(--text);
    font-weight: 700;
}

.profile-panel-actions {
    display: flex;
    gap: 8px;
}

.profile-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-2);
    font-size: 0.78rem;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    box-shadow: var(--shadow-xs);
    transition: all var(--t-fast);
}
.profile-action-btn:hover {
    background: var(--surface-hover);
    color: var(--text);
    border-color: var(--border-focus);
    transform: translateY(-1px);
}

.profile-action-logout {
    color: var(--accent-rose);
    border-color: rgba(244, 63, 94, 0.3);
}
.profile-action-logout:hover {
    background: rgba(244, 63, 94, 0.1);
    color: #e11d48;
    border-color: var(--accent-rose);
}

.profile-chevron {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.profile-chevron.rotated {
    transform: rotate(180deg);
}

/* ======================== 11. RESPONSIVE ======================== */
@media (max-width: 1024px) {
    .kanban-column { flex: 0 0 100%; min-width: 100%; }
    .kanban-cards { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .main-area { margin-left: 0; padding: 20px; }
    .form-row.cols-4, .form-row.cols-3 { grid-template-columns: 1fr; }
    .kanban-cards { grid-template-columns: 1fr; }
    .metrics-row { flex-direction: column; }
}

/* ======================== 12. LOGIN PAGE & LOADER ======================== */
/* Loader overlay when submitting login */
.loader-overlay {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(8, 12, 20, 0.88) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    z-index: 999999 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    flex-direction: column !important;
    gap: 20px !important;
}
.loader-overlay.active {
    display: flex !important;
    animation: fadeIn 0.3s ease;
}

body:has(.login-page) {
    zoom: 1 !important;
    overflow: hidden !important;
}

.login-page {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg-page);
    background-image: radial-gradient(at 50% 0%, rgba(99, 102, 241, 0.18) 0%, transparent 60%),
                      radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.12) 0%, transparent 50%),
                      radial-gradient(at 0% 100%, rgba(56, 189, 248, 0.12) 0%, transparent 50%);
    overflow: hidden;
    z-index: 1;
}
.login-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.orb {
    position: absolute; border-radius: 50%;
    filter: blur(100px); opacity: 0.45;
    animation: orbFloat 14s infinite alternate ease-in-out;
}
.orb-1 { width: 480px; height: 480px; background: rgba(99, 102, 241, 0.35); top: -100px; left: -100px; animation-duration: 16s; }
.orb-2 { width: 420px; height: 420px; background: rgba(236, 72, 153, 0.25); bottom: -60px; right: -60px; animation-duration: 20s; }
.orb-3 { width: 360px; height: 360px; background: rgba(56, 189, 248, 0.25); top: 45%; left: 45%; transform: translate(-50%, -50%); animation-duration: 18s; }
@keyframes orbFloat {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(30px) scale(1.08); }
}

.login-settings {
    position: absolute;
    top: 24px;
    right: 28px;
    display: flex;
    gap: 12px;
    align-items: center;
    z-index: 50;
}
.login-settings .custom-lang-select .lang-trigger {
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-xs);
    font-size: 0.85rem;
    font-weight: 700;
}
.login-settings .theme-toggle {
    background: var(--surface) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid var(--border) !important;
    border-radius: 50% !important;
    width: 42px !important;
    height: 42px !important;
    box-shadow: var(--shadow-xs) !important;
}

.login-card {
    position: relative; z-index: 10;
    background: var(--surface);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    padding: 44px 40px;
    border-radius: var(--radius-2xl);
    width: 100%; max-width: 430px;
    box-shadow: 0 24px 64px -12px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.09), 0 0 60px -15px rgba(99, 102, 241, 0.2);
    border: 1px solid var(--border);
    text-align: center;
    animation: modalSpringIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.login-icon {
    width: 68px; height: 68px; margin: 0 auto 18px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(168, 85, 247, 0.15));
    border: 1px solid rgba(99, 102, 241, 0.3);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.25);
    transition: transform var(--t-fast);
}
.login-card:hover .login-icon {
    transform: scale(1.05);
}
.login-card h1 {
    font-size: 1.85rem; font-weight: 800; color: var(--text);
    letter-spacing: -0.025em; margin-bottom: 4px;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.login-subtitle { font-size: 0.88rem; color: var(--text-3); font-weight: 500; margin-bottom: 28px; }
.login-error {
    background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444; padding: 12px; border-radius: var(--radius-md);
    font-weight: 700; font-size: 0.85rem; margin-bottom: 20px;
}
.login-card .form-group { text-align: left; margin-bottom: 18px; }
.login-card .form-group label {
    display: block; font-size: 0.78rem; font-weight: 800;
    color: var(--text-3); margin-bottom: 8px;
    text-transform: uppercase; letter-spacing: 0.06em;
}
.login-card .form-group input,
.login-card .custom-select-trigger {
    width: 100%; padding: 13px 18px; border: 1px solid var(--border);
    background: var(--surface-card); color: var(--text);
    border-radius: var(--radius-lg); font-size: 0.95rem; font-weight: 500;
    transition: all var(--t-fast); outline: none;
}
.login-card .form-group input:focus,
.login-card .custom-select-trigger:hover,
.login-card .custom-select-container.open .custom-select-trigger {
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.login-btn-submit {
    width: 100%; padding: 14px; margin-top: 16px;
    border-radius: var(--radius-lg); border: none;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #ffffff; font-size: 0.92rem; font-weight: 700;
    letter-spacing: 0.03em; cursor: pointer;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
    transition: all var(--t-fast);
}
.login-btn-submit:hover {
    filter: brightness(1.12);
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(99, 102, 241, 0.55);
}
.login-btn-submit:active {
    transform: translateY(0) scale(0.98);
}
.w-full { width: 100%; display: block; text-align: center; }

/* ============ ONLINE USERS CLUSTER ============ */
.online-users-cluster {
    display: flex;
    align-items: center;
    margin-right: 16px;
    height: 100%;
}
.online-users-cluster:empty {
    display: none;
}
.online-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid var(--bg-page);
    margin-left: -10px;
    object-fit: cover;
    background-color: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    position: relative;
    cursor: default;
    transition: transform 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.online-avatar:first-child {
    margin-left: 0;
}
.online-avatar:hover {
    transform: translateY(-2px);
    z-index: 10;
}
.online-avatar-counter {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-color: var(--surface-hover);
    border: 2px solid var(--bg-page);
    margin-left: -10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--text-2);
    font-weight: 600;
    z-index: 1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ======================== 9. WEATHER WIDGET ======================== */
.ios-weather-widget {
    position: relative;
    width: 100%;
    border-radius: 20px;
    background-color: #1e293b;
    background-size: cover;
    background-position: center;
    color: white;
    padding: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    transition: background-image 0.8s ease-in-out;
    overflow: hidden;
}
.ios-weather-widget::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.5) 100%);
    z-index: 1;
}
.ios-weather-widget-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.iww-loc { font-size: 0.9rem; font-weight: 600; display: flex; align-items: center; gap: 4px; opacity: 0.95; }
.iww-temp { font-size: 3.5rem; font-weight: 300; margin: 4px 0 0 0; line-height: 1.1; letter-spacing: -1px; text-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.iww-desc { font-size: 1rem; font-weight: 500; margin-bottom: auto; text-shadow: 0 1px 2px rgba(0,0,0,0.2); text-transform: capitalize; }
.iww-highlow { font-size: 0.85rem; font-weight: 500; opacity: 0.95; margin-bottom: 2px; }
.iww-feels { font-size: 0.8rem; font-weight: 500; opacity: 0.85; }

/* ======================== TEAM CHAT — PREMIUM UI ======================== */

/* Chat Bubble Button */
.chat-bubble-btn {
    width: 52px; height: 52px; border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #a78bfa);
    color: white; border: none;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.45), 0 0 0 0 rgba(99, 102, 241, 0.3);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    position: relative; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.chat-bubble-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(99, 102, 241, 0.55);
}
.chat-bubble-btn.has-unread {
    animation: chatPulse 2s ease-in-out infinite;
}
@keyframes chatPulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(99, 102, 241, 0.45), 0 0 0 0 rgba(99, 102, 241, 0.4); }
    50% { box-shadow: 0 4px 20px rgba(99, 102, 241, 0.45), 0 0 0 12px rgba(99, 102, 241, 0); }
}
.chat-badge {
    position: absolute; top: -4px; right: -4px;
    background: linear-gradient(135deg, #ef4444, #f97316);
    color: white; font-size: 10px; font-weight: 700;
    min-width: 20px; height: 20px; border-radius: 10px; padding: 0 5px;
    display: none; align-items: center; justify-content: center;
    border: 2.5px solid var(--bg-page, #0f172a);
    animation: badgePop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes badgePop {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

/* Chat Panel */
.chat-panel {
    position: fixed; bottom: 76px; right: 20px;
    width: min(370px, calc(100vw - 48px));
    height: min(540px, calc(100vh - 100px));
    background: var(--surface, #1e293b);
    backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 12px 48px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    overflow: hidden; display: flex; flex-direction: column;
    z-index: 10001;
    opacity: 0; transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.chat-panel.open {
    opacity: 1; transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    padding: 14px 16px; color: white;
    display: flex; justify-content: space-between; align-items: center;
    flex-shrink: 0;
}
.chat-header-left {
    display: flex; align-items: center; gap: 10px;
}
.chat-header-icon {
    width: 34px; height: 34px; border-radius: 10px;
    background: rgba(255,255,255,0.18);
    display: flex; align-items: center; justify-content: center;
}
.chat-header-info h3 {
    margin: 0; font-size: 14px; font-weight: 600; letter-spacing: 0.01em;
}
.chat-header-info .chat-online-count {
    font-size: 11px; opacity: 0.8; font-weight: 400; margin-top: 1px;
}
.chat-close-btn {
    background: rgba(255,255,255,0.15); border: none; color: white;
    cursor: pointer; width: 30px; height: 30px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
}
.chat-close-btn:hover { background: rgba(255,255,255,0.28); }

/* Chat Messages */
.chat-messages {
    flex: 1; padding: 12px 14px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 6px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(139,92,246,0.3) transparent;
}
.chat-messages::-webkit-scrollbar { width: 5px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(139,92,246,0.3); border-radius: 10px; }

.chat-welcome {
    text-align: center; color: var(--text-3, #94a3b8);
    font-size: 12px; margin: 8px 0 4px;
    padding: 8px 16px; border-radius: 12px;
    background: rgba(139, 92, 246, 0.06);
    border: 1px dashed rgba(139, 92, 246, 0.15);
}

/* Message Bubbles */
.chat-msg-row {
    display: flex; gap: 8px; animation: msgSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.chat-msg-row.me { flex-direction: row-reverse; }

@keyframes msgSlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.chat-msg-avatar {
    width: 30px; height: 30px; border-radius: 50%; object-fit: cover;
    flex-shrink: 0; background: var(--surface, #1e293b);
    border: 2px solid rgba(139, 92, 246, 0.2);
}
.chat-msg-content {
    display: flex; flex-direction: column; max-width: 72%;
}
.chat-msg-row.me .chat-msg-content { align-items: flex-end; }
.chat-msg-meta {
    font-size: 10px; color: var(--text-4, #64748b);
    margin-bottom: 3px; padding: 0 4px;
    display: flex; align-items: center; gap: 4px;
}
.chat-msg-meta .msg-sender { font-weight: 600; color: var(--text-3, #94a3b8); }
.chat-msg-bubble {
    padding: 8px 13px; border-radius: 16px;
    word-wrap: break-word; overflow-wrap: break-word;
    font-size: 13px; line-height: 1.45;
    position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.chat-msg-bubble.other {
    background: var(--surface-hover, #1e293b);
    color: var(--text, #e2e8f0);
    border-bottom-left-radius: 4px;
}
.chat-msg-bubble.me {
    background: linear-gradient(135deg, #6366f1, #7c3aed);
    color: white;
    border-bottom-right-radius: 4px;
}
.chat-msg-bubble img {
    max-width: 100%; border-radius: 10px; cursor: pointer;
    transition: transform 0.2s;
}
.chat-msg-bubble img:hover { transform: scale(1.02); }
.chat-msg-bubble .file-link {
    color: inherit; text-decoration: none; display: flex;
    align-items: center; gap: 6px; padding: 6px 10px;
    background: rgba(255,255,255,0.1); border-radius: 8px;
    font-size: 12px; transition: background 0.2s;
}
.chat-msg-bubble .file-link:hover { background: rgba(255,255,255,0.18); }
.chat-msg-bubble .msg-only-emoji {
    font-size: 32px; line-height: 1.3; background: none !important;
    box-shadow: none !important; padding: 2px 0 !important;
}
.chat-typing-indicator {
    padding: 8px 16px;
    font-size: 11px;
    color: var(--text-3, #94a3b8);
    display: flex;
    align-items: center;
    gap: 4px;
}
.typing-dots span {
    animation: typing 1.4s infinite;
    animation-fill-mode: both;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}
.chat-msg-read-avatars {
    display: flex;
    justify-content: flex-end;
    gap: -4px;
    margin-top: 2px;
    min-height: 14px;
}
.chat-msg-read-avatars img {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--bg-panel, #0f172a);
    margin-left: -6px;
    z-index: 1;
}
.chat-msg-row.me .chat-msg-read-avatars {
    justify-content: flex-end;
}
.chat-msg-row:not(.me) .chat-msg-read-avatars {
    justify-content: flex-start;
}


/* Chat Input Area */
.chat-input-area {
    padding: 10px 12px; flex-shrink: 0;
    border-top: 1px solid rgba(255,255,255,0.06);
    background: var(--bg-page, #0f172a);
}
.chat-input-row {
    display: flex; align-items: center; gap: 6px;
    background: var(--surface, #1e293b);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 24px; padding: 4px 6px 4px 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.chat-input-row:focus-within {
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.chat-input-field {
    flex: 1; border: none; background: transparent;
    color: var(--text, #e2e8f0); font-size: 13px;
    outline: none; padding: 7px 0;
    font-family: inherit;
}
.chat-input-field::placeholder { color: var(--text-4, #64748b); }

.chat-input-btn {
    background: transparent; border: none; color: var(--text-4, #64748b);
    cursor: pointer; width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; flex-shrink: 0;
}
.chat-input-btn:hover { color: var(--text-2, #cbd5e1); background: rgba(255,255,255,0.06); }
.chat-send-btn {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white; border: none; cursor: pointer;
    width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}
.chat-send-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.45);
}

/* File preview strip */
.chat-file-preview {
    display: none; align-items: center; gap: 8px;
    padding: 6px 10px; margin-bottom: 6px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 12px; font-size: 12px;
    color: var(--text-2, #cbd5e1);
    animation: msgSlideIn 0.2s ease;
}
.chat-file-preview.active { display: flex; }
.chat-file-preview .file-icon { flex-shrink: 0; color: #8b5cf6; }
.chat-file-preview .file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-file-preview .file-remove {
    background: transparent; border: none; color: var(--text-4);
    cursor: pointer; padding: 2px; display: flex; border-radius: 4px;
    transition: color 0.2s;
}
.chat-file-preview .file-remove:hover { color: #ef4444; }

/* Emoji Picker */
.emoji-picker-container {
    position: absolute; bottom: calc(100% + 8px); left: 8px; right: 8px;
    background: var(--surface, #1e293b);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    padding: 10px;
    display: none; flex-direction: column; gap: 8px;
    z-index: 10;
    animation: emojiFadeIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.emoji-picker-container.open { display: flex; }
@keyframes emojiFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.emoji-picker-search {
    width: 100%; padding: 7px 10px; border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px; background: rgba(0,0,0,0.2);
    color: var(--text, #e2e8f0); font-size: 12px; outline: none;
    font-family: inherit;
}
.emoji-picker-search::placeholder { color: var(--text-4); }
.emoji-picker-search:focus {
    border-color: rgba(99, 102, 241, 0.4);
}
.emoji-tabs {
    display: flex; gap: 2px; overflow-x: auto; padding-bottom: 4px;
    scrollbar-width: none;
}
.emoji-tabs::-webkit-scrollbar { display: none; }
.emoji-tab {
    background: transparent; border: none; padding: 4px 8px;
    border-radius: 8px; cursor: pointer; font-size: 16px;
    transition: background 0.15s; flex-shrink: 0;
    opacity: 0.6;
}
.emoji-tab:hover, .emoji-tab.active { background: rgba(99, 102, 241, 0.15); opacity: 1; }
.emoji-grid {
    display: grid; grid-template-columns: repeat(8, 1fr);
    gap: 2px; max-height: 180px; overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(139,92,246,0.2) transparent;
}
.emoji-grid::-webkit-scrollbar { width: 4px; }
.emoji-grid::-webkit-scrollbar-thumb { background: rgba(139,92,246,0.2); border-radius: 4px; }
.emoji-item {
    width: 100%; aspect-ratio: 1; display: flex;
    align-items: center; justify-content: center;
    font-size: 20px; border-radius: 8px; border: none;
    background: transparent; cursor: pointer;
    transition: all 0.15s;
}
.emoji-item:hover {
    background: rgba(99, 102, 241, 0.12);
    transform: scale(1.2);
}

/* Date separator */
.chat-date-sep {
    text-align: center; font-size: 10px; color: var(--text-4, #64748b);
    margin: 6px 0; position: relative;
    display: flex; align-items: center; gap: 8px;
}
.chat-date-sep::before, .chat-date-sep::after {
    content: ''; flex: 1; height: 1px;
    background: rgba(255,255,255,0.06);
}

/* Uploading state */
.chat-uploading {
    display: none; align-items: center; gap: 8px;
    padding: 8px 14px; font-size: 12px;
    color: var(--text-3); animation: msgSlideIn 0.2s;
}
.chat-uploading.active { display: flex; }
.chat-uploading .spinner {
    width: 14px; height: 14px; border: 2px solid rgba(139,92,246,0.2);
    border-top-color: #8b5cf6; border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Custom Tag Colors */
.tag-lettering { background: #dcfce7 !important; color: #166534 !important; border-color: #bbf7d0 !important; }
.tag-prep { background: #ffedd5 !important; color: #c2410c !important; border-color: #fed7aa !important; }
.tag-retouch { background: #dbeafe !important; color: #1e40af !important; border-color: #bfdbfe !important; }
.tag-correction { background: #fee2e2 !important; color: #991b1b !important; border-color: #fecaca !important; }
.tag-lettering-retouch { background: #ede9fe !important; color: #5b21b6 !important; border-color: #ddd6fe !important; }

.dark-theme .tag-lettering { background: rgba(34, 197, 94, 0.2) !important; color: #4ade80 !important; border-color: rgba(34, 197, 94, 0.3) !important; }
.dark-theme .tag-prep { background: #ffedd5 !important; color: #c2410c !important; border-color: #fed7aa !important; }
.dark-theme .tag-retouch { background: rgba(59, 130, 246, 0.2) !important; color: #60a5fa !important; border-color: rgba(59, 130, 246, 0.3) !important; }
.dark-theme .tag-correction { background: rgba(239, 68, 68, 0.2) !important; color: #f87171 !important; border-color: rgba(239, 68, 68, 0.3) !important; }
.dark-theme .tag-lettering-retouch { background: rgba(139, 92, 246, 0.2) !important; color: #a78bfa !important; border-color: rgba(139, 92, 246, 0.3) !important; }

.job-group-header { grid-column: 1 / -1; width: 100%; font-size: 0.85rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; margin: 16px 0 8px 0; padding-bottom: 6px; border-bottom: 1px solid var(--border); }

/* --- Notion-style Controls --- */
.notion-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px 0;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.notion-icon-btn {
    color: var(--text-3);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}
.notion-icon-btn:hover {
    background: var(--surface);
    color: var(--text-1);
}
.notion-search-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-full) !important;
    padding: 6px 14px;
    box-shadow: var(--shadow-xs);
    transition: all var(--t-fast);
}
.notion-search-wrapper:hover, .notion-search-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}
.notion-search-wrapper i {
    color: var(--text-3);
    font-size: 0.85rem;
}
.notion-search-input {
    border: none;
    background: transparent;
    outline: none;
    color: var(--text);
    width: 100%;
    font-size: 0.86rem;
    font-weight: 500;
}
.notion-search-input::placeholder {
    color: var(--text-4);
}

.notion-icon-btn {
    border-radius: var(--radius-full) !important;
    padding: 8px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-2);
    box-shadow: var(--shadow-xs);
    transition: all var(--t-fast);
}
.notion-icon-btn:hover {
    background-color: var(--surface-hover);
    color: var(--text);
    border-color: var(--border-focus);
    transform: translateY(-1px);
}

.notion-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 50;
    min-width: 200px;
    padding: 8px 0;
    font-family: var(--font);
    font-size: 0.84rem;
    color: var(--text-2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: modalSpringIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.notion-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    cursor: pointer;
    font-weight: 500;
    transition: all var(--t-fast);
}
.notion-dropdown-item:hover {
    background-color: var(--surface-hover);
    color: var(--text);
}
.notion-dropdown-item.active {
    color: var(--primary);
    font-weight: 700;
    background: var(--primary-bg);
}
.notion-dropdown-item .fa-check {
    display: none;
    color: var(--primary);
    font-size: 0.75rem;
}
.notion-dropdown-item.active .fa-check {
    display: inline-block;
}
.notion-dropdown-divider {
    height: 1px;
    background-color: var(--border-subtle);
    margin: 6px 0;
}

/* ========== POPUP FLATPICKR — Premium Glassmorphism ========== */
.flatpickr-calendar {
    background: rgba(15, 23, 42, 0.96) !important;
    backdrop-filter: blur(20px) saturate(1.8) !important;
    -webkit-backdrop-filter: blur(20px) saturate(1.8) !important;
    border: 1px solid rgba(99, 102, 241, 0.3) !important;
    border-radius: 16px !important;
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 1px 0 rgba(255, 255, 255, 0.06) inset !important;
    padding: 12px !important;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif !important;
    overflow: visible !important;
    min-width: 320px !important;
    z-index: 100005 !important;
}

/* Hide ugly arrows */
.flatpickr-calendar.arrowTop::before,
.flatpickr-calendar.arrowTop::after,
.flatpickr-calendar.arrowBottom::before,
.flatpickr-calendar.arrowBottom::after {
    display: none !important;
}

/* Month header */
.flatpickr-calendar .flatpickr-months {
    margin-bottom: 4px !important;
}

.flatpickr-calendar .flatpickr-month {
    height: 36px !important;
}

.flatpickr-calendar .flatpickr-current-month {
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    color: #e2e8f0 !important;
    letter-spacing: 0.02em !important;
}

.flatpickr-calendar .flatpickr-current-month .flatpickr-monthDropdown-months {
    background: transparent !important;
    color: #e2e8f0 !important;
    font-weight: 600 !important;
    border: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

.flatpickr-calendar .flatpickr-current-month .flatpickr-monthDropdown-months option {
    background: #1e293b !important;
    color: #e2e8f0 !important;
}

.flatpickr-calendar .flatpickr-current-month input.cur-year {
    color: #e2e8f0 !important;
    font-weight: 600 !important;
}

/* Nav arrows */
.flatpickr-calendar .flatpickr-prev-month,
.flatpickr-calendar .flatpickr-next-month {
    padding: 6px !important;
    border-radius: 8px !important;
    transition: background 0.2s ease !important;
}

.flatpickr-calendar .flatpickr-prev-month:hover,
.flatpickr-calendar .flatpickr-next-month:hover {
    background: rgba(99, 102, 241, 0.15) !important;
}

.flatpickr-calendar .flatpickr-prev-month svg,
.flatpickr-calendar .flatpickr-next-month svg {
    fill: #94a3b8 !important;
    transition: fill 0.2s ease !important;
}

.flatpickr-calendar .flatpickr-prev-month:hover svg,
.flatpickr-calendar .flatpickr-next-month:hover svg {
    fill: #818cf8 !important;
}

/* Weekday headers */
.flatpickr-calendar .flatpickr-weekday {
    color: #64748b !important;
    font-weight: 600 !important;
    font-size: 0.7rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
}

.flatpickr-calendar .flatpickr-weekdays {
    border-bottom: 1px solid rgba(148, 163, 184, 0.1) !important;
    padding-bottom: 6px !important;
    margin-bottom: 4px !important;
}

/* Day cells */
.flatpickr-calendar .flatpickr-day {
    color: #cbd5e1 !important;
    border-radius: 10px !important;
    border: 1px solid transparent !important;
    font-weight: 500 !important;
    font-size: 0.85rem !important;
    transition: all 0.15s ease !important;
    height: 36px !important;
    line-height: 36px !important;
}

.flatpickr-calendar .flatpickr-day:hover {
    background: rgba(99, 102, 241, 0.15) !important;
    border-color: rgba(99, 102, 241, 0.35) !important;
    color: #e2e8f0 !important;
}

.flatpickr-calendar .flatpickr-day.today {
    border-color: rgba(99, 102, 241, 0.5) !important;
    color: #818cf8 !important;
    font-weight: 700 !important;
}

.flatpickr-calendar .flatpickr-day.selected,
.flatpickr-calendar .flatpickr-day.selected:hover {
    background: linear-gradient(135deg, #6366f1, #818cf8) !important;
    border-color: transparent !important;
    color: #fff !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4) !important;
}

.flatpickr-calendar .flatpickr-day.flatpickr-disabled,
.flatpickr-calendar .flatpickr-day.prevMonthDay,
.flatpickr-calendar .flatpickr-day.nextMonthDay {
    color: #334155 !important;
}

/* Time picker section */
.flatpickr-calendar .flatpickr-time {
    border-top: 1px solid rgba(148, 163, 184, 0.1) !important;
    margin-top: 8px !important;
    padding-top: 10px !important;
    height: 46px !important;
    max-height: none !important;
    overflow: visible !important;
}

.flatpickr-calendar .flatpickr-time input {
    color: #e2e8f0 !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    background: rgba(30, 41, 59, 0.6) !important;
    border-radius: 8px !important;
    border: 1px solid rgba(148, 163, 184, 0.15) !important;
    transition: all 0.2s ease !important;
    margin: 0 2px !important;
}

.flatpickr-calendar .flatpickr-time input:hover,
.flatpickr-calendar .flatpickr-time input:focus {
    background: rgba(30, 41, 59, 0.9) !important;
    border-color: rgba(99, 102, 241, 0.4) !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1) !important;
}

.flatpickr-calendar .flatpickr-time .flatpickr-time-separator {
    color: #64748b !important;
    font-weight: 700 !important;
    font-size: 1.1rem !important;
}

.flatpickr-calendar .flatpickr-time .numInputWrapper span.arrowUp,
.flatpickr-calendar .flatpickr-time .numInputWrapper span.arrowDown {
    border: none !important;
}

.flatpickr-calendar .flatpickr-time .numInputWrapper span.arrowUp::after {
    border-bottom-color: #94a3b8 !important;
}

.flatpickr-calendar .flatpickr-time .numInputWrapper span.arrowDown::after {
    border-top-color: #94a3b8 !important;
}

.flatpickr-calendar .flatpickr-time .numInputWrapper:hover span.arrowUp::after {
    border-bottom-color: #818cf8 !important;
}

.flatpickr-calendar .flatpickr-time .numInputWrapper:hover span.arrowDown::after {
    border-top-color: #818cf8 !important;
}

/* ==========================================================================
   TASK HANDOVER & COMMENTS (RETOUCH ⇄ LETTERING)
   ========================================================================== */
.task-handover-box {
    margin-top: 16px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

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

.handover-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
}

.handover-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
}

.handover-volume-name {
    color: #fbbf24;
    font-weight: 700;
    margin-left: 4px;
}

.handover-partner-badge {
    font-size: 0.75rem;
    color: #a5b4fc;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.25);
    padding: 2px 8px;
    border-radius: 6px;
}

.quick-handover-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding-bottom: 4px;
}

.quick-handover-label {
    font-size: 0.75rem;
    color: var(--text-3);
    font-weight: 500;
    margin-right: 2px;
}

.btn-quick-tag {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-2);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-quick-tag:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text);
}

.btn-quick-tag.done-retouch {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.25);
    color: #34d399;
}
.btn-quick-tag.done-retouch:hover {
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.4);
}

.btn-quick-tag.in-progress {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.25);
    color: #fbbf24;
}
.btn-quick-tag.in-progress:hover {
    background: rgba(245, 158, 11, 0.18);
    border-color: rgba(245, 158, 11, 0.4);
}

.btn-quick-tag.note {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.25);
    color: #f87171;
}
.btn-quick-tag.note:hover {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.4);
}

.handover-comments-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 180px;
    overflow-y: auto;
    padding-right: 4px;
    margin: 4px 0;
}

.handover-empty {
    font-size: 0.8rem;
    color: var(--text-4);
    font-style: italic;
    padding: 8px 0;
}

.handover-comment-item {
    display: flex;
    gap: 10px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 8px 12px;
    transition: all 0.2s ease;
    position: relative;
}

.handover-comment-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.comment-avatar {
    flex-shrink: 0;
}

.comment-avatar-img {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(99, 102, 241, 0.4);
}

.comment-avatar-fallback {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #4f46e5;
    color: white;
    font-size: 0.72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.comment-content {
    flex: 1;
    min-width: 0;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.comment-user {
    font-size: 0.8rem;
    font-weight: 600;
    color: #818cf8;
}

.comment-tag {
    font-size: 0.65rem;
    font-weight: 500;
    padding: 1px 5px;
    border-radius: 4px;
}
.comment-tag.handover {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}
.comment-tag.progress {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}
.comment-tag.warning {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.comment-time {
    font-size: 0.68rem;
    color: var(--text-4);
    margin-left: auto;
}

.btn-delete-comment {
    background: transparent;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 11px;
    padding: 2px 5px;
    border-radius: 4px;
    line-height: 1;
    opacity: 0.85;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
}

.btn-delete-comment:hover {
    opacity: 1;
    background: rgba(239, 68, 68, 0.15);
    transform: scale(1.1);
}

.comment-text {
    font-size: 0.82rem;
    color: var(--text);
    line-height: 1.35;
    word-break: break-word;
}

.handover-input-group {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 4px;
}

.handover-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 7px 12px;
    color: var(--text);
    font-size: 0.82rem;
    outline: none;
    transition: all 0.15s ease;
}

.handover-input:focus {
    border-color: #6366f1;
}

.btn-handover-send {
    background: #6366f1;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 7px 14px;
    font-weight: 500;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-handover-send:hover {
    background: #4f46e5;
}

@keyframes toastSlideIn {
    0% { transform: translateY(-20px) scale(0.95); opacity: 0; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* ==========================================================================
   NOTIFICATION CENTER (TOP RIGHT ALARM)
   ========================================================================== */
.notification-center-wrapper {
    position: relative;
    display: inline-block;
}

.notification-bell-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    font-size: 1.1rem;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.notification-bell-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
    color: #fff;
    transform: translateY(-1px);
}

.notification-bell-btn.has-unread {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.4);
}

.notification-bell-btn.ringing {
    animation: bellRing 0.8s ease;
}

@keyframes bellRing {
    0%, 100% { transform: rotate(0); }
    20%, 60% { transform: rotate(15deg); }
    40%, 80% { transform: rotate(-15deg); }
}

.notification-unread-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #0f172a;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.5);
    animation: pulseBadge 2s infinite;
}

@keyframes pulseBadge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.notification-dropdown-panel {
    position: absolute;
    top: 50px;
    right: 0;
    width: 380px;
    max-width: 90vw;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.95), 0 0 24px rgba(99, 102, 241, 0.25);
    backdrop-filter: blur(20px);
    z-index: 9999999 !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: notifSlideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes notifSlideDown {
    0% { opacity: 0; transform: translateY(-10px) scale(0.96); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.notification-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.notification-panel-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
}

.notification-header-actions {
    display: flex;
    gap: 6px;
}

.btn-notif-action {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-3);
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-notif-action:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.btn-notif-action.danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
}

.notification-items-list {
    max-height: 360px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 6px;
}

.notification-item {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    transition: all 0.15s ease;
    cursor: pointer;
    position: relative;
    margin-bottom: 3px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.notification-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
}

.notification-item.unread {
    background: rgba(99, 102, 241, 0.1);
    border-left: 3px solid #6366f1;
}

.notif-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.notif-avatar-fallback {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #4f46e5;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notif-body {
    flex: 1;
    min-width: 0;
}

.notif-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
}

.notif-user-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #818cf8;
}

.notif-time {
    font-size: 0.68rem;
    color: var(--text-4);
}

.notif-task-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #fbbf24;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 2px;
}

.notif-message-text {
    font-size: 0.78rem;
    color: var(--text-2);
    line-height: 1.35;
    word-break: break-word;
}

.btn-notif-dismiss {
    background: transparent;
    border: none;
    color: var(--text-4);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    border-radius: 4px;
    transition: all 0.15s ease;
    align-self: flex-start;
}

.btn-notif-dismiss:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
}

.notification-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 36px 16px;
    color: var(--text-4);
    font-size: 0.82rem;
    text-align: center;
}

.notification-panel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.btn-notif-close-panel {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-3);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-notif-close-panel:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

/* ======================== 24. TASK RESOURCE LINKS WIDGET ======================== */
.task-links-box {
    margin-bottom: 16px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

.task-links-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.task-links-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
}

.btn-manage-links {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #818cf8;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-manage-links:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: #818cf8;
    color: #c7d2fe;
    transform: translateY(-1px);
}

.task-links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

@media (min-width: 600px) {
    .task-links-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.task-link-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: 10px;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    user-select: none;
    overflow: hidden;
}

.task-link-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.task-link-card:hover .task-link-icon {
    transform: scale(1.1);
}

.task-link-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.task-link-name {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.task-link-status {
    font-size: 0.65rem;
    font-weight: 600;
    margin-top: 1px;
    white-space: nowrap;
    opacity: 0.85;
}

.task-link-edit-btn {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.4);
    color: var(--text-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    opacity: 0;
    transition: all 0.15s ease;
}

.task-link-card:hover .task-link-edit-btn {
    opacity: 0.9;
}

.task-link-edit-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    transform: scale(1.15);
}

/* Tool specific themes */
.task-link-card.mikan.empty {
    background: rgba(249, 115, 22, 0.05);
    border-color: rgba(249, 115, 22, 0.2);
    color: var(--text-3);
}
.task-link-card.mikan.empty .task-link-icon {
    background: rgba(249, 115, 22, 0.12);
    color: rgba(249, 115, 22, 0.7);
}
.task-link-card.mikan.has-url {
    background: rgba(249, 115, 22, 0.12);
    border-color: rgba(249, 115, 22, 0.45);
    color: #fdba74;
}
.task-link-card.mikan.has-url .task-link-icon {
    background: rgba(249, 115, 22, 0.25);
    color: #f97316;
}
.task-link-card.mikan:hover {
    background: rgba(249, 115, 22, 0.22);
    border-color: #f97316;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.25);
}

.task-link-card.notion.empty {
    background: rgba(99, 102, 241, 0.05);
    border-color: rgba(99, 102, 241, 0.2);
    color: var(--text-3);
}
.task-link-card.notion.empty .task-link-icon {
    background: rgba(99, 102, 241, 0.12);
    color: rgba(99, 102, 241, 0.7);
}
.task-link-card.notion.has-url {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.45);
    color: #c7d2fe;
}
.task-link-card.notion.has-url .task-link-icon {
    background: rgba(99, 102, 241, 0.25);
    color: #818cf8;
}
.task-link-card.notion:hover {
    background: rgba(99, 102, 241, 0.22);
    border-color: #818cf8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.task-link-card.asana.empty {
    background: rgba(244, 63, 94, 0.05);
    border-color: rgba(244, 63, 94, 0.2);
    color: var(--text-3);
}
.task-link-card.asana.empty .task-link-icon {
    background: rgba(244, 63, 94, 0.12);
    color: rgba(244, 63, 94, 0.7);
}
.task-link-card.asana.has-url {
    background: rgba(244, 63, 94, 0.12);
    border-color: rgba(244, 63, 94, 0.45);
    color: #fecdd3;
}
.task-link-card.asana.has-url .task-link-icon {
    background: rgba(244, 63, 94, 0.25);
    color: #f43f5e;
}
.task-link-card.asana:hover {
    background: rgba(244, 63, 94, 0.22);
    border-color: #f43f5e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.25);
}

.task-link-card.dropbox.empty {
    background: rgba(0, 97, 254, 0.05);
    border-color: rgba(0, 97, 254, 0.2);
    color: var(--text-3);
}
.task-link-card.dropbox.empty .task-link-icon {
    background: rgba(0, 97, 254, 0.12);
    color: rgba(0, 97, 254, 0.7);
}
.task-link-card.dropbox.has-url {
    background: rgba(0, 97, 254, 0.12);
    border-color: rgba(0, 97, 254, 0.45);
    color: #93c5fd;
}
.task-link-card.dropbox.has-url .task-link-icon {
    background: rgba(0, 97, 254, 0.25);
    color: #3b82f6;
}
.task-link-card.dropbox:hover {
    background: rgba(0, 97, 254, 0.22);
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 97, 254, 0.25);
}

/* Edit Task Links Modal */
.task-links-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10005;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.2s ease;
}

.task-links-modal-card {
    width: 100%;
    max-width: 500px;
    background: var(--surface, #1e1e2d);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    animation: zoomIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.task-links-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.task-links-modal-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.task-links-modal-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.task-links-modal-subtitle {
    font-size: 0.75rem;
    color: var(--text-3);
    display: block;
    margin-top: 2px;
}

.task-links-modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 70vh;
    overflow-y: auto;
}

.task-link-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.task-link-input-group label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-2);
}

.tool-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 2px 7px;
    border-radius: 4px;
}

.tool-badge.mikan { background: rgba(249, 115, 22, 0.15); color: #fb923c; }
.tool-badge.notion { background: rgba(99, 102, 241, 0.15); color: #a5b4fc; }
.tool-badge.asana { background: rgba(244, 63, 94, 0.15); color: #fda4af; }
.tool-badge.dropbox { background: rgba(0, 97, 254, 0.15); color: #93c5fd; }

.input-hint {
    font-size: 0.7rem;
    color: var(--text-4);
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.task-link-input {
    width: 100%;
    padding: 8px 36px 8px 12px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.85rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.task-link-input:focus {
    outline: none;
    border-color: #818cf8;
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.btn-paste-link {
    position: absolute;
    right: 6px;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: var(--text-3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.15s ease;
}

.btn-paste-link:hover {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
}

.task-links-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.btn-links-cancel {
    padding: 7px 14px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: var(--text-3);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-links-cancel:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.btn-links-save {
    padding: 7px 18px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.btn-links-save:hover {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.45);
}



