/*
 * Star town Medical System v1.4.2
 * Modernized Stylesheet - Fixed Sidebar Layout
 */

/* =========================================
   1. VARIABLES & THEME CONFIG
   ========================================= */
:root {
    /* --- Brand Colors (Teal/Cyan) --- */
    --color-primary: #0D9488;
    /* Teal 600 - Readable on light backgrounds */
    --color-primary-hover: #0F766E;
    /* Teal 700 - Darker for Hover */
    --color-primary-light: #CCFBF1;
    /* Teal 100 - Light teal for accents */
    --color-secondary: #E0F2FE;
    /* Light Cyan for secondary */
    --color-accent: #06B6D4;
    /* Cyan 500 */
    --color-accent-glow: rgba(45, 212, 191, 0.4);

    /* --- Grid / Glow Effect Colors --- */
    --color-grid-line: rgba(45, 212, 191, 0.06);
    --color-grid-line-strong: rgba(45, 212, 191, 0.04);
    --color-grid-highlight: rgba(6, 182, 212, 1);
    --color-grid-glow: rgba(45, 212, 191, 0.4);
    --color-circle-border: rgba(6, 182, 212, 0.3);
    --color-circle-fill: rgba(6, 182, 212, 0.15);
    --color-circle-alt-border: rgba(45, 212, 191, 0.4);
    --color-mouse-glow: rgba(6, 182, 212, 0.25);
    --color-ambient-1: rgba(45, 212, 191, 0.7);
    --color-ambient-2: rgba(6, 182, 212, 0.6);
    --color-ambient-3: rgba(45, 212, 191, 0.5);
    --color-particle: rgba(13, 148, 136, 0.5);
    --color-particle-shadow: rgba(13, 148, 136, 0.4);
    --color-input-focus: #0D9488;
    --color-input-focus-ring: rgba(13, 148, 136, 0.2);
    --color-btn-primary-glow: #0D9488;

    /* --- Semantic Colors --- */
    --color-success: #10B981;
    /* Emerald 500 */
    --color-warning: #F59E0B;
    /* Amber 500 */
    --color-danger: #EF4444;
    /* Red 500 */
    --color-danger-hover: #DC2626;
    /* Red 600 */
    --color-info: #06B6D4;
    /* Cyan 500 */

    /* --- Neutral Colors (Light Mode) --- */
    --color-text: #1F2937;
    /* Gray 800 */
    --color-text-muted: #6B7280;
    /* Gray 500 */
    --color-border: #E5E7EB;
    /* Gray 200 */
    --color-bg-base: #F9FAFB;
    /* Gray 50 */
    --color-bg-surface: #FFFFFF;
    /* White */
    --color-bg-hover: #F3F4F6;
    /* Gray 100 */

    /* --- Typography --- */
    --font-family-base: 'Kanit', sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;

    /* --- Spacing & Layout --- */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 20px rgba(45, 212, 191, 0.3);

    /* --- Transitions --- */
    --transition-fast: 0.15s ease-in-out;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Dark Mode Variables (Cerberus Style) --- */
html.dark {
    /* Brand Colors (Vibrant Teal for Dark Mode) */
    --color-primary: #2DD4BF;
    /* Teal 400 */
    --color-primary-hover: #14B8A6;
    /* Teal 500 */
    --color-primary-light: #042F2E;
    /* Teal 950 (Backgrounds) */
    --color-secondary: #164E63;
    /* Cyan 800 */
    --color-accent: #22D3EE;
    /* Cyan 400 */
    --color-accent-glow: rgba(45, 212, 191, 0.5);

    /* --- Grid / Glow Effect Colors (Dark) --- */
    --color-grid-line: rgba(45, 212, 191, 0.06);
    --color-grid-line-strong: rgba(45, 212, 191, 0.04);
    --color-grid-highlight: rgba(6, 182, 212, 1);
    --color-grid-glow: rgba(45, 212, 191, 0.4);
    --color-circle-border: rgba(6, 182, 212, 0.3);
    --color-circle-fill: rgba(6, 182, 212, 0.15);
    --color-circle-alt-border: rgba(45, 212, 191, 0.4);
    --color-mouse-glow: rgba(6, 182, 212, 0.25);
    --color-ambient-1: rgba(45, 212, 191, 0.7);
    --color-ambient-2: rgba(6, 182, 212, 0.6);
    --color-ambient-3: rgba(45, 212, 191, 0.5);
    --color-particle: rgba(255, 255, 255, 0.5);
    --color-particle-shadow: rgba(255, 255, 255, 0.4);
    --color-input-focus: #2DD4BF;
    --color-input-focus-ring: rgba(45, 212, 191, 0.2);
    --color-btn-primary-glow: #2DD4BF;

    /* Semantic Colors */
    --color-danger: #F87171;
    /* Red 400 */
    --color-danger-hover: #EF4444;
    /* Red 500 */
    --color-info: #22D3EE;
    /* Cyan 400 */

    /* Neutral Colors (Dark) */
    --color-text: #F1F5F9;
    /* Slate 100 */
    --color-text-muted: #94A3B8;
    /* Slate 400 */
    --color-border: rgba(255, 255, 255, 0.1);
    /* Subtle white border */
    --color-bg-base: #0a0a0a;
    /* Near Black */
    --color-bg-surface: #141414;
    /* Very Dark Gray */
    --color-bg-hover: #1f1f1f;
    /* Slightly lighter */
    --shadow-glow: 0 0 25px rgba(45, 212, 191, 0.4);
}

/* =========================================
   2. GLOBAL BASE & RESET
   ========================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family-base);
    color: var(--color-text);
    background-color: var(--color-bg-base);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--transition-normal), color var(--transition-normal);
    margin: 0;
}

button,
.cursor-pointer,
.nav-link,
.btn {
    user-select: none;
}

/* =========================================
   3. UTILITIES & HELPERS
   ========================================= */
/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background-color: rgba(156, 163, 175, 0.5);
    border-radius: var(--radius-full);
    transition: background-color var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(156, 163, 175, 0.8);
}

html.dark ::-webkit-scrollbar-thumb {
    background-color: rgba(71, 85, 105, 0.6);
}

html.dark ::-webkit-scrollbar-thumb:hover {
    background-color: rgba(71, 85, 105, 0.9);
}

/* Glassmorphism Panel (Cerberus Style) */
.glass-panel {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(13, 148, 136, 0.15);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-panel:hover {
    border-color: rgba(13, 148, 136, 0.35);
    box-shadow: 0 8px 32px rgba(13, 148, 136, 0.15), 0 0 0 1px rgba(13, 148, 136, 0.1);
}

html.dark .glass-panel {
    background: rgba(20, 20, 20, 0.85);
    border: 1px solid rgba(45, 212, 191, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

html.dark .glass-panel:hover {
    border-color: rgba(45, 212, 191, 0.3);
    box-shadow: 0 8px 40px rgba(45, 212, 191, 0.15), 0 0 0 1px rgba(45, 212, 191, 0.15);
}

/* Glow Card (Enhanced) */
.glow-card {
    position: relative;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.glow-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.3), transparent 50%, rgba(6, 182, 212, 0.3));
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
    filter: blur(8px);
}

.glow-card:hover::before {
    opacity: 1;
}

.glow-card:hover {
    border-color: rgba(45, 212, 191, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 30px rgba(45, 212, 191, 0.1);
}

html.dark .glow-card {
    background: rgba(20, 20, 20, 0.9);
    border-color: rgba(255, 255, 255, 0.08);
}

html.dark .glow-card:hover {
    border-color: rgba(45, 212, 191, 0.5);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 40px rgba(45, 212, 191, 0.15);
}

/* Animated Glow Border Card */
.glow-border-card {
    position: relative;
    background: var(--color-bg-surface);
    border-radius: var(--radius-lg);
    padding: 1px;
    overflow: hidden;
}

.glow-border-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: conic-gradient(from 0deg, transparent 0deg, rgba(45, 212, 191, 0.5) 60deg, transparent 120deg);
    animation: rotate-glow 4s linear infinite;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.glow-border-card:hover::before {
    opacity: 1;
}

.glow-border-card>.glow-border-inner {
    position: relative;
    background: var(--color-bg-surface);
    border-radius: calc(var(--radius-lg) - 1px);
    height: 100%;
    z-index: 1;
}

html.dark .glow-border-card>.glow-border-inner {
    background: #141414;
}

/* ====== COBALT-STYLE GLASSMORPHISM CARDS (DARK MODE ONLY) ====== */

/* Dark mode glassmorphism cards */
html.dark .glass-card,
html.dark .bg-white.rounded-2xl:not(.settings-dropdown),
html.dark .bg-white.rounded-xl:not(.settings-dropdown),
html.dark .dark\:bg-slate-800.rounded-2xl:not(.settings-dropdown),
html.dark .dark\:bg-slate-800.rounded-xl:not(.settings-dropdown) {
    position: relative;
    background: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2), 0 8px 32px rgba(0, 0, 0, 0.3) !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark mode hover glow on border */
html.dark .glass-card:hover,
html.dark .bg-white.rounded-2xl:hover:not(.settings-dropdown),
html.dark .bg-white.rounded-xl:hover:not(.settings-dropdown) {
    border-color: rgba(45, 212, 191, 0.3) !important;
    box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.2), 0 20px 50px rgba(0, 0, 0, 0.4), 0 0 60px rgba(45, 212, 191, 0.15) !important;
}

/* Dark mode text colors */
html.dark .glass-card,
html.dark .bg-white.rounded-2xl:not(.settings-dropdown),
html.dark .bg-white.rounded-xl:not(.settings-dropdown) {
    color: white;
}

html.dark .glass-card h1,
html.dark .glass-card h2,
html.dark .glass-card h3,
html.dark .glass-card h4,
html.dark .glass-card p,
html.dark .bg-white.rounded-2xl:not(.settings-dropdown) h1,
html.dark .bg-white.rounded-2xl:not(.settings-dropdown) h2,
html.dark .bg-white.rounded-2xl:not(.settings-dropdown) h3,
html.dark .bg-white.rounded-xl:not(.settings-dropdown) h1,
html.dark .bg-white.rounded-xl:not(.settings-dropdown) h2,
html.dark .bg-white.rounded-xl:not(.settings-dropdown) h3 {
    color: white !important;
}

html.dark .glass-card .text-gray-500,
html.dark .glass-card .text-gray-400,
html.dark .glass-card .text-gray-600,
html.dark .bg-white.rounded-2xl:not(.settings-dropdown) .text-gray-500,
html.dark .bg-white.rounded-xl:not(.settings-dropdown) .text-gray-500 {
    color: rgba(255, 255, 255, 0.6) !important;
}

html.dark .glass-card .text-gray-800,
html.dark .bg-white.rounded-2xl:not(.settings-dropdown) .text-gray-800,
html.dark .bg-white.rounded-xl:not(.settings-dropdown) .text-gray-800 {
    color: white !important;
}

/* Dropdown specific styles - normal positioning */
.settings-dropdown {
    position: absolute !important;
    top: 100% !important;
    margin-top: 0.5rem !important;
}

html.dark .settings-dropdown {
    background: rgba(15, 23, 42, 0.98) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}


/* ====== GLASSMORPHISM HEADER/SIDEBAR/FOOTER ====== */
.glass-header {
    background: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-bottom: 0.5px solid rgba(45, 212, 191, 0.15) !important;
}

html.dark .glass-header {
    background: rgba(20, 20, 20, 0.8) !important;
    border-bottom: 0.5px solid rgba(45, 212, 191, 0.1) !important;
}

.glass-sidebar {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border-right: 0.5px solid rgba(45, 212, 191, 0.15) !important;
}

html.dark .glass-sidebar {
    background: rgba(15, 15, 15, 0.85) !important;
    border-right: 0.5px solid rgba(45, 212, 191, 0.1) !important;
}

.glass-footer {
    background: rgba(255, 255, 255, 0.6) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-top: 0.5px solid rgba(45, 212, 191, 0.1) !important;
}

html.dark .glass-footer {
    background: rgba(15, 15, 15, 0.7) !important;
    border-top: 0.5px solid rgba(45, 212, 191, 0.08) !important;
}

@keyframes rotate-glow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Loading Spinner */
.loader {
    width: 48px;
    height: 48px;
    border: 5px solid rgba(229, 231, 235, 0.3);
    border-bottom-color: var(--color-primary);
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

.loader-small {
    width: 16px;
    height: 16px;
    border: 2px solid;
    border-color: currentColor transparent currentColor transparent;
    border-radius: 50%;
    display: inline-block;
    animation: rotation 0.8s linear infinite;
    vertical-align: text-bottom;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Animations */
.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-shine {
    animation: shine 1s;
}

@keyframes shine {
    100% {
        left: 125%;
    }
}

.perspective {
    perspective: 1000px;
}

/* =========================================
   4. COMPONENT: BUTTONS (Cerberus Style)
   ========================================= */
.btn {
    font-weight: 500;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    border: 1px solid transparent;
    cursor: pointer;
    font-size: var(--font-size-sm);
    line-height: 1.25rem;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    background-color: #6B7280 !important;
    border-color: #6B7280 !important;
    color: #D1D5DB !important;
}

html.dark .btn:disabled,
html.dark .btn[disabled] {
    background-color: #374151 !important;
    border-color: #374151 !important;
    color: #6B7280 !important;
}

/* Button Variants */
.btn-primary {
    background-color: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.btn-primary:hover {
    background-color: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    box-shadow: 0 0 20px rgba(13, 148, 136, 0.4);
}

html.dark .btn-primary {
    color: #0a0a0a;
}

html.dark .btn-primary:hover {
    box-shadow: 0 0 25px rgba(45, 212, 191, 0.5);
}

/* NEW: Outline Button (Cerberus Style) */
.btn-outline {
    background-color: transparent;
    color: var(--color-primary);
    border: 1px solid rgba(13, 148, 136, 0.4);
}

.btn-outline:hover {
    border-color: var(--color-primary);
    box-shadow: 0 0 20px rgba(13, 148, 136, 0.3);
    background-color: rgba(13, 148, 136, 0.05);
}

html.dark .btn-outline {
    color: var(--color-primary);
    border-color: rgba(45, 212, 191, 0.4);
}

html.dark .btn-outline:hover {
    border-color: var(--color-primary);
    box-shadow: 0 0 25px rgba(45, 212, 191, 0.4);
    background-color: rgba(45, 212, 191, 0.1);
}

/* Secondary Button */
.btn-secondary {
    background-color: #F3F4F6;
    color: #1F2937;
    border-color: #E5E7EB;
}

.btn-secondary:hover {
    background-color: #E5E7EB;
    border-color: #D1D5DB;
}

html.dark .btn-secondary {
    background-color: #1f1f1f;
    color: #E2E8F0;
    border-color: rgba(255, 255, 255, 0.1);
}

html.dark .btn-secondary:hover {
    background-color: #2a2a2a;
    border-color: rgba(255, 255, 255, 0.2);
}

/* Danger Button */
.btn-danger {
    background-color: var(--color-danger);
    color: white;
    border-color: var(--color-danger);
}

.btn-danger:hover {
    background-color: var(--color-danger-hover);
    border-color: var(--color-danger-hover);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

.btn-danger-outline {
    background-color: transparent;
    color: var(--color-danger);
    border-color: rgba(239, 68, 68, 0.4);
}

.btn-danger-outline:hover {
    background-color: var(--color-danger);
    color: white;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

html.dark .btn-danger-outline {
    color: var(--color-danger);
    border-color: rgba(248, 113, 113, 0.4);
}

html.dark .btn-danger-outline:hover {
    background-color: var(--color-danger);
    color: #0a0a0a;
}

/* =========================================
   5. COMPONENT: FORMS
   ========================================= */
.form-input {
    width: 100%;
    padding: 0.625rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background-color: var(--color-bg-surface);
    color: var(--color-text);
    transition: all var(--transition-fast);
    font-size: var(--font-size-sm);
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.2);
}

html.dark .form-input {
    background-color: #141414;
    border-color: rgba(255, 255, 255, 0.1);
    color: #F1F5F9;
}

html.dark .form-input:focus {
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.3);
}

.form-input-sm {
    padding: 0.4rem 0.75rem;
    font-size: var(--font-size-xs);
    border-radius: var(--radius-md);
}

.form-label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: var(--font-size-xs);
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

html.dark .form-label {
    color: #94A3B8;
}

.form-checkbox {
    cursor: pointer;
    border-radius: var(--radius-sm);
    border-color: var(--color-border);
    color: var(--color-primary);
}

html.dark .form-checkbox {
    background-color: #1E293B;
    border-color: #4B5563;
}

.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #CBD5E1;
    transition: .3s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

input:checked+.slider {
    background-color: var(--color-primary);
}

input:checked+.slider:before {
    transform: translateX(24px);
}

.switch.switch-small {
    width: 36px;
    height: 20px;
}

.switch.switch-small .slider:before {
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
}

.switch.switch-small input:checked+.slider:before {
    transform: translateX(16px);
}

/* =========================================
   6. COMPONENT: NAVIGATION & LAYOUT (SIDEBAR FIX)
   ========================================= */
/* Sidebar Container */
#sidebar {
    transition: transform var(--transition-normal);
    /* z-index is controlled by Tailwind classes in HTML (z-[50]) */
    border-right: 1px solid var(--color-border);
}

html.dark #sidebar {
    background-color: #0F172A;
    /* Slate 900 */
    border-right: 1px solid #1E293B;
}

#sidebar-overlay {
    transition: opacity var(--transition-normal);
    /* z-index is controlled by Tailwind classes in HTML (z-[48]) */
}

header {
    /* z-index is controlled by Tailwind classes in HTML (z-[55]) */
    position: relative;
}

/* Navigation Group Header (Toggle) */
.nav-header-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    margin-top: 1rem;
    margin-bottom: 0.25rem;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.nav-header-toggle:hover {
    color: var(--color-text);
    background-color: rgba(0, 0, 0, 0.03);
}

html.dark .nav-header-toggle:hover {
    color: var(--color-text);
    background-color: rgba(255, 255, 255, 0.03);
}

.nav-header-toggle .chevron-icon {
    transition: transform 0.3s ease;
    opacity: 0.7;
}

.nav-header-toggle.open .chevron-icon {
    transform: rotate(180deg);
}

.nav-header-toggle.open {
    color: var(--color-primary);
}

/* Nav Submenu Container */
.nav-submenu {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-submenu.open {
    max-height: 1000px;
}

/* --- [UPDATED] Navigation Links (Flexbox Fix) --- */
#main-nav .nav-link {
    display: flex;
    /* Use Flexbox */
    flex-direction: row;
    /* Force items to be in a row */
    align-items: center;
    /* Center vertically */
    justify-content: flex-start;
    /* Align to left */
    white-space: nowrap;
    /* Prevent text wrapping */

    /* Spacing & Styling */
    padding: 0.75rem 1rem;
    gap: 0.75rem;
    /* Gap between icon and text */

    font-weight: 500;
    border-radius: var(--radius-md);
    border-left: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    width: 100%;
    /* Full width */
    margin-left: 0.5rem;
    margin-right: 0.5rem;
    width: calc(100% - 1rem);
}

/* Hover State */
#main-nav .nav-link:hover {
    color: var(--color-text);
    background-color: var(--color-bg-hover);
    padding-left: 1rem;
    /* No slide */
    transform: translateX(2px);
}

html.dark #main-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.03);
    color: #F1F5F9;
}

/* Active State */
#main-nav .nav-link.active {
    background-color: rgba(13, 148, 136, 0.1);
    color: var(--color-primary);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

html.dark #main-nav .nav-link.active {
    background-color: rgba(45, 212, 191, 0.15);
    color: var(--color-primary);
}

/* Icons inside Nav */
#main-nav .nav-link i,
#main-nav .nav-link svg {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    /* Prevent icon shrinking */
    transition: color 0.2s;
    opacity: 0.8;
}

#main-nav .nav-link:hover i,
#main-nav .nav-link:hover svg {
    opacity: 1;
}

#main-nav .nav-link.active i,
#main-nav .nav-link.active svg {
    opacity: 1;
    color: var(--color-primary);
    filter: drop-shadow(0 0 5px var(--color-accent-glow));
}

/* Sidebar Footer (Profile) */
#user-profile-sidebar {
    border-top: 1px solid var(--color-border);
    margin-top: auto;
}

/* Nav Badges */
.nav-badge {
    background-color: var(--color-danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    height: 1.25rem;
    min-width: 1.25rem;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.4rem;
    margin-left: auto;
    /* Push badge to right */
    line-height: 1;
}

/* Tab Navigation */
.tab-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-muted);
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
    cursor: pointer;
}

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

.tab-btn.active {
    color: var(--color-primary);
    font-weight: 600;
    border-bottom-color: var(--color-primary);
}

.tab-badge {
    background-color: var(--color-danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    height: 1.1rem;
    min-width: 1.1rem;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.3rem;
    margin-left: 0.5rem;
    transform: translateY(-1px);
}

/* Settings Dropdown */
.settings-dropdown {
    transform-origin: top right;
    animation: scale-in 0.15s ease-out forwards;
}

.settings-dropdown.hidden {
    display: none;
}

@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.dropdown-link {
    display: flex;
    align-items: center;
    padding: 0.65rem 1rem;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text);
    transition: all var(--transition-fast);
    cursor: pointer;
    border-radius: var(--radius-sm);
    margin: 0.25rem 0.5rem;
}

.dropdown-link:hover {
    background-color: var(--color-bg-hover);
    color: var(--color-primary);
}

.dropdown-link i,
.dropdown-link svg {
    margin-right: 0.75rem;
    width: 1rem;
    height: 1rem;
    color: var(--color-text-muted);
}

.dropdown-link:hover i,
.dropdown-link:hover svg {
    color: var(--color-primary);
}

/* =========================================
   7. COMPONENT: BADGES & STATUS
   ========================================= */
.badge {
    padding: 0.125rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    display: inline-block;
    line-height: 1.25;
}

.badge-pending {
    background-color: #FEF9C3;
    color: #854D0E;
}

html.dark .badge-pending {
    background-color: #713F12;
    color: #FDE047;
}

.badge-approved,
.badge-success {
    background-color: #DCFCE7;
    color: #166534;
}

html.dark .badge-approved,
html.dark .badge-success {
    background-color: #14532D;
    color: #86EFAC;
}

.badge-rejected,
.badge-danger {
    background-color: #FEE2E2;
    color: #991B1B;
}

html.dark .badge-rejected,
html.dark .badge-danger {
    background-color: #7F1D1D;
    color: #FCA5A5;
}

/* =========================================
   8. COMPONENT: CALENDAR REPORT
   ========================================= */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.375rem;
}

.calendar-header {
    font-weight: 600;
    text-align: center;
    padding: 0.5rem;
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.calendar-day {
    position: relative;
    min-height: 110px;
    background-color: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
}

.calendar-day.today {
    background-color: var(--color-primary-light);
    border-color: var(--color-primary);
    box-shadow: inset 0 0 0 1px var(--color-primary);
}

html.dark .calendar-day.today {
    background-color: rgba(249, 115, 22, 0.15);
}

.calendar-day:not(.empty):hover {
    background-color: var(--color-bg-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary);
    z-index: 10;
}

.calendar-day.empty {
    background-color: var(--color-bg-base);
    border-color: transparent;
    cursor: default;
}

.rank-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 1rem;
    line-height: 1;
    opacity: 0.8;
}

.day-number {
    font-weight: 700;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
}

.day-content {
    flex-grow: 1;
    font-size: var(--font-size-xs);
}

.day-text {
    font-weight: 600;
    font-size: var(--font-size-sm);
    margin-bottom: 0.25rem;
}

/* Calendar Status Colors */
.calendar-day.status-active .day-text {
    color: var(--color-success);
}

.calendar-day.status-leave .day-text {
    color: var(--color-warning);
}

.calendar-day.status-mixed .day-text {
    color: var(--color-info);
}

.calendar-day.status-off .day-text {
    color: var(--color-text-muted);
}

/* Day List Items */
.day-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.day-content ul li {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.day-content .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.li-active {
    color: var(--color-success);
}

.li-active .dot {
    background: var(--color-success);
}

.li-leave {
    color: var(--color-warning);
}

.li-leave .dot {
    background: var(--color-warning);
}

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

.li-off .dot {
    background: var(--color-text-muted);
}

/* =========================================
   9. COMPONENT: SETTINGS & RANKS
   ========================================= */
.role-permission-group {
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
}

.role-permission-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* Rank Drag & Drop */
.rank-item {
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.rank-item:hover {
    background-color: var(--color-bg-hover);
}

.rank-item.rank-selected {
    background-color: var(--color-primary-light);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary);
}

html.dark .rank-item.rank-selected {
    background-color: rgba(249, 115, 22, 0.15);
}

.rank-item .rank-drag-handle {
    cursor: grab;
    color: var(--color-text-muted);
}

.rank-item .rank-drag-handle:active {
    cursor: grabbing;
}

.rank-item.drag-over {
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px dashed var(--color-success);
}

.rank-color-dot {
    width: 0.875rem;
    height: 0.875rem;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

html.dark .rank-color-dot {
    border-color: rgba(255, 255, 255, 0.2);
}

/* =========================================
   10. UTILITY OVERRIDES (Toastify)
   ========================================= */
.toastify {
    font-family: var(--font-family-base) !important;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 1rem 1.25rem;
    font-size: var(--font-size-sm);
    font-weight: 500;
}

/* =========================================
   11. Effect Animate
   ========================================= */
:root {
    --bg-color: #000;
    /* หรือสีพื้นหลังเดิมของคุณ */
    --grid-color: rgba(255, 255, 255, 0.05);
    /* สีเส้นตาราง */
    --accent-color: #ffffff;
}

/* 1. เอฟเฟคตาราง (Wope-style Grid) */
.grid-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 50px 50px;
    /* ขนาดของตาราง */
    z-index: -1;
    mask-image: radial-gradient(circle at center, black, transparent 80%);
}

/* เอฟเฟคแสงวิ่งตามเมาส์บนตาราง (ความเวอร์) */
.grid-highlight {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(600px circle at var(--x) var(--y), rgba(255, 255, 255, 0.08), transparent 40%);
    z-index: -1;
    pointer-events: none;
}

/* 2. เอฟเฟคปุ่ม (Cobalt-style Button) */
.btn-cobalt {
    position: relative;
    padding: 12px 24px;
    background: #111;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    outline: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.btn-cobalt:hover {
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

/* เส้นแสงวิ่งรอบปุ่มแบบ Cobalt */
.btn-cobalt::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg,
            transparent,
            rgba(255, 255, 255, 0.2),
            transparent);
    transition: all 0.6s ease;
}


.btn-cobalt:hover::before {
    left: 100%;
}

/* Nav Link Fix */
.nav-link-content {
    display: flex;
    align-items: center;
    width: 100%;
}

.nav-link-content>span:last-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =========================================
   15. DARK MODE OVERRIDES: SweetAlert2
   ========================================= */
html.dark .swal2-popup {
    background: #1E293B !important;
    color: #F1F5F9 !important;
    border: 1px solid #334155 !important;
}

html.dark .swal2-title {
    color: #F1F5F9 !important;
}

html.dark .swal2-html-container,
html.dark .swal2-content {
    color: #94A3B8 !important;
}

html.dark .swal2-input,
html.dark .swal2-textarea,
html.dark .swal2-select {
    background: #0F172A !important;
    color: #F1F5F9 !important;
    border-color: #334155 !important;
}

html.dark .swal2-input:focus,
html.dark .swal2-textarea:focus,
html.dark .swal2-select:focus {
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.3) !important;
}

html.dark .swal2-validation-message {
    background: #7F1D1D !important;
    color: #FCA5A5 !important;
}

html.dark .swal2-close {
    color: #94A3B8 !important;
}

html.dark .swal2-close:hover {
    color: #F1F5F9 !important;
}

/* Dark Mode: Select Dropdowns  */
html.dark select.form-input,
html.dark select {
    background-color: #1E293B;
    color: #F1F5F9;
    border-color: #334155;
}

html.dark select.form-input option,
html.dark select option {
    background-color: #1E293B;
    color: #F1F5F9;
}

/* =========================================
   16. MICRO-ANIMATIONS
   ========================================= */
@keyframes bounce-in {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.animate-bounce-in {
    animation: bounce-in 0.3s ease-out forwards;
}

@keyframes slide-up {
    0% {
        transform: translateY(20px);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.animate-slide-up {
    animation: slide-up 0.3s ease-out forwards;
}

/* Staggered animation for cards */
.stagger-animation>* {
    opacity: 0;
    animation: slide-up 0.4s ease-out forwards;
}

.stagger-animation>*:nth-child(1) {
    animation-delay: 0.05s;
}

.stagger-animation>*:nth-child(2) {
    animation-delay: 0.1s;
}

.stagger-animation>*:nth-child(3) {
    animation-delay: 0.15s;
}

.stagger-animation>*:nth-child(4) {
    animation-delay: 0.2s;
}

.stagger-animation>*:nth-child(5) {
    animation-delay: 0.25s;
}

.stagger-animation>*:nth-child(6) {
    animation-delay: 0.3s;
}

.stagger-animation>*:nth-child(7) {
    animation-delay: 0.35s;
}

.stagger-animation>*:nth-child(8) {
    animation-delay: 0.4s;
}

/* =========================================
   17. STAMP ANIMATION (Event Activity)
   ========================================= */
@keyframes stamp-effect {
    0% {
        transform: scale(3) rotate(-15deg);
        opacity: 0;
    }

    50% {
        transform: scale(1.2) rotate(5deg);
        opacity: 1;
    }

    70% {
        transform: scale(0.95) rotate(-2deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes stamp-ripple {
    0% {
        transform: scale(0.5);
        opacity: 0.8;
    }

    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

.stamp-animation {
    animation: stamp-effect 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.stamp-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.stamp-badge {
    width: 180px;
    height: 180px;
    background: linear-gradient(135deg, #10B981, #059669);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 900;
    text-transform: uppercase;
    box-shadow: 0 0 60px rgba(16, 185, 129, 0.6), inset 0 0 20px rgba(255, 255, 255, 0.2);
    border: 4px solid rgba(255, 255, 255, 0.3);
}

.stamp-badge::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: transparent;
    border: 4px dashed rgba(255, 255, 255, 0.3);
    animation: spin 10s linear infinite;
}

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

/* =========================================
   18. DRAG & DROP UPLOAD ZONE
   ========================================= */
.drop-zone {
    position: relative;
    border: 2px dashed var(--color-border, #e2e8f0);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    background: var(--color-bg-secondary, #f8fafc);
    cursor: pointer;
}

html.dark .drop-zone {
    border-color: #334155;
    background: #1e293b;
}

.drop-zone:hover {
    border-color: var(--color-primary);
    background: rgba(13, 148, 136, 0.05);
}

.drop-zone.dragover {
    border-color: var(--color-primary);
    background: rgba(13, 148, 136, 0.1);
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(45, 212, 191, 0.3);
}

.drop-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* =========================================
   Popup Banner Modal (Login Popup)
   ========================================= */
.popup-banner-modal {
    max-width: 85vw !important;
    max-height: 85vh !important;
}

.popup-banner-modal .swal2-image {
    max-width: 100%;
    max-height: calc(85vh - 120px);
    width: auto;
    height: auto;
    object-fit: contain;
    margin: 0 auto;
}

/* =========================================
   19. LOGIN PAGE & VISUAL EFFECTS
   (Moved from index.php inline <style>)
   ========================================= */

/* --- Login Background System --- */
.login-bg-wrapper {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.bg-image-layer {
    position: absolute;
    inset: 0;
    background-image: url('../../img/bg.png');
    background-size: cover;
    background-position: center;
    filter: brightness(0.25) blur(2px);
}

.grid-base {
    position: absolute;
    inset: 0;
    background-size: 60px 60px;
    background-image: linear-gradient(to right, var(--color-grid-line) 1px, transparent 1px), linear-gradient(to bottom, var(--color-grid-line) 1px, transparent 1px);
    mask-image: radial-gradient(ellipse at center, black 50%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 50%, transparent 100%);
    pointer-events: none;
}

.login-bg-wrapper .grid-highlight {
    position: absolute;
    inset: 0;
    background-size: 60px 60px;
    background-image: linear-gradient(to right, var(--color-grid-highlight) 1px, transparent 1px), linear-gradient(to bottom, var(--color-grid-highlight) 1px, transparent 1px);
    mask-image: radial-gradient(400px circle at var(--mouse-x) var(--mouse-y), black, transparent);
    -webkit-mask-image: radial-gradient(400px circle at var(--mouse-x) var(--mouse-y), black, transparent);
    opacity: 1;
    transition: opacity 0.3s ease;
    pointer-events: none;
    mix-blend-mode: screen;
}

/* Login Floating Circles */
.login-floating-circle {
    position: absolute;
    border-radius: 50%;
    border: 1px solid var(--color-circle-border);
    pointer-events: none;
    animation: float-circle 20s ease-in-out infinite;
}

.login-floating-circle::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle, var(--color-circle-fill) 0%, transparent 70%);
}

.login-circle-1 {
    width: 300px;
    height: 300px;
    top: 10%;
    left: -5%;
    animation-delay: 0s;
}

.login-circle-2 {
    width: 200px;
    height: 200px;
    bottom: 15%;
    right: -3%;
    animation-delay: -7s;
}

.login-circle-3 {
    width: 150px;
    height: 150px;
    top: 50%;
    left: 70%;
    animation-delay: -14s;
}

.login-circle-4 {
    width: 100px;
    height: 100px;
    top: 20%;
    right: 15%;
    animation-delay: -10s;
    border-color: var(--color-circle-alt-border);
}

@keyframes float-circle {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.7;
    }

    25% {
        transform: translate(20px, -30px) scale(1.05);
        opacity: 0.9;
    }

    50% {
        transform: translate(-15px, 20px) scale(0.95);
        opacity: 0.6;
    }

    75% {
        transform: translate(10px, 10px) scale(1.02);
        opacity: 0.8;
    }
}

/* Login Mouse Glow Orb */
.login-mouse-glow {
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--color-mouse-glow) 0%, transparent 50%);
    pointer-events: none;
    transform: translate(-50%, -50%);
    filter: blur(40px);
    opacity: 0.8;
    transition: left 0.15s ease-out, top 0.15s ease-out;
}

/* --- Login Glass Card --- */
.cobalt-card {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2), 0 20px 50px rgba(0, 0, 0, 0.5);
}

.cobalt-input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    transition: all 0.3s ease;
}

.cobalt-input:focus {
    border-color: var(--color-input-focus);
    box-shadow: 0 0 0 4px var(--color-input-focus-ring);
    background: rgba(0, 0, 0, 0.5);
}

/* --- Wope-Style Login Button --- */
.wope-btn {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 9999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    padding: 1px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 5px 15px -5px rgba(0, 0, 0, 0.5);
}

.wope-btn:hover {
    transform: translateY(-1px);
}

.wope-btn:active {
    transform: translateY(1px);
}

/* Moving Light Beam */
.wope-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300%;
    height: 300%;
    background: conic-gradient(from 0deg, transparent 0 300deg, var(--btn-color) 360deg);
    animation: wope-spin 2.5s linear infinite;
    transform: translate(-50%, -50%);
    z-index: 0;
    filter: blur(8px);
    opacity: 0.8;
}

/* Sharp Beam Layer */
.wope-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300%;
    height: 300%;
    background: conic-gradient(from 0deg, transparent 0 340deg, #fff 360deg);
    animation: wope-spin 2.5s linear infinite;
    transform: translate(-50%, -50%);
    z-index: 0;
    opacity: 0.7;
    mix-blend-mode: overlay;
}

@keyframes wope-spin {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Wope Button Content */
.wope-btn-content {
    position: relative;
    z-index: 1;
    background-color: #050505;
    color: white;
    width: 100%;
    height: 100%;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 0.75rem;
    transition: background-color 0.2s;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.wope-btn:hover .wope-btn-content {
    background-color: #0f0f0f;
}

/* Wope Button Variants */
.wope-btn-primary {
    --btn-color: var(--color-btn-primary-glow);
}

.wope-btn-discord {
    --btn-color: #7289da;
}

/* Heartbeat Icon */
.heartbeat-icon polyline {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: dash 2s linear infinite;
}

@keyframes dash {
    0% {
        stroke-dashoffset: 100;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    80% {
        stroke-dashoffset: 0;
        opacity: 1;
    }

    100% {
        stroke-dashoffset: -100;
        opacity: 0;
    }
}

/* Version Link */
.version-link:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

/* Maintenance SVG icon */
.maintenance-icon {
    color: var(--color-primary);
}

/* ====== ANIMATED GRID BACKGROUND ====== */
.animated-grid-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.grid-lines {
    position: absolute;
    inset: 0;
    background-size: 60px 60px;
    background-image:
        linear-gradient(to right, var(--color-grid-line-strong) 1px, transparent 1px),
        linear-gradient(to bottom, var(--color-grid-line-strong) 1px, transparent 1px);
    mask-image: radial-gradient(ellipse 100% 100% at 50% 50%, black 50%, transparent 95%);
    -webkit-mask-image: radial-gradient(ellipse 100% 100% at 50% 50%, black 50%, transparent 95%);
}

.grid-glow {
    position: absolute;
    inset: 0;
    background-size: 60px 60px;
    background-image:
        linear-gradient(to right, var(--color-grid-glow) 1px, transparent 1px),
        linear-gradient(to bottom, var(--color-grid-glow) 1px, transparent 1px);
    mask-image: radial-gradient(350px circle at var(--glow-x, 50%) var(--glow-y, 50%), black, transparent);
    -webkit-mask-image: radial-gradient(350px circle at var(--glow-x, 50%) var(--glow-y, 50%), black, transparent);
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Ambient Glow Orbs */
.ambient-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.35;
    animation: float-glow 12s ease-in-out infinite;
}

.ambient-glow-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--color-ambient-1) 0%, transparent 60%);
    top: 5%;
    left: 5%;
    animation-delay: 0s;
}

.ambient-glow-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--color-ambient-2) 0%, transparent 60%);
    bottom: 10%;
    right: 10%;
    animation-delay: -4s;
}

.ambient-glow-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--color-ambient-3) 0%, transparent 60%);
    top: 40%;
    right: 25%;
    animation-delay: -8s;
}

@keyframes float-glow {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.35;
    }

    33% {
        transform: translate(40px, -30px) scale(1.15);
        opacity: 0.45;
    }

    66% {
        transform: translate(-30px, 30px) scale(0.9);
        opacity: 0.3;
    }
}

/* ====== FLOATING PARTICLES (Ambient Drift) ====== */
.particles-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--color-particle);
    border-radius: 50%;
    box-shadow: 0 0 4px var(--color-particle-shadow);
    opacity: 0;
}

.particle.drift-1 {
    animation: drift-a 25s ease-in-out infinite;
}

.particle.drift-2 {
    animation: drift-b 30s ease-in-out infinite;
}

.particle.drift-3 {
    animation: drift-c 28s ease-in-out infinite;
}

@keyframes drift-a {
    0% {
        transform: translate(0, 0);
        opacity: 0;
    }

    10% {
        opacity: 0.4;
    }

    50% {
        transform: translate(30px, -40px);
        opacity: 0.25;
    }

    90% {
        opacity: 0.35;
    }

    100% {
        transform: translate(-20px, -80px);
        opacity: 0;
    }
}

@keyframes drift-b {
    0% {
        transform: translate(0, 0);
        opacity: 0;
    }

    15% {
        opacity: 0.3;
    }

    50% {
        transform: translate(-25px, -50px);
        opacity: 0.2;
    }

    85% {
        opacity: 0.3;
    }

    100% {
        transform: translate(15px, -90px);
        opacity: 0;
    }
}

@keyframes drift-c {
    0% {
        transform: translate(0, 0);
        opacity: 0;
    }

    12% {
        opacity: 0.35;
    }

    50% {
        transform: translate(20px, -60px);
        opacity: 0.15;
    }

    88% {
        opacity: 0.25;
    }

    100% {
        transform: translate(-10px, -70px);
        opacity: 0;
    }
}

/* Light mode - reduce effects */
html:not(.dark) .animated-grid-bg {
    opacity: 0.5;
}

html:not(.dark) .ambient-glow {
    opacity: 0.12;
}

html:not(.dark) .particle {
    box-shadow: 0 0 4px var(--color-particle-shadow);
}

/* ====== EFFECTS OFF MODE ====== */
html.effects-off .animated-grid-bg,
html.effects-off .particles-container {
    display: none !important;
}

html.effects-off .glow-card::before,
html.effects-off .glow-border-card::before {
    display: none !important;
}

html.effects-off .glow-card,
html.effects-off .glow-border-card {
    box-shadow: none !important;
}

/* Disable glassmorphism glow borders */
html.effects-off.dark .glass-card,
html.effects-off.dark .glass-panel,
html.effects-off.dark .bg-white.rounded-2xl:not(.settings-dropdown),
html.effects-off.dark .bg-white.rounded-xl:not(.settings-dropdown),
html.effects-off.dark .dark\:bg-slate-800.rounded-2xl:not(.settings-dropdown),
html.effects-off.dark .dark\:bg-slate-800.rounded-xl:not(.settings-dropdown) {
    border-color: rgba(255, 255, 255, 0.06) !important;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

html.effects-off.dark .glass-card:hover,
html.effects-off.dark .glass-panel:hover,
html.effects-off.dark .bg-white.rounded-2xl:hover:not(.settings-dropdown),
html.effects-off.dark .bg-white.rounded-xl:hover:not(.settings-dropdown) {
    border-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

/* Clean dark background when effects are off */
html.effects-off.dark body {
    background: #111827 !important;
}

html.effects-off.dark .glass-header {
    background: rgba(17, 24, 39, 0.95) !important;
    backdrop-filter: none !important;
}

html.effects-off.dark .glass-sidebar {
    background: #111827 !important;
    backdrop-filter: none !important;
}

html.effects-off.dark .glass-footer {
    background: rgba(17, 24, 39, 0.95) !important;
    backdrop-filter: none !important;
}