/* Modern Theme Setup using CSS Variables */
:root {
    --font-primary: 'Outfit', 'Sarabun', sans-serif;
    transition: all 0.3s ease;
}

/* Glass-Dark Theme Variables */
.theme-dark {
    --bg-main: radial-gradient(ellipse 120% 100% at 50% 0%, #0f1729 0%, #080d1a 40%, #050810 100%);
    --bg-card: rgba(30, 41, 59, 0.7);
    --card-bg: rgba(30, 41, 59, 0.7);
    --bg-sidebar: rgba(8, 13, 26, 0.92);
    --border-color: rgba(148, 163, 184, 0.14);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --accent-color: #6366f1; /* Indigo – premium & modern */
    --accent-glow: rgba(99, 102, 241, 0.4);
    --accent-secondary: #a78bfa; /* Violet accent */
    --success-color: #34d399; /* Bright emerald */
    --warning-color: #fbbf24; /* Golden amber */
    --danger-color: #f87171; /* Soft rose */
    --shadow-main: 0 8px 32px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(99, 102, 241, 0.06);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5), 0 4px 16px rgba(99, 102, 241, 0.08);
    --backdrop-blur: blur(16px);
    --column-bg: rgba(15, 23, 42, 0.45);
    --input-bg: rgba(8, 12, 24, 0.7);
    --glass-highlight: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 50%);
    --noise-opacity: 0.015;
}

/* Cozy-Light Theme Variables (Premium Pastel Mint Green) */
.theme-light {
    --bg-main: linear-gradient(135deg, #f4f8f6 0%, #e2ede8 100%);
    --bg-card: #ffffff; /* Pure white card background */
    --card-bg: #ffffff;
    --bg-sidebar: linear-gradient(180deg, #d3ebd6 0%, #b8dfbe 100%); /* Pastel mint-green sidebar (~20-30% screen area) */
    --border-color: rgba(34, 197, 94, 0.12); /* Subtle green border */
    --text-primary: #142a1d; /* Dark forest green/slate */
    --text-secondary: #475d52; /* Slate green */
    --accent-color: #10b981; /* Pastel green primary */
    --accent-glow: rgba(16, 185, 129, 0.25);
    --success-color: #059669;
    --warning-color: #d97706;
    --danger-color: #dc2626;
    --shadow-main: 0 8px 24px rgba(20, 42, 29, 0.06);
    --backdrop-blur: blur(10px);
    --column-bg: rgba(255, 255, 255, 0.6);
    --input-bg: #ffffff;
}

/* Arctic Snow Theme Variables (Premium Cool Light Blue-Gray) */
.theme-snow {
    --bg-main: linear-gradient(135deg, #f0f4f8 0%, #d9e2ec 100%);
    --bg-card: rgba(255, 255, 255, 0.75);
    --card-bg: rgba(255, 255, 255, 0.75);
    --bg-sidebar: linear-gradient(180deg, #e1e7f0 0%, #cad5e2 100%); /* Soft cool-gray-blue sidebar */
    --border-color: rgba(186, 201, 218, 0.4);
    --text-primary: #102a43;
    --text-secondary: #486581;
    --accent-color: #0077b6; /* Ice blue primary */
    --accent-glow: rgba(0, 119, 182, 0.2);
    --success-color: #2b9348;
    --warning-color: #d97706;
    --danger-color: #d62828;
    --shadow-main: 0 8px 32px rgba(16, 42, 67, 0.08);
    --backdrop-blur: blur(12px);
    --column-bg: rgba(255, 255, 255, 0.45);
    --input-bg: rgba(255, 255, 255, 0.9);
    --glass-highlight: linear-gradient(135deg, rgba(255,255,255,0.6) 0%, transparent 50%);
}

/* Cyberpunk Neon Theme Variables (Vibrant Neon Cyberpunk Style) */
.theme-cyberpunk {
    --bg-main: radial-gradient(circle at 50% 50%, #0e051a, #07020d);
    --bg-card: rgba(22, 10, 36, 0.75);
    --card-bg: rgba(22, 10, 36, 0.75);
    --bg-sidebar: rgba(10, 3, 19, 0.95);
    --border-color: rgba(255, 0, 127, 0.18);
    --text-primary: #ffffff;
    --text-secondary: #00f0ff;
    --accent-color: #ff007f;
    --accent-glow: rgba(255, 0, 127, 0.4);
    --accent-secondary: #00f0ff;
    --success-color: #39ff14;
    --warning-color: #ff00ff;
    --danger-color: #ff3333;
    --shadow-main: 0 0 20px rgba(255, 0, 127, 0.25), 0 0 5px rgba(0, 240, 255, 0.1);
    --backdrop-blur: blur(16px);
    --column-bg: rgba(10, 3, 19, 0.5);
    --input-bg: rgba(20, 8, 35, 0.85);
    --glass-highlight: linear-gradient(135deg, rgba(255, 0, 127, 0.05) 0%, transparent 50%);
}

/* Sunset Gold Theme Variables (Elegant Warm Sunset & Amber Glow) */
.theme-sunset {
    --bg-main: radial-gradient(ellipse 120% 100% at 50% 0%, #170d06 0%, #0d0703 60%, #060301 100%);
    --bg-card: rgba(36, 24, 15, 0.72);
    --card-bg: rgba(36, 24, 15, 0.72);
    --bg-sidebar: rgba(23, 13, 7, 0.95);
    --border-color: rgba(251, 191, 36, 0.16);
    --text-primary: #fffbeb;
    --text-secondary: #fcd34d;
    --accent-color: #f59e0b;
    --accent-glow: rgba(245, 158, 11, 0.3);
    --accent-secondary: #d97706;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --shadow-main: 0 8px 32px rgba(26, 15, 8, 0.4);
    --backdrop-blur: blur(12px);
    --column-bg: rgba(26, 15, 8, 0.5);
    --input-bg: rgba(19, 10, 5, 0.8);
    --glass-highlight: linear-gradient(135deg, rgba(251, 191, 36, 0.04) 0%, transparent 50%);
}

/* Nordic Forest Theme Variables (Calming Deep Sage & Pine Green) */
.theme-forest {
    --bg-main: radial-gradient(ellipse 120% 100% at 50% 0%, #08120e 0%, #040907 60%, #020504 100%);
    --bg-card: rgba(14, 28, 22, 0.7);
    --card-bg: rgba(14, 28, 22, 0.7);
    --bg-sidebar: rgba(7, 15, 12, 0.95);
    --border-color: rgba(52, 211, 153, 0.12);
    --text-primary: #ecfdf5;
    --text-secondary: #a7f3d0;
    --accent-color: #10b981;
    --accent-glow: rgba(16, 185, 129, 0.3);
    --accent-secondary: #059669;
    --success-color: #34d399;
    --warning-color: #fbbf24;
    --danger-color: #f87171;
    --shadow-main: 0 8px 32px rgba(4, 9, 7, 0.45);
    --backdrop-blur: blur(14px);
    --column-bg: rgba(7, 15, 12, 0.55);
    --input-bg: rgba(4, 10, 8, 0.85);
    --glass-highlight: linear-gradient(135deg, rgba(16, 185, 129, 0.04) 0%, transparent 50%);
}

/* Lavender Amethyst Theme Variables (Mysterious Lavender & Deep Violet) */
.theme-amethyst {
    --bg-main: radial-gradient(ellipse 120% 100% at 50% 0%, #150e26 0%, #0b0714 60%, #06040b 100%);
    --bg-card: rgba(30, 20, 50, 0.65);
    --card-bg: rgba(30, 20, 50, 0.65);
    --bg-sidebar: rgba(15, 10, 26, 0.95);
    --border-color: rgba(167, 139, 250, 0.18);
    --text-primary: #f5f3ff;
    --text-secondary: #c084fc;
    --accent-color: #8b5cf6;
    --accent-glow: rgba(139, 92, 246, 0.3);
    --accent-secondary: #a78bfa;
    --success-color: #10b981;
    --warning-color: #fbbf24;
    --danger-color: #ef4444;
    --shadow-main: 0 8px 32px rgba(11, 7, 20, 0.45);
    --backdrop-blur: blur(14px);
    --column-bg: rgba(15, 10, 26, 0.5);
    --input-bg: rgba(22, 14, 38, 0.8);
    --glass-highlight: linear-gradient(135deg, rgba(167, 139, 250, 0.04) 0%, transparent 50%);
}

/* Base Body Styles */
body {
    font-family: var(--font-primary);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.app-wrapper {
    background: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    position: relative;
    transition: background 0.5s ease;
}

/* Premium ambient glow orbs for dark theme */
.theme-dark .app-wrapper::before {
    content: '';
    position: fixed;
    top: -20%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    animation: ambientFloat 25s ease-in-out infinite;
}

.theme-dark .app-wrapper::after {
    content: '';
    position: fixed;
    bottom: -15%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(167, 139, 250, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    animation: ambientFloat2 30s ease-in-out infinite;
}

@keyframes ambientFloat {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(40px, 30px); }
    66% { transform: translate(-20px, 15px); }
}

@keyframes ambientFloat2 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(-30px, -20px); }
    66% { transform: translate(25px, -10px); }
}

/* Custom Loading Screen */
.initial-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #06080c;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner-box {
    width: 90px;
    height: 90px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: transparent;
    position: relative;
}

.circle-border {
    width: 90px !important;
    height: 90px !important;
    padding: 2px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background: linear-gradient(0deg, rgba(99, 102, 241, 0.1) 33%, var(--accent-color) 100%) !important;
    animation: spin 1s linear infinite !important;
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.15), inset 0 0 16px rgba(99, 102, 241, 0.05);
}

.circle-core {
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.75) !important;
    backdrop-filter: blur(4px);
    border-radius: 50%;
    background-image: url('/logo.png');
    background-size: 55% auto;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.2), 0 0 0 1px rgba(255,255,255,0.06);
    animation: corePulseMini 2s ease-in-out infinite;
}

.spinner-box::before,
.spinner-box::after {
    content: '';
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent-color);
    opacity: 0.8;
    box-shadow: 0 0 8px var(--accent-color);
}

.spinner-box::before {
    animation: dotOrbitMini1 2s ease-in-out infinite;
}

.spinner-box::after {
    animation: dotOrbitMini2 2s ease-in-out infinite;
}

@keyframes corePulseMini {
    0%, 100% { box-shadow: 0 0 12px rgba(99, 102, 241, 0.2); transform: scale(1); }
    50% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.4); transform: scale(1.04); }
}

@keyframes dotOrbitMini1 {
    0% { transform: rotate(0deg) translateX(43px) rotate(0deg); opacity: 0.8; }
    50% { opacity: 1; }
    100% { transform: rotate(360deg) translateX(43px) rotate(-360deg); opacity: 0.8; }
}

@keyframes dotOrbitMini2 {
    0% { transform: rotate(180deg) translateX(43px) rotate(-180deg); opacity: 0.8; }
    50% { opacity: 1; }
    100% { transform: rotate(540deg) translateX(43px) rotate(-540deg); opacity: 0.8; }
}


.loader-text {
    margin-top: 20px;
    color: #9ca3af;
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 1.5px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes spin {
    from { transform: rotate(0); }
    to { transform: rotate(359deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Sidebar Layout */
.sidebar {
    width: 280px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    backdrop-filter: var(--backdrop-blur);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    transition: width 0.3s ease;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
    overflow: hidden;
}

.sidebar-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 36px;
    text-decoration: none;
    text-align: center;
}

.sidebar-logo i {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-secondary, #a78bfa));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 10px var(--accent-glow));
}

.menu-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}

.menu-section::-webkit-scrollbar {
    width: 6px;
}
.menu-section::-webkit-scrollbar-track {
    background: transparent;
}
.menu-section::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.25);
    border-radius: 3px;
}
.menu-section::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.45);
}

.menu-category {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    opacity: 0.5;
    padding: 4px 18px 2px;
    margin-top: 4px;
}

.menu-category-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 18px;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.7;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 8px;
    margin-top: 4px;
}

.menu-category-btn:hover {
    opacity: 1;
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.06);
}

.menu-chevron {
    font-size: 1rem;
    transition: transform 0.25s ease;
}

.menu-chevron.expanded {
    transform: rotate(90deg);
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 18px;
    border-radius: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.menu-item:hover, .menu-item.active {
    color: var(--text-primary);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.04) 100%);
    border-color: rgba(99, 102, 241, 0.15);
    transform: translateX(5px);
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.06);
}

.menu-item i {
    font-size: 1.3rem;
}

.menu-item.active i {
    color: var(--accent-color);
    text-shadow: 0 0 8px var(--accent-glow);
}

/* User Profile & Sidebar Footer */
.sidebar-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    margin-top: auto;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color) 0%, #a78bfa 50%, #c084fc 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: 0 4px 14px var(--accent-glow), 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--border-color);
    padding: 2px 6px;
    border-radius: 4px;
    width: fit-content;
    margin-top: 2px;
}

/* Main Content Area */
.main-content {
    margin-left: 280px;
    flex-grow: 1;
    padding: 40px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Area */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
}

.page-title {
    margin: 0;
    font-weight: 800;
    font-size: 1.4rem;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.02em;
}

.theme-dark .page-title {
    background: linear-gradient(135deg, #f1f5f9 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Dynamic Buttons */
.btn-control {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 16px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    cursor: pointer;
    backdrop-filter: var(--backdrop-blur);
    transition: all 0.2s ease;
}

.btn-control:hover {
    background: var(--border-color);
    border-color: var(--accent-color);
}

.btn-primary-custom {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-secondary, #a78bfa) 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 14px var(--accent-glow);
    font-weight: 600;
    letter-spacing: 0.01em;
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--accent-glow), 0 2px 8px rgba(99, 102, 241, 0.3);
    filter: brightness(1.1);
}

/* Modern Card/Glass Box */
.glass-card {
    background: var(--bg-card);
    background-image: var(--glass-highlight, none);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    backdrop-filter: var(--backdrop-blur);
    box-shadow: var(--shadow-main);
    position: relative;
}

/* Login Page Styling */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100vw;
    background: var(--bg-main);
    position: relative;
    overflow: hidden;
}

@keyframes float-blob-1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, -60px) scale(1.15); }
}

@keyframes float-blob-2 {
    0%, 100% { transform: translate(0, 0) scale(1.1); }
    50% { transform: translate(-50px, 40px) scale(0.9); }
}

.login-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    z-index: 0;
    opacity: 0.85;
}

.blob-1 {
    width: 450px;
    height: 450px;
    background: rgba(99, 102, 241, 0.28);
    top: -120px;
    left: -120px;
    animation: float-blob-1 14s infinite ease-in-out;
}

.blob-2 {
    width: 550px;
    height: 550px;
    background: rgba(167, 139, 250, 0.22);
    bottom: -180px;
    right: -180px;
    animation: float-blob-2 18s infinite ease-in-out;
}

@keyframes login-card-entry {
    0% {
        opacity: 0;
        transform: translateY(24px) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-card {
    width: 440px;
    z-index: 10;
    text-align: center;
    position: relative;
    animation: login-card-entry 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
    padding: 45px 36px !important;
}

.login-logo {
    font-size: 3.5rem;
    color: var(--accent-color);
    margin-bottom: 18px;
    text-shadow: 0 0 20px var(--accent-glow);
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.login-logo i {
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.login-card:hover .login-logo i {
    transform: rotate(15deg) scale(1.1);
}

.login-title {
    font-size: 1.9rem;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 28px;
    opacity: 0.8;
}

.login-tab-container {
    display: flex;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    gap: 4px;
}

.login-tab-btn {
    flex: 1;
    padding: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.login-tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.login-tab-btn.active {
    background: var(--accent-color);
    color: white !important;
    box-shadow: 0 2px 8px var(--accent-glow);
}

.form-group-custom {
    text-align: left;
    margin-bottom: 20px;
}

.form-label-custom {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: block;
}

.form-input-custom {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.95rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-input-custom:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px var(--accent-glow), 0 4px 12px rgba(99, 102, 241, 0.08);
    transform: translateY(-1px);
}

/* Dropdown Option Styles for Theme Compatibility */
.form-input-custom option {
    background-color: #ffffff;
    color: #1e293b;
}

.theme-dark .form-input-custom option {
    background-color: #0f172a;
    color: #f1f5f9;
}

.theme-light .form-input-custom option {
    background-color: #ffffff;
    color: #142a1d;
}

.theme-snow .form-input-custom option {
    background-color: #ffffff;
    color: #102a43;
}

.login-button {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-secondary, #a78bfa));
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 14px var(--accent-glow);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 10px;
    letter-spacing: 0.02em;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
    filter: brightness(1.05);
}

.login-button:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px var(--accent-glow);
    filter: brightness(0.95);
}

/* ============================================
   KANBAN BOARD — Premium Modern Design
   ============================================ */

/* Board Layout */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(280px, 1fr));
    gap: 20px;
    flex-grow: 1;
    overflow-x: auto;
    padding-bottom: 12px;
}

/* Custom scrollbar for the board itself */
.kanban-board::-webkit-scrollbar { height: 8px; }
.kanban-board::-webkit-scrollbar-track { background: transparent; }
.kanban-board::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 10px; }
.kanban-board::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ---- Column Base ---- */
.kanban-column {
    background: var(--column-bg);
    background-image: var(--glass-highlight, none);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 22px 18px;
    display: flex;
    flex-direction: column;
    height: 74vh;
    backdrop-filter: var(--backdrop-blur);
    transition: all 0.35s cubic-bezier(.4,0,.2,1);
    position: relative;
}

/* Colored top glow strip per column */
.kanban-col-todo    { border-top: 3px solid #6b7280; }
.kanban-col-inprogress { border-top: 3px solid var(--warning-color); box-shadow: 0 -4px 20px rgba(251, 191, 36, 0.06); }
.kanban-col-review   { border-top: 3px solid #8b5cf6; box-shadow: 0 -4px 20px rgba(139, 92, 246, 0.06); }
.kanban-col-done    { border-top: 3px solid var(--success-color); box-shadow: 0 -4px 20px rgba(52, 211, 153, 0.06); }

/* Drag target highlight — pulsing border when dragging */
.kanban-column.drag-target-active {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: inset 0 0 40px rgba(99, 102, 241, 0.04), 0 0 24px rgba(99, 102, 241, 0.08);
}

/* ---- Column Header ---- */
.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.column-title {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.02em;
}

/* Column status icon bubble */
.column-icon {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}
.col-icon-todo       { background: rgba(107,114,128,0.15); color: #9ca3af; }
.col-icon-inprogress { background: rgba(99,102,241,0.15); color: var(--accent-color); }
.col-icon-review     { background: rgba(139,92,246,0.15); color: #8b5cf6; }
.col-icon-done       { background: rgba(52,211,153,0.15); color: var(--success-color); }

/* Column count badge */
.column-count {
    font-size: 0.8rem;
    background: var(--border-color);
    padding: 3px 10px;
    border-radius: 20px;
    color: var(--text-secondary);
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}
.count-inprogress { background: rgba(99,102,241,0.12); color: var(--accent-color); }
.count-review     { background: rgba(139,92,246,0.12); color: #8b5cf6; }
.count-done       { background: rgba(52,211,153,0.12); color: var(--success-color); }

/* ---- Cards Container ---- */
.kanban-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1 1 0%;
    min-height: 0;
    padding: 2px;
    overflow-y: auto;
}

/* ============================================
   KANBAN CARD — Premium Card Design
   ============================================ */
.kanban-card {
    display: flex;
    flex-shrink: 0;
    border-radius: 14px;
    overflow: hidden;
    cursor: grab;
    transition: all 0.28s cubic-bezier(.4,0,.2,1);
    position: relative;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    background-image: var(--glass-highlight, none);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
}

/* Colored left accent strip */
.card-accent {
    width: 4px;
    flex-shrink: 0;
    border-radius: 4px 0 0 4px;
    transition: width 0.2s ease;
}
.accent-todo       { background: linear-gradient(180deg, #6b7280, #9ca3af); }
.accent-inprogress { background: linear-gradient(180deg, #6366f1, #818cf8); }
.accent-review     { background: linear-gradient(180deg, #8b5cf6, #a78bfa); }
.accent-done       { background: linear-gradient(180deg, #10b981, #34d399); }

.card-body {
    flex: 1;
    padding: 16px;
    min-width: 0;
}

/* Card top row: title + edit */
.card-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
}

.card-edit-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    transition: all 0.2s;
    opacity: 0;
    font-size: 1rem;
}
.kanban-card:hover .card-edit-btn { opacity: 1; }
.card-edit-btn:hover { background: rgba(99,102,241,0.1); color: var(--accent-color); }

/* ---- Card hover / drag states ---- */
.kanban-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 16px 40px rgba(0,0,0,0.2), 0 4px 12px rgba(99,102,241,0.08);
    border-color: rgba(99, 102, 241, 0.12);
}
.kanban-card:hover .card-accent { width: 5px; }

.card-status-todo:hover        { box-shadow: 0 12px 28px rgba(107,114,128,0.12); }
.card-status-inprogress:hover  { box-shadow: 0 12px 28px rgba(99,102,241,0.15); border-color: rgba(99,102,241,0.25); }
.card-status-review:hover      { box-shadow: 0 12px 28px rgba(139,92,246,0.15); border-color: rgba(139,92,246,0.25); }
.card-status-done:hover        { box-shadow: 0 12px 28px rgba(52,211,153,0.12); border-color: rgba(52,211,153,0.25); }

.kanban-card:active {
    cursor: grabbing;
    transform: translateY(-2px) scale(0.98);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    opacity: 0.85;
}

/* ---- My Task Highlight ---- */
.kanban-card.my-task {
    border-color: var(--accent-color) !important;
    border-width: 1.5px;
    background: linear-gradient(135deg, rgba(99,102,241,0.08) 0%, var(--bg-card) 60%);
    box-shadow: 0 0 12px var(--accent-glow), 0 2px 12px rgba(0, 0, 0, 0.12);
}

.theme-dark .kanban-card.my-task {
    border-color: #fbbf24 !important;
    background: linear-gradient(135deg, rgba(251,191,36,0.08) 0%, var(--bg-card) 60%);
    box-shadow: 0 0 14px rgba(251, 191, 36, 0.45), 0 2px 12px rgba(0, 0, 0, 0.25);
}

.kanban-card.my-task .card-accent {
    width: 5px;
}

.kanban-card.my-task .card-title {
    font-weight: 700;
}

/* Hide the corner triangle */
.kanban-card.my-task::after {
    display: none !important;
}

.theme-dark .kanban-card.my-task::after {
    display: none !important;
}

.kanban-card.my-task:hover {
    box-shadow: 0 0 20px var(--accent-glow), 0 4px 20px rgba(99, 102, 241, 0.15);
    transform: translateY(-4px) scale(1.01);
}

.theme-dark .kanban-card.my-task:hover {
    box-shadow: 0 0 22px rgba(251, 191, 36, 0.65), 0 4px 20px rgba(251, 191, 36, 0.2);
    transform: translateY(-4px) scale(1.01);
}

.kanban-card.my-task .card-edit-btn {
    opacity: 0.8;
}

/* ---- Progress Section ---- */
.card-progress-section {
    margin-bottom: 12px;
}
.card-progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.progress-value { font-variant-numeric: tabular-nums; }
.progress-complete { color: var(--success-color); font-weight: 700; }

.card-attachments {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    align-items: center;
}
.card-attach-thumb {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}
.card-attach-thumb:hover {
    transform: scale(2.5);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    z-index: 10;
    position: relative;
}
.card-attach-file-count {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--border-color);
    padding: 2px 6px;
    border-radius: 4px;
}

.progress-bar-custom {
    height: 5px;
    border-radius: 10px;
    overflow: hidden;
}
.progress-fill-todo       { background: linear-gradient(90deg, #6b7280, #9ca3af); }
.progress-fill-inprogress { background: linear-gradient(90deg, #6366f1, #818cf8); }
.progress-fill-review     { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.progress-fill-done       { background: linear-gradient(90deg, #10b981, #34d399); }

/* ---- Card Footer ---- */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
}

.card-assignee {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Status-themed avatar */
.card-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.3s;
}
.avatar-todo       { background: #6b7280; }
.avatar-inprogress { background: var(--accent-color); box-shadow: 0 0 0 3px rgba(99,102,241,0.2); }
.avatar-review     { background: #8b5cf6; box-shadow: 0 0 0 3px rgba(139,92,246,0.2); }
.avatar-done       { background: var(--success-color); box-shadow: 0 0 0 3px rgba(52,211,153,0.2); }

.card-date {
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    white-space: nowrap;
}
.date-range {
    color: var(--text-secondary);
    font-weight: normal;
}

/* Smooth column scrollbar */
.kanban-cards::-webkit-scrollbar { width: 6px; }
.kanban-cards::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.02); border-radius: 10px; }
.kanban-cards::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.35); border-radius: 10px; }
.kanban-cards::-webkit-scrollbar-thumb:hover { background: var(--accent-color); }

/* Assign columns scrollbar */
.assign-column-body::-webkit-scrollbar { width: 6px; }
.assign-column-body::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.02); border-radius: 10px; }
.assign-column-body::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.35); border-radius: 10px; }
.assign-column-body::-webkit-scrollbar-thumb:hover { background: var(--accent-color); }

/* Card entrance animation */
@keyframes cardSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.kanban-card {
    animation: cardSlideIn 0.3s ease both;
}

/* Deadline color coding */
.date-future {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}
.date-today {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}
.date-overdue {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    animation: flash-red 2s infinite;
}

@keyframes flash-red {
    0%, 100% { background: rgba(239, 68, 68, 0.1); }
    50% { background: rgba(239, 68, 68, 0.25); }
}

/* Master Member Cards Grid */
.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.member-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 30px 20px;
    position: relative;
    overflow: hidden;
}

.member-card-avatar {
    width: 72px;
    height: 72px;
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.member-name {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.member-email {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.member-stats {
    width: 100%;
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-num {
    font-size: 1.2rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Visual Progress Bar for Workload */
.progress-bar-custom {
    width: 100%;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), var(--success-color));
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Wide modal when fields > 7 */
.modal-content-wide {
    width: 700px;
    max-width: 95%;
}

.form-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 28px;
}

.form-grid-2col .full-width {
    grid-column: 1 / -1;
}

/* Custom Modals */
.modal-backdrop-custom {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px) saturate(1.2);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content-custom {
    width: 500px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header-custom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.modal-close {
    font-size: 1.5rem;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text-primary);
}

.modal-footer-custom {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
    margin-top: 20px;
}

/* Notification Badge & Panel */
.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: var(--accent-color);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 0 8px rgba(99,102,241,0.5);
    pointer-events: none;
}

.notification-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 360px;
    max-height: 480px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.notification-list {
    overflow-y: auto;
    flex: 1;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid var(--border-color);
}

.notification-item:hover {
    background: rgba(99,102,241,0.04);
}

.notification-item.unread {
    background: rgba(99,102,241,0.06);
}

.notification-container {
    position: relative;
    display: inline-block;
}

/* File Upload Zone */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    background: rgba(255,255,255,0.01);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: relative;
}

.upload-zone:hover {
    border-color: var(--accent-color);
    background: rgba(99, 102, 241, 0.02);
}

.upload-icon {
    font-size: 3.5rem;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.upload-zone:hover .upload-icon {
    color: var(--accent-color);
    transform: scale(1.1);
}

.hidden-file-input {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

/* Dashboard Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 24px;
}

.dash-stat-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
}

.dash-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.icon-blue { background: rgba(99,102,241,0.1); color: var(--accent-color); }
.icon-green { background: rgba(16,185,129,0.1); color: var(--success-color); }
.icon-amber { background: rgba(245,158,11,0.1); color: var(--warning-color); }

.dash-stat-info {
    display: flex;
    flex-direction: column;
}

.dash-stat-num {
    font-size: 1.4rem;
    font-weight: 700;
}

.dash-stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Custom Visual SVG/CSS Charts */
.chart-container {
    margin-top: 20px;
    height: 300px;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    padding-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
}

.chart-bar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 60px;
    position: relative;
}

.chart-bar {
    width: 32px;
    background: linear-gradient(180deg, var(--accent-color) 0%, rgba(99, 102, 241, 0.4) 100%);
    border-radius: 6px 6px 0 0;
    transition: height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 4px 10px var(--accent-glow);
}

.chart-bar:hover {
    filter: brightness(1.2);
}

.chart-bar-tooltip {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    color: #fff;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    white-space: nowrap;
}

.chart-bar:hover .chart-bar-tooltip {
    opacity: 1;
}

.chart-bar-label {
    margin-top: 10px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 80px;
}

/* Notification/Toasts System */
.toasts-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 100000;
}

.toast-custom {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 10px;
    color: white;
    font-weight: 500;
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
    animation: slide-in 0.3s ease;
    min-width: 280px;
}

.toast-success { background: var(--success-color); }
.toast-danger { background: var(--danger-color); }
.toast-warning { background: var(--warning-color); }

@keyframes slide-in {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ══════════════════════════════════════════
   PREMIUM SYSTEM CONFIG PAGE STYLES (.sys-)
   ══════════════════════════════════════════ */

/* Stats Cards */
.sys-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.sys-stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sys-stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-color);
    box-shadow: 0 12px 20px rgba(99, 102, 241, 0.08);
}

.sys-stat-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.sys-icon-blue { background: rgba(99, 102, 241, 0.12); color: var(--accent-color); }
.sys-icon-amber { background: rgba(245, 158, 11, 0.12); color: var(--warning-color); }
.sys-icon-green { background: rgba(16, 185, 129, 0.12); color: var(--success-color); }
.sys-icon-purple { background: rgba(139, 92, 246, 0.12); color: #8b5cf6; }

.sys-stat-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.sys-stat-number {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.sys-stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.sys-stat-trend {
    font-size: 1.2rem;
    color: var(--accent-color);
    opacity: 0.6;
}
.trend-amber { color: var(--warning-color); }
.trend-green { color: var(--success-color); }
.trend-purple { color: #8b5cf6; }

/* Section Headers */
.sys-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.sys-section-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.sys-section-icon-chart {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.sys-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.sys-section-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 2px 0 0 0;
}

/* Warnings */
.sys-warnings-card {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.sys-warnings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.sys-warnings-header h5 {
    margin: 0;
    color: var(--danger-color);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.sys-warnings-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
}

.sys-warnings-list {
    margin: 0;
    padding-left: 20px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Upload Grid Layout */
.sys-upload-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 24px;
    margin-bottom: 30px;
}

@media (max-width: 992px) {
    .sys-upload-grid {
        grid-template-columns: 1fr;
    }
}

.sys-upload-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.sys-drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.01);
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 220px;
}

.sys-drop-zone:hover {
    border-color: var(--accent-color);
    background: rgba(99, 102, 241, 0.02);
}

.sys-drop-zone-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    pointer-events: none;
}

.sys-drop-icon-ring {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--accent-color);
    transition: all 0.3s ease;
}

.sys-drop-zone:hover .sys-drop-icon-ring {
    transform: scale(1.1);
    background: var(--accent-color);
    color: white;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.sys-drop-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sys-drop-title {
    font-weight: 600;
    color: var(--text-primary);
}

.sys-drop-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.sys-upload-progress {
    width: 160px;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
}

.sys-upload-progress-bar {
    width: 40%;
    height: 100%;
    background: var(--accent-color);
    border-radius: 2px;
    animation: loading-pulse 1.5s infinite ease-in-out;
}

@keyframes loading-pulse {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(250%); }
}

.sys-uploading-text {
    font-size: 0.8rem;
    color: var(--accent-color);
    font-weight: 500;
}

.sys-drop-locked {
    border-color: rgba(239, 68, 68, 0.2);
    background: rgba(239, 68, 68, 0.02);
    cursor: not-allowed;
}

/* Timeline History */
.sys-history-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    max-height: 270px;
}

.sys-history-header {
    margin-bottom: 16px;
}

.sys-history-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sys-history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.sys-history-empty i {
    font-size: 2rem;
}

.sys-history-list {
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 4px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
}

.sys-history-list::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--border-color);
}

.sys-history-item {
    display: flex;
    gap: 16px;
    position: relative;
}

.sys-history-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 3px solid var(--accent-color);
    z-index: 1;
    flex-shrink: 0;
    margin-top: 4px;
}

.sys-history-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
}

.sys-history-file {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.sys-history-file i {
    color: var(--text-secondary);
}

.sys-history-filename {
    font-weight: 600;
    color: var(--text-primary);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sys-history-badge {
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-color);
    font-weight: 600;
    text-transform: uppercase;
}

.sys-history-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.sys-history-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Analytics Dashboard Section */
.sys-analytics-grid {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 24px;
    margin-bottom: 30px;
}

@media (max-width: 992px) {
    .sys-analytics-grid {
        grid-template-columns: 1fr;
    }
}

.sys-chart-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 320px;
}

.sys-chart-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    font-size: 1.5rem;
    color: var(--accent-color);
}

.sys-chart-area {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 200px;
    border-bottom: 1.5px solid var(--border-color);
    padding-bottom: 8px;
    margin-top: 10px;
}

.sys-chart-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 60px;
}

.sys-chart-tooltip-wrap {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
}

.sys-chart-bar-stack {
    width: 28px;
    border-radius: 6px 6px 0 0;
    overflow: hidden;
    display: flex;
    flex-direction: column-reverse;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.3s;
}

.sys-chart-bar-stack:hover {
    transform: scaleY(1.03);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.sys-bar-segment {
    width: 100%;
    transition: height 0.6s ease;
}

.sys-bar-done { background: var(--success-color); }
.sys-bar-review { background: #8b5cf6; }
.sys-bar-active { background: var(--warning-color); }
.sys-bar-todo { background: var(--border-color); }

.sys-chart-hover-card {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    color: white;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-lg);
    z-index: 10;
    white-space: nowrap;
}

.sys-chart-tooltip-wrap:hover .sys-chart-hover-card {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.sys-hover-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.sys-hover-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.sys-dot-done { background: var(--success-color); }
.sys-dot-active { background: var(--warning-color); }
.sys-dot-todo { background: var(--border-color); }

.sys-chart-name {
    margin-top: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sys-chart-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 16px;
}

.sys-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.sys-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* Circular Completion Rate Card */
.sys-completion-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

.sys-completion-title {
    margin: 0 0 16px 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    align-self: flex-start;
}

.sys-ring-container {
    position: relative;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sys-ring-label {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sys-ring-pct {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.sys-ring-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
}

.sys-completion-breakdown {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
}

.sys-breakdown-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 4px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}

.sys-breakdown-row:last-child {
    border-bottom: none;
}

.sys-breakdown-val {
    font-weight: 600;
    color: var(--text-primary);
}

.sys-val-accent { color: var(--accent-color); }
.sys-val-amber { color: var(--warning-color); }
.sys-val-green { color: var(--success-color); }

/* Priority Badges */
.priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: fit-content;
}

.priority-low {
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-color);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.priority-medium {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.priority-high {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.2);
}

/* Time Tracker Card Bar styles */
.time-tracker-card-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 5px;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.time-tracker-card-bar.running {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.25);
    animation: borderPulse 2s infinite ease-in-out;
}

@keyframes borderPulse {
    0% { border-color: rgba(239, 68, 68, 0.25); }
    50% { border-color: rgba(239, 68, 68, 0.6); }
    100% { border-color: rgba(239, 68, 68, 0.25); }
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #ef4444;
    display: inline-block;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.9); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.4; }
    100% { transform: scale(0.9); opacity: 1; }
}

.time-display {
    font-family: monospace;
    font-weight: 700;
    color: #ef4444;
    font-size: 0.85rem;
}

.btn-time-control {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.btn-time-control.btn-start {
    color: var(--accent-color);
    padding: 2px 6px;
    border-radius: 4px;
}
.btn-time-control.btn-start:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-primary);
}

.btn-time-control.btn-stop {
    color: #ef4444;
}
.btn-time-control.btn-stop:hover {
    transform: scale(1.1);
}

/* Activity Heatmap Styles */
.heatmap-container {
    padding: 15px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-top: 15px;
}

.heatmap-grid {
    display: grid;
    grid-auto-flow: column;
    grid-template-columns: repeat(53, 1fr);
    grid-template-rows: repeat(7, 1fr);
    gap: 3px;
    margin-top: 10px;
    overflow-x: auto;
}

.heatmap-cell {
    aspect-ratio: 1 / 1;
    border-radius: 2px;
    background-color: rgba(255, 255, 255, 0.05);
}

.heatmap-cell.level-0 { background-color: rgba(255, 255, 255, 0.05); }
.theme-light .heatmap-cell.level-0 { background-color: rgba(20, 42, 29, 0.05); }

.heatmap-cell.level-1 { background-color: rgba(99, 102, 241, 0.25); }
.heatmap-cell.level-2 { background-color: rgba(99, 102, 241, 0.5); }
.heatmap-cell.level-3 { background-color: rgba(99, 102, 241, 0.75); }
.heatmap-cell.level-4 { background-color: rgba(99, 102, 241, 1.0); }

.theme-light .heatmap-cell.level-1 { background-color: #d1fae5; }
.theme-light .heatmap-cell.level-2 { background-color: #6ee7b7; }
.theme-light .heatmap-cell.level-3 { background-color: #059669; }
.theme-light .heatmap-cell.level-4 { background-color: #047857; }

/* Blazor error UI - hidden by default */
#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #dc2626;
    color: white;
    padding: 10px 16px;
    z-index: 99999;
    font-size: 0.85rem;
    text-align: center;
}

#blazor-error-ui .reload {
    color: white;
    font-weight: 700;
    margin-left: 10px;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    margin-left: 10px;
}

#blazor-error-ui[data-display=""] {
    display: block;
}

/* ============================================
   MODERN PREMIUM LOADING OVERLAY
   ============================================ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 8, 16, 0.75);
    backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    animation: overlayFadeIn 0.3s ease-out;
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

/* ---- Orbital loader ---- */
.loader-orbit {
    position: relative;
    width: 160px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.orbit-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(99, 102, 241, 0.1);
    border-top-color: var(--accent-color);
    border-right-color: var(--accent-secondary, #a78bfa);
    animation: spin 1s linear infinite;
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.15), inset 0 0 30px rgba(99, 102, 241, 0.05);
}

.orbit-core {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 24px rgba(99, 102, 241, 0.2), 0 0 0 1px rgba(255,255,255,0.06);
    z-index: 1;
    animation: corePulse 2s ease-in-out infinite;
}

@keyframes corePulse {
    0%, 100% { box-shadow: 0 0 24px rgba(99, 102, 241, 0.3); transform: scale(1); }
    50% { box-shadow: 0 0 40px rgba(99, 102, 241, 0.5); transform: scale(1.05); }
}

.orbit-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-color);
    opacity: 0.8;
    animation: dotOrbit 2s ease-in-out infinite;
}

.orbit-dot.dot-1 { animation-delay: 0s; }
.orbit-dot.dot-2 { animation-delay: 0.67s; }
.orbit-dot.dot-3 { animation-delay: 1.33s; }

.orbit-dot::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: var(--accent-color);
    opacity: 0.2;
    animation: dotGlow 2s ease-in-out infinite;
}

@keyframes dotOrbit {
    0% { transform: rotate(0deg) translateX(72px) rotate(0deg); opacity: 0.8; }
    50% { opacity: 1; }
    100% { transform: rotate(360deg) translateX(72px) rotate(-360deg); opacity: 0.8; }
}

@keyframes dotGlow {
    0%, 100% { transform: scale(1); opacity: 0.2; }
    50% { transform: scale(1.8); opacity: 0.1; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---- Progress bar ---- */
.loader-progress-bar {
    width: 320px;
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--accent-color), var(--accent-secondary, #a78bfa), var(--accent-color));
    background-size: 200% 100%;
    animation: progressSweep 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes progressSweep {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

/* ============================================
   DARK THEME SHOOTING STARS (ฝนดาวตก)
   ============================================ */
.shooting-stars {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.shooting-star {
    position: absolute;
    width: 3px;
    height: 3px;
    background: white;
    border-radius: 50%;
    opacity: 0;
}

.shooting-star::before {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 80px;
    height: 1.5px;
    background: linear-gradient(to left, rgba(255,255,255,0.6), transparent);
    right: 3px;
}

.shooting-star:nth-child(1) {
    top: 10%;
    left: 80%;
    animation: shoot1 8s ease-in-out infinite;
}

.shooting-star:nth-child(2) {
    top: 25%;
    left: 60%;
    animation: shoot2 10s ease-in-out infinite 3s;
}

.shooting-star:nth-child(3) {
    top: 40%;
    left: 90%;
    animation: shoot1 9s ease-in-out infinite 5s;
}

.shooting-star:nth-child(4) {
    top: 15%;
    left: 40%;
    animation: shoot2 11s ease-in-out infinite 7s;
}

.shooting-star:nth-child(5) {
    top: 50%;
    left: 70%;
    animation: shoot1 7s ease-in-out infinite 2s;
}

@keyframes shoot1 {
    0% { transform: translate(0, 0) rotate(-35deg); opacity: 0; }
    5% { opacity: 1; }
    20% { opacity: 1; }
    25% { opacity: 0; transform: translate(-300px, 200px) rotate(-35deg); }
    100% { opacity: 0; }
}

@keyframes shoot2 {
    0% { transform: translate(0, 0) rotate(-25deg); opacity: 0; }
    5% { opacity: 0.8; }
    18% { opacity: 0.8; }
    22% { opacity: 0; transform: translate(-250px, 120px) rotate(-25deg); }
    100% { opacity: 0; }
}

/* Only show shooting stars in dark and cyberpunk themes */
.theme-dark .shooting-star,
.theme-cyberpunk .shooting-star {
    display: block;
}

.theme-light .shooting-star,
.theme-snow .shooting-star,
.theme-sunset .shooting-star,
.theme-forest .shooting-star,
.theme-amethyst .shooting-star {
    display: none;
}

/* Cyberpunk colorful laser beams */
.theme-cyberpunk .shooting-star:nth-child(1) {
    background: #ff007f;
    box-shadow: 0 0 8px #ff007f;
}
.theme-cyberpunk .shooting-star:nth-child(1)::before {
    background: linear-gradient(to left, #ff007f, transparent);
}

.theme-cyberpunk .shooting-star:nth-child(2) {
    background: #00f0ff;
    box-shadow: 0 0 8px #00f0ff;
}
.theme-cyberpunk .shooting-star:nth-child(2)::before {
    background: linear-gradient(to left, #00f0ff, transparent);
}

.theme-cyberpunk .shooting-star:nth-child(3) {
    background: #39ff14;
    box-shadow: 0 0 8px #39ff14;
}
.theme-cyberpunk .shooting-star:nth-child(3)::before {
    background: linear-gradient(to left, #39ff14, transparent);
}

.theme-cyberpunk .shooting-star:nth-child(4) {
    background: #bd93f9;
    box-shadow: 0 0 8px #bd93f9;
}
.theme-cyberpunk .shooting-star:nth-child(4)::before {
    background: linear-gradient(to left, #bd93f9, transparent);
}

.theme-cyberpunk .shooting-star:nth-child(5) {
    background: #ff00ff;
    box-shadow: 0 0 8px #ff00ff;
}
.theme-cyberpunk .shooting-star:nth-child(5)::before {
    background: linear-gradient(to left, #ff00ff, transparent);
}

/* ============================================
   SNOW FALL (ฝหิมะตก) — Snow Theme Only
   ============================================ */
.snow-flurry {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    top: -12px;
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    opacity: 0;
    filter: blur(0.5px);
}

.snowflake:nth-child(odd) { width: 4px; height: 4px; opacity: 0.5; }
.snowflake:nth-child(3n) { width: 8px; height: 8px; opacity: 0.7; filter: blur(1px); }

.snowflake:nth-child(1)  { left: 3%;  animation: snowfall 14s linear infinite; animation-delay: 0s; }
.snowflake:nth-child(2)  { left: 8%;  animation: snowfall 16s linear infinite; animation-delay: 1s; }
.snowflake:nth-child(3)  { left: 14%; animation: snowfall 12s linear infinite; animation-delay: 3s; }
.snowflake:nth-child(4)  { left: 20%; animation: snowfall 18s linear infinite; animation-delay: 0.5s; }
.snowflake:nth-child(5)  { left: 26%; animation: snowfall 15s linear infinite; animation-delay: 2s; }
.snowflake:nth-child(6)  { left: 32%; animation: snowfall 13s linear infinite; animation-delay: 4s; }
.snowflake:nth-child(7)  { left: 38%; animation: snowfall 17s linear infinite; animation-delay: 0.8s; }
.snowflake:nth-child(8)  { left: 44%; animation: snowfall 14s linear infinite; animation-delay: 2.5s; }
.snowflake:nth-child(9)  { left: 50%; animation: snowfall 16s linear infinite; animation-delay: 1.5s; }
.snowflake:nth-child(10) { left: 56%; animation: snowfall 12s linear infinite; animation-delay: 3.5s; }
.snowflake:nth-child(11) { left: 62%; animation: snowfall 18s linear infinite; animation-delay: 0.2s; }
.snowflake:nth-child(12) { left: 68%; animation: snowfall 15s linear infinite; animation-delay: 4.5s; }
.snowflake:nth-child(13) { left: 74%; animation: snowfall 13s linear infinite; animation-delay: 1.8s; }
.snowflake:nth-child(14) { left: 80%; animation: snowfall 17s linear infinite; animation-delay: 3.2s; }
.snowflake:nth-child(15) { left: 86%; animation: snowfall 14s linear infinite; animation-delay: 0.7s; }
.snowflake:nth-child(16) { left: 92%; animation: snowfall 16s linear infinite; animation-delay: 2.2s; }
.snowflake:nth-child(17) { left: 10%; animation: snowfall 19s linear infinite; animation-delay: 5s; }
.snowflake:nth-child(18) { left: 46%; animation: snowfall 11s linear infinite; animation-delay: 1.2s; }
.snowflake:nth-child(19) { left: 70%; animation: snowfall 15s linear infinite; animation-delay: 4s; }
.snowflake:nth-child(20) { left: 28%; animation: snowfall 13s linear infinite; animation-delay: 2.8s; }
.snowflake:nth-child(21) { left: 96%; animation: snowfall 17s linear infinite; animation-delay: 0.3s; }
.snowflake:nth-child(22) { left: 18%; animation: snowfall 14s linear infinite; animation-delay: 3.7s; }
.snowflake:nth-child(23) { left: 54%; animation: snowfall 12s linear infinite; animation-delay: 1.9s; }
.snowflake:nth-child(24) { left: 82%; animation: snowfall 16s linear infinite; animation-delay: 4.2s; }

@keyframes snowfall {
    0% { transform: translateY(-20px) translateX(0) rotate(0deg); opacity: 0; }
    10% { opacity: 0.8; }
    90% { opacity: 0.6; }
    100% { transform: translateY(100vh) translateX(40px) rotate(360deg); opacity: 0; }
}

.theme-snow .snowflake { display: block; }
.theme-dark .snowflake,
.theme-light .snowflake { display: none; }

/* ============================================
   FALLING LEAVES + WIND (ใบไม้ร่วง + ลมพัด) — Mint Theme Only
   ============================================ */
.falling-leaves {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.leaf {
    position: absolute;
    top: -30px;
    width: 16px;
    height: 16px;
    opacity: 0;
    border-radius: 2px 8px 2px 8px;
}

.leaf:nth-child(1)  { left: 5%;  background: #4ade80; animation: leafFall1 10s ease-in-out infinite; animation-delay: 0s; }
.leaf:nth-child(2)  { left: 15%; background: #22c55e; animation: leafFall2 12s ease-in-out infinite; animation-delay: 2s; }
.leaf:nth-child(3)  { left: 25%; background: #86efac; animation: leafFall1 11s ease-in-out infinite; animation-delay: 4s; }
.leaf:nth-child(4)  { left: 35%; background: #16a34a; animation: leafFall2 13s ease-in-out infinite; animation-delay: 1s; }
.leaf:nth-child(5)  { left: 45%; background: #4ade80; animation: leafFall1 9s ease-in-out infinite;  animation-delay: 3s; }
.leaf:nth-child(6)  { left: 55%; background: #22c55e; animation: leafFall2 11s ease-in-out infinite; animation-delay: 5s; }
.leaf:nth-child(7)  { left: 65%; background: #86efac; animation: leafFall1 12s ease-in-out infinite; animation-delay: 0.5s; }
.leaf:nth-child(8)  { left: 75%; background: #16a34a; animation: leafFall2 10s ease-in-out infinite; animation-delay: 2.5s; }
.leaf:nth-child(9)  { left: 85%; background: #4ade80; animation: leafFall1 13s ease-in-out infinite; animation-delay: 4.5s; }
.leaf:nth-child(10) { left: 92%; background: #22c55e; animation: leafFall2 9s ease-in-out infinite;  animation-delay: 1.5s; }
.leaf:nth-child(11) { left: 10%; background: #86efac; animation: leafFall1 11s ease-in-out infinite; animation-delay: 3.5s; }
.leaf:nth-child(12) { left: 50%; background: #16a34a; animation: leafFall2 12s ease-in-out infinite; animation-delay: 0.8s; }

@keyframes leafFall1 {
    0% { transform: translateY(-40px) translateX(0) rotate(0deg); opacity: 0; }
    10% { opacity: 0.8; }
    50% { transform: translateY(50vh) translateX(60px) rotate(180deg); opacity: 0.7; }
    100% { transform: translateY(105vh) translateX(-40px) rotate(360deg); opacity: 0; }
}

@keyframes leafFall2 {
    0% { transform: translateY(-40px) translateX(0) rotate(0deg); opacity: 0; }
    10% { opacity: 0.7; }
    50% { transform: translateY(55vh) translateX(-70px) rotate(-160deg); opacity: 0.6; }
    100% { transform: translateY(105vh) translateX(50px) rotate(-340deg); opacity: 0; }
}

.leaf::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 2px;
    background: rgba(0,0,0,0.1);
    border-radius: 50%;
}

.btn-control {
    position: relative;
    overflow: hidden;
}
.btn-control i {
    transition: transform 0.3s ease, filter 0.3s ease;
}
.btn-control:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 8px 24px rgba(99,102,241,0.18);
}
.btn-control:hover i {
    transform: scale(1.15);
    filter: drop-shadow(0 0 6px currentColor);
}
.btn-control::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.4s ease;
    background: radial-gradient(circle at var(--mx,50%) var(--my,50%), rgba(255,255,255,0.15) 0%, transparent 60%);
}
.btn-control:hover::after {
    opacity: 1;
}

/* ============= Confirm Dialog ============= */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}
@@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.confirm-dialog {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 36px 40px 28px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 24px 64px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.05);
    animation: dialogIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@@keyframes dialogIn {
    from { opacity: 0; transform: scale(0.85) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.confirm-icon-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}
.confirm-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    animation: iconPulse 0.6s ease-out;
}
@@keyframes iconPulse {
    0% { transform: scale(0); }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); }
}
.icon-danger {
    background: rgba(239,68,68,0.12);
    color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239,68,68,0.08);
}
.icon-info {
    background: rgba(99,102,241,0.12);
    color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(99,102,241,0.08);
}
.confirm-title {
    margin: 0 0 8px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}
.confirm-message {
    margin: 0 0 24px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.confirm-btn {
    flex: 1;
    padding: 10px 20px;
    border-radius: 12px;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}
.confirm-btn-cancel {
    background: var(--border-color);
    color: var(--text-primary);
}
.confirm-btn-cancel:hover {
    background: rgba(148,163,184,0.25);
    transform: translateY(-1px);
}
.confirm-btn-confirm {
    background: #ef4444;
    color: white;
    box-shadow: 0 4px 14px rgba(239,68,68,0.25);
}
.confirm-btn-confirm:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239,68,68,0.35);
}
.confirm-danger .confirm-btn-confirm {
    background: #ef4444;
    color: white;
}
.confirm-danger .confirm-btn-confirm:hover {
    background: #dc2626;
}
.confirm-btn-success {
    background: rgba(52, 211, 153, 0.15) !important;
    color: var(--success-color) !important;
    border: 1px solid rgba(52, 211, 153, 0.3) !important;
    box-shadow: none !important;
}
.confirm-btn-success:hover {
    background: rgba(52, 211, 153, 0.25) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(52, 211, 153, 0.2) !important;
}

.theme-light .leaf { display: block; }
.theme-dark .leaf,
.theme-snow .leaf { display: none; }

/* Assign columns height and scrolling */
.assign-column {
    max-height: 75vh;
}
.assign-column-body {
    overflow-y: auto !important;
    max-height: calc(75vh - 60px);
}

/* Highly Prominent and Clear Datepicker Styling */
input[type="date"].form-input-custom {
    border: 2px solid var(--accent-color) !important;
    background-color: var(--input-bg);
    color: var(--text-primary);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.15);
    font-weight: 600;
}
input[type="date"].form-input-custom:hover,
input[type="date"].form-input-custom:focus {
    box-shadow: 0 0 14px var(--accent-glow) !important;
    border-color: var(--accent-color) !important;
}
/* Style the calendar picker indicator icon to match theme */
input[type="date"].form-input-custom::-webkit-calendar-picker-indicator {
    filter: invert(0.5) sepia(1) saturate(5) hue-rotate(200deg);
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
}
.theme-dark input[type="date"].form-input-custom::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(0.9) sepia(1) saturate(5) hue-rotate(200deg);
}

/* Gamified Achievements Badges Styling */
.badge-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.badge-card.locked {
    opacity: 0.5;
    filter: grayscale(1);
}

.badge-card.unlocked {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.03) 100%);
    border: 1px solid rgba(99, 102, 241, 0.25);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.05);
}

.badge-card.unlocked:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.4);
}

.badge-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.badge-card.unlocked .badge-icon {
    background: linear-gradient(135deg, var(--accent-color), #a78bfa);
    color: white;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.badge-info {
    flex: 1;
    min-width: 0;
}

.badge-name {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.badge-desc {
    font-size: 0.7rem;
    color: var(--text-secondary);
    line-height: 1.3;
    margin-bottom: 4px;
}

.badge-status {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-card.unlocked .badge-status {
    color: var(--success-color);
}

.badge-card.locked .badge-status {
    color: var(--text-secondary);
}

/* Live Activity Drawer Styling */
.activity-drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
    z-index: 999;
}

.activity-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    height: 100vh;
    background: var(--bg-sidebar);
    border-left: 1px solid var(--border-color);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding: 0 !important;
    border-radius: 0 !important;
}

.activity-drawer-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.activity-drawer-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-drawer-item {
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.activity-drawer-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--accent-color);
}

.badge-action-create { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.badge-action-update { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }
.badge-action-delete { background: rgba(239, 68, 68, 0.12); color: #ef4444; }
.badge-action-close { background: rgba(139, 92, 246, 0.12); color: #8b5cf6; }