/* static/css/theme.css */

/* -- Layout -- */
.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    background-color: var(--body-bg);
}

/* -- Sidebar -- */
.sidebar {
    width: var(--sidebar-width, 270px);
    min-width: var(--sidebar-width, 270px);
    max-width: var(--sidebar-width, 270px);
    height: 100vh;
    max-height: 100vh;
    background-color: var(--body-bg) !important;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s ease;
    z-index: 100;
    flex-shrink: 0;
    overflow: hidden;
}

/* -- Brand Logo Header -- */
.sidebar-header {
    height: 68px;
    min-height: 68px;
    background-color: var(--body-bg) !important;
    display: flex;
    align-items: center;
    padding: 0 18px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.brand-wrapper:hover {
    opacity: 0.92;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--gradient-start, #667eea) 0%, var(--gradient-end, #764ba2) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 6px 14px rgba(102, 126, 234, 0.35);
    flex-shrink: 0;
}

.brand-icon .material-symbols-outlined {
    font-size: 20px;
    font-variation-settings: 'FILL' 1, 'wght' 700;
    color: #ffffff;
    line-height: 1;
}

.brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.brand-title {
    font-weight: 900;
    font-size: 1.02rem;
    line-height: 1.1;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, var(--gradient-start, #667eea) 0%, var(--gradient-end, #764ba2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    white-space: nowrap;
}

.brand-accent-text {
    background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
}

.brand-subtitle {
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-secondary);
    white-space: nowrap;
    margin-top: 2px;
    line-height: 1;
}

/* -- Sidebar Navigation & Section Titles -- */
.sidebar-nav {
    flex: 1;
    padding: 10px 12px 28px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}
.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.2);
    border-radius: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

.nav-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #475569;
    padding: 16px 12px 6px;
    font-weight: 800;
    user-select: none;
}

[data-theme="dark"] .nav-section-title {
    color: #94a3b8;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    color: #1e293b;
    font-size: 0.90rem;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    white-space: nowrap;
    text-decoration: none;
    line-height: 1;
    box-sizing: border-box;
    width: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

[data-theme="dark"] .nav-item {
    color: #cbd5e1;
}

.nav-link-main {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    height: 100%;
    color: inherit;
    text-decoration: none;
    min-width: 0;
}

/* Leading Icon Squircle */
.nav-item > .material-symbols-outlined:first-child,
.nav-link-main > .material-symbols-outlined:first-child {
    width: 32px;
    height: 32px;
    min-width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 9px;
    font-size: 18px;
    color: #475569;
    box-shadow: none;
    margin-right: 0;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

[data-theme="dark"] .nav-item > .material-symbols-outlined:first-child,
[data-theme="dark"] .nav-link-main > .material-symbols-outlined:first-child {
    background: #1e1e2e;
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: none;
}

.nav-item:hover {
    background: rgba(99, 102, 241, 0.08);
    color: #0f172a;
}

[data-theme="dark"] .nav-item:hover {
    background: rgba(124, 58, 237, 0.2);
    color: #ffffff;
}

.nav-item:hover > .material-symbols-outlined:first-child,
.nav-item:hover .nav-link-main > .material-symbols-outlined:first-child {
    background: #ffffff;
    color: #4f46e5;
    transform: scale(1.1) rotate(-2deg);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] .nav-item:hover > .material-symbols-outlined:first-child,
[data-theme="dark"] .nav-item:hover .nav-link-main > .material-symbols-outlined:first-child {
    background: #1e1e2e;
    color: #a855f7;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.nav-item.active {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
    color: #ffffff !important;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(79, 70, 229, 0.35) !important;
}

.nav-item.active > .material-symbols-outlined:first-child,
.nav-item.active .nav-link-main > .material-symbols-outlined:first-child {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.25) !important;
    transform: none !important;
    box-shadow: none !important;
    font-variation-settings: 'FILL' 1, 'wght' 700;
}

/* Right Dropdown Chevron */
.sidebar-dropdown-arrow,
#sidebarSpacesArrow,
#sidebarProjectsArrow {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    max-width: 24px !important;
    background: transparent !important;
    border-radius: 6px !important;
    font-size: 18px !important;
    color: #64748b !important;
    box-shadow: none !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease, color 0.2s ease, background-color 0.2s ease;
    padding: 0 !important;
    margin-left: auto;
    flex-shrink: 0;
}

[data-theme="dark"] .sidebar-dropdown-arrow,
[data-theme="dark"] #sidebarSpacesArrow,
[data-theme="dark"] #sidebarProjectsArrow {
    color: #94a3b8 !important;
}

.sidebar-dropdown-arrow:hover,
#sidebarSpacesArrow:hover,
#sidebarProjectsArrow:hover {
    background: rgba(100, 116, 139, 0.15) !important;
    color: #0f172a !important;
}

[data-theme="dark"] .sidebar-dropdown-arrow:hover,
[data-theme="dark"] #sidebarSpacesArrow:hover,
[data-theme="dark"] #sidebarProjectsArrow:hover {
    color: #ffffff !important;
}

.nav-item.active .sidebar-dropdown-arrow,
.nav-item.active #sidebarSpacesArrow,
.nav-item.active #sidebarProjectsArrow {
    color: #ffffff !important;
}

/* -- Sidebar Submenu & Accordion Dropdown -- */
.sidebar-dropdown-group {
    display: flex;
    flex-direction: column !important;
    width: 100% !important;
    margin-bottom: 2px;
}

.sidebar-submenu {
    display: none;
    padding-left: 14px;
    padding-right: 4px;
    margin-top: 2px;
    margin-bottom: 4px;
    flex-direction: column !important;
    gap: 2px;
    width: 100% !important;
    box-sizing: border-box;
    max-height: 220px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.4) transparent;
}

.sidebar-submenu::-webkit-scrollbar {
    width: 4px;
}

.sidebar-submenu::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-submenu::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 4px;
}

.sidebar-submenu::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.7);
}

[data-theme="dark"] .sidebar-submenu {
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

[data-theme="dark"] .sidebar-submenu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .sidebar-submenu::-webkit-scrollbar-thumb:hover {
    background: rgba(129, 140, 248, 0.7);
}

.sidebar-submenu.open {
    display: flex !important;
}

.submenu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    border-radius: 8px;
    color: #334155;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    cursor: pointer;
    flex-shrink: 0;
}

[data-theme="dark"] .submenu-item {
    color: #cbd5e1;
}

.submenu-item .material-symbols-outlined {
    font-size: 16px;
    margin-right: 6px;
}

.submenu-arrow {
    font-size: 16px;
    transition: transform 0.2s ease;
    color: var(--text-secondary);
}

.submenu-arrow.rotated {
    transform: rotate(90deg);
}

.nested-submenu {
    display: none;
    padding-left: 10px;
    padding-right: 2px;
    margin-top: 2px;
    flex-direction: column;
    gap: 2px;
    border-left: 1px dashed var(--border-color, rgba(226, 232, 240, 0.2));
    margin-left: 8px;
    max-height: 180px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.4) transparent;
}

.nested-submenu::-webkit-scrollbar {
    width: 3px;
}

.nested-submenu::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 3px;
}

.nested-submenu.open {
    display: flex;
}


/* -- Main Content -- */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
    background-color: var(--body-bg);
}

.topbar {
    height: 58px;
    min-height: 58px;
    background-color: var(--body-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 40;
    flex-shrink: 0;
}

[data-theme="dark"] .topbar {
    background-color: var(--body-bg);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background-color: var(--border-color);
    color: var(--text-primary);
}

.content-wrapper {
    padding: 16px 28px;
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
    flex: 1;
}

/* ── App Footer ── */
.app-footer {
    margin-top: auto;
    padding: 14px 28px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* -- Cards -- */
.card {
    background-color: var(--bg-secondary);
    border-radius: 16px;
    padding: 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease, border-color 0.4s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-primary-hover);
}

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

/* -- Auth Layout -- */
.auth-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    background: var(--bg-primary, #f8fafc);
    overflow-x: hidden;
}

.auth-left {
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    position: relative;
    z-index: 10;
    width: 100%;
    box-sizing: border-box;
}

.auth-right {
    flex: 1.15;
    background: var(--accent-gradient, linear-gradient(135deg, #6366f1 0%, #4f46e5 100%));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    padding: 60px 48px;
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    box-sizing: border-box;
}

.auth-card {
    background: var(--bg-secondary, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 20px;
    padding: 44px 38px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.07), 0 0 1px 1px rgba(0, 0, 0, 0.02);
    position: relative;
    z-index: 10;
    box-sizing: border-box;
    margin: auto 0;
}

@media (max-width: 992px) {
    .auth-container {
        flex-direction: column;
    }
    .auth-right {
        display: none !important;
    }
    .auth-left {
        padding: 32px 20px;
        min-height: 100vh;
        justify-content: center;
    }
    .auth-card {
        padding: 32px 24px !important;
        max-width: 440px !important;
        border-radius: 16px !important;
    }
}

@media (max-width: 480px) {
    .auth-left {
        padding: 20px 12px;
    }
    .auth-card {
        padding: 24px 18px !important;
        border-radius: 14px !important;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important;
    }
}

/* -- Forms & Inputs -- */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.88rem;
    line-height: 1.4;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

select.form-input,
select {
    padding-top: 6px !important;
    padding-bottom: 6px !important;
    padding-left: 12px !important;
    padding-right: 30px !important;
    height: 38px !important;
    line-height: 1.3 !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
    color: #ffffff !important;
    padding: 8px 16px;
    border-radius: 9px;
    font-weight: 700;
    font-size: 0.88rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    border: none !important;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
    filter: brightness(1.08);
}

#statusDependencyConfirm:disabled,
#statusDependencyConfirm:disabled:hover {
    opacity: 0.45 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    transform: none !important;
    filter: none !important;
    box-shadow: none !important;
}

.btn-secondary {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background-color 0.3s ease, transform 0.3s ease;
    border: 1px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: var(--border-color);
    transform: translateY(-2px);
}
}

/* -- Utilities -- */
.text-center {
    text-align: center;
}

.mb-2 {
    margin-bottom: 8px;
}

.mb-4 {
    margin-bottom: 16px;
}

.mb-6 {
    margin-bottom: 24px;
}

.mb-8 {
    margin-bottom: 32px;
}

.mt-4 {
    margin-top: 16px;
}

.text-gradient {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* -- Global Modal Scroll (applies to every page) -- */
.modal-overlay {
    overflow-y: auto !important;
    align-items: flex-start !important;
    padding: 40px 16px !important;
}

.modal-content {
    max-height: 90vh;
    overflow-y: auto;
    margin: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary, #6366f1) transparent;
}


/* -- Global Custom Scrollbars -- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--bg-primary);
}

.modal-content::-webkit-scrollbar-track,
.kanban-cards::-webkit-scrollbar-track,
.kanban-board::-webkit-scrollbar-track {
    background: transparent;
}


/* -- Responsive -- */
.mobile-only {
    display: none !important;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

@media (max-width: 768px) {
    .mobile-only {
        display: inline-flex !important;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        transform: translateX(-100%);
        z-index: 100;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .topbar {
        padding: 0 16px;
    }


    .content-wrapper {
        padding: 16px;
    }

    .topbar-actions {
        gap: 8px;
    }

    .view-switcher,
    .task-toolbar {
        flex-wrap: wrap;
    }

    .view-switcher {
        justify-content: space-between;
    }

    .sidebar-overlay.open {
        opacity: 1;
        pointer-events: auto;
    }

    /* Global Modal and Form responsiveness */
    .modal-content {
        padding: 20px 16px !important;
        width: 95% !important;
    }

    .form-row {
        flex-direction: column !important;
        gap: 12px !important;
        margin-bottom: 12px !important;
    }

    .form-row>.form-group {
        width: 100% !important;
    }

    /* Clean up Filter Toolbars */
    .project-filters {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

    .project-filters>button,
    .project-filters>select,
    .project-filters>div {
        width: 100% !important;
        margin-left: 0 !important;
    }

    .view-switcher>div {
        margin-left: 0 !important;
        width: 100%;
        justify-content: flex-start;
    }
}

/* ===== PREMIUM PAGE LOADER (matching http://localhost:8000/) ===== */
.global-loader,
.premium-loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-primary, #0b0f19);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.premium-loader {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.premium-loader::before,
.premium-loader::after {
    content: '';
    position: absolute;
    border-radius: 50%;
}

.premium-loader::before {
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    box-sizing: border-box;
    border: 3px solid transparent;
    border-top-color: var(--accent-primary, #6366f1);
    border-bottom-color: #3b82f6;
    animation: spin-glow 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    z-index: 2;
}

.premium-loader::after {
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
    background: linear-gradient(135deg, var(--accent-primary, #6366f1), #a855f7);
    filter: blur(12px);
    animation: pulse-glow 2s ease-in-out infinite alternate;
    z-index: 1;
}

.premium-loader-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bounce-icon 2s ease-in-out infinite;
    z-index: 3;
    pointer-events: none;
    user-select: none;
}

.loader-text,
.premium-loader-text {
    margin-top: 24px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 4px;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--accent-primary, #6366f1), #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: pulse-opacity 1.5s ease-in-out infinite;
    text-align: center;
}

@keyframes spin-glow {
    0% {
        transform: rotate(0deg);
        box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(59, 130, 246, 0.4);
    }
    100% {
        transform: rotate(360deg);
        box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
    }
}

@keyframes pulse-glow {
    0% {
        transform: scale(0.8);
        opacity: 0.3;
    }
    100% {
        transform: scale(1.3);
        opacity: 0.7;
    }
}

@keyframes bounce-icon {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.15);
    }
}

@keyframes pulse-opacity {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

.bug-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 12px;
}

@media (max-width: 768px) {
    .bug-details-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .bug-details-header .modal-header-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

/* -- Flatpickr Calendar Styling (Compact & Dark Mode) -- */
.flatpickr-calendar {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4) !important;
    color: var(--text-primary) !important;
    width: 280px !important;
    padding: 8px !important;
}

.flatpickr-months {
    align-items: center !important;
}

.flatpickr-months .flatpickr-month {
    background: transparent !important;
    color: var(--text-primary) !important;
    fill: var(--text-primary) !important;
    height: 34px !important;
}

.flatpickr-current-month {
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    padding-top: 4px !important;
    color: var(--text-primary) !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    font-weight: 600 !important;
    padding: 2px 4px !important;
    border-radius: 6px !original;
}

.flatpickr-current-month input.cur-year {
    color: var(--text-primary) !important;
    font-weight: 700 !important;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    fill: var(--text-secondary) !important;
    color: var(--text-secondary) !important;
    padding: 6px !important;
}

.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
    fill: var(--accent-primary) !important;
    color: var(--accent-primary) !important;
}

span.flatpickr-weekday {
    color: var(--text-secondary) !important;
    font-weight: 600 !important;
    font-size: 0.75rem !important;
}

.dayContainer {
    width: 264px !important;
    min-width: 264px !important;
    max-width: 264px !important;
}

.flatpickr-days {
    width: 264px !important;
}

.flatpickr-day {
    color: var(--text-primary) !important;
    border-radius: 8px !important;
    max-width: 34px !important;
    height: 34px !important;
    line-height: 34px !important;
    font-size: 0.82rem !important;
    font-weight: 500 !important;
    margin: 2px 1.5px !important;
}

.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: var(--text-secondary) !important;
    opacity: 0.35 !important;
}

.flatpickr-day:hover {
    background: rgba(99, 102, 241, 0.15) !important;
    color: var(--accent-primary) !important;
    border-color: transparent !important;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    color: #ffffff !important;
    border-color: transparent !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4) !important;
}

/* -- Global Responsive Layout Rules -- */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-only {
    display: none !important;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    border-radius: 8px;
}

@media (max-width: 1024px) {
    .mobile-only {
        display: inline-flex !important;
    }

    .app-container {
        position: relative;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        z-index: 999;
        transform: translateX(-100%);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        width: 100%;
    }

    .topbar {
        padding: 0 12px;
        height: 54px;
    }

    .topbar-actions {
        gap: 6px;
    }

    .topbar-actions .icon-btn {
        padding: 6px;
    }

    /* Modal responsiveness & centering */
    .modal-backdrop.show,
    .modal-overlay:not(#taskModal).show,
    .modal-backdrop.open,
    .modal-overlay:not(#taskModal).open,
    .modal-backdrop[style*="display: flex"],
    .modal-overlay:not(#taskModal)[style*="display: flex"],
    .modal-backdrop[style*="display: block"]:not(#taskModal),
    .modal-overlay:not(#taskModal)[style*="display: block"] {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 16px 8px !important;
        overflow-y: auto !important;
    }

    .modal-overlay:not(#taskModal) .modal-content,
    .modal-card,
    .premium-modal {
        width: 96% !important;
        max-width: 440px !important;
        margin: auto !important;
        max-height: 82vh !important;
        border-radius: 14px !important;
        overflow-y: auto !important;
        padding: 18px 16px !important;
    }
}

@media (max-width: 768px) {
    .flex-wrap-mobile {
        flex-wrap: wrap !important;
    }

    .grid-responsive-3,
    .grid-responsive-2,
    .grid-responsive-sidebar {
        grid-template-columns: 1fr !important;
        display: flex !important;
        flex-direction: column !important;
    }

    #topNotifDropdown {
        position: fixed !important;
        top: 58px !important;
        left: 16px !important;
        right: 16px !important;
        width: auto !important;
        max-width: none !important;
        box-shadow: 0 16px 36px rgba(0, 0, 0, 0.3) !important;
        z-index: 2500 !important;
    }

    .content-wrapper {
        padding: 12px 16px !important;
    }

    .kanban-board {
        display: flex !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: 12px !important;
        gap: 12px !important;
    }

    .kanban-column {
        min-width: 280px !important;
        flex-shrink: 0 !important;
    }
}

.view-switcher-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 768px) {
    .view-switcher {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

    .view-switcher-buttons {
        display: flex !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        gap: 6px !important;
        width: 100% !important;
        padding-bottom: 4px !important;
    }

    .view-switcher .view-btn {
        flex-shrink: 0 !important;
        white-space: nowrap !important;
        padding: 6px 14px !important;
        font-size: 0.8rem !important;
    }

    .task-filters-wrap {
        width: 100% !important;
        margin-left: 0 !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
        margin-top: 4px !important;
    }

    .task-filters-wrap>div {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 4px !important;
    }

    .task-filters-wrap label {
        font-size: 0.72rem !important;
        font-weight: 700 !important;
        text-transform: uppercase !important;
    }

    .task-filters-wrap .form-input,
    .task-filters-wrap .filter-select-native,
    .task-filters-wrap .filter-tom-wrap {
        width: 100% !important;
        max-width: none !important;
        padding: 8px 10px !important;
        font-size: 0.82rem !important;
    }

    .task-filters-wrap .btn-primary {
        grid-column: 1 / -1 !important;
        width: 100% !important;
        justify-content: center !important;
        margin-top: 4px !important;
    }

    .task-toolbar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
        padding: 10px 12px !important;
    }

    .task-toolbar>div[style*="width: 1px"] {
        display: none !important;
    }

    .task-toolbar .filter-group {
        display: flex !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: 4px !important;
        gap: 6px !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
    }

    .task-toolbar .filter-chip {
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        padding: 5px 12px !important;
        font-size: 0.78rem !important;
    }

    @media (max-width: 768px) {
        .task-list-card {
            flex-direction: column !important;
            align-items: stretch !important;
            gap: 10px !important;
            padding: 12px 14px !important;
        }

        .task-list-card>div:first-child {
            flex-direction: column !important;
            align-items: flex-start !important;
            gap: 6px !important;
        }

        .task-list-actions-bar {
            display: flex !important;
            flex-direction: row !important;
            flex-wrap: wrap !important;
            align-items: center !important;
            justify-content: space-between !important;
            width: 100% !important;
            border-top: 1px dashed var(--border-color) !important;
            padding-top: 8px !important;
            gap: 8px !important;
        }
    }

    /* ── Global Table View Responsiveness ── */
    .table-responsive {
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        border-radius: 12px;
        border: 1px solid var(--border-color);
        background: var(--bg-secondary);
    }

    .task-table {
        width: 100% !important;
        min-width: 980px !important;
        border-collapse: collapse;
    }

    .task-table th,
    .task-table td {
        padding: 12px 14px;
        border-bottom: 1px solid var(--border-color);
        font-size: 0.85rem;
        vertical-align: middle;
    }

    .task-table th {
        background: var(--bg-primary);
        font-weight: 700;
        text-transform: uppercase;
        font-size: 0.72rem;
        letter-spacing: 0.5px;
        color: var(--text-secondary);
    }

    .task-table tbody tr {
        transition: background 0.15s ease;
        cursor: pointer;
    }

    .task-table tbody tr:hover {
        background: var(--bg-primary);
    }

    /* ── FullCalendar Responsiveness ── */
    #calendar-container {
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: 16px;
        padding: 16px;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .fc {
        width: 100%;
        min-width: 0;
    }

    .fc-header-toolbar {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 10px !important;
        align-items: center !important;
        justify-content: space-between !important;
        margin-bottom: 16px !important;
    }

    @media (max-width: 768px) {
        #calendar-container {
            padding: 10px 6px !important;
        }

        .fc-header-toolbar {
            flex-direction: column !important;
            align-items: stretch !important;
            gap: 12px !important;
        }

        .fc-toolbar-chunk {
            display: flex !important;
            align-items: center !important;
            justify-content: space-between !important;
            width: 100% !important;
        }

        .fc-toolbar-chunk:nth-child(1) {
            order: 2 !important;
            justify-content: space-between !important;
        }

        .fc-toolbar-chunk:nth-child(2) {
            order: 1 !important;
            justify-content: center !important;
        }

        .fc-toolbar-chunk:nth-child(3) {
            order: 3 !important;
            justify-content: center !important;
        }

        .fc-button-group {
            display: flex !important;
            width: 100% !important;
            justify-content: space-between !important;
            gap: 6px !important;
        }

        .fc-button-group>.fc-button {
            flex: 1 !important;
            border-radius: 8px !important;
            margin: 0 !important;
            text-align: center !important;
        }

        .fc-toolbar-title {
            font-size: 1.15rem !important;
            font-weight: 700 !important;
            text-align: center !important;
            width: 100% !important;
        }

        .fc .fc-button {
            padding: 5px 10px !important;
            font-size: 0.76rem !important;
        }

        .fc .fc-daygrid-day-number {
            font-size: 0.75rem !important;
            padding: 2px 4px !important;
        }
    }

    .task-modal-grid {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 290px !important;
        gap: 18px !important;
        align-items: start !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .task-modal-grid>div {
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .task-sidebar-sticky {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    @media (min-width: 1440px) {
        .task-modal-grid {
            grid-template-columns: minmax(0, 1fr) 320px !important;
            gap: 24px !important;
        }
    }

    @media (max-width: 1150px) {
        .task-modal-grid {
            grid-template-columns: 1fr !important;
            display: flex !important;
            flex-direction: column !important;
            gap: 16px !important;
        }

        #taskModal .modal-content {
            width: 100% !important;
            max-width: 100% !important;
            padding: 16px 18px !important;
            border-radius: 8px !important;
        }

        .modal-header-actions {
            width: 100% !important;
            justify-content: flex-end !important;
            gap: 6px !important;
            margin-top: 8px !important;
        }

        .modal-header-actions button {
            padding: 5px 10px !important;
            font-size: 0.76rem !important;
        }
    }

    /* ── Global Quill Mention & Dark Mode Support ── */
    .ql-mention-list-container {
        background-color: var(--card-bg, var(--bg-secondary, #111827)) !important;
        border: 1px solid var(--border-color, #374151) !important;
        border-radius: 10px !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
        z-index: 999999 !important;
        overflow: hidden !important;
        min-width: 200px !important;
        max-width: 320px !important;
        padding: 6px !important;
    }

    .ql-mention-list {
        list-style: none !important;
        margin: 0 !important;
        padding: 0 !important;
        max-height: 220px !important;
        overflow-y: auto !important;
    }

    .ql-mention-list-item {
        cursor: pointer !important;
        font-size: 0.85rem !important;
        font-weight: 500 !important;
        padding: 8px 12px !important;
        color: var(--text-primary, #f9fafb) !important;
        border-radius: 6px !important;
        transition: all 0.15s ease !important;
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        line-height: 1.4 !important;
    }

    .ql-mention-list-item:hover,
    .ql-mention-list-item.selected {
        background: rgba(99, 102, 241, 0.25) !important;
        color: var(--accent-primary, #818cf8) !important;
        font-weight: 600 !important;
    }

    [data-theme="dark"] .ql-mention-list-container {
        background-color: #111827 !important;
        border-color: #374151 !important;
    }

    [data-theme="dark"] .ql-mention-list-item {
        color: #f3f4f6 !important;
    }

    [data-theme="dark"] .ql-mention-list-item:hover,
    [data-theme="dark"] .ql-mention-list-item.selected {
        background: rgba(99, 102, 241, 0.35) !important;
        color: #a5b4fc !important;
    }

    .mention,
    span.mention,
    .ql-editor .mention,
    .rich-text-comment .mention,
    span[data-denotation-char] {
        background: rgba(99, 102, 241, 0.18) !important;
        color: var(--accent-primary, #6366f1) !important;
        padding: 2px 8px !important;
        border-radius: 6px !important;
        font-weight: 600 !important;
        font-size: 0.88em !important;
        display: inline-flex !important;
        align-items: center !important;
        border: 1px solid rgba(99, 102, 241, 0.35) !important;
        margin: 0 2px !important;
        user-select: none !important;
        width: auto !important;
        max-width: 100% !important;
        height: auto !important;
        float: none !important;
        white-space: nowrap !important;
        vertical-align: middle !important;
        line-height: normal !important;
        box-sizing: border-box !important;
    }

    .mention *,
    span.mention *,
    .ql-editor .mention *,
    .rich-text-comment .mention * {
        white-space: nowrap !important;
        width: auto !important;
        height: auto !important;
        float: none !important;
        display: inline !important;
    }

    [data-theme="dark"] .mention,
    [data-theme="dark"] span.mention,
    [data-theme="dark"] .ql-editor .mention,
    [data-theme="dark"] .rich-text-comment .mention,
    [data-theme="dark"] span[data-denotation-char] {
        background: rgba(99, 102, 241, 0.25) !important;
        color: #a5b4fc !important;
        border-color: rgba(99, 102, 241, 0.45) !important;
    }