@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Outfit:wght@300;400;600;700;800&display=swap');

:root {
    --bg-color: #fdfaf6;
    --sidebar-bg: #f5f1ea;
    --card-bg: #ffffff;
    --text-main: #2d3436;
    --text-main-rgb: 45, 52, 54;
    --text-muted: #636e72;
    --accent: #8da47e;
    --accent-rgb: 141, 164, 126;
    --accent-hover: #7a916c;
    --text-on-accent: #ffffff;
    --success: #10b981;
    --success-rgb: 16, 185, 129;
    --border-color: #e2e8f0;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.8);
    --danger-color: #e74c3c;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --ease-elastic: cubic-bezier(0.68, -0.6, 0.32, 1.6);
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}



/* --- NEW PREMIUM LOGIN SCREEN --- */
/* ==========================================================================
   Modernized Login Screen - Split Showcase & Glassmorphic Auth
   ========================================================================== */
#login-screen {
    position: fixed;
    inset: 0;
    background: #090d16 !important;
    display: flex;
    flex-direction: column;
    z-index: 2000;
    overflow-y: auto;
    overflow-x: hidden;
    font-family: 'Outfit', sans-serif;
    color: #f8fafc !important;
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Aurora Mesh Background - Stałe, eleganckie poświaty niezależne od motywu */
.aurora-mesh-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.aurora-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.45;
    animation: auroraFloat 18s ease-in-out infinite alternate;
}

.aurora-orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.5) 0%, rgba(99, 102, 241, 0) 70%);
    top: -150px;
    left: -100px;
    animation-duration: 22s;
}

.aurora-orb-2 {
    width: 550px;
    height: 550px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.4) 0%, rgba(56, 189, 248, 0) 70%);
    bottom: -100px;
    right: 5%;
    animation-duration: 26s;
    animation-delay: -6s;
}

.aurora-orb-3 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(129, 140, 248, 0.35) 0%, rgba(129, 140, 248, 0) 70%);
    top: 40%;
    left: 45%;
    animation-duration: 20s;
    animation-delay: -12s;
}

.aurora-grid-overlay {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
}

@keyframes auroraFloat {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(80px, 40px) scale(1.08); }
    100% { transform: translate(-40px, 80px) scale(0.95); }
}

/* Top Utility Header */
.login-top-bar {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 36px 12px;
    width: 100%;
    max-width: 1360px;
    margin: 0 auto;
    box-sizing: border-box;
}

.login-brand-capsule {
    display: flex;
    align-items: center;
    gap: 12px;
}

.login-brand-logo {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
}

.login-brand-logo svg {
    width: 20px;
    height: 20px;
}

.login-brand-name {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #ffffff;
}

.login-brand-tag {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Split Main Container */
.login-split-container {
    position: relative;
    z-index: 10;
    flex: 1;
    display: grid;
    grid-template-columns: 1.15fr 0.95fr;
    gap: 48px;
    max-width: 1360px;
    width: 100%;
    margin: 0 auto;
    padding: 12px 36px 28px;
    align-items: center;
    box-sizing: border-box;
}

/* Left: Showcase Panel */
.login-showcase-panel {
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding-right: 20px;
    animation: fadeSlideUp 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.showcase-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #818cf8;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.showcase-headline {
    font-size: 38px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -1px;
    color: #ffffff;
    margin: 0;
}

.showcase-headline span {
    background: linear-gradient(135deg, #ffffff 35%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.showcase-subtext {
    font-size: 14.5px;
    line-height: 1.6;
    color: #94a3b8;
    margin: 0;
    max-width: 540px;
}

/* Feature Showcase Cards / Carousel */
.showcase-carousel-wrapper {
    position: relative;
    background: rgba(19, 27, 46, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 22px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.showcase-slide {
    display: none;
    flex-direction: column;
    gap: 14px;
    animation: fadeIn 0.4s ease-in-out;
}

.showcase-slide.active {
    display: flex;
}

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

.slide-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.18);
    color: #818cf8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.slide-title-wrap h4 {
    margin: 0 0 3px;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
}

.slide-title-wrap p {
    margin: 0;
    font-size: 12px;
    color: #94a3b8;
}

.slide-preview-box {
    background: rgba(11, 15, 25, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 14px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.slide-mini-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.slide-mini-item i {
    font-size: 14px;
    color: #818cf8;
}

.slide-mini-item .mini-item-label {
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
}

.slide-mini-item .mini-item-desc {
    font-size: 9.5px;
    color: #64748b;
}

/* Carousel Dots & Controls */
.showcase-carousel-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.showcase-dots {
    display: flex;
    gap: 8px;
}

.showcase-dot {
    width: 24px;
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: all 0.25s ease;
    border: none;
    padding: 0;
}

.showcase-dot.active {
    background: #6366f1;
    width: 38px;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.6);
}

.showcase-pill-tags {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.showcase-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
}

.showcase-pill i {
    color: #818cf8;
    font-size: 11px;
}

/* Right: Glassmorphic Auth Card */
.login-auth-panel {
    display: flex;
    justify-content: center;
    animation: cardEntrance 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-card-glass {
    width: 100%;
    max-width: 440px;
    background: rgba(19, 27, 46, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 28px;
    padding: 36px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.65), 0 0 24px rgba(99, 102, 241, 0.1);
    position: relative;
    box-sizing: border-box;
}

.auth-header {
    margin-bottom: 20px;
    text-align: left;
}

.auth-header h2 {
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 6px;
    letter-spacing: -0.5px;
    color: #ffffff;
}

.auth-header p {
    font-size: 13px;
    color: #94a3b8;
    margin: 0;
}

/* Demo Mode Button */
.login-demo-btn {
    width: 100%;
    padding: 12px 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(99, 102, 241, 0.08));
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 18px;
    user-select: none;
}

.login-demo-btn:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.32), rgba(99, 102, 241, 0.15));
    border-color: #6366f1;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.35);
}

.login-demo-btn .demo-btn-label {
    display: flex;
    align-items: center;
    gap: 10px;
}

.login-demo-btn .demo-btn-label i {
    color: #818cf8;
    font-size: 15px;
}

.login-demo-btn .demo-btn-tag {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 6px;
    background: #4f46e5;
    color: #ffffff;
}

/* Divider */
.login-divider-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.login-divider-row .divider-line {
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.login-divider-row span {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    white-space: nowrap;
}

/* Modern Input Groups */
.auth-input-group {
    margin-bottom: 16px;
    position: relative;
}

.auth-input-group label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #cbd5e1;
    margin-bottom: 6px;
}

.auth-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.auth-input-icon {
    position: absolute;
    left: 14px;
    color: #64748b;
    font-size: 14px;
    pointer-events: none;
    transition: color 0.2s ease;
    z-index: 2;
}

.auth-input,
input[type="text"].auth-input,
input[type="password"].auth-input {
    width: 100% !important;
    height: 46px !important;
    padding: 0 42px 0 44px !important;
    border-radius: 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    background: rgba(11, 15, 25, 0.7) !important;
    color: #ffffff !important;
    font-size: 14px !important;
    font-family: inherit !important;
    outline: none !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-sizing: border-box !important;
}

.auth-input:focus,
input[type="text"].auth-input:focus,
input[type="password"].auth-input:focus {
    border-color: #6366f1 !important;
    background: rgba(11, 15, 25, 0.9) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25) !important;
}

.auth-input:focus ~ .auth-input-icon,
input.auth-input:focus ~ .auth-input-icon {
    color: #818cf8 !important;
}

/* Password Toggle & Caps Lock */
.password-toggle-btn {
    position: absolute;
    right: 10px;
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 14px;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: color 0.2s ease;
}

.password-toggle-btn:hover {
    color: #ffffff;
}

.caps-lock-warning {
    display: none;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #f59e0b;
    font-weight: 600;
    margin-top: 5px;
}

/* Extras: Remember Me */
.auth-extras {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.auth-remember-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 12.5px;
    color: #cbd5e1;
    user-select: none;
}

.auth-remember-label input[type="checkbox"] {
    accent-color: #4f46e5;
    width: 15px;
    height: 15px;
    border-radius: 4px;
    cursor: pointer;
}

/* Submit Button */
.auth-submit-btn {
    width: 100%;
    height: 46px;
    border-radius: 12px;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    border: none;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 24px rgba(79, 70, 229, 0.4);
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(79, 70, 229, 0.55);
    background: linear-gradient(135deg, #4338ca, #4f46e5);
}

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

.auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.auth-error-box {
    margin-top: 14px;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    font-size: 12px;
    font-weight: 600;
    display: none;
    animation: fadeIn 0.3s ease;
}

/* Admin Subviews */
.admin-subview {
    display: none;
    width: 100%;
    height: 100%;
}

.admin-subview.active {
    display: block !important;
}

/* Footer Status Bar */
.login-footer-bar {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 36px;
    width: 100%;
    max-width: 1360px;
    margin: 0 auto;
    font-size: 11.5px;
    color: #64748b;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    box-sizing: border-box;
}

.login-status-badges {
    display: flex;
    align-items: center;
    gap: 16px;
}

.status-live-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    margin-right: 6px;
}

/* Responsive Rules */
@media (max-width: 1080px) {
    .login-split-container {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 16px 24px;
    }

    .login-showcase-panel {
        padding-right: 0;
        text-align: center;
        align-items: center;
    }

    .showcase-subtext {
        margin: 0 auto;
    }

    .slide-header {
        justify-content: center;
        text-align: left;
    }

    .login-auth-panel {
        width: 100%;
    }

    .login-card-glass {
        max-width: 480px;
        margin: 0 auto;
    }
}

@media (max-width: 640px) {
    .login-top-bar {
        padding: 16px 20px;
    }

    .login-brand-tag {
        display: none;
    }

    .login-split-container {
        padding: 10px 16px 20px;
    }

    .showcase-headline {
        font-size: 26px;
    }

    .showcase-carousel-wrapper {
        display: none;
    }

    .login-card-glass {
        padding: 24px 20px;
        border-radius: 20px;
    }

    .login-footer-bar {
        flex-direction: column;
        gap: 8px;
        text-align: center;
        padding: 12px 20px;
    }
}

/* Existing Code Fix */
/* --- MOOD PERMISSIONS UI (GLOBAL FIX) --- */
.fieldset-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.mood-permissions-section {
    background: rgba(var(--text-main-rgb), 0.02) !important;
    padding: 20px !important;
    border-radius: var(--radius-md) !important;
    border: 1px solid var(--border-color) !important;
    margin-top: 15px !important;
    display: block !important;
}

.mood-perms-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.fieldset-title-mini {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.btn-text-action {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--accent) !important;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: var(--transition);
}

.moods-selection-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
    gap: 12px !important;
    margin-top: 15px !important;
}

.mood-item {
    position: relative;
    display: block !important;
}

.mood-item label {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 12px 16px !important;
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-sm) !important;
    cursor: pointer !important;
    transition: var(--transition) !important;
}

.mood-item label:hover {
    border-color: var(--accent) !important;
    background: rgba(var(--accent-rgb), 0.04) !important;
}

.mood-item input:checked+label {
    border-color: var(--accent) !important;
    background: rgba(var(--accent-rgb), 0.1) !important;
    box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.15) !important;
}

.mood-item input:disabled+label {
    opacity: 0.6;
    cursor: not-allowed;
    background: rgba(var(--text-main-rgb), 0.05) !important;
}

.mood-swatch-mini {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.mood-name-mini {
    font-size: 13px;
    font-weight: 600 !important;
    color: var(--text-main) !important;
}

/* End of Global Fix */


[data-theme="dark"][data-theme-mode="sage"] {
    --bg-color: #121212;
    --sidebar-bg: #1c1c1c;
    --card-bg: #242424;
    --text-main: #e0d7c7;
    --text-main-rgb: 224, 215, 199;
    --text-muted: #a09586;
    --accent: #a3b593;
    --accent-rgb: 163, 181, 147;
    --accent-hover: #b5c5a7;
    --text-on-accent: #121212;
    --border-color: #333333;
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.4);
    --glass-bg: rgba(28, 28, 28, 0.7);
}

/* Linear Slate & Indigo Palette */
[data-theme-mode="linear"] {
    --bg-color: #f8fafc;
    --sidebar-bg: #f1f5f9;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-main-rgb: 15, 23, 42;
    --text-muted: #64748b;
    --accent: #5e6ad2;
    --accent-rgb: 94, 106, 210;
    --accent-hover: #4f46e5;
    --text-on-accent: #ffffff;
    --border-color: #e2e8f0;
    --glass-bg: rgba(248, 250, 252, 0.8);
}

[data-theme="dark"][data-theme-mode="linear"] {
    --bg-color: #0b0d14;
    --sidebar-bg: #0f111a;
    --card-bg: #151824;
    --text-main: #f1f5f9;
    --text-main-rgb: 241, 245, 249;
    --text-muted: #8e9bb0;
    --accent: #6366f1;
    --accent-rgb: 99, 102, 241;
    --accent-hover: #818cf8;
    --text-on-accent: #ffffff;
    --border-color: #262a3b;
    --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 14px 36px rgba(0, 0, 0, 0.55);
    --glass-bg: rgba(15, 17, 26, 0.75);
}

[data-theme-mode="linear"] .bento-tile,
[data-theme-mode="linear"] .card,
[data-theme-mode="linear"] .fieldset-box {
    border-color: var(--border-color);
}

[data-theme-mode="linear"] button.primary,
[data-theme-mode="linear"] .filter-btn.active,
[data-theme-mode="linear"] .sub-nav-item.active {
    background: var(--accent);
    color: var(--text-on-accent);
}

[data-theme-mode="linear"] .logo-text {
    background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Obsidian Aurora / Cosmic Glass Palette */
/* Light Mode */
[data-theme="light"][data-theme-mode="aurora"],
[data-theme-mode="aurora"]:not([data-theme="dark"]) {
    --bg-color: #f6f8fd;
    --sidebar-bg: #edf2fb;
    --card-bg: rgba(255, 255, 255, 0.85);
    --text-main: #0f172a;
    --text-main-rgb: 15, 23, 42;
    --text-muted: #64748b;
    --accent: #0284c7;
    --accent-rgb: 2, 132, 199;
    --accent-hover: #0369a1;
    --aurora-secondary: #f97316;
    --aurora-secondary-rgb: 249, 115, 22;
    --text-on-accent: #ffffff;
    --border-color: rgba(15, 23, 42, 0.08);
    --shadow-sm: 0 4px 16px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 12px 32px rgba(15, 23, 42, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.80);
}

/* Dark Mode */
[data-theme="dark"][data-theme-mode="aurora"] {
    --bg-color: #070913;
    --sidebar-bg: #0b0e1e;
    --card-bg: rgba(15, 22, 41, 0.75);
    --text-main: #f8fafc;
    --text-main-rgb: 248, 250, 252;
    --text-muted: #94a3b8;
    --accent: #38bdf8;
    --accent-rgb: 56, 189, 248;
    --accent-hover: #0284c7;
    --aurora-secondary: #f97316;
    --aurora-secondary-rgb: 249, 115, 22;
    --text-on-accent: #0f172a;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 12px 36px rgba(0, 0, 0, 0.6);
    --glass-bg: rgba(11, 15, 30, 0.65);
}

/* Obsidian Aurora Accent Variations - Dark Mode */
[data-theme="dark"][data-theme-mode="aurora"][data-aurora-accent="sky"],
[data-theme="dark"][data-theme-mode="aurora"]:not([data-aurora-accent]) {
    --accent: #38bdf8;
    --accent-rgb: 56, 189, 248;
    --accent-hover: #0284c7;
    --aurora-secondary: #818cf8;
    --aurora-secondary-rgb: 129, 140, 248;
}

[data-theme="dark"][data-theme-mode="aurora"][data-aurora-accent="emerald"] {
    --accent: #10b981;
    --accent-rgb: 16, 185, 129;
    --accent-hover: #059669;
    --aurora-secondary: #34d399;
    --aurora-secondary-rgb: 52, 211, 153;
}

[data-theme="dark"][data-theme-mode="aurora"][data-aurora-accent="amber"] {
    --accent: #facc15;
    --accent-rgb: 250, 204, 21;
    --accent-hover: #eab308;
    --aurora-secondary: #f59e0b;
    --aurora-secondary-rgb: 245, 158, 11;
}

[data-theme="dark"][data-theme-mode="aurora"][data-aurora-accent="tangerine"] {
    --accent: #fb923c;
    --accent-rgb: 251, 146, 60;
    --accent-hover: #f97316;
    --aurora-secondary: #fdba74;
    --aurora-secondary-rgb: 253, 186, 116;
}

[data-theme="dark"][data-theme-mode="aurora"][data-aurora-accent="ruby"] {
    --accent: #f87171;
    --accent-rgb: 248, 113, 113;
    --accent-hover: #ef4444;
    --aurora-secondary: #fca5a5;
    --aurora-secondary-rgb: 252, 165, 165;
}

[data-theme="dark"][data-theme-mode="aurora"][data-aurora-accent="fuchsia"] {
    --accent: #e879f9;
    --accent-rgb: 232, 121, 249;
    --accent-hover: #d946ef;
    --aurora-secondary: #f0abfc;
    --aurora-secondary-rgb: 240, 171, 252;
}

[data-theme="dark"][data-theme-mode="aurora"][data-aurora-accent="violet"] {
    --accent: #a855f7;
    --accent-rgb: 168, 85, 247;
    --accent-hover: #9333ea;
    --aurora-secondary: #c084fc;
    --aurora-secondary-rgb: 192, 132, 252;
}

[data-theme="dark"][data-theme-mode="aurora"][data-aurora-accent="cyan"] {
    --accent: #22d3ee;
    --accent-rgb: 34, 211, 238;
    --accent-hover: #06b6d4;
    --aurora-secondary: #67e8f9;
    --aurora-secondary-rgb: 103, 232, 249;
}

[data-theme="dark"][data-theme-mode="aurora"][data-aurora-accent="coral"] {
    --accent: #fb7185;
    --accent-rgb: 251, 113, 133;
    --accent-hover: #f43f5e;
    --aurora-secondary: #fda4af;
    --aurora-secondary-rgb: 253, 164, 175;
}

/* Obsidian Aurora Accent Variations - Light Mode */
[data-theme="light"][data-theme-mode="aurora"][data-aurora-accent="sky"],
[data-theme-mode="aurora"]:not([data-theme="dark"]):not([data-aurora-accent]),
[data-theme-mode="aurora"]:not([data-theme="dark"])[data-aurora-accent="sky"] {
    --accent: #0284c7;
    --accent-rgb: 2, 132, 199;
    --accent-hover: #0369a1;
    --aurora-secondary: #6366f1;
    --aurora-secondary-rgb: 99, 102, 241;
}

[data-theme="light"][data-theme-mode="aurora"][data-aurora-accent="emerald"],
[data-theme-mode="aurora"]:not([data-theme="dark"])[data-aurora-accent="emerald"] {
    --accent: #059669;
    --accent-rgb: 5, 150, 105;
    --accent-hover: #047857;
    --aurora-secondary: #10b981;
    --aurora-secondary-rgb: 16, 185, 129;
}

[data-theme="light"][data-theme-mode="aurora"][data-aurora-accent="amber"],
[data-theme-mode="aurora"]:not([data-theme="dark"])[data-aurora-accent="amber"] {
    --accent: #d97706;
    --accent-rgb: 217, 119, 6;
    --accent-hover: #b45309;
    --aurora-secondary: #f59e0b;
    --aurora-secondary-rgb: 245, 158, 11;
}

[data-theme="light"][data-theme-mode="aurora"][data-aurora-accent="tangerine"],
[data-theme-mode="aurora"]:not([data-theme="dark"])[data-aurora-accent="tangerine"] {
    --accent: #ea580c;
    --accent-rgb: 234, 88, 12;
    --accent-hover: #c2410c;
    --aurora-secondary: #fb923c;
    --aurora-secondary-rgb: 251, 146, 60;
}

[data-theme="light"][data-theme-mode="aurora"][data-aurora-accent="ruby"],
[data-theme-mode="aurora"]:not([data-theme="dark"])[data-aurora-accent="ruby"] {
    --accent: #dc2626;
    --accent-rgb: 220, 38, 38;
    --accent-hover: #b91c1c;
    --aurora-secondary: #f87171;
    --aurora-secondary-rgb: 248, 113, 113;
}

[data-theme="light"][data-theme-mode="aurora"][data-aurora-accent="fuchsia"],
[data-theme-mode="aurora"]:not([data-theme="dark"])[data-aurora-accent="fuchsia"] {
    --accent: #c026d3;
    --accent-rgb: 192, 38, 211;
    --accent-hover: #a21caf;
    --aurora-secondary: #e879f9;
    --aurora-secondary-rgb: 232, 121, 249;
}

[data-theme="light"][data-theme-mode="aurora"][data-aurora-accent="violet"],
[data-theme-mode="aurora"]:not([data-theme="dark"])[data-aurora-accent="violet"] {
    --accent: #7c3aed;
    --accent-rgb: 124, 58, 237;
    --accent-hover: #6d28d9;
    --aurora-secondary: #a855f7;
    --aurora-secondary-rgb: 168, 85, 247;
}

[data-theme="light"][data-theme-mode="aurora"][data-aurora-accent="cyan"],
[data-theme-mode="aurora"]:not([data-theme="dark"])[data-aurora-accent="cyan"] {
    --accent: #0891b2;
    --accent-rgb: 8, 145, 178;
    --accent-hover: #0e7490;
    --aurora-secondary: #22d3ee;
    --aurora-secondary-rgb: 34, 211, 238;
}

[data-theme="light"][data-theme-mode="aurora"][data-aurora-accent="coral"],
[data-theme-mode="aurora"]:not([data-theme="dark"])[data-aurora-accent="coral"] {
    --accent: #e11d48;
    --accent-rgb: 225, 29, 72;
    --accent-hover: #be123c;
    --aurora-secondary: #fb7185;
    --aurora-secondary-rgb: 251, 113, 133;
}

/* Obsidian Aurora - Dark Mode Body & Elements */
[data-theme="dark"][data-theme-mode="aurora"] body {
    background-color: #070913;
    background-image:
        radial-gradient(circle at 90% 90%, rgba(var(--aurora-secondary-rgb, 249, 115, 22), 0.12) 0%, transparent 40%),
        radial-gradient(circle at 10% 10%, rgba(var(--accent-rgb), 0.12) 0%, transparent 45%);
    background-attachment: fixed;
}

[data-theme="dark"][data-theme-mode="aurora"] .bento-tile,
[data-theme="dark"][data-theme-mode="aurora"] .card,
[data-theme="dark"][data-theme-mode="aurora"] .fieldset-box,
[data-theme="dark"][data-theme-mode="aurora"] .modal-content,
[data-theme="dark"][data-theme-mode="aurora"] .sidebar {
    background: rgba(15, 22, 41, 0.75) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

[data-theme="dark"][data-theme-mode="aurora"] .logo-text {
    background: linear-gradient(135deg, var(--accent) 0%, #818cf8 50%, var(--aurora-secondary, #f97316) 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

/* Obsidian Aurora - Light Mode Body & Elements */
[data-theme="light"][data-theme-mode="aurora"] body,
[data-theme-mode="aurora"]:not([data-theme="dark"]) body {
    background-color: #f6f8fd;
    background-image:
        radial-gradient(circle at 90% 90%, rgba(var(--aurora-secondary-rgb, 249, 115, 22), 0.07) 0%, transparent 40%),
        radial-gradient(circle at 10% 10%, rgba(var(--accent-rgb), 0.09) 0%, transparent 45%);
    background-attachment: fixed;
}

[data-theme="light"][data-theme-mode="aurora"] .bento-tile,
[data-theme="light"][data-theme-mode="aurora"] .card,
[data-theme="light"][data-theme-mode="aurora"] .fieldset-box,
[data-theme="light"][data-theme-mode="aurora"] .modal-content,
[data-theme="light"][data-theme-mode="aurora"] .sidebar,
[data-theme-mode="aurora"]:not([data-theme="dark"]) .bento-tile,
[data-theme-mode="aurora"]:not([data-theme="dark"]) .card,
[data-theme-mode="aurora"]:not([data-theme="dark"]) .fieldset-box,
[data-theme-mode="aurora"]:not([data-theme="dark"]) .modal-content,
[data-theme-mode="aurora"]:not([data-theme="dark"]) .sidebar {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    box-shadow: 0 8px 28px 0 rgba(15, 23, 42, 0.06);
}

[data-theme="light"][data-theme-mode="aurora"] .logo-text,
[data-theme-mode="aurora"]:not([data-theme="dark"]) .logo-text {
    background: linear-gradient(135deg, var(--accent) 0%, #6366f1 50%, var(--aurora-secondary, #ea580c) 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

[data-theme-mode="aurora"] button.primary,
[data-theme-mode="aurora"] .filter-btn.active,
[data-theme-mode="aurora"] .sub-nav-item.active {
    background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 100%) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 4px 14px rgba(var(--accent-rgb), 0.35) !important;
}

[data-theme="light"] .theme-card[data-mode="aurora"] .swatch-bg {
    background: #f6f8fd !important;
}

/* Aurora Accent Picker UI */
.aurora-accent-picker {
    margin-top: 18px;
    padding: 16px 20px 14px;
    background: rgba(var(--text-main-rgb), 0.03);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.3s ease;
    position: relative;
}

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

.aurora-accent-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.2px;
}

.aurora-accent-swatches-wrapper {
    position: relative;
    min-height: 54px;
    display: flex;
    align-items: center;
}

.aurora-accent-swatches {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    flex-wrap: wrap;
    transition: opacity 0.3s ease, filter 0.3s ease;
    width: 100%;
}

.aurora-accent-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    outline: none;
    transition: transform 0.2s ease;
}

.aurora-accent-circle {
    position: relative;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, var(--accent-swatch-light, #fff) -20%, var(--accent-swatch) 50%, rgba(0, 0, 0, 0.4) 120%);
    box-shadow: 0 0 12px var(--accent-swatch-glow, rgba(255, 255, 255, 0.2)), inset 0 1px 2px rgba(255, 255, 255, 0.4);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}

.aurora-accent-item:hover .aurora-accent-circle {
    transform: scale(1.12);
    box-shadow: 0 0 18px var(--accent-swatch-glow, rgba(255, 255, 255, 0.3)), inset 0 1px 3px rgba(255, 255, 255, 0.6);
}

.aurora-accent-item.active .aurora-accent-circle {
    transform: scale(1.05);
    box-shadow:
        0 0 0 3px var(--card-bg, #0b0e1e),
        0 0 0 5px var(--accent-swatch),
        0 0 22px var(--accent-swatch-glow),
        inset 0 1px 3px rgba(255, 255, 255, 0.6);
}

.aurora-accent-name {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.2s ease;
    min-height: 14px;
    text-align: center;
    opacity: 0;
    transform: translateY(-2px);
}

.aurora-accent-item.active .aurora-accent-name {
    opacity: 1;
    transform: translateY(0);
    color: var(--accent-swatch);
    text-shadow: 0 0 8px var(--accent-swatch-glow);
}

/* Semi-transparent locked notice when another mood is active */
.aurora-accent-locked-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(var(--text-main-rgb), 0.03);
    border: 1px dashed rgba(var(--text-main-rgb), 0.16);
    border-radius: 14px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: var(--text-muted);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.2px;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    pointer-events: none;
    z-index: 2;
    padding: 10px 16px;
    text-align: center;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.05);
}

.aurora-accent-locked-overlay i {
    font-size: 12px;
    opacity: 0.75;
}

:root:not([data-theme-mode="aurora"]) .aurora-accent-swatches,
.aurora-accent-picker.disabled .aurora-accent-swatches {
    opacity: 0.18;
    filter: blur(1.5px) grayscale(0.7);
    pointer-events: none;
    user-select: none;
}

:root:not([data-theme-mode="aurora"]) .aurora-accent-locked-overlay,
.aurora-accent-picker.disabled .aurora-accent-locked-overlay {
    display: flex;
}

:root[data-theme-mode="aurora"] .aurora-accent-picker:not(.disabled) .aurora-accent-swatches {
    opacity: 1;
    filter: none;
    pointer-events: auto;
}

:root[data-theme-mode="aurora"] .aurora-accent-picker:not(.disabled) .aurora-accent-locked-overlay {
    display: none;
}

/* Eldoria - Cozy RPG & Arcane Fantasy Palette */
/* Light Mode (Royal Parchment & Sunlit Tavern) */
[data-theme="light"][data-theme-mode="eldoria"],
[data-theme-mode="eldoria"]:not([data-theme="dark"]) {
    --bg-color: #faf6ed;
    --sidebar-bg: #f2ebd9;
    --card-bg: rgba(255, 253, 247, 0.88);
    --text-main: #2e2010;
    --text-main-rgb: 46, 32, 16;
    --text-muted: #856a4b;
    --accent: #b47818;
    --accent-rgb: 180, 120, 24;
    --accent-hover: #96610f;
    --eldoria-secondary: #7a5c38;
    --eldoria-secondary-rgb: 122, 92, 56;
    --text-on-accent: #ffffff;
    --border-color: rgba(180, 136, 88, 0.22);
    --shadow-sm: 0 4px 16px rgba(46, 32, 16, 0.05);
    --shadow-md: 0 12px 32px rgba(46, 32, 16, 0.09);
    --glass-bg: rgba(255, 253, 247, 0.82);
}

/* Dark Mode (Ancient Tavern & Deep Mahogany) */
[data-theme="dark"][data-theme-mode="eldoria"] {
    --bg-color: #0d0a05;
    --sidebar-bg: #1c1508;
    --card-bg: rgba(28, 21, 8, 0.82);
    --text-main: #f0e0b0;
    --text-main-rgb: 240, 224, 176;
    --text-muted: #b08858;
    --accent: #c8952a;
    --accent-rgb: 200, 149, 42;
    --accent-hover: #a6751c;
    --eldoria-secondary: #d4b880;
    --eldoria-secondary-rgb: 212, 184, 128;
    --text-on-accent: #0d0a05;
    --border-color: rgba(212, 184, 128, 0.18);
    --shadow-sm: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 12px 36px rgba(0, 0, 0, 0.7);
    --glass-bg: rgba(28, 21, 8, 0.75);
}

/* Eldoria RPG Glowing Gem Variations - Dark Mode */
[data-theme="dark"][data-theme-mode="eldoria"][data-eldoria-accent="gold"],
[data-theme="dark"][data-theme-mode="eldoria"]:not([data-eldoria-accent]) {
    --accent: #c8952a;
    --accent-rgb: 200, 149, 42;
    --accent-hover: #a6751c;
    --eldoria-secondary: #f0e0b0;
    --eldoria-secondary-rgb: 240, 224, 176;
}

[data-theme="dark"][data-theme-mode="eldoria"][data-eldoria-accent="ruby"] {
    --accent: #d44040;
    --accent-rgb: 212, 64, 64;
    --accent-hover: #b91c1c;
    --eldoria-secondary: #fca5a5;
    --eldoria-secondary-rgb: 252, 165, 165;
}

[data-theme="dark"][data-theme-mode="eldoria"][data-eldoria-accent="arcane"] {
    --accent: #8840c0;
    --accent-rgb: 136, 64, 192;
    --accent-hover: #6b21a8;
    --eldoria-secondary: #d8b4fe;
    --eldoria-secondary-rgb: 216, 180, 254;
}

[data-theme="dark"][data-theme-mode="eldoria"][data-eldoria-accent="mana"] {
    --accent: #5b8fd4;
    --accent-rgb: 91, 143, 212;
    --accent-hover: #2563eb;
    --eldoria-secondary: #93c5fd;
    --eldoria-secondary-rgb: 147, 197, 253;
}

[data-theme="dark"][data-theme-mode="eldoria"][data-eldoria-accent="abyss"] {
    --accent: #2a5090;
    --accent-rgb: 42, 80, 144;
    --accent-hover: #1e3a8a;
    --eldoria-secondary: #60a5fa;
    --eldoria-secondary-rgb: 96, 165, 250;
}

[data-theme="dark"][data-theme-mode="eldoria"][data-eldoria-accent="elven"] {
    --accent: #7dd87a;
    --accent-rgb: 125, 216, 122;
    --accent-hover: #4ade80;
    --eldoria-secondary: #bbf7d0;
    --eldoria-secondary-rgb: 187, 247, 208;
}

[data-theme="dark"][data-theme-mode="eldoria"][data-eldoria-accent="forest"] {
    --accent: #3a9e50;
    --accent-rgb: 58, 158, 80;
    --accent-hover: #16a34a;
    --eldoria-secondary: #86efac;
    --eldoria-secondary-rgb: 134, 239, 172;
}

[data-theme="dark"][data-theme-mode="eldoria"][data-eldoria-accent="parchment"] {
    --accent: #d4b880;
    --accent-rgb: 212, 184, 128;
    --accent-hover: #b45309;
    --eldoria-secondary: #fef3c7;
    --eldoria-secondary-rgb: 254, 243, 199;
}

/* Eldoria RPG Glowing Gem Variations - Light Mode */
[data-theme="light"][data-theme-mode="eldoria"][data-eldoria-accent="gold"],
[data-theme-mode="eldoria"]:not([data-theme="dark"]):not([data-eldoria-accent]),
[data-theme-mode="eldoria"]:not([data-theme="dark"])[data-eldoria-accent="gold"] {
    --accent: #b47818;
    --accent-rgb: 180, 120, 24;
    --accent-hover: #96610f;
    --eldoria-secondary: #7a5c38;
    --eldoria-secondary-rgb: 122, 92, 56;
}

[data-theme="light"][data-theme-mode="eldoria"][data-eldoria-accent="ruby"],
[data-theme-mode="eldoria"]:not([data-theme="dark"])[data-eldoria-accent="ruby"] {
    --accent: #b91c1c;
    --accent-rgb: 185, 28, 28;
    --accent-hover: #991b1b;
    --eldoria-secondary: #dc2626;
    --eldoria-secondary-rgb: 220, 38, 38;
}

[data-theme="light"][data-theme-mode="eldoria"][data-eldoria-accent="arcane"],
[data-theme-mode="eldoria"]:not([data-theme="dark"])[data-eldoria-accent="arcane"] {
    --accent: #6b21a8;
    --accent-rgb: 107, 33, 168;
    --accent-hover: #581c87;
    --eldoria-secondary: #9333ea;
    --eldoria-secondary-rgb: 147, 51, 234;
}

[data-theme="light"][data-theme-mode="eldoria"][data-eldoria-accent="mana"],
[data-theme-mode="eldoria"]:not([data-theme="dark"])[data-eldoria-accent="mana"] {
    --accent: #2563eb;
    --accent-rgb: 37, 99, 235;
    --accent-hover: #1d4ed8;
    --eldoria-secondary: #3b82f6;
    --eldoria-secondary-rgb: 59, 130, 246;
}

[data-theme="light"][data-theme-mode="eldoria"][data-eldoria-accent="abyss"],
[data-theme-mode="eldoria"]:not([data-theme="dark"])[data-eldoria-accent="abyss"] {
    --accent: #1e3a8a;
    --accent-rgb: 30, 58, 138;
    --accent-hover: #172554;
    --eldoria-secondary: #2563eb;
    --eldoria-secondary-rgb: 37, 99, 235;
}

[data-theme="light"][data-theme-mode="eldoria"][data-eldoria-accent="elven"],
[data-theme-mode="eldoria"]:not([data-theme="dark"])[data-eldoria-accent="elven"] {
    --accent: #16a34a;
    --accent-rgb: 22, 163, 74;
    --accent-hover: #15803d;
    --eldoria-secondary: #22c55e;
    --eldoria-secondary-rgb: 34, 197, 94;
}

[data-theme="light"][data-theme-mode="eldoria"][data-eldoria-accent="forest"],
[data-theme-mode="eldoria"]:not([data-theme="dark"])[data-eldoria-accent="forest"] {
    --accent: #15803d;
    --accent-rgb: 21, 128, 61;
    --accent-hover: #166534;
    --eldoria-secondary: #16a34a;
    --eldoria-secondary-rgb: 22, 163, 74;
}

[data-theme="light"][data-theme-mode="eldoria"][data-eldoria-accent="parchment"],
[data-theme-mode="eldoria"]:not([data-theme="dark"])[data-eldoria-accent="parchment"] {
    --accent: #92400e;
    --accent-rgb: 146, 64, 14;
    --accent-hover: #78350f;
    --eldoria-secondary: #b45309;
    --eldoria-secondary-rgb: 180, 83, 9;
}

/* Eldoria - Dark Mode Body & Elements */
[data-theme="dark"][data-theme-mode="eldoria"] body {
    background-color: #0d0a05;
    background-image:
        radial-gradient(circle at 90% 90%, rgba(200, 149, 42, 0.10) 0%, transparent 42%),
        radial-gradient(circle at 10% 10%, rgba(var(--accent-rgb), 0.12) 0%, transparent 48%);
    background-attachment: fixed;
}

[data-theme="dark"][data-theme-mode="eldoria"] .bento-tile,
[data-theme="dark"][data-theme-mode="eldoria"] .card,
[data-theme="dark"][data-theme-mode="eldoria"] .fieldset-box,
[data-theme="dark"][data-theme-mode="eldoria"] .modal-content,
[data-theme="dark"][data-theme-mode="eldoria"] .sidebar {
    background: rgba(28, 21, 8, 0.82) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(212, 184, 128, 0.18) !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

[data-theme="dark"][data-theme-mode="eldoria"] .logo-text {
    background: linear-gradient(135deg, #f0e0b0 0%, var(--accent) 50%, var(--eldoria-secondary, #d4b880) 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

/* Eldoria - Light Mode Body & Elements */
[data-theme="light"][data-theme-mode="eldoria"] body,
[data-theme-mode="eldoria"]:not([data-theme="dark"]) body {
    background-color: #faf6ed;
    background-image:
        radial-gradient(circle at 90% 90%, rgba(200, 149, 42, 0.07) 0%, transparent 42%),
        radial-gradient(circle at 10% 10%, rgba(var(--accent-rgb), 0.08) 0%, transparent 48%);
    background-attachment: fixed;
}

[data-theme="light"][data-theme-mode="eldoria"] .bento-tile,
[data-theme="light"][data-theme-mode="eldoria"] .card,
[data-theme="light"][data-theme-mode="eldoria"] .fieldset-box,
[data-theme="light"][data-theme-mode="eldoria"] .modal-content,
[data-theme="light"][data-theme-mode="eldoria"] .sidebar,
[data-theme-mode="eldoria"]:not([data-theme="dark"]) .bento-tile,
[data-theme-mode="eldoria"]:not([data-theme="dark"]) .card,
[data-theme-mode="eldoria"]:not([data-theme="dark"]) .fieldset-box,
[data-theme-mode="eldoria"]:not([data-theme="dark"]) .modal-content,
[data-theme-mode="eldoria"]:not([data-theme="dark"]) .sidebar {
    background: rgba(255, 253, 247, 0.88) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(180, 136, 88, 0.22) !important;
    box-shadow: 0 8px 28px 0 rgba(74, 52, 32, 0.08);
}

[data-theme="light"][data-theme-mode="eldoria"] .logo-text,
[data-theme-mode="eldoria"]:not([data-theme="dark"]) .logo-text {
    background: linear-gradient(135deg, #4a3420 0%, var(--accent) 50%, #856a4b 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

[data-theme-mode="eldoria"] button.primary,
[data-theme-mode="eldoria"] .filter-btn.active,
[data-theme-mode="eldoria"] .sub-nav-item.active {
    background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 100%) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.4) !important;
}

[data-theme="light"] .theme-card[data-mode="eldoria"] .swatch-bg {
    background: #faf6ed !important;
}

/* Eldoria Accent Picker UI */
.eldoria-accent-picker {
    margin-top: 18px;
    padding: 16px 20px 14px;
    background: rgba(var(--text-main-rgb), 0.03);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.3s ease;
    position: relative;
}

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

.eldoria-accent-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.2px;
}

.eldoria-accent-swatches-wrapper {
    position: relative;
    min-height: 54px;
    display: flex;
    align-items: center;
}

.eldoria-accent-swatches {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    flex-wrap: wrap;
    transition: opacity 0.3s ease, filter 0.3s ease;
    width: 100%;
}

.eldoria-accent-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    outline: none;
    transition: transform 0.2s ease;
}

.eldoria-accent-circle {
    position: relative;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, var(--accent-swatch-light, #fff) -20%, var(--accent-swatch) 50%, rgba(0, 0, 0, 0.5) 120%);
    box-shadow: 0 0 12px var(--accent-swatch-glow, rgba(255, 255, 255, 0.2)), inset 0 1px 2px rgba(255, 255, 255, 0.4);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}

.eldoria-accent-item:hover .eldoria-accent-circle {
    transform: scale(1.12);
    box-shadow: 0 0 18px var(--accent-swatch-glow, rgba(255, 255, 255, 0.3)), inset 0 1px 3px rgba(255, 255, 255, 0.6);
}

.eldoria-accent-item.active .eldoria-accent-circle {
    transform: scale(1.05);
    box-shadow:
        0 0 0 3px var(--card-bg, #1c1508),
        0 0 0 5px var(--accent-swatch),
        0 0 22px var(--accent-swatch-glow),
        inset 0 1px 3px rgba(255, 255, 255, 0.6);
}

.eldoria-accent-name {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.2s ease;
    min-height: 14px;
    text-align: center;
    opacity: 0;
    transform: translateY(-2px);
}

.eldoria-accent-item.active .eldoria-accent-name {
    opacity: 1;
    transform: translateY(0);
    color: var(--accent-swatch);
    text-shadow: 0 0 8px var(--accent-swatch-glow);
}

.eldoria-accent-locked-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(var(--text-main-rgb), 0.03);
    border: 1px dashed rgba(var(--text-main-rgb), 0.16);
    border-radius: 14px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: var(--text-muted);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.2px;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    pointer-events: none;
    z-index: 2;
    padding: 10px 16px;
    text-align: center;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.05);
}

.eldoria-accent-locked-overlay i {
    font-size: 12px;
    opacity: 0.75;
}

:root:not([data-theme-mode="eldoria"]) .eldoria-accent-swatches,
.eldoria-accent-picker.disabled .eldoria-accent-swatches {
    opacity: 0.18;
    filter: blur(1.5px) grayscale(0.7);
    pointer-events: none;
    user-select: none;
}

:root:not([data-theme-mode="eldoria"]) .eldoria-accent-locked-overlay,
.eldoria-accent-picker.disabled .eldoria-accent-locked-overlay {
    display: flex;
}

:root[data-theme-mode="eldoria"] .eldoria-accent-picker:not(.disabled) .eldoria-accent-swatches {
    opacity: 1;
    filter: none;
    pointer-events: auto;
}

:root[data-theme-mode="eldoria"] .eldoria-accent-picker:not(.disabled) .eldoria-accent-locked-overlay {
    display: none;
}

/* Nordic Blue Palette */
[data-theme-mode="nordic"] {
    --bg-color: #f1f4f7;
    --sidebar-bg: #e5e9ef;
    --card-bg: #ffffff;
    --text-main: #2c3e50;
    --text-main-rgb: 44, 62, 80;
    --text-muted: #7f8c8d;
    --accent: #5d768d;
    --accent-rgb: 93, 118, 141;
    --accent-hover: #4a5d6e;
    --text-on-accent: #ffffff;
    --border-color: #dcdde1;
}

[data-theme="dark"][data-theme-mode="nordic"] {
    --bg-color: #1a202c;
    --sidebar-bg: #171923;
    --card-bg: #2d3748;
    --text-main: #edf2f7;
    --text-main-rgb: 237, 242, 247;
    --accent: #7e8da4;
    --text-on-accent: #1a202c;
    --border-color: #4a5568;
}

/* Warm Sand Palette */
[data-theme-mode="sand"] {
    --bg-color: #faf7f2;
    --sidebar-bg: #f2ede4;
    --card-bg: #ffffff;
    --text-main: #5d4037;
    --text-main-rgb: 93, 64, 55;
    --text-muted: #8d6e63;
    --accent: #c4a484;
    --accent-rgb: 196, 164, 132;
    --accent-hover: #b38f6d;
    --text-on-accent: #ffffff;
    --border-color: #e0d8cc;
}

[data-theme="dark"][data-theme-mode="sand"] {
    --bg-color: #1f1a17;
    --sidebar-bg: #292421;
    --card-bg: #362f2b;
    --text-main: #f2eee6;
    --text-main-rgb: 242, 238, 230;
    --accent: #d4bc9c;
    --border-color: #4a3e34;
}

/* Midnight Matrix Palette */
[data-theme-mode="midnight"] {
    --bg-color: #030303;
    --sidebar-bg: #0a0a0a;
    --card-bg: #0f1211;
    --text-main: #00ffcc;
    --text-main-rgb: 0, 255, 204;
    --text-muted: #008888;
    --accent: #00ffcc;
    --accent-rgb: 0, 255, 204;
    --accent-hover: #00ccaa;
    --text-on-accent: #000000;
    --border-color: #003333;
}



/* --- ONYX GINGER THEME (Premium Neumorphism) --- */
[data-theme-mode="onyx"] {
    --bg-color: #f5f7fa;
    --sidebar-bg: #ebedf0;
    --card-bg: #ffffff;
    --text-main: #2d3436;
    --text-main-rgb: 45, 52, 54;
    --text-muted: #636e72;
    --accent: #ff6b35;
    --accent-rgb: 255, 107, 53;
    --accent-hover: #e65a25;
    --text-on-accent: #ffffff;
    --border-color: rgba(0, 0, 0, 0.05);
    --shadow-sm: 4px 4px 10px rgba(163, 177, 198, 0.4), -4px -4px 10px rgba(255, 255, 255, 0.8);
    --shadow-md: 8px 8px 20px rgba(163, 177, 198, 0.5), -8px -8px 20px rgba(255, 255, 255, 0.8);
    --glass-bg: rgba(255, 255, 255, 0.8);
    --radius-md: 16px;
}

[data-theme="dark"][data-theme-mode="onyx"] {
    --bg-color: #0d0f14;
    --sidebar-bg: #07080b;
    --card-bg: #161a21;
    --text-main: #e0e0e0;
    --text-main-rgb: 224, 224, 224;
    --text-muted: #80868b;
    --accent: #ff6b35;
    --accent-rgb: 255, 107, 53;
    --accent-hover: #e65a25;
    --text-on-accent: #ffffff;
    --border-color: rgba(255, 255, 255, 0.05);
    --shadow-sm: 4px 4px 10px rgba(0, 0, 0, 0.4), -2px -2px 8px rgba(255, 255, 255, 0.02);
    --shadow-md: 8px 8px 20px rgba(0, 0, 0, 0.5), -4px -4px 15px rgba(255, 255, 255, 0.03);
    --glass-bg: rgba(22, 26, 33, 0.8);
}

[data-theme-mode="onyx"] .bento-tile {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-sm) !important;
    border-radius: var(--radius-md) !important;
}

[data-theme="dark"][data-theme-mode="onyx"] .bento-tile {
    box-shadow: 8px 8px 16px #090b0f, -4px -4px 12px rgba(255, 255, 255, 0.02) !important;
}

[data-theme-mode="onyx"] button.primary,
[data-theme-mode="onyx"] .filter-btn.active,
[data-theme-mode="onyx"] .sub-nav-item.active {
    background: linear-gradient(135deg, #ff6b35 0%, #d44e1e 100%) !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(212, 78, 30, 0.4), inset 1px 1px 2px rgba(255, 255, 255, 0.2) !important;
    color: white !important;
}

[data-theme-mode="onyx"] .sub-nav-item {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 2px 2px 5px rgba(163, 177, 198, 0.3), -2px -2px 5px rgba(255, 255, 255, 0.7) !important;
    color: var(--text-muted) !important;
    border-radius: 20px !important;
    margin: 0 5px !important;
}

[data-theme="dark"][data-theme-mode="onyx"] .sub-nav-item {
    box-shadow: 4px 4px 8px #090b0f, -2px -2px 6px rgba(255, 255, 255, 0.01) !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

[data-theme-mode="onyx"] .card {
    background: var(--card-bg) !important;
    box-shadow: var(--shadow-md) !important;
    border: 1px solid var(--border-color) !important;
}

[data-theme-mode="onyx"] .modal-content {
    background: var(--bg-color) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 20px 20px 60px rgba(163, 177, 198, 0.5), -10px -10px 40px rgba(255, 255, 255, 0.8) !important;
}

[data-theme="dark"][data-theme-mode="onyx"] .modal-content {
    background: #11141a !important;
    box-shadow: 20px 20px 60px #07080b, -10px -10px 40px rgba(255, 255, 255, 0.01) !important;
}

[data-theme-mode="onyx"] .floating-group input {
    background: var(--bg-color) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: inset 4px 4px 8px rgba(163, 177, 198, 0.3), inset -2px -2px 5px rgba(255, 255, 255, 0.7) !important;
}

[data-theme="dark"][data-theme-mode="onyx"] .floating-group input {
    background: #090b0f !important;
    box-shadow: inset 5px 5px 10px #040507, inset -2px -2px 5px rgba(255, 255, 255, 0.01) !important;
}

[data-theme-mode="onyx"] .nav-item.active {
    background: rgba(255, 107, 53, 0.1) !important;
    color: var(--accent) !important;
    border-left: 4px solid var(--accent) !important;
}

[data-theme-mode="onyx"] .status-tag {
    border: 1px solid var(--border-color) !important;
    box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.05) !important;
}

[data-theme-mode="onyx"] input,
[data-theme-mode="onyx"] select,
[data-theme-mode="onyx"] textarea {
    background: var(--bg-color) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: inset 2px 2px 5px rgba(163, 177, 198, 0.2) !important;
}

[data-theme="dark"][data-theme-mode="onyx"] input,
[data-theme="dark"][data-theme-mode="onyx"] select,
[data-theme="dark"][data-theme-mode="onyx"] textarea {
    background: #11141a !important;
    box-shadow: inset 4px 4px 8px #090b0f, inset -2px -2px 6px rgba(255, 255, 255, 0.01) !important;
}

[data-theme-mode="onyx"] .sidebar {
    background: var(--sidebar-bg) !important;
    border-right: 1px solid var(--border-color) !important;
}

[data-theme-mode="onyx"] .logo-text {
    color: var(--accent) !important;
    text-shadow: 0 0 15px rgba(255, 107, 53, 0.2);
}

/* Specific fix for Dashboard Header in Onyx theme */
[data-theme-mode="onyx"] .dashboard-header {
    background: linear-gradient(135deg, #ff6b35 0%, #d44e1e 100%) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 10px 30px rgba(212, 78, 30, 0.3) !important;
}

[data-theme-mode="onyx"] .dashboard-header h1,
[data-theme-mode="onyx"] .dashboard-header .clock-display,
[data-theme-mode="onyx"] .dashboard-header .weather-temp,
[data-theme-mode="onyx"] .dashboard-header .weather-city,
[data-theme-mode="onyx"] .dashboard-header .weather-desc {
    color: white !important;
}

[data-theme-mode="onyx"] .dashboard-header .header-widgets {
    background: rgba(0, 0, 0, 0.15) !important;
    backdrop-filter: blur(2px);
}

[data-theme-mode="onyx"] .gridjs-search-input {
    background: var(--bg-color) !important;
}

[data-theme="dark"][data-theme-mode="onyx"] .gridjs-search-input {
    background: #11141a !important;
}

[data-theme="dark"][data-theme-mode="midnight"] {
    --bg-color: #050505;
    --sidebar-bg: #0a0a0a;
    --card-bg: #0f0f0f;
    --text-main: #00ff88;
    --accent: #ff0077;
}

[data-theme="dark"] {
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.4);
    --danger-color: #ff5252;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    transition: var(--transition);
    height: 100vh;
    margin: 0;
    overflow: hidden;
}

#app-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar Styling - Premium Redesign */
.sidebar {
    width: 200px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background-color: #f9f9fb;
    border-right: 1px solid #e5e5e7;
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

[data-theme="dark"] .sidebar {
    background-color: #161618;
    border-right-color: #2c2c2e;
}

.sidebar.collapsed {
    width: 64px;
}

.sidebar-header {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.sparkle-icon {
    width: 20px !important;
    height: 20px !important;
    color: var(--accent);
    flex-shrink: 0;
}

.logo-text {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    opacity: 1;
    transition: var(--transition);
}

.sidebar.collapsed .logo-text {
    opacity: 0;
    width: 0;
}

.btn-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: 0.2s;
}

.btn-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .btn-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-toggle svg {
    width: 14px;
    height: 14px;
    transition: 0.3s;
}

.sidebar.collapsed .btn-toggle svg {
    transform: rotate(180deg);
}

.sidebar-nav {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Sidebar Tooltips (only in collapsed mode) */
.nav-item {
    overflow: visible;
    /* CRITICAL: Allows tooltips to show outside the nav item */
}

/* Sidebar Tooltips handled by JS engine */

/* Tooltip Arrow Removed to avoid conflict with Active Indicator */

.btn-logout {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--text-main-rgb), 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 16px;
    cursor: pointer;
    transition: var(--transition);
    margin: 15px auto 0 auto;
}

.btn-logout:hover {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
    border-color: rgba(220, 38, 38, 0.2);
}

.btn-logout span {
    font-size: 13px;
    font-weight: 600;
}

.sidebar.collapsed .btn-logout span {
    display: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    background: rgba(var(--text-main-rgb), 0.03);
    border: 1px solid transparent;
}

.nav-item:hover {
    background: var(--card-bg);
    color: var(--text-main);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-color: rgba(var(--accent-rgb), 0.1);
}

.nav-item.active {
    background: var(--accent) !important;
    color: white !important;
    box-shadow: 0 8px 24px rgba(var(--accent-rgb), 0.3);
    border-color: var(--accent);
}

.nav-item.active::before {
    content: "";
    position: absolute;
    left: -14px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: var(--accent);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 10px var(--accent);
}

.nav-item:active {
    transform: scale(0.96);
}

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

.nav-icon {
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0;
    stroke-width: 1.5;
}

.nav-label {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    transition: var(--transition);
}

.sidebar.collapsed .nav-label {
    display: none;
}

/* Redundant rule removed */

.sidebar-footer {
    padding: 16px 8px;
    border-top: 1px solid rgba(var(--text-main-rgb), 0.08);
    margin-top: auto;
}

.footer-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.sidebar-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-top: 10px;
}

.profile-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(var(--accent-rgb), 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info {
    display: none;
}

.app-version {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar.collapsed .footer-meta {
    display: none;
}

/* Main Content Area */
.main-content {
    margin-left: 200px;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    height: 100vh;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed~.main-content {
    margin-left: 80px;
}

@media (max-width: 768px) {
    .sidebar {
        width: 100% !important;
        height: 70px !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        flex-direction: row !important;
        padding: 0 10px !important;
        border-right: none !important;
        border-top: 1px solid var(--border-color) !important;
        border-radius: 24px 24px 0 0 !important;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.1) !important;
    }

    .sidebar-header,
    .sidebar-footer,
    .btn-toggle {
        display: none !important;
    }

    .sidebar-nav {
        flex-direction: row !important;
        justify-content: space-around !important;
        align-items: center !important;
        width: 100% !important;
        padding: 0 !important;
        gap: 0 !important;
    }

    .nav-item {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 10px !important;
        flex-direction: column !important;
        gap: 4px !important;
        border-radius: 12px !important;
        flex: 1 !important;
    }

    .nav-item.active {
        color: var(--accent) !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    .nav-item.active::before {
        display: none !important;
    }

    .nav-label {
        font-size: 10px !important;
        font-weight: 700 !important;
    }

    .main-content {
        margin-left: 0 !important;
        height: calc(100vh - 70px) !important;
    }

    .content-view {
        padding: 20px !important;
    }

    .dashboard-hub {
        padding: 20px !important;
    }

    .hub-top-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 15px !important;
    }

    .hub-actions {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    .hub-links-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)) !important;
        gap: 8px !important;
    }

    .hub-link-tile {
        padding: 10px !important;
    }

    .hub-link-tile i {
        font-size: 16px !important;
    }

    .hub-link-tile span {
        font-size: 10px !important;
    }

    /* LIMIT MOBILE FUNCTIONALITY TO 2 OPTIONS */

    /* 1. Sidebar items */
    .nav-item:not([data-view="home"]):not([data-view="projects"]):not([data-view="settings"]) {
        display: none !important;
    }

    /* Change Home label to To-Do on mobile */
    .nav-item[data-view="home"] .nav-label {
        font-size: 0 !important;
    }

    .nav-item[data-view="home"] .nav-label::after {
        content: "To-Do";
        font-size: 9px !important;
    }

    /* 2. Home View - Only To-Do */
    .hub-actions-col,
    .hub-reminders-col,
    .hub-decoration {
        display: none !important;
    }

    .hub-todo-col {
        display: block !important;
        width: 100% !important;
    }

    #btn-todo-photo {
        display: flex !important;
    }

    /* 3. Personal View - Only Passwords */
    #view-personal .settings-nav {
        display: none !important;
    }

    .personal-subview:not(#personal-passwords) {
        display: none !important;
    }

    #personal-passwords {
        display: block !important;
    }

    #password-matrix-blocks {
        display: none !important;
    }

    /* RESPONSIVE CARDS FOR MODERN-TABLE */
    .table-container {
        overflow-x: visible !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    .modern-table {
        border: none !important;
        background: transparent !important;
    }

    .modern-table thead {
        display: none !important;
    }

    .modern-table,
    .modern-table tbody,
    .modern-table tr,
    .modern-table td {
        display: block !important;
        width: 100% !important;
    }

    .modern-table tr {
        background: var(--card-bg) !important;
        margin-bottom: 20px !important;
        border-radius: 20px !important;
        padding: 12px 0 !important;
        border: 1px solid var(--border-color) !important;
        box-shadow: var(--shadow-sm) !important;
    }

    [data-theme="dark"] .modern-table tr {
        background: rgba(255, 255, 255, 0.03) !important;
    }

    .modern-table td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 10px 20px !important;
        border: none !important;
        text-align: right !important;
        font-size: 14px !important;
    }

    .modern-table td::before {
        content: attr(data-label);
        font-weight: 700 !important;
        color: var(--text-muted) !important;
        font-size: 11px !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
        text-align: left !important;
        margin-right: 15px !important;
    }

    .modern-table td[data-label="Service"] {
        border-bottom: 1px solid rgba(var(--text-main-rgb), 0.05) !important;
        padding-bottom: 15px !important;
        margin-bottom: 5px !important;
        font-size: 16px !important;
    }

    .modern-table td[data-label="Service"]::before {
        display: none !important;
    }

    .modern-table td[data-label="Service"] {
        justify-content: center !important;
        text-align: center !important;
    }

    .pass-actions {
        display: flex !important;
        gap: 12px !important;
    }

    .actions-wrapper {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 20px !important;
        width: 100% !important;
    }

    .actions-col {
        border-top: 1px solid rgba(var(--text-main-rgb), 0.05) !important;
        margin-top: 10px !important;
        padding: 15px 20px !important;
    }
}

/* To-Do Thumbnail Styling */
.todo-thumbnail {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    margin-right: 12px;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.todo-thumbnail:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.todo-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.todo-item {
    display: flex;
    align-items: center;
}

.todo-text {
    flex: 1;
}

/* Dashboard Full-Width Override */
#view-home {
    padding: 0 !important;
    overflow: hidden !important;
}

#view-map {
    /*padding: 0 !important;*/
    overflow: hidden !important;
}

#view-gtk {
    padding: 0 !important;
    overflow: hidden !important;
}

#view-gtk header {
    padding: 24px 24px 0 24px;
}

.gtk-container {
    padding: 0 24px 24px 24px;
    flex: 1;
    min-height: 0;
}

#view-home .grid-stack {
    margin: 0;
    width: 100% !important;
    max-width: none !important;
    position: relative;
    min-height: 500px;
    /* Ensure drag surface exists */
}


.content-view {
    display: none;
    flex-direction: column;
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    overflow-x: hidden;
    animation: fadeSlideUp 0.4s var(--ease-out-expo);
}

.content-view.active {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    min-height: 100% !important;
    animation: none !important;
}

.content-view header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-shrink: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

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

    to {
        opacity: 1;
        transform: none;
        /* Removed translate to avoid perspective issues during drag */
    }
}

@keyframes softPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }

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

@keyframes glass-shine {
    from {
        transform: translateX(-100%) skewX(-15deg);
    }

    to {
        transform: translateX(200%) skewX(-15deg);
    }
}

/* --- NEW DASHBOARD HUB STYLES --- */
.dashboard-hub {
    padding: 30px 60px;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
    background: radial-gradient(circle at top left, rgba(var(--accent-rgb), 0.05), transparent 40%),
        radial-gradient(circle at bottom right, rgba(var(--accent-rgb), 0.05), transparent 40%);
}

/* Sidebar Welcome Section */
.sidebar-welcome {
    padding: 0 24px 20px 24px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.sidebar-clock {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    line-height: 1;
}

.sidebar-date {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 8px;
}

.sidebar-greeting {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    opacity: 0.9;
}

.sidebar.collapsed .sidebar-welcome {
    display: none;
}

.hub-header {
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.hub-welcome {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.hub-clock-container {
    display: flex;
    flex-direction: column;
    gap: 0px;
}

.hub-clock {
    font-size: 64px;
    font-weight: 300;
    color: var(--text-main);
    line-height: 1;
    letter-spacing: -2px;
    font-family: 'Outfit', sans-serif;
}

.hub-date {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 2px;
}

.hub-greeting-box {
    margin-top: 12px;
}

.hub-greeting {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 2px;
}

.hub-status {
    font-size: 13px;
    color: var(--text-muted);
}

.hub-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
    z-index: 2;
    max-width: 1000px;
}

.hub-tile {
    background: rgba(var(--text-main-rgb), 0.03);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(1px);
}

.hub-tile:hover {
    transform: translateY(-4px);
    background: rgba(var(--text-main-rgb), 0.06);
    border-color: var(--accent);
}

.tile-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
}

.action-projects .tile-icon {
    background: #3b82f6;
}

.action-map .tile-icon {
    background: #f59e0b;
}

.action-sql .tile-icon {
    background: #10b981;
}

.action-gtk .tile-icon {
    background: #ef4444;
}

.tile-label {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
}

.tile-meta {
    font-size: 11px;
    color: var(--text-muted);
}

/* QUICK LINKS */
.hub-section {
    margin-bottom: 30px;
    z-index: 2;
}

.hub-section-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.hub-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    grid-auto-rows: 110px;
    grid-auto-flow: dense;
    gap: 14px;
    width: 100%;
}

.hub-link-wrapper {
    position: relative;
    grid-column: span 1;
    grid-row: span 1;
    height: 110px;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hub-link-wrapper.tile-wide {
    grid-column: span 2;
}

.hub-link-wrapper.tile-tall {
    grid-row: span 2;
    height: 234px;
}

.hub-link-wrapper.tile-large {
    grid-column: span 2;
    grid-row: span 2;
    height: 234px;
}

.hub-link-tile {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(var(--text-main-rgb), 0.04) 0%, rgba(var(--text-main-rgb), 0.01) 100%);
    border: 1px solid rgba(var(--text-main-rgb), 0.08);
    border-radius: 18px;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.15s cubic-bezier(0.2, 0, 0.2, 1), border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(10px);
}

/* Metro Subtle Color Accents */
.hub-link-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), transparent);
    opacity: 0.6;
    transition: opacity 0.3s ease, height 0.3s ease;
}

.hub-link-tile:hover::before {
    opacity: 1;
    height: 4px;
}

/* Windows 8 Metro 3D Press & Hover Animation */
.hub-link-tile:hover {
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.1) 0%, rgba(var(--text-main-rgb), 0.03) 100%);
    border-color: rgba(var(--accent-rgb), 0.4);
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3), 0 0 20px rgba(var(--accent-rgb), 0.15);
}

.hub-link-tile:active {
    transform: scale(0.96) perspective(600px) rotateX(3deg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Metro Tile Top Icon Section */
.hub-link-tile-header {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.hub-link-tile img {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    object-fit: contain;
    transition: transform 0.25s ease;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
}

.hub-link-tile:hover img {
    transform: scale(1.08) rotate(3deg);
}

.hub-link-icon-fallback {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--accent-rgb), 0.12);
    color: var(--accent);
    border: 1px solid rgba(var(--accent-rgb), 0.2);
    border-radius: 12px;
    font-size: 16px;
    transition: transform 0.25s ease, background 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.hub-link-icon-fallback i {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.hub-link-tile:hover .hub-link-icon-fallback {
    transform: scale(1.08) rotate(3deg);
    background: var(--accent);
    color: white;
}

/* Metro Tile Label (Centered) */
.hub-link-label {
    font-size: 12px;
    font-weight: 700;
    color: inherit;
    text-align: center;
    white-space: normal;
    word-break: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    max-width: 100%;
    line-height: 1.25;
    letter-spacing: -0.1px;
}

.hub-link-wrapper.tile-wide .hub-link-tile {
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    text-align: left;
    padding: 14px 18px;
    gap: 14px;
}

.hub-link-wrapper.tile-wide .hub-link-tile-header {
    width: auto;
    justify-content: flex-start;
    flex-shrink: 0;
}

.hub-link-wrapper.tile-wide .hub-link-label {
    text-align: left;
    font-size: 13.5px;
}

/* Metro Tile Action Controls (Delete & Resize) */
.hub-tile-actions {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    gap: 5px;
    opacity: 0.85;
    pointer-events: auto;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 50;
}

.hub-link-wrapper:hover .hub-tile-actions {
    opacity: 1;
    transform: scale(1.05);
}

.btn-tile-action {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 11px;
    transition: transform 0.15s ease, background 0.15s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

.btn-tile-action i {
    font-size: 11px;
    color: #ffffff !important;
    display: block;
    line-height: 1;
    pointer-events: none;
}

.btn-tile-action.resize-btn {
    background: #1e293b !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
}

.btn-tile-action.resize-btn:hover {
    background: var(--accent) !important;
    transform: scale(1.15);
}

.btn-tile-action.delete-btn {
    background: #dc2626 !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.btn-tile-action.delete-btn:hover {
    background: #ef4444 !important;
    transform: scale(1.15);
}

.hub-footer {
    margin-top: auto;
    padding-bottom: 20px;
    z-index: 2;
}

/* Hub Main Layout Grid */
.hub-main-layout {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 20px;
    margin-top: 20px;
    z-index: 2;
    position: relative;
}

@media (max-width: 1200px) {
    .hub-main-layout {
        grid-template-columns: 1fr;
    }
}

.hub-left-column {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.hub-right-column {
    display: flex;
    flex-direction: column;
}

.reminders-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reminder-item {
    background: rgba(var(--text-main-rgb), 0.03);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(2px);
}

.reminder-item:hover {
    background: rgba(var(--text-main-rgb), 0.06);
    border-color: var(--accent);
    /*transform: translateX(4px);*/
}

.reminder-item.completed {
    opacity: 0.5;
}

.reminder-item.completed .reminder-text {
    text-decoration: line-through;
}

.reminder-checkbox {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.reminder-item.completed .reminder-checkbox {
    background: var(--accent);
}

.reminder-item.completed .reminder-checkbox::after {
    content: '\2713';
    color: white;
    font-size: 14px;
    font-weight: 900;
}

.reminder-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

/* Pomodoro Focus Timer */
.pomodoro-card {
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    border-radius: 24px;
    margin-top: 10px;
    background: rgba(var(--accent-rgb), 0.03);
    border: 1px solid rgba(var(--accent-rgb), 0.1);
}

.timer-circle {
    position: relative;
    width: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timer-circle svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-bg {
    fill: none;
    stroke: rgba(var(--text-main-rgb), 0.05);
    stroke-width: 6;
}

.timer-bar {
    fill: none;
    stroke: var(--accent);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
    filter: drop-shadow(0 0 8px rgba(var(--accent-rgb), 0.5));
}

.timer-time {
    font-size: 42px;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    letter-spacing: -1px;
}

.timer-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-timer {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-timer.main {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: var(--accent);
    color: white;
    border: none;
    font-size: 18px;
    box-shadow: 0 8px 20px rgba(var(--accent-rgb), 0.3);
}

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

.btn-timer.main:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 25px rgba(var(--accent-rgb), 0.4);
}

.timer-modes {
    display: flex;
    background: rgba(var(--text-main-rgb), 0.05);
    padding: 4px;
    border-radius: 12px;
    gap: 4px;
}

.timer-mode {
    padding: 6px 16px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.timer-mode.active {
    background: var(--card-bg);
    color: var(--text-main);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.hub-decoration {
    position: absolute;
    top: -100px;
    left: -100px;
    width: 400px;
    height: 400px;
    z-index: 1;
    pointer-events: none;
}

/* Kanban Board Styles */
.kanban-board {
    display: flex;
    gap: 20px;
    padding: 10px 0;
    overflow-x: auto;
    min-height: calc(100vh - 300px);
    align-items: flex-start;
}

.kanban-column {
    background: rgba(var(--text-main-rgb), 0.03);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    min-width: 350px;
    max-width: 350px;
    display: flex;
    flex-direction: column;
    max-height: 100%;
    backdrop-filter: blur(5px);
}

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

.kanban-header h3 {
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-main);
    margin: 0;
}

.kanban-count {
    background: var(--accent);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 20px;
}

.kanban-list {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 200px;
    max-height: 68vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.kanban-list::-webkit-scrollbar {
    width: 4px;
}

.kanban-list::-webkit-scrollbar-track {
    background: transparent;
}

.kanban-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.kanban-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
    cursor: grab;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-sm);
}

.kanban-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

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

.kanban-card.dragging {
    opacity: 0.4;
    transform: scale(0.95);
}

.kanban-card h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-main);
}

.kanban-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.kanban-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(var(--text-main-rgb), 0.05);
    color: var(--text-muted);
}

.kanban-column[data-kanban-status="To Do"] .kanban-header h3 {
    color: #64748b;
}

.kanban-column[data-kanban-status="In Progress"] .kanban-header h3 {
    color: #3b82f6;
}

.kanban-column[data-kanban-status="Done"] .kanban-header h3 {
    color: #10b981;
}

.kanban-list.drag-over {
    background: rgba(var(--accent-rgb), 0.05);
    border-radius: 12px;
}

@media (max-width: 768px) {
    .dashboard-hub {
        padding: 40px 20px;
    }

    .hub-clock {
        font-size: 64px;
    }

    .hub-actions {
        grid-template-columns: 1fr 1fr;
    }
}

.hub-link-tile.add-link-btn {
    border-style: dashed;
    background: rgba(var(--accent-rgb), 0.05);
}

.hub-link-tile.add-link-btn:hover {
    background: rgba(var(--accent-rgb), 0.1);
    border-color: var(--accent);
}

.hub-link-wrapper {
    position: relative;
    transition: transform 0.2s ease;
}

.hub-link-wrapper:hover {
    transform: translateY(-2px);
}

.hub-link-delete {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ff4d4d;
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s, background 0.2s;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    font-size: 10px;
}

.hub-link-wrapper:hover .hub-link-delete {
    opacity: 1;
}

.hub-link-delete:hover {
    background: #ff1a1a;
    transform: scale(1.1);
}

.add-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 16px;
}

.hub-footer {
    margin-top: auto;
    padding-bottom: 20px;
    z-index: 2;
}

.sub-nav-item {
    padding: 10px 24px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: rgba(var(--text-main-rgb), 0.03);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 42px;
}

.sub-nav-item:hover {
    background: rgba(var(--text-main-rgb), 0.06);
    color: var(--text-main);
    border-color: var(--accent);
}

.sub-nav-item.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.3);
}

.sub-nav-item .counter {
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 11px;
    min-width: 20px;
    text-align: center;
}

.project-sub-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    width: 100%;
}

.search-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: none;
    max-height: 300px;
    overflow-y: auto;
    padding: 8px;
    backdrop-filter: blur(1px);
}

.search-dropdown .search-result-item {
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-dropdown .search-result-item:hover {
    background: rgba(var(--accent-rgb), 0.1);
    color: var(--accent);
}

select.sub-nav-item {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px !important;
}

.sub-nav-item.dynamic-tab {
    position: relative;
    padding-right: 40px;
}

.sub-nav-item.dynamic-tab .tab-close {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.sub-nav-item.dynamic-tab .tab-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

#add-project-btn {
    height: 42px;
    padding: 0 24px;
    border-radius: 14px;
    font-weight: 700;
    margin-left: auto;
}

/* Form View Container */
.board-inner-view {
    padding: 24px;
    min-height: 400px;
}

.form-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.form-view-header .header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-view-header .modal-icon {
    font-size: 24px;
}

.form-view-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}


.bento-tile h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: var(--text-main);
}

/* Environment Tile */
.tile-env {
    background: linear-gradient(135deg, var(--sidebar-bg), var(--bg-color));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 12px;
}

.clock-display {
    font-family: 'Outfit', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -1px;
}

.weather-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.weather-city {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    opacity: 0.6;
}

.weather-temp {
    font-size: 20px;
    font-weight: 700;
}

.weather-desc {
    font-size: 12px;
    opacity: 0.8;
}

/* Activity Feed */
/* Project Statistics Dashboard */
.projects-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 15px;
}

.stat-card {
    background: var(--card-bg);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
}

.stat-trend {
    font-size: 11px;
    font-weight: 500;
}

.trend-up {
    color: #10b981;
}

.trend-down {
    color: var(--danger-color);
}

/* Activity Feed */
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 500px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(var(--text-main-rgb), 0.02);
    border-radius: var(--radius-md);
}

.activity-item {
    display: flex;
    gap: 16px;
    padding: 14px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 13px;
    align-items: flex-start;
    transition: var(--transition-fast);
}

.activity-item:hover {
    border-color: var(--accent);
}

.activity-icon-container {
    width: 32px;
    height: 32px;
    background: rgba(var(--accent-rgb), 0.1);
    color: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.activity-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.activity-desc {
    color: var(--text-main);
    line-height: 1.4;
}

.activity-desc b {
    color: var(--accent);
}

.activity-time {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Unified Work Balance Insights Tile */
.tile-work-insights {
    display: flex;
    flex-direction: column;
    background: linear-gradient(145deg, var(--sidebar-bg), rgba(var(--accent-rgb), 0.03));
    padding: 16px !important;
    overflow: hidden;
}

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

.insights-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.insight-card-mini {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.insight-card-mini:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.mini-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.balance-status {
    font-size: 11px;
    font-weight: 600;
    margin-top: 2px;
}

.balance-status.positive {
    color: #10b981;
}

.balance-status.negative {
    color: #ef4444;
}

.insights-chart-container {
    flex: 1;
    min-height: 100px;
    position: relative;
    background: rgba(var(--accent-rgb), 0.02);
    border-radius: var(--radius-md);
    padding: 8px;
    border: 1px dashed rgba(var(--accent-rgb), 0.1);
}

.balance-value {
    font-size: 20px;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.02em;
}

.balance-value.negative {
    color: #ef4444;
}

.balance-value.positive {
    color: #10b981;
}

.balance-cell.positive {
    color: #10b981;
}

.balance-cell.negative {
    color: #ef4444;
}

.grid-stack-item[gs-w="1"] .balance-value,
.grid-stack-item[gs-h="1"] .balance-value {
    font-size: 22px !important;
}

.grid-stack-item[gs-w="1"] .balance-label,
.grid-stack-item[gs-h="1"] .balance-label {
    font-size: 9px !important;
    margin-top: 0 !important;
}

.grid-stack-item[gs-w="1"] .card-header,
.grid-stack-item[gs-h="1"] .card-header {
    margin-bottom: 2px !important;
    padding-top: 4px !important;
}

.grid-stack-item[gs-w="1"] .card-header h3,
.grid-stack-item[gs-h="1"] .card-header h3 {
    font-size: 10px !important;
}

/* Container Queries Enable */
.grid-stack-item-content {
    container-type: both;
}

/* Compact Mode for Small Tiles (gs-w=1 or small resize) */
@container (max-width: 250px) {
    .tile-balance {
        padding: 6px 12px !important;
    }

    .tile-balance .card-header {
        margin-bottom: 2px;
    }

    .tile-balance .card-header h3 {
        font-size: 10px !important;
        letter-spacing: 0;
        white-space: nowrap;
    }

    .balance-inner-box {
        margin: 2px 16px 2px 0;
        padding: 4px;
    }

    .balance-value {
        font-size: clamp(12px, 20cqw, 22px) !important;
    }

    .balance-label {
        font-size: 9px !important;
        margin-top: 0;
    }

    .balance-progress-bar {
        width: 4px;
        right: 4px;
        top: 6px;
        bottom: 6px;
    }
}

/* Mid-range scaling adjustment */
@container (min-width: 181px) and (max-width: 300px) {
    .balance-value {
        font-size: clamp(16px, 16cqw, 32px);
    }
}

.overview-tables-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 20px;
}


.overview-col {
    flex: 1;
    min-width: 450px;
}

.overview-table-container {
    margin-top: 10px;
    overflow-x: auto;
}

.balance-label {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
}

.balance-footer {
    font-size: 11px;
    color: var(--text-muted);
}

.chart-container {
    width: 100%;
    height: 100%;
    min-height: 200px;
    position: relative;
}

/* Sub-tasks Styling (Alpha 0.4) */
.subtasks-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.subtask-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(var(--text-main-rgb), 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.subtask-item:hover {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.05);
}

.subtask-item.completed {
    opacity: 0.6;
}

.subtask-item.completed .subtask-text {
    text-decoration: line-through;
}

.subtask-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent);
}

.subtask-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.subtask-delete {
    opacity: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--danger-color);
    padding: 4px;
    transition: var(--transition);
}

.subtask-item:hover .subtask-delete {
    opacity: 1;
}

.subtask-placeholder {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm);
}

/* Personal View Styling (Alpha 0.5) */
.personal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

.reports-card {
    min-width: 400px;
}

.report-controls {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    margin-top: 20px;
    margin-bottom: 12px;
}

.report-controls .form-group {
    flex: 1;
}

.report-note {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}





/* Home Grid & Quick Links */
.home-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

@media (max-width: 1024px) {
    .home-grid {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(var(--accent-rgb), 0.2);
}

/* Glass Shine Effect */
.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 20%;
    height: 100%;
    background: linear-gradient(to right,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.2) 50%,
            rgba(255, 255, 255, 0) 100%);
    transform: skewX(-15deg);
    pointer-events: none;
}

.card:hover::after {
    animation: glass-shine 0.8s var(--ease-out-expo);
}

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

.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 16px;
}

.quick-link-item-container {
    position: relative;
    display: flex;
    flex-direction: column;
}

.quick-link-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background-color: var(--bg-color);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    text-align: center;
}

.quick-link-item:hover {
    background-color: var(--card-bg);
    border-color: var(--accent);
    box-shadow: var(--shadow);
}

.quick-link-item img,
.quick-link-item span.icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

/* Priority Table Indicators */
.gridjs-td {
    padding: 5px 12px !important;
    position: relative;
}

.priority-row-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    padding-left: 10px;
}

.priority-stripe {
    position: absolute;
    left: -15px;
    top: -12px;
    bottom: -12px;
    width: 4px;
    border-radius: 0 4px 4px 0;
}

.priority-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
    font-family: 'Outfit', sans-serif;
}

/* Priority Colors */
.priority-urgent .priority-stripe,
.priority-urgent .priority-circle {
    background-color: #ff4757;
    color: white;
}

.priority-high .priority-stripe,
.priority-high .priority-circle {
    background-color: #ffa502;
    color: white;
}

.priority-medium .priority-stripe,
.priority-medium .priority-circle {
    background-color: #2f3542;
    color: white;
}

.priority-low .priority-stripe,
.priority-low .priority-circle {
    background-color: #747d8c;
    color: white;
}

/* Light mode overrides for circles if needed */
[data-theme="light"] .priority-circle {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.project-name-text {
    font-weight: 700;
    color: var(--text-main);
    font-size: 15px;
    letter-spacing: -0.2px;
}

.project-col-id {
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-mono, monospace);
    color: var(--text-main);
    opacity: 0.9;
}

.project-col-client {
    font-size: 14px;
    font-weight: 500;
}

.quick-link-item .label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.btn-delete-small {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--danger-color, #ff4d4d);
    color: white;
    border: 2px solid var(--bg-color);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
    font-weight: bold;
    z-index: 10;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.btn-delete-small:hover {
    transform: scale(1.1);
    background-color: #ff3333;
}

.quick-link-item-container:hover .btn-delete-small,
.selection-item:hover .btn-delete-small {
    display: flex;
}

/* SortableJS Styles */
.sortable-ghost {
    opacity: 0.4;
    background: var(--accent) !important;
}

.sortable-chosen {
    cursor: grabbing;
}

/* SQL Manager */
.sql-input-section {
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sql-input-section textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border-radius: var(--radius-md);
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    color: var(--text-main);
    resize: vertical;
}

.sql-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.settings-main-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.settings-main-header .welcome-msg h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.settings-main-header .welcome-msg p {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 14px;
}

.theme-toggle-btn {
    white-space: nowrap;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0 30px 0;
    padding-top: 10px;
}

.settings-header h3 {
    margin: 0;
    font-size: 20px;
}

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

.sql-card {
    background-color: var(--bg-color);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    position: relative;
    max-height: 250px;
    display: flex;
    flex-direction: column;
}

.sql-card h4 {
    margin-bottom: 12px;
    padding-right: 24px;
}

.sql-card pre {
    background-color: var(--card-bg);
    padding: 12px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    overflow-y: auto;
    flex: 1;
    font-family: inherit;
    font-size: 13px;
    margin: 0;
    color: var(--accent);
}

.sql-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
}

.sql-actions .btn-icon {
    font-size: 14px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.btn-edit-sql {
    color: var(--text-main);
}

.btn-delete-sql {
    color: var(--danger-color);
}

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

/* GTK Section */
.gtk-container {
    display: flex;
    gap: 24px;
    flex: 1;
    height: 100%;
    min-height: 0;
}

.gtk-sidebar {
    width: 500px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.gtk-preview {
    flex-grow: 1;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gtk-preview embed,
.gtk-preview iframe {
    width: 100%;
    height: 100%;
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}

.file-item {
    padding: 6px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: rgba(var(--text-main-rgb), 0.02);
}

.file-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* CRITICAL for truncation inside flexbox */
    flex: 1;
}

.pdf-name {
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.pdf-date {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.pdf-item-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.pdf-delete-btn,
.pdf-edit-btn {
    opacity: 0;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    padding: 6px;
    border-radius: 6px;
    transition: var(--transition);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-item:hover .pdf-delete-btn,
.file-item:hover .pdf-edit-btn {
    opacity: 0.6;
}

.pdf-delete-btn:hover {
    opacity: 1 !important;
    background: rgba(var(--danger-color-rgb), 0.1);
    color: var(--danger-color);
    transform: scale(1.1);
}

.pdf-edit-btn:hover {
    opacity: 1 !important;
    background: rgba(var(--accent-rgb), 0.1);
    color: var(--accent);
    transform: scale(1.1);
}

.file-item:hover,
.file-item.active {
    background-color: var(--card-bg);
    border-color: var(--accent);
}

/* Settings — Full Width Layout */
.settings-layout {
    display: flex;
    flex: 1;
    gap: 0;
    min-height: 0;
    width: 100%;
    overflow: hidden;
    margin-top: 0;
}

/* Settings content area */
.settings-content {
    flex: 1;
    min-width: 0;
    width: 100%;
    overflow-y: auto;
    padding: 0 0 24px 0 !important;
}

.settings-content::-webkit-scrollbar {
    width: 4px;
}

.settings-content::-webkit-scrollbar-thumb {
    background: rgba(var(--text-main-rgb), 0.15);
    border-radius: 4px;
}

/* Nav items â€” vertical style */
.settings-nav-item {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    padding: 10px 14px;
    border-radius: 12px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    font-size: 13.5px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    position: relative;
}

.settings-nav-item i {
    width: 16px;
    text-align: center;
    font-size: 14px;
    opacity: 0.7;
    flex-shrink: 0;
}

.settings-nav-item:hover {
    background: rgba(var(--text-main-rgb, 255, 255, 255), 0.05);
    color: var(--text-main);
}

.settings-nav-item:hover i {
    opacity: 1;
}

.settings-nav-item.active {
    background: rgba(var(--accent-rgb), 0.12);
    color: var(--accent) !important;
    font-weight: 700;
}

.settings-nav-item.active i {
    opacity: 1;
}

.settings-nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 3px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}

.settings-subview {
    display: none;
    animation: settingsFadeIn 0.25s ease-out;
}

@keyframes settingsFadeIn {
    from {
        opacity: 0;
        transform: translateX(6px);
    }

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

.settings-subview.active {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    animation: none !important;
}

.selection-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.info-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: var(--transition);
}

.info-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.info-card-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.info-card-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
}

.info-card-label {
    font-size: 12px;
    color: var(--text-muted);
}

.info-card .dot {
    width: 10px;
    height: 10px;
}

.selection-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background-color: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    position: relative;
    /* Fixed: Absolute children will now anchor here */
}

.selection-info {
    display: flex;
    gap: 24px;
    flex-grow: 1;
}

.selection-item .category-tag {
    background-color: var(--sidebar-bg);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent);
}

/* General Utilities */
.coming-soon {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-style: italic;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    box-shadow: 0 6px 16px rgba(var(--accent-rgb), 0.3);
    filter: brightness(1.1);
}

.btn-primary:active {
    transform: translateY(1px) scale(0.97);
    box-shadow: 0 2px 4px rgba(var(--accent-rgb), 0.1);
}

.btn-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-icon:hover {
    background-color: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: scale(1.1);
}

select {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--text-main);
    outline: none;
}

/* Dashboard Cards */
.board-container {
    background-color: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 10px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    width: 100%;
}

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

.input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
}

input[type="text"] {
    flex-grow: 1;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--text-main);
    outline: none;
    transition: var(--transition);
}

input[type="text"]:focus {
    border-color: var(--accent);
}

button {
    transition: var(--transition-fast);
}

button:active {
    transform: scale(0.96);
}

button.primary {
    padding: 12px 24px;
    background-color: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

button.primary:hover {
    background-color: var(--accent-hover);
}

.task-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    gap: 16px;
    transition: var(--transition);
}

.task-item:last-child {
    border-bottom: none;
}

.task-item:hover {
    background-color: rgba(141, 164, 126, 0.05);
}

.checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid var(--accent);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.checkbox.checked {
    background-color: var(--accent);
}

.checkbox.checked::after {
    content: '\2713';
    color: white;
    font-size: 14px;
}

.task-text {
    flex-grow: 1;
    font-size: 16px;
}

.task-text.done {
    text-decoration: line-through;
    color: var(--text-muted);
}

.delete-btn {
    opacity: 0;
    cursor: pointer;
    color: #ff6b6b;
    font-weight: 800;
    padding: 4px 8px;
    transition: var(--transition);
}

.task-item:hover .delete-btn {
    opacity: 1;
}

/* Theme Toggle Button */
#theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    cursor: pointer;
    font-size: 14px;
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--card-bg);
    padding: 32px;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.modal-content h2 {
    margin-bottom: 30px;
}

.form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
    flex: 1;
    min-width: 0;
}

.form-group.no-label {
    margin-bottom: 20px;
}

.form-group>label {
    position: absolute;
    left: 12px;
    top: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent);
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 10 !important;
    opacity: 0.9;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 24px 12px 8px;
    /* Room at top for the label */
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    color: var(--text-main);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23999' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    background-color: var(--bg-color);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

/* Specific adjustment for textarea to keep label at top */
.form-group textarea {
    min-height: 100px;
    padding-top: 28px;
}

/* Adjust for fieldset title spacing */
.fieldset-box {
    margin-bottom: 20px;
}

.fieldset-title {
    margin-bottom: 16px;
}

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
    cursor: pointer;
}

.form-actions,
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.btn-secondary {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-muted);
}

.btn-danger {
    padding: 12px 24px;
    background-color: var(--danger-color);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.btn-danger:hover {
    background-color: #d32f2f;
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

/* Grid.js Customization */
.gridjs-container {
    padding: 0;
    color: var(--text-main) !important;
}

.gridjs-wrapper {
    border: none !important;
    border-radius: var(--radius-md);
}

.gridjs-th {
    background-color: var(--sidebar-bg) !important;
    color: var(--text-muted) !important;
    font-weight: 600 !important;
    border: none !important;
}

.gridjs-td {
    background-color: var(--card-bg) !important;
    color: var(--text-main) !important;
    border: none !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.gridjs-tr:last-child .gridjs-td {
    border-bottom: none !important;
}

.gridjs-footer {
    background-color: var(--sidebar-bg) !important;
    border: none !important;
    color: var(--text-muted) !important;
    padding: 12px 24px !important;
    border-top: 1px solid var(--border-color) !important;
}

.gridjs-summary {
    color: var(--text-muted) !important;
}

.gridjs-pages button {
    background-color: var(--bg-color) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-sm) !important;
    transition: var(--transition) !important;
}

.gridjs-pages button:hover {
    background-color: var(--card-bg) !important;
    border-color: var(--accent) !important;
}

.gridjs-pages button.gridjs-currentPage {
    background-color: var(--accent) !important;
    color: white !important;
    border-color: var(--accent) !important;
}

.gridjs-search {
    width: 100%;
    padding: 24px 30px !important;
    background: rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid var(--border-color);
}

.gridjs-search-input {
    width: 400px !important;
    background: rgba(0, 0, 0, 0.2) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    padding: 12px 20px !important;
    color: var(--text-main) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    outline: none !important;
    transition: all 0.2s !important;
}

.gridjs-search-input:focus {
    border-color: var(--accent) !important;
    background: rgba(0, 0, 0, 0.3) !important;
    box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.1) !important;
}

.gridjs-tr {
    transition: background 0.2s;
}

.gridjs-tr:hover td {
    background: rgba(255, 255, 255, 0.02) !important;
}

/* Modal Actions for centering */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

/* Selection Info 50% width adjustment */
.selection-info {
    display: flex;
    gap: 24px;
    flex-grow: 1;
}

.selection-info span:last-child {
    flex: 1;
    min-width: 50%;
}

.category-filters-container {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    align-items: center;
}

.filter-btn {
    padding: 8px 20px !important;
    height: 36px !important;
    border-radius: 18px !important;
    border: 1px solid rgba(var(--text-main-rgb), 0.15) !important;
    background: rgba(var(--text-main-rgb), 0.05) !important;
    color: var(--text-muted) !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    white-space: nowrap !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
}

.filter-btn:hover {
    border-color: var(--accent) !important;
    color: var(--accent) !important;
    background: rgba(var(--accent-rgb), 0.1) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

.filter-btn.active {
    background: var(--accent) !important;
    color: white !important;
    border-color: var(--accent) !important;
    box-shadow: 0 4px 15px rgba(var(--accent-rgb), 0.3) !important;
}

[data-theme="dark"] .filter-btn {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.7) !important;
}

[data-theme="dark"] .filter-btn:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: white !important;
    border-color: var(--accent) !important;
}

[data-theme="dark"] .filter-btn.active {
    background: var(--accent) !important;
    color: #1a1a1a !important;
    border-color: var(--accent) !important;
}

.gridjs-head {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 24px !important;
    padding-bottom: 24px !important;
}

.gridjs-search {
    padding: 0 !important;
    margin: 0 !important;
    float: none !important;
}

.gridjs-search-input {
    width: 240px !important;
    padding: 10px 16px !important;
}

.gridjs-search-input {
    border-radius: var(--radius-md) !important;
    border: 1px solid var(--border-color) !important;
    background-color: var(--bg-color) !important;
    color: var(--text-main) !important;
}

/* Glassmorphism utility */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    min-width: 320px;
    max-width: 420px;
    padding: 14px 20px;
    border-radius: 14px;
    background: rgba(13, 14, 18, 0.85) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #f3f4f6 !important;
    display: flex;
    align-items: center;
    gap: 14px;
    animation: toast-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    cursor: pointer;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.5),
        0 1px 0 rgba(255, 255, 255, 0.1) inset;
    transition: all 0.3s ease;
}

/* Accent Indicator Line */
.toast .toast-accent {
    width: 3px;
    height: 24px;
    border-radius: 99px;
    flex-shrink: 0;
}

/* Toast Text Area */
.toast .toast-content {
    font-size: 13px;
    line-height: 1.5;
    font-family: 'Outfit', sans-serif !important;
    color: #e5e7eb;
}

.toast .toast-content strong {
    color: #ffffff;
    font-weight: 600;
}

/* Success status */
.toast.success {
    border-color: rgba(16, 185, 129, 0.35) !important;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.5),
        0 1px 0 rgba(255, 255, 255, 0.1) inset,
        0 0 18px rgba(16, 185, 129, 0.15) !important;
}

.toast.success .toast-accent {
    background: #10b981;
}

/* Error status (using red/orange like the top toast) */
.toast.error {
    border-color: rgba(239, 68, 68, 0.35) !important;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.5),
        0 1px 0 rgba(255, 255, 255, 0.1) inset,
        0 0 18px rgba(239, 68, 68, 0.15) !important;
}

.toast.error .toast-accent {
    background: #ef4444;
}

/* Warning status (using yellow/amber like the 3rd toast) */
.toast.warning {
    border-color: rgba(245, 158, 11, 0.35) !important;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.5),
        0 1px 0 rgba(255, 255, 255, 0.1) inset,
        0 0 18px rgba(245, 158, 11, 0.15) !important;
}

.toast.warning .toast-accent {
    background: #f59e0b;
}

/* Info status (using blue like the bottom toast) */
.toast.info {
    border-color: rgba(59, 130, 246, 0.35) !important;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.5),
        0 1px 0 rgba(255, 255, 255, 0.1) inset,
        0 0 18px rgba(59, 130, 246, 0.15) !important;
}

.toast.info .toast-accent {
    background: #3b82f6;
}

@keyframes toast-in {
    from {
        transform: translateX(120%);
        opacity: 0;
    }

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

.toast-out {
    animation: toast-out 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toast-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

.dashboard-toolbar {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--glass-bg);
    backdrop-filter: blur(2px);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    z-index: 10;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.view-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.grid-stack {
    width: 100% !important;
    min-height: 800px;
    position: relative;
    padding: 10px;
    transition: background-color 0.3s;
}

.edit-mode-active.grid-stack {
    background-image:
        linear-gradient(rgba(var(--text-main-rgb), 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--text-main-rgb), 0.05) 1px, transparent 1px);
    /* 8 columns at 100% width. Row height 110px to match JS cellHeight. */
    background-size: calc(100% / 8) 110px;
    background-position: left top;
}

.grid-stack.edit-mode-active {
    background-color: rgba(var(--accent-rgb), 0.03);
    background-image:
        linear-gradient(rgba(var(--accent-rgb), 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--accent-rgb), 0.08) 1px, transparent 1px);
    background-size: 12.5% 110px;
    border-radius: var(--radius-lg);
    transition: all 0.5s ease;
    animation: blueprintPulse 4s ease-in-out infinite alternate;
}

@keyframes blueprintPulse {
    0% {
        background-color: rgba(var(--accent-rgb), 0.02);
    }

    100% {
        background-color: rgba(var(--accent-rgb), 0.05);
    }
}


/* GridStack 8-column Core Overrides (Fail-safe) */
.grid-stack>.grid-stack-item {
    min-width: 0;
    position: absolute !important;
}

/* Drag Handle Styling */
.drag-handle {
    position: absolute;
    top: 10px;
    left: 10px;
    /* Moved to left for better ergonomcis */
    width: 32px;
    height: 32px;
    background: var(--accent);
    color: white;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: grab;
    z-index: 100;
    /* Extremely high to be above all content */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s, background 0.2s;
}

.drag-handle:active {
    cursor: grabbing;
    transform: scale(1.1);
}

.edit-mode-active .drag-handle {
    display: flex;
}

.edit-mode-active .grid-stack-item-content {
    outline: 2px dashed var(--accent);
    outline-offset: -4px;
    /* Ensure it stays inside */
    box-shadow: 0 10px 25px rgba(var(--accent-rgb), 0.2) !important;
    animation: floatingTile 3s ease-in-out infinite;
}

/* Hard reset for dragging elements to ensure perfect coordinates */
.grid-stack-item.ui-draggable-dragging .grid-stack-item-content,
.grid-stack-item.grid-stack-item-moving .grid-stack-item-content {
    animation: none !important;
    transform: none !important;
    transition: none !important;
}

/* Premium Resize Handle (Alpha 0.8.12) */
.ui-resizable-handle.ui-resizable-se {
    width: 28px !important;
    height: 28px !important;
    right: 5px !important;
    bottom: 5px !important;
    background: var(--accent) !important;
    border-radius: 50% 0 8px 0 !important;
    display: none !important;
    align-items: center;
    justify-content: center;
    cursor: nwse-resize;
    z-index: 100 !important;
}

.edit-mode-active .ui-resizable-handle.ui-resizable-se {
    display: flex !important;
}

.ui-resizable-handle.ui-resizable-se::after {
    content: "";
    width: 10px;
    height: 10px;
    border-right: 3px solid white;
    border-bottom: 3px solid white;
    border-bottom-right-radius: 2px;
    opacity: 1;
}


/* Iron Width Protection (Alpha 0.8.6) - Forced 8-column geometry only when NOT moving */
.grid-stack>.grid-stack-item:not(.ui-draggable-dragging):not(.ui-resizable-resizing):not(.grid-stack-placeholder) {
    min-width: calc(100% / 8) !important;
    position: absolute !important;
}

.grid-stack>.grid-stack-item:not(.ui-draggable-dragging)[gs-w="1"] {
    width: calc(100% / 8 * 1) !important;
}

.grid-stack>.grid-stack-item:not(.ui-draggable-dragging)[gs-w="2"] {
    width: calc(100% / 8 * 2) !important;
}

.grid-stack>.grid-stack-item:not(.ui-draggable-dragging)[gs-w="3"] {
    width: calc(100% / 8 * 4) !important;
}

/* Adjusted grid for 8 */
.grid-stack>.grid-stack-item:not(.ui-draggable-dragging)[gs-w="3"] {
    width: calc(100% / 8 * 3) !important;
}

.grid-stack>.grid-stack-item:not(.ui-draggable-dragging)[gs-w="4"] {
    width: calc(100% / 8 * 4) !important;
}

.grid-stack>.grid-stack-item:not(.ui-draggable-dragging)[gs-w="5"] {
    width: calc(100% / 8 * 5) !important;
}

.grid-stack>.grid-stack-item:not(.ui-draggable-dragging)[gs-w="6"] {
    width: calc(100% / 8 * 6) !important;
}

.grid-stack>.grid-stack-item:not(.ui-draggable-dragging)[gs-w="7"] {
    width: calc(100% / 8 * 7) !important;
}

.grid-stack>.grid-stack-item:not(.ui-draggable-dragging)[gs-w="8"] {
    width: 100% !important;
}

/* X-Pos Iron Helpers - Exempt while dragging */
.grid-stack>.grid-stack-item:not(.ui-draggable-dragging)[gs-x="1"] {
    left: calc(100% / 8 * 1) !important;
}

.grid-stack>.grid-stack-item:not(.ui-draggable-dragging)[gs-x="2"] {
    left: calc(100% / 8 * 2) !important;
}

.grid-stack>.grid-stack-item:not(.ui-draggable-dragging)[gs-x="3"] {
    left: calc(100% / 8 * 3) !important;
}

.grid-stack>.grid-stack-item:not(.ui-draggable-dragging)[gs-x="4"] {
    left: calc(100% / 8 * 4) !important;
}

.grid-stack>.grid-stack-item:not(.ui-draggable-dragging)[gs-x="5"] {
    left: calc(100% / 8 * 5) !important;
}

.grid-stack>.grid-stack-item:not(.ui-draggable-dragging)[gs-x="6"] {
    left: calc(100% / 8 * 6) !important;
}

.grid-stack>.grid-stack-item:not(.ui-draggable-dragging)[gs-x="7"] {
    left: calc(100% / 8 * 7) !important;
}

/* Y-Pos Iron Helpers - Exempt while dragging (Alpha 0.8.9) - 110px Rows */
.grid-stack>.grid-stack-item:not(.ui-draggable-dragging)[gs-y="0"] {
    top: 10px !important;
}

.grid-stack>.grid-stack-item:not(.ui-draggable-dragging)[gs-y="1"] {
    top: 120px !important;
}

.grid-stack>.grid-stack-item:not(.ui-draggable-dragging)[gs-y="2"] {
    top: 230px !important;
}

.grid-stack>.grid-stack-item:not(.ui-draggable-dragging)[gs-y="3"] {
    top: 340px !important;
}

.grid-stack>.grid-stack-item:not(.ui-draggable-dragging)[gs-y="4"] {
    top: 450px !important;
}

.grid-stack>.grid-stack-item:not(.ui-draggable-dragging)[gs-y="5"] {
    top: 560px !important;
}

.grid-stack>.grid-stack-item:not(.ui-draggable-dragging)[gs-y="6"] {
    top: 670px !important;
}

.grid-stack>.grid-stack-item:not(.ui-draggable-dragging)[gs-y="7"] {
    top: 780px !important;
}

.grid-stack>.grid-stack-item:not(.ui-draggable-dragging)[gs-y="8"] {
    top: 890px !important;
}

.grid-stack>.grid-stack-item:not(.ui-draggable-dragging)[gs-y="9"] {
    top: 1000px !important;
}

.grid-stack>.grid-stack-item:not(.ui-draggable-dragging)[gs-y="10"] {
    top: 1110px !important;
}




/* Compact 1x1 Layout Optimizations */
.grid-stack-item[gs-w="1"] .card-header h3,
.grid-stack-item[gs-h="1"] .card-header h3 {
    font-size: 11px !important;
    max-width: 60px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.grid-stack-item[gs-w="1"] .balance-footer,
.grid-stack-item[gs-w="1"] .weather-desc,
.grid-stack-item[gs-w="1"] .weather-city,
.grid-stack-item[gs-w="1"] .date-tag,
.grid-stack-item[gs-w="1"] .btn-icon {
    display: none !important;
}


.grid-stack-item[gs-w="1"] .clock-display {
    font-size: 18px !important;
}

.grid-stack-item[gs-w="1"][gs-h="1"].tile-deadline .deadline-box h4 {
    font-size: 12px !important;
}

.grid-stack-item[gs-w="1"] .welcome-content h1 {
    font-size: 14px !important;
    /* Smaller for 1x2 */
}

.grid-stack-item[gs-w="1"] #current-day-info {
    display: none !important;
    /* Hide long date in narrow vertical view */
}

.grid-stack-item[gs-w="1"] .grid-stack-item-content {
    padding: 10px !important;
}


/* 1x2 and Narrow-Tall Vertical Layouts */
.grid-stack-item .grid-stack-item-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 15px !important;
}

.stat-val {
    font-size: 24px !important;
    font-weight: 700 !important;
    color: var(--accent);
    display: block;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 11px !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
}

.grid-stack-item[gs-w="1"] .welcome-content h1 {
    font-size: 14px !important;
}


.grid-stack-item[gs-w="1"] .tile-welcome {
    flex-direction: column !important;
    padding: 20px 10px !important;
    gap: 10px;
}

.grid-stack-item[gs-w="1"] .tile-welcome h1 {
    font-size: 18px !important;
    margin-bottom: 5px;
}

.grid-stack-item[gs-w="1"] .welcome-main {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.grid-stack-item[gs-w="1"] .stats-mini-grid {
    grid-template-columns: 1fr;
    gap: 8px;
}

.grid-stack-item[gs-w="1"] .tile-env {
    flex-direction: column !important;
    justify-content: center;
    gap: 15px;
}


.dashboard-header {
    margin-bottom: 30px;
    padding: 24px 40px !important;
    background: linear-gradient(135deg, var(--accent) 0%, #4facfe 100%) !important;
    color: white !important;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    min-height: 140px;
}

.header-widgets {
    display: flex;
    align-items: center;
    gap: 30px;
    background: rgba(255, 255, 255, 0.1);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    backdrop-filter: blur(1px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.header-widgets .clock-display {
    font-size: 36px;
    color: white;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -1px;
}

.header-widgets .weather-info {
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding-left: 20px;
}

.header-widgets .weather-city {
    display: none;
    /* Hide city name in header to save space */
}

.header-widgets .weather-temp {
    font-size: 24px;
    font-weight: 800;
    color: white;
}

.header-widgets .weather-desc {
    font-size: 13px;
    font-weight: 600;
    opacity: 0.9;
    color: white;
}

.welcome-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.dashboard-header h1 {
    color: white !important;
    margin-bottom: 8px;
    font-size: 32px;
}

/* Clear Grid In Non-Edit Mode */
.grid-stack-item-content {
    inset: 5px;
    background: rgba(var(--card-bg-rgb), 0.8) !important;
    backdrop-filter: blur(2px) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-sm) !important;
    overflow: hidden;
    transition: var(--transition);
}

/* Indicators ONLY in Edit Mode */
.edit-mode-active .grid-stack-item-content {
    border: 1px solid var(--accent) !important;
    box-shadow: var(--shadow-md) !important;
    outline: 2px dashed var(--accent);
}

.edit-mode-active .drag-handle {
    display: flex !important;
}

.dashboard-header {
    margin-bottom: 0px;
    padding: 30px 40px !important;
    background: linear-gradient(135deg, var(--accent) 0%, #4facfe 100%) !important;
    color: white !important;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: none !important;
}

.dashboard-header h1 {
    color: white !important;
    margin-bottom: 8px;
    font-size: 32px;
}

.tile-welcome h1 {
    color: white !important;
    margin-bottom: 8px;
    font-size: 28px;
}

.btn-welcome {
    background: rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(1px);
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: white !important;
    padding: 10px 20px !important;
    font-size: 14px !important;
    border-radius: var(--radius-md) !important;
    font-weight: 600 !important;
    transition: all 0.2s ease;
}

.btn-welcome:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}


/* Stats Tile (Modular in Alpha 0.9.0) */
.tile-stats {
    padding: 20px !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stats-mini-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    width: 100%;
}

/* Quick Links Adaptive Grid (Alpha 0.9.0) */
.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    padding: 10px;
    width: 100%;
    margin-top: 10px;
}


.stats-mini-grid .stat-box {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(2px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 15px;
    border-radius: var(--radius-md);
    text-align: center;
    color: white;
}

.stats-mini-grid .stat-val {
    color: white;
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
}

.stats-mini-grid .stat-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
    margin-top: 4px;
}


.bento-tile {
    min-height: 100px;
    /* Reduced to fit 1-row GridStack items */
    display: flex;
    flex-direction: column;
}


.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 10px;
}

.stat-box {
    background: var(--bg-color);
    padding: 12px;
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px solid var(--border-color);
}

.stat-val {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.deadline-box {
    margin-top: 10px;
}

.date-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    background: var(--accent);
    color: white;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
}

@media (max-width: 1200px) {
    .home-grid-bento {
        grid-template-columns: repeat(2, 1fr);
        padding: 16px;
    }

    .tile-welcome,
    .tile-env,
    .tile-stats,
    .tile-quicklinks,
    .tile-balance,
    .tile-deadline,
    .tile-todo,
    .tile-activity {
        grid-column: span 2;
        grid-row: auto;
    }
}

@media (max-width: 768px) {
    .home-grid-bento {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .tile-welcome,
    .tile-env,
    .tile-stats,
    .tile-quicklinks,
    .tile-balance,
    .tile-deadline,
    .tile-todo,
    .tile-activity {
        grid-column: 1;
        grid-row: auto;
    }
}


.calendar-card {
    padding: 0px !important;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.calendar-nav {
    display: flex;
    gap: 10px;
}

.calendar-grid-header {
    display: grid;
    grid-template-columns: 50px repeat(7, 1fr);
    text-align: center;
    font-weight: 700;
    color: var(--text-muted);
    font-size: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    background: rgba(var(--card-bg-rgb), 0.5);
    backdrop-filter: blur(2px);
    border-bottom: 1px solid var(--border-color);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.calendar-days-grid {
    display: grid;
    grid-template-columns: 50px repeat(7, 1fr);
    background: var(--border-color);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--radius-lg);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.modal-content {
    background: var(--card-bg);
    width: 90%;
    max-width: 600px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    animation: modalBounceIn 0.5s var(--ease-elastic);
    transform-origin: center;
}

@keyframes modalBounceIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

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

.calendar-day {
    background: var(--card-bg);
    min-height: 130px;
    padding: 12px;
    position: relative;
    border: 1px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.calendar-day:hover {
    background: rgba(var(--accent-rgb), 0.02);
}

.calendar-day::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: all 0.3s ease;
    transform: translateX(-50%);
    opacity: 0;
}

.calendar-day:hover::after {
    width: 80%;
    opacity: 0.5;
}

.calendar-day.today::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent);
    z-index: 1;
}

.calendar-day.other-month {
    opacity: 0.4;
    background: rgba(var(--text-main-rgb), 0.02);
}

.day-number {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
}

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

.day-hours-badge {
    background: rgba(var(--accent-rgb), 0.1);
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.day-hours-badge:hover {
    background: var(--accent);
    color: white;
}

.day-hours-badge.target-reached {
    background: #10b981;
    color: white;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.day-hours-badge.target-reached .variance-over {
    color: #ccfbf1;
}

/* Shift Details Styling */
.shift-details-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 10px 0;
}

.shift-item {
    background: rgba(var(--text-main-rgb), 0.03);
    padding: 12px;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--accent);
}

.shift-main {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.shift-place {
    font-weight: 700;
    font-size: 14px;
}

.shift-duration {
    font-weight: 700;
    color: var(--accent);
}

.shift-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

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

.shift-actions .btn-icon {
    padding: 2px;
    font-size: 14px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.shift-actions .btn-icon:hover {
    opacity: 1;
}

.shift-meta .target {
    font-style: italic;
    opacity: 0.8;
}

.variance-over {
    color: #10b981;
    font-weight: 700;
}

.variance-under {
    color: #ef4444;
    font-weight: 700;
}

.variance-zero {
    color: var(--text-muted);
}

/* New: Multi-day Event Bars */
.calendar-event-bar {
    font-size: 11px;
    padding: 6px 12px;
    margin-bottom: 4px;
    border-radius: 8px;
    background: var(--accent);
    color: white;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.2s ease;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.calendar-event-bar:hover {
    transform: translateY(-1.5px) scale(1.02);
    box-shadow: 0 6px 15px rgba(var(--accent-rgb), 0.35);
    filter: brightness(1.1);
}

.calendar-event-bar.status-finish {
    background: linear-gradient(135deg, #10b981, #059669);
}

.calendar-event-bar.status-in-progress {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.calendar-event-bar.status-planned {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.calendar-event-bar.status-hold {
    background: linear-gradient(135deg, #64748b, #475569);
}

.calendar-event-bar.status-waiting {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

[data-theme="dark"] .calendar-event-bar {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Reminders List Widget */
.reminders-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 0;
    max-height: 200px;
    overflow-y: auto;
    width: 100%;
}

.reminder-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background-color: var(--bg-color);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.reminder-item:hover {
    background-color: var(--card-bg);
    border-color: var(--accent);
}

.reminder-check {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: transparent;
    transition: var(--transition);
    flex-shrink: 0;
}

.reminder-item.is-done .reminder-check {
    background-color: var(--accent);
    color: white;
}

.reminder-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
    transition: var(--transition);
}

.reminder-item.is-done .reminder-text {
    text-decoration: line-through;
    opacity: 0.5;
}

.reminder-delete {
    opacity: 0;
    color: var(--danger-color);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
}

.reminder-item:hover .reminder-delete {
    opacity: 1;
}

.tile-daily-reminders {
    display: flex;
    flex-direction: column;
    align-items: stretch !important;
}

.tile-input-group {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px dashed var(--border-color);
    width: 100%;
}

.tile-input-group input {
    flex: 1;
    background: rgba(var(--text-main-rgb), 0.05);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-main);
}

.btn-add-small {
    background-color: var(--accent);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: bold;
    font-size: 18px;
}

/* Animations */
@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

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

.calendar-days-grid {
    animation: slideInUp 0.4s ease-out;
}

/* Spotlight Modal */
.spotlight-modal {
    align-items: flex-start !important;
    padding-top: 10vh;
}

.spotlight-modal .modal-content {
    width: 600px;
    max-width: 90%;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    gap: 16px;
}

.search-icon {
    font-size: 20px;
    opacity: 0.5;
}

#spotlight-input {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-main);
    width: 100%;
    outline: none;
}

.search-results {
    max-height: 400px;
    overflow-y: auto;
    padding: 12px 0;
    display: none;
}

.search-category {
    padding: 8px 0;
}

.search-category label {
    display: block;
    padding: 4px 24px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent);
    letter-spacing: 1px;
    opacity: 0.8;
}

.results-list {
    display: flex;
    flex-direction: column;
}

.search-result-item {
    padding: 10px 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
}

.search-result-item:hover {
    background: rgba(var(--accent-rgb), 0.05);
}

.search-result-item .icon {
    font-size: 16px;
}

.search-result-item .title {
    font-weight: 500;
    font-size: 14px;
}

.search-footer {
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 20px;
    font-size: 11px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
}

kbd {
    background: var(--border-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace
}

/* --- Premium Cozy Scrollbar --- */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(var(--accent-rgb), 0.4);
    border-radius: 10px;
    border: 3px solid var(--bg-color);
    transition: var(--transition);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border: 3px solid var(--card-bg);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--accent-rgb), 0.7);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* --- Quick Tasks Premium Refinements --- */
.todo-list {
    max-height: 280px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.todo-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(var(--text-main-rgb), 0.03);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    width: 100%;
    flex-wrap: nowrap;
    gap: 15px;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.todo-item:hover {
    background: rgba(var(--text-main-rgb), 0.06);
    transform: translateX(4px);
    border-color: var(--accent);
}

.todo-item span {
    flex-grow: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.todo-item.completed {
    opacity: 0.6;
}

.todo-item.completed span {
    text-decoration: line-through;
    color: var(--text-muted);
}

.todo-item .todo-actions {
    display: flex;
    gap: 6px;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.2s ease;
}

.todo-item:hover .todo-actions {
    opacity: 1;
    transform: translateX(0);
}

.btn-todo {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    cursor: pointer;
    font-size: 16px;
    padding: 6px;
    border-radius: 8px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
}

.btn-todo:hover {
    background: rgba(var(--text-main-rgb), 0.1) !important;
}

.btn-todo-complete {
    color: #10b981;
}

.btn-todo-delete {
    color: var(--danger-color);
}

/* === Sidebar Footer & Diagnostics === */
.sidebar-footer {
    margin-top: auto;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar {
    width: 260px;
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px 10px;
    transition: width var(--transition-slow);
    z-index: 100;
}

.diag-info {
    font-size: 10px;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    opacity: 0.7;
}

.diag-item {
    background: rgba(var(--primary-rgb), 0.1);
    padding: 2px 7px;
    border-radius: 4px;
    white-space: nowrap;
    font-family: monospace;
}

.diag-item.ok {
    color: #4ade80;
}

.diag-item.err {
    color: #f87171;
}

/* === Coming Soon === */
.coming-soon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 300px;
    font-size: 1.1rem;
    color: var(--text-muted);
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    margin: 24px;
    background: rgba(var(--primary-rgb), 0.02);
}

/* === Quick Tasks Scrollbar === */
.todo-list::-webkit-scrollbar {
    width: 6px;
}

.todo-list::-webkit-scrollbar-track {
    background: rgba(var(--primary-rgb), 0.05);
    border-radius: 10px;
}

.todo-list::-webkit-scrollbar-thumb {
    background: rgba(var(--primary-rgb), 0.4);
    border-radius: 10px;
}

.todo-list::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--primary-rgb), 0.7);
}

/* Settings Row */
.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

/* --- Project Enhancements --- */

/* Tab Counters */
.sub-nav-item .counter {
    background: rgba(var(--accent-rgb), 0.15);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    margin-left: 8px;
    transition: var(--transition);
}

.sub-nav-item.active .counter {
    background: rgba(0, 0, 0, 0.2);
    color: white;
}

[data-theme-mode="onyx"] .sub-nav-item.active .counter {
    background: rgba(0, 0, 0, 0.25) !important;
    color: white !important;
}

/* --- Premium Glassy Tags (All Themes) --- */
.tags-row-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: nowrap;
}

.premium-tag {
    --current-tag-color: var(--tag-color, #808080);
    --current-tag-font: var(--tag-font, #fff);

    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px 2px 6px;
    border-radius: 50px;
    font-size: 10px;
    font-weight: 700;
    text-transform: capitalize;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    position: relative;
    height: 24px;
    box-sizing: border-box;

    /* Strong Glass Effect */
    background: var(--current-tag-color) !important;
    color: var(--current-tag-font) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);

    background-color: color-mix(in srgb, var(--current-tag-color), transparent 60%) !important;

    box-shadow:
        inset 0 0 10px rgba(255, 255, 255, 0.1),
        0 4px 15px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .premium-tag {
    --current-tag-color: var(--tag-color-light, var(--tag-color, #808080));
    --current-tag-font: var(--tag-font-light, #333);

    background-color: color-mix(in srgb, var(--current-tag-color), transparent 75%) !important;
    color: var(--current-tag-font) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

[data-theme="dark"] .premium-tag {
    --current-tag-color: var(--tag-color, #808080);
    --current-tag-font: var(--tag-font, #fff);
}

.premium-tag:hover {
    background-color: color-mix(in srgb, var(--current-tag-color), transparent 40%) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.tag-icon-circle {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: var(--current-tag-font) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    flex-shrink: 0;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tag-text {
    letter-spacing: 0.3px;
}

/* Dual Preview in Modal */
.dual-preview-container {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.dual-mode-colors-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    background: rgba(var(--text-main-rgb), 0.05);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-top: 15px;
}

.mode-colors-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mode-colors-section .fieldset-title-small {
    margin-bottom: 8px;
    color: var(--accent-color);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    width: 100%;
    border-bottom: 1px solid rgba(var(--accent-rgb), 0.2);
    padding-bottom: 5px;
}

.mode-colors-section .color-selection-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mode-colors-section .color-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mode-colors-section .color-item span {
    font-size: 11px;
    font-weight: 600;
}

.mode-colors-section input[type="color"] {
    width: 40px;
    height: 24px;
}

.preview-box {
    flex: 1;
    padding: 30px 15px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.dark-preview {
    background: #0d0f14 !important;
}

.light-preview {
    background: #fdfaf6 !important;
}

.preview-label {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    position: absolute;
    top: 8px;
    left: 12px;
    opacity: 0.6;
}

.preview-badge-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Status & Priority Tags (Base Overrides) */
.status-tag,
.priority-tag,
.category-tag {
    /* These now use .premium-tag shared logic */
}


/* Status Variants */
.tag-planned {
    background: #e0f2fe;
    color: #0369a1;
}

.tag-in-progress {
    background: #fef3c7;
    color: #b45309;
}

.tag-waiting-for-response {
    background: #f3e8ff;
    color: #7e22ce;
}

.tag-finish {
    background: #d1fae5;
    color: #047857;
}

/* Work Places Stats */
.wp-stats {
    display: flex;
    gap: 12px;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-muted);
}

.wp-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.wp-stats .highlight {
    color: var(--accent);
    font-weight: 700;
    background: rgba(var(--accent-rgb), 0.1);
    padding: 1px 6px;
    border-radius: 4px;
}

.tag-cancelled {
    background: #fee2e2;
    color: #b91c1c;
}

/* Priority Variants */
.tag-urgent {
    background: #ef4444;
    color: white;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.tag-high {
    background: #f97316;
    color: white;
}

.tag-medium {
    background: #3b82f6;
    color: white;
}

.tag-low {
    background: #94a3b8;
    color: white;
}

[data-theme="dark"] .tag-planned {
    background: rgba(3, 105, 161, 0.2);
    color: #7dd3fc;
}

[data-theme="dark"] .tag-in-progress {
    background: rgba(180, 83, 9, 0.2);
    color: #fcd34d;
}

[data-theme="dark"] .tag-waiting-for-response {
    background: rgba(126, 34, 206, 0.2);
    color: #d8b4fe;
}

[data-theme="dark"] .tag-finish {
    background: rgba(4, 120, 87, 0.2);
    color: #6ee7b7;
}

[data-theme="dark"] .tag-hold {
    background: rgba(71, 85, 105, 0.2);
    color: #cbd5e1;
}

.sel-opt-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.sel-edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    opacity: 0.6;
    transition: var(--transition);
    padding: 4px;
}

.sel-edit-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}



.btn-edit-premium {
    background: rgba(var(--accent-rgb), 0.1) !important;
    border: 1px solid rgba(var(--accent-rgb), 0.2) !important;
    color: var(--accent) !important;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.btn-edit-premium:hover {
    background: var(--accent) !important;
    color: white !important;
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.3);
}

.btn-copy {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: 4px;
    opacity: 0.5;
    transition: var(--transition);
}

.btn-copy:hover {
    opacity: 1;
    background: rgba(var(--accent-rgb), 0.1);
    transform: scale(1.1);
}

.icon-copy {
    width: 14px;
    height: 14px;
    vertical-align: middle;
    transition: var(--transition);
}

/* Selection Settings 3-Column Layout */
.selection-row {
    display: flex;
    gap: 16px;
    margin-top: 20px;
    flex-wrap: wrap;
    /* Added wrap for responsiveness */
}

.selection-column {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    min-height: 400px;
    /* Reduced from 480 to look better with fewer items */
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.flex-40 {
    flex: 0 0 calc(40% - 18px);
}

.flex-30 {
    flex: 0 0 calc(30% - 18px);
}

.flex-25 {
    flex: 0 0 calc(25% - 18px);
}

.flex-20 {
    flex: 0 0 calc(20% - 13px);
}

/* On smaller screens, make them 50% or 100% */
@media (max-width: 1400px) {
    .flex-20 {
        flex: 0 0 calc(33.33% - 11px);
    }
}

@media (max-width: 1100px) {

    .flex-25,
    .flex-20 {
        flex: 0 0 calc(50% - 8px);
    }
}

@media (max-width: 768px) {

    .flex-25,
    .flex-20 {
        flex: 0 0 100%;
    }
}

.selection-column:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.column-header {
    border-bottom: 2px solid rgba(var(--accent-rgb), 0.1);
    margin-bottom: 20px;
    padding-bottom: 16px;
    display: flex;
    align-items: center;
}

.column-header h4 {
    margin: 0;
    font-size: 15px;
    letter-spacing: 0.5px;
    color: var(--text-main);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.column-header h4 .icon {
    font-size: 18px;
    opacity: 0.9;
}

.selection-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kanban-board.panning {
    cursor: grabbing;
    user-select: none;
}

.kanban-column.column-dragging {
    opacity: 0.5;
    transform: scale(0.98);
    border: 2px dashed var(--accent);
}

.kanban-header[draggable="true"] {
    cursor: grab;
}

.kanban-header[draggable="true"]:active {
    cursor: grabbing;
}

.sel-opt-sort {
    font-size: 10px;
    font-weight: 700;
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.1);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-right: 8px;
    border: 1px solid rgba(var(--accent-rgb), 0.2);
}

.sel-opt-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(var(--text-main-rgb), 0.02);
    padding: 2px 15px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    font-size: 14px;
    transition: all 0.2s ease;
}

.sel-opt-item:hover {
    background: white;
    transform: translateX(4px);
    border-color: var(--accent);
    box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .sel-opt-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.sel-opt-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sel-opt-details {
    display: flex;
    flex-direction: column;
}

.sel-opt-label {
    font-weight: 700;
    color: var(--text-main);
}

.sel-opt-value {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.sel-opt-icon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.sel-delete-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
    opacity: 0;
}

.sel-opt-item:hover .sel-delete-btn {
    opacity: 0.5;
}

.sel-delete-btn:hover {
    opacity: 1 !important;
    color: var(--danger-color);
    background: rgba(var(--danger-color-rgb), 0.1);
}

/* --- Modern 2-Column Modal Overhaul --- */
.modal-content-wide {
    width: 95% !important;
    max-width: 1900px !important;
    padding: 24px !important;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

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

.modal-icon {
    font-size: 24px;
}

.modal-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--accent);
}

.modal-tabs {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 30px;
    background: rgba(var(--text-main-rgb), 0.05);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    width: 100%;
}

.tabs-left,
.tabs-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tab-item {
    padding: 8px 24px;
    border: none;
    background: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.tab-item.active {
    background: var(--card-bg);
    color: var(--accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .modal-content-wide {
    background: #ffffff;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    border: 1px solid #ffffff;
}

[data-theme="light"] .fieldset-box {
    border-color: #e0dcd5;
}

.tab-pane.active {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding-right: 6px;
}

.modal-grid {
    display: grid;
    grid-template-columns: 1fr 40%;
    gap: 24px;
    padding-top: 20px;
    overflow: visible !important;
    /* Allow dropdowns to float freely over sibling fieldsets */
}

.project-details-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto;
    gap: 16px;
    align-items: stretch;
}

.project-details-grid-3 > .fieldset-box:first-child {
    grid-column: 1;
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 12px;
    margin-bottom: 0;
}

.project-details-grid-3 > .fieldset-box:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 12px;
    margin-bottom: 0;
}

.project-details-grid-3 > .fieldset-box:nth-child(3) {
    grid-column: 3;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 12px;
    margin-bottom: 0;
}

.project-details-grid-3 > .project-form-actions-bar {
    grid-column: 2 / 4;
    grid-row: 2;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 0;
}

.project-details-grid-3 .fieldset-box .form-group {
    margin-bottom: 0 !important;
}

/* Full width White Paper in Project Tab */
.tab-pane[data-tab-content="whitepaper"] {
    width: 100% !important;
    max-width: 100% !important;
}

.tab-pane[data-tab-content="whitepaper"] .fieldset-box {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 520px;
}

#edit-project-whitepaper {
    width: 100% !important;
    min-height: 500px;
    box-sizing: border-box;
}

@media (max-width: 992px) {
    .project-details-grid-3 {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .project-details-grid-3 > .fieldset-box:first-child,
    .project-details-grid-3 > .fieldset-box:nth-child(2),
    .project-details-grid-3 > .fieldset-box:nth-child(3),
    .project-details-grid-3 > .project-form-actions-bar {
        grid-column: 1;
        grid-row: auto;
    }
}

/* Fieldset Styling (The Reference Style) */
.fieldset-box {
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 18px 18px 14px;
    margin-bottom: 16px;
    background: rgba(var(--text-main-rgb), 0.015);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.fieldset-box>.form-row:last-child,
.fieldset-box>.form-group:last-child,
.fieldset-box>.form-row:last-child .form-group {
    margin-bottom: 0 !important;
}

.fieldset-title {
    position: absolute;
    top: -11px;
    left: 18px;
    background: var(--card-bg);
    padding: 2px 10px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--accent);
    text-transform: uppercase;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .fieldset-title {
    color: var(--accent);
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
    border-radius: 6px;
    top: -11px;
}

/* Timeline fieldset full-width override */
#project-timeline-fieldset {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin-top: 16px !important;
    margin-bottom: 20px !important;
    position: relative !important;
    z-index: 0 !important;
}

.fieldset-box .form-group {
    margin-bottom: 16px;
}

.form-group.no-label label {
    display: none;
}

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

.form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.form-row .form-group {
    flex: 1;
    min-width: 0;
}

.flex-1 {
    flex: 1;
}

.attachment-upload {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    background: rgba(var(--text-main-rgb), 0.03);
    border-radius: var(--radius-md);
}

.btn-outline {
    background: none;
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    cursor: pointer;
    font-size: 13px;
}

.file-status {
    font-size: 12px;
    color: var(--text-muted);
}

/* Sidebar Log & Notes */
.modal-side-col {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.fieldset-box.full-height {
    height: 100%;
    max-height: 460px !important;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}

#project-comments-list {
    max-height: 310px !important;
    overflow-y: auto !important;
}

.fieldset-box.full-height .form-group.full-height {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.log-textarea {
    flex: 1;
    width: 100%;
    background: none !important;
    border: none !important;
    padding: 8px !important;
    resize: none !important;
    font-size: 14px;
    color: var(--text-main);
    line-height: 1.6;
    overflow-y: auto;
    word-break: break-word;
    outline: none;
}

.modal-footer-minimal {
    padding-top: 16px;
    display: flex;
    justify-content: flex-start;
}

/* Tab Panes */
.tab-pane {
    display: none;
    animation: fadeIn 0.2s ease-out;
}

.tab-pane.active {
    display: block;
}

/* Sidebar Footer & Diag Indicator */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
    transition: all 0.3s ease;
}

.dot.online {
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
    animation: pulse-green 2s infinite;
}

.dot.offline {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

@keyframes pulse-green {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

.app-version {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.8;
}

/* Table Font Size */
.gridjs-td,
.gridjs-th {
    font-size: 12px !important;
}

th.gridjs-th {
    padding: 10px 14px;
}

/* Color Picker Palette */
.color-picker-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
    padding: 10px;
    background: rgba(var(--text-main-rgb), 0.03);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

/* Native Color Picker Styling */
.native-color-picker {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 48px;
    height: 48px;
    background: none;
    background-color: transparent;
    border: 2px solid rgba(var(--text-main-rgb), 0.1);
    border-radius: 8px !important;
    cursor: pointer;
    overflow: hidden;
    padding: 0;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.native-color-picker:hover {
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.native-color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.native-color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
}

.native-color-picker::-moz-color-swatch {
    border: none;
    border-radius: 6px;
}

.matrix-group {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px 20px 25px 20px;
    /* Adjusted padding */
    box-shadow: var(--shadow-sm);
    animation: fadeIn 0.4s ease-out;
    margin-bottom: 30px;
}

.matrix-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 16px;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.matrix-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 16px;
    background: var(--accent);
    border-radius: 2px;
}

.matrix-table {
    border-collapse: separate;
    border-spacing: 4px;
}

.matrix-table th {
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.matrix-cell {
    min-width: 120px;
    position: relative;
    padding-right: 40px !important;
    /* Make room for actions */
}

.cell-actions {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.matrix-cell:hover .cell-actions {
    opacity: 1;
}

/* Multi-Select Custom Styling */
.multi-select-container {
    position: relative;
    width: 100%;
}

.multi-select-header {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px 12px 8px;
    /* Matched to standard form-group inputs */
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 48px;
    transition: all 0.2s ease;
    font-size: 14px;
    position: relative;
}

.multi-select-header:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}

/* Removed native ::after caret in favor of FontAwesome icon in JS */
.multi-select-header .caret {
    font-size: 10px;
    color: var(--text-muted);
    transition: transform 0.2s;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}

.multi-select-container {
    position: relative;
    width: 100%;
}

.multi-select-container.open {
    z-index: 2 !important;
    position: relative !important;
}

.multi-select-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 600px;
    min-width: 100%;
    max-width: 90vw;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    z-index: 99999999 !important;
    max-height: 500px;
    overflow-y: auto;
    display: none;
    padding: 16px;
    animation: fadeInDown 0.2s ease-out;
}

.multi-select-grid {
    column-count: 2;
    column-gap: 15px;
    padding: 4px;
}

.multi-select-container.open .multi-select-dropdown {
    display: block;
}

/* Parent elevation when dropdown is open */
.project-details-grid-3 {
    position: relative;
    z-index: 10;
}

.project-details-grid-3:has(.multi-select-container.open),
.project-details-grid-3.has-open-dropdown {
    position: relative !important;
    z-index: 9999 !important;
}

.fieldset-box {
    position: relative;
    z-index: 1;
}

.fieldset-box:has(.multi-select-container.open),
.fieldset-box.has-open-dropdown {
    z-index: 99999 !important;
    position: relative !important;
}

.form-group:has(.multi-select-container.open),
.form-group.has-open-dropdown {
    z-index: 999999 !important;
    position: relative !important;
}

.multi-option-item {
    break-inside: avoid;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
    gap: 10px;
}

.multi-option-item:hover {
    background: rgba(var(--accent-rgb), 0.08);
}

.multi-option-item.selected {
    background: rgba(var(--accent-rgb), 0.15);
    font-weight: 600;
}

.multi-option-item input[type="checkbox"],
.multi-option-item input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
    margin: 0;
}

.multi-option-item label {
    position: static !important;
    /* Reset absolute positioning from global form styles */
    transform: none !important;
    pointer-events: auto !important;
    margin: 0 !important;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-main);
    flex: 1;
    opacity: 1 !important;
}

.selected-count-badge {
    background: var(--accent);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: auto;
}

.multi-client-tag {
    background: rgba(var(--accent-rgb), 0.1);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: help;
    border: 1px solid rgba(var(--accent-rgb), 0.2);
}

.multi-select-group-label {
    padding: 10px 12px 5px;
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-top: 1px solid var(--border-color);
    margin-top: 5px;
    background: rgba(var(--accent-rgb), 0.02);
}

.multi-select-group-label:first-child {
    border-top: none;
    margin-top: 0;
}

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

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

.btn-mini {
    background: rgba(var(--accent-rgb), 0.1);
    border: none;
    border-radius: 4px;
    padding: 2px 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.btn-mini:hover {
    background: rgba(var(--accent-rgb), 0.2);
}

.copy-badge {
    position: absolute;
    top: -20px;
    right: 0;
    background: var(--success);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    animation: fadeInOut 1.5s forwards;
    white-space: nowrap;
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translateY(5px);
    }

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

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

    100% {
        opacity: 0;
        transform: translateY(-5px);
    }
}

.color-input-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.color-picker-row {
    background: rgba(var(--text-main-rgb), 0.02);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(var(--text-main-rgb), 0.05);
    width: fit-content;
}

.color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.color-swatch:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.color-swatch.active {
    border-color: var(--text-main);
}

.color-swatch.active::after {
    content: '\2713';
    font-size: 14px;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Light color swatchess checkmark color shift */
.color-swatch[style*="#f"]::after,
.color-swatch[style*="#e"]::after,
.color-swatch[style*="#d"]::after {
    color: #333;
}

.sel-color-circle {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 10px;
}

/* Dynamic Tag Support */
.status-tag[data-color],
.priority-tag[data-color] {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .status-tag[data-color],
[data-theme="dark"] .priority-tag[data-color] {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Specific light color tag text normalization */
.status-tag[style*="background-color: #f"],
.status-tag[style*="background-color: #e"],
.status-tag[style*="background-color: #d"],
.priority-tag[style*="background-color: #f"],
.priority-tag[style*="background-color: #e"],
.priority-tag[style*="background-color: #d"] {
    color: #333 !important;
    text-shadow: none !important;
}

/* Audit Logs Table Styles */
.modern-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.modern-table th {
    background: rgba(var(--accent-rgb), 0.05);
    padding: 14px 20px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
}

.modern-table td {
    padding: 16px 20px;
    vertical-align: middle !important;
    border-bottom: 1px solid rgba(var(--text-main-rgb), 0.05);
    color: var(--text-main);
}

.modern-table tr:last-child td {
    border-bottom: none;
}

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-secondary {
    background: rgba(107, 107, 107, 0.1);
    color: var(--text-muted);
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

[data-theme="dark"] .modern-table {
    border: 1px solid var(--border-color);
}

/* SQL Split Layout Overhaul */
#view-sql.active {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

.sql-container {
    display: flex;
    gap: 20px;
    height: 100% !important;
    min-height: 0 !important;
    margin-top: 0 !important;
    overflow: hidden;
    flex: 1;
}

.sql-sidebar {
    width: 300px;
    min-width: 300px;
    height: 100% !important;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.sql-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(var(--accent-rgb), 0.05);
    gap: 10px;
}

.sql-sidebar-header .sidebar-label {
    padding: 0;
    border-bottom: none;
    background: transparent;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.sql-sidebar-header #add-sql-btn {
    padding: 6px 12px;
    font-size: 11.5px;
    font-weight: 600;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.sidebar-label {
    padding: 16px 20px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(var(--accent-rgb), 0.05);
}

.sql-names-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.sql-name-item {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    color: var(--text-main);
    transition: var(--transition);
    border: 1px solid transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.sql-name-item:hover {
    background: rgba(var(--accent-rgb), 0.1);
    color: var(--accent);
}

.sql-name-item.active {
    background: var(--accent);
    color: var(--text-on-accent);
    font-weight: 700;
}

.sql-main {
    flex: 1;
    height: 100% !important;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.sql-display-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(var(--accent-rgb), 0.02);
}

.sql-display-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-main);
}

.sql-display-actions {
    display: flex;
    gap: 12px;
}

.sql-display-actions .btn-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: white;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    font-size: 18px;
}

.sql-display-actions .btn-icon:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: var(--bg-color);
    color: var(--accent);
}

[data-theme="dark"] .sql-display-actions .btn-icon {
    background: #2a2a2a;
    border-color: #444;
}

.sql-display-content {
    flex: 1;
    padding: 24px;
    overflow: auto;
    background: var(--card-bg);
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin: 12px;
}

.sql-display-content pre {
    margin: 0;
    font-family: 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-main);
    white-space: pre-wrap;
    word-break: break-all;
}

.sql-display-content .placeholder {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: 40px;
}

/* Login Screen */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(1px);
    z-index: 1000;
    opacity: 0;
    transition: opacity var(--transition);
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
}

.modal-content {
    animation: modalIn 0.4s var(--ease-elastic);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

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



.login-card {
    background: rgba(var(--card-bg-rgb, 255, 255, 255), 0.7);
    backdrop-filter: blur(3px) saturate(180%);
    -webkit-backdrop-filter: blur(3px) saturate(180%);
    width: 100%;
    max-width: 440px;
    padding: 48px;
    border-radius: 32px;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.15),
        inset 0 0 0 1px rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: loginEntrance 1.2s var(--ease-out-expo);
    position: relative;
    z-index: 2;
}

[data-theme="dark"] .login-card {
    background: rgba(30, 41, 59, 0.6);
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.05);
}

@keyframes loginEntrance {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(30px);
        filter: blur(2px);
    }

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

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header .logo-text {
    font-size: 42px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
    display: block;
    letter-spacing: -1.5px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 16px;
    font-weight: 500;
    opacity: 0.8;
}

/* Floating Label Logic */
.floating-group {
    position: relative;
    margin-bottom: 28px;
}

.floating-group input {
    width: 100%;
    height: 60px;
    padding: 24px 18px 8px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-main);
    background: rgba(var(--bg-color), 0.4);
    border: 1.5px solid var(--border-color);
    border-radius: 16px;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-group label {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    font-weight: 500;
    color: var(--text-muted);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.7;
}

.floating-group input:focus,
.floating-group input:not(:placeholder-shown) {
    border-color: var(--accent);
    background: rgba(var(--card-bg), 0.8);
    box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.1);
}

.floating-group input:focus~label,
.floating-group input:not(:placeholder-shown)~label {
    top: 14px;
    transform: translateY(0);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    opacity: 1;
}

.input-glow {
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, var(--accent), transparent, var(--accent));
    border-radius: 18px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    filter: blur(1px);
}

.floating-group input:focus~.input-glow {
    opacity: 0.2;
}

[data-theme="dark"] .floating-group input {
    background: rgba(15, 23, 42, 0.4);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .floating-group input:focus {
    background: rgba(15, 23, 42, 0.8);
}

/* Custom Checkbox */
.login-extras {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding: 0 4px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.remember-me:hover {
    color: var(--text-main);
}

.remember-me input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkbox-custom {
    height: 20px;
    width: 20px;
    background-color: rgba(var(--text-main-rgb), 0.05);
    border: 1.5px solid var(--border-color);
    border-radius: 6px;
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.remember-me input:checked~.checkbox-custom {
    background-color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.3);
}

.checkbox-custom:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

.remember-me input:checked~.checkbox-custom:after {
    display: block;
}

/* Login Button Refinement */
#login-submit-btn {
    width: 100%;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: white;
    border: none;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 20px -5px rgba(var(--accent-rgb), 0.4);
}

#login-submit-btn:hover {
    box-shadow: 0 15px 30px -5px rgba(var(--accent-rgb), 0.5);
    filter: brightness(1.05);
}

#login-submit-btn:active {
    transform: translateY(0);
}

.btn-icon-right {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

#login-submit-btn:hover .btn-icon-right {
    transform: translateX(4px);
}

.login-error {
    margin-top: 24px;
    padding: 14px;
    border-radius: 12px;
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    border: 1px solid rgba(239, 68, 68, 0.2);
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

/* Sidebar Logout Btn */
.btn-logout {
    margin-top: 16px;
    width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-logout svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    opacity: 0.7;
    flex-shrink: 0;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.05);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.2);
}

[data-theme="dark"] .btn-logout:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Sidebar Footer Tweaks */
.sidebar-footer .diag-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 8px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1;
}

.app-version {
    margin-top: 2px !important;
    opacity: 0.6;
}

/* User Profile Panel - Modernized & Moved Top */
.sidebar-profile {
    padding: 16px;
    background: rgba(var(--text-main-rgb), 0.03);
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(var(--text-main-rgb), 0.06);
    overflow: hidden;
    position: relative;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.sidebar-profile::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-profile:hover {
    background: rgba(var(--text-main-rgb), 0.05);
    border-color: rgba(var(--accent-rgb), 0.2);
}

.sidebar-profile:hover::before {
    opacity: 1;
}

.sidebar.collapsed .sidebar-profile {
    padding: 6px;
    border-radius: 12px;
    justify-content: center;
    gap: 0;
}

.profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1.5px solid rgba(var(--accent-rgb), 0.4);
    background: var(--card-bg);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.sidebar-profile:hover .profile-avatar {
    border-color: var(--accent);
    transform: scale(1.05);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: all 0.3s ease;
    z-index: 1;
}

.sidebar.collapsed .profile-info {
    display: none;
}

.profile-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.3px;
}

.profile-role {
    font-size: 10px;
    color: var(--accent);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-top: 1px;
    opacity: 0.8;
}

/* Theme Gallery */
.theme-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 16px;
    margin-top: 12px;
}

.theme-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
}

.theme-card:hover {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.05);
}

.theme-card.active {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.1);
}

.theme-card.active::after {
    content: '\2713';
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--accent);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    box-shadow: var(--shadow-sm);
}

.theme-swatch {
    width: 100%;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.swatch-bg {
    flex: 1;
}

.swatch-accent {
    width: 35%;
}

.theme-card span {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.actions-col {
    text-align: right;
    width: 100px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

/* Container for buttons inside the column */
.actions-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

/* Personal Subviews */
.personal-subview {
    display: none;
}

.personal-subview.active {
    display: flex;
    flex-direction: column;
    flex: 1;
    animation: fadeIn 0.3s ease;
}

/* Day Bubbles for Habit Scheduling */
.day-bubbles {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.day-bubble {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: var(--transition-fast);
    background: var(--card-bg);
}

.day-bubble:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.day-bubble.active {
    background: var(--accent);
    color: var(--text-on-accent);
    border-color: var(--accent);
}

/* Password Management Styles */
.pass-masked {
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

.copy-badge {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translate(-50%, 10px);
        opacity: 0;
    }

    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* Password Matrix Styles */
.password-matrix-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
}

/* Matrix Styles consolidated below */

.password-matrix-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
}

.matrix-wrapper {
    overflow-x: auto;
    padding: 10px 10px 20px 10px;
    background: rgba(var(--accent-rgb), 0.02);
    border-radius: var(--radius-md);
    margin: 10px;
}

.table-responsive {
    overflow-x: auto;
    padding-bottom: 10px;
    /* Space for scrollbar so it doesn't clip the last row */
    -webkit-overflow-scrolling: touch;
}

.matrix-table {
    width: 100%;
    border-collapse: separate !important;
    border-spacing: 6px;
    table-layout: auto;
}

.matrix-table th {
    font-size: 11px;
    font-weight: 800;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px 10px;
    text-align: center;
    background: rgba(var(--accent-rgb), 0.05);
    border-radius: 8px;
}

.matrix-header-cell {
    position: relative !important;
    padding-right: 22px !important;
}

.matrix-col-del-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    opacity: 0.3;
    padding: 2px 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.matrix-header-cell:hover .matrix-col-del-btn {
    opacity: 1;
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.15);
}

.matrix-table td {
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color) !important;
    padding: 12px;
    text-align: center;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    vertical-align: middle !important;
}

.matrix-table tr:last-child td {
    border-bottom: 1px solid var(--border-color) !important;
}

.matrix-table .row-header {
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: rgba(var(--text-main-rgb), 0.03) !important;
    text-align: left;
    padding-left: 15px;
    width: 100px;
}

.matrix-cell {
    cursor: pointer;
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    position: relative;
    height: 48px;
    /* Fixed height works better for centered content in tables */
    min-width: 100px;
}

.matrix-cell:hover {
    border-color: var(--accent) !important;
    background: rgba(var(--accent-rgb), 0.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.matrix-cell .cell-actions {
    display: none;
    position: absolute;
    bottom: -8px;
    right: -8px;
    gap: 4px;
    background: var(--card-bg);
    padding: 4px;
    border-radius: 8px;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-sm);
    z-index: 10;
}

.matrix-cell:hover .cell-actions {
    display: flex;
}

.matrix-cell.masked {
    color: var(--text-muted);
    letter-spacing: 2px;
}

.matrix-cell .btn-mini {
    padding: 2px 6px;
    font-size: 11px;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 4px;
}

.matrix-cell .btn-mini:hover {
    background: rgba(var(--accent-rgb), 0.1);
    color: var(--accent);
}

/* Edit Cell Inline Popover */
.matrix-editor {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    display: flex;
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
}

.matrix-editor input {
    flex: 1;
    border: 2px solid var(--accent) !important;
    border-radius: 8px 0 0 8px !important;
    padding: 8px !important;
    font-size: 12px !important;
    margin: 0 !important;
}

.matrix-editor .btn-save {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0 10px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
}

/* Water Tracker Styles - Refined Horizontal Layout */
.water-tracker-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    /* Tighter gap */
    margin-top: 10px;
    padding: 10px;
    background: rgba(var(--text-main-rgb), 0.05);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    width: 100%;
}

[data-theme="dark"] .water-tracker-container {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.1);
}

.glass-item {
    flex: 1;
    max-width: 18px;
    height: 24px;
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
    border: 1.5px solid #4facfe;
    /* Water blue border */
    border-top: none;
    border-radius: 0 0 4px 4px;
    background: transparent;
    overflow: hidden;
}

[data-theme="dark"] .glass-item {
    border-color: rgba(79, 172, 254, 0.6);
    background: rgba(255, 255, 255, 0.05);
}

.glass-item::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(180deg, #4facfe 0%, #00f2fe 100%);
    /* Water gradient */
    transition: height 0.3s var(--ease-out-expo);
    opacity: 0.9;
}

.glass-item.filled::before {
    height: 100%;
}

.glass-item:hover {
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.4);
}

.reminder-item.water-habit {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 15px;
    min-height: 90px;
    gap: 4px;
    /* Local gap */
}

.reminder-item.water-habit:hover {
    transform: none;
    /* Disable horizontal displacement for the large water tile */
}

.water-header {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 12px;
}

.water-habit .reminder-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none !important;
    /* Managed by habit-name */
}

.water-habit .habit-name {
    transition: var(--transition);
}

.reminder-item.is-done .habit-name {
    text-decoration: line-through;
    opacity: 0.5;
}

.water-badge {
    background: #4facfe;
    /* Water blue */
    color: white;
    padding: 2px 7px;
    border-radius: 12px;
    font-size: 10px;
    text-decoration: none !important;
    font-weight: 800;
    box-shadow: 0 2px 4px rgba(79, 172, 254, 0.3);
}

.water-habit .reminder-check {
    background: #4facfe !important;
    border-color: #4facfe !important;
}

.water-habit.is-done .reminder-check {
    background: #4facfe !important;
}

/* Attempt 2: GridStack Coordinate Stabilization - REMOVED */


/* EMERGENCY REVERT: Restoring Flexbox Layout & Sidebar States */
#app-container {
    /* removed forced flex to allow login screen to hide it */
}

.sidebar {
    position: relative !important;
    flex-shrink: 0 !important;
}

.sidebar.collapsed {
    width: 68px !important;
}

.sidebar:not(.collapsed) {
    width: 200px !important;
}

.main-content {
    flex-grow: 1 !important;
    display: flex !important;
    margin-left: 0 !important;
    width: auto !important;
}

.grid-stack {
    width: 100% !important;
}


/* Dashboard Alignment Overrides (Approach 4 - Fixed Selectors) */
.tile-daily-reminders.grid-stack-item-content,
.tile-quicklinks.grid-stack-item-content {
    justify-content: flex-start !important;
    align-items: flex-start !important;
    text-align: left !important;
}

#daily-reminders-list {
    width: 100%;
}

.quick-links-grid {
    grid-template-columns: repeat(auto-fill, minmax(115px, 1fr)) !important;
    /* Increased from 100px to prevent overlap */
    gap: 20px !important;
    /* More breathing room */
    justify-items: start !important;
    padding: 0 !important;
    margin: 0 !important;
}

.quick-link-add-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 115px !important;
    /* Match minmax width */
    height: 100px;
    border: 2px dashed var(--accent);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    background: rgba(var(--accent-rgb), 0.05);
    order: 999;
}

.quick-link-add-item:hover {
    background: rgba(var(--accent-rgb), 0.1);
    border-color: var(--accent-hover);
}

.quick-link-add-item .plus-icon {
    font-size: 32px;
    color: var(--accent);
    font-weight: 300;
}

.quick-link-add-item .label {
    font-size: 11px;
    color: var(--accent);
    font-weight: 600;
    margin-top: 4px;
}


/* Final Quick Links Tile Sizing (115x100) */
.quick-link-item {
    width: 115px !important;
    height: 100px !important;
    justify-content: center !important;
    padding: 12px !important;
}


/* Quick Link Modal Fixes */
.input-with-icon {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    transition: var(--transition);
}

.input-with-icon:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

.input-with-icon input {
    border: none !important;
    padding: 0 !important;
    background: transparent !important;
    outline: none !important;
    flex: 1;
}

.icon-preview {
    width: 32px;
    height: 32px;
    background: var(--bg-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.reminder-item.water-habit {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 15px;
    min-height: 90px;
    gap: 4px;
}

.reminder-item.water-habit:hover {
    transform: none;
}

.water-header {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 12px;
}

.water-habit .reminder-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none !important;
    /* Managed by habit-name */
}

.water-habit .habit-name {
    transition: var(--transition);
}

.reminder-item.is-done .habit-name {
    text-decoration: line-through;
    opacity: 0.5;
}

.water-badge {
    background: #4facfe;
    /* Water blue */
    color: white;
    padding: 2px 7px;
    border-radius: 12px;
    font-size: 10px;
    text-decoration: none !important;
    font-weight: 800;
    box-shadow: 0 2px 4px rgba(79, 172, 254, 0.3);
}

.water-habit .reminder-check {
    background: #4facfe !important;
    border-color: #4facfe !important;
}

.water-habit.is-done .reminder-check {
    background: #4facfe !important;
}

/* Attempt 2: GridStack Coordinate Stabilization - REMOVED */


/* EMERGENCY REVERT: Restoring Flexbox Layout & Sidebar States */
#app-container {
    /* removed forced flex to allow login screen to hide it */
}

.sidebar {
    position: relative !important;
    flex-shrink: 0 !important;
}

.sidebar.collapsed {
    width: 68px !important;
}

.sidebar:not(.collapsed) {
    width: 200px !important;
}

.main-content {
    flex-grow: 1 !important;
    display: flex !important;
    margin-left: 0 !important;
    width: auto !important;
}

.grid-stack {
    width: 100% !important;
}


/* Dashboard Alignment Overrides (Approach 4 - Fixed Selectors) */
.tile-daily-reminders.grid-stack-item-content,
.tile-quicklinks.grid-stack-item-content {
    justify-content: flex-start !important;
    align-items: flex-start !important;
    text-align: left !important;
}

#daily-reminders-list {
    width: 100%;
}

.quick-links-grid {
    grid-template-columns: repeat(auto-fill, minmax(115px, 1fr)) !important;
    /* Increased from 100px to prevent overlap */
    gap: 20px !important;
    /* More breathing room */
    justify-items: start !important;
    padding: 0 !important;
    margin: 0 !important;
}

.quick-link-add-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 115px !important;
    /* Match minmax width */
    height: 100px;
    border: 2px dashed var(--accent);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    background: rgba(var(--accent-rgb), 0.05);
    order: 999;
}

.quick-link-add-item:hover {
    background: rgba(var(--accent-rgb), 0.1);
    border-color: var(--accent-hover);
}

.quick-link-add-item .plus-icon {
    font-size: 32px;
    color: var(--accent);
    font-weight: 300;
}

.quick-link-add-item .label {
    font-size: 11px;
    color: var(--accent);
    font-weight: 600;
    margin-top: 4px;
}


/* Final Quick Links Tile Sizing (115x100) */
.quick-link-item {
    width: 115px !important;
    height: 100px !important;
    justify-content: center !important;
    padding: 12px !important;
}


/* Quick Link Modal Fixes */
.input-with-icon {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    transition: var(--transition);
}

.input-with-icon:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

.input-with-icon input {
    opacity: 1 !important;
    pointer-events: auto !important;
}


/* --- FINAL EMERGENCY DASHBOARD FIXES --- */
#tile-weekly-balance .tile-balance,
#tile-monthly-balance .tile-balance,
#tile-weekly-balance .grid-stack-item-content,
#tile-monthly-balance .grid-stack-item-content {
    padding-top: 20px !important;
    /* Fix title clipping */
    overflow: hidden !important;
}

#tile-weekly-balance .card-header,
#tile-monthly-balance .card-header {
    margin-bottom: 5px !important;
    position: relative;
    top: 5px;
}

#tile-weekly-balance h3,
#tile-monthly-balance h3 {
    font-size: 13px !important;
}

#tile-weekly-balance .balance-inner-box,
#tile-monthly-balance .balance-inner-box {
    margin: 5px 26px 5px 5px !important;
    /* Forced space for the bar */
    border: 1px solid var(--border-color) !important;
    background: var(--card-bg) !important;
}

#tile-weekly-balance .balance-value,
#tile-monthly-balance .balance-value {
    font-size: clamp(20px, 18cqw, 28px) !important;
    font-weight: 800 !important;
}

#tile-weekly-balance .balance-label,
#tile-monthly-balance .balance-label {
    font-size: 9px !important;
}

/* --- REPORT PREVIEW & PDF POLISH --- */
.report-preview-section {
    margin-top: 24px;
}

.preview-card {
    background: var(--sidebar-bg);
    border: none;
    box-shadow: var(--shadow-lg);
}

/* --- PDF VIEWER INTERFACE --- */
.pdf-viewer-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    min-height: 800px;
}

.pdf-sidebar {
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 24px;
    z-index: 2;
}

.pdf-control-card {
    background: transparent !important;
    /*border: none !important;*/
    box-shadow: none !important;
    /*padding: 0 !important;*/
}

.pdf-viewport {
    background: #2d3436;
    /* Deep dark background for viewport contrast */
    padding: 60px 40px;
    overflow-y: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    height: 100%;
}


.text-right {
    text-align: right !important;
}


/* --- USER MANAGEMENT TABBED UI --- */
.user-sub-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(var(--text-main-rgb), 0.05);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    width: 100%;
}

.user-sub-nav .sub-nav-item {
    padding: 8px 20px;
    border: none;
    background: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-sub-nav .sub-nav-item:hover {
    background: rgba(var(--text-main-rgb), 0.05);
    color: var(--text-main);
}

.user-sub-nav .sub-nav-item.active {
    background: var(--card-bg);
    color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.user-sub-nav .tab-close {
    font-size: 16px;
    line-height: 1;
    opacity: 0.5;
    transition: var(--transition);
    margin-left: 4px;
}

.user-sub-nav .tab-close:hover {
    opacity: 1;
    color: var(--danger-color);
}

/* Premium Grid Adjustments for User Form */
#user-form-view .modal-grid {
    grid-template-columns: 1fr 340px;
    gap: 30px;
    align-items: start;
}

#user-form-view .fieldset-box {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}



/* Dashboard Toolbar Extensions */
.dashboard-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.toolbar-right {
    display: flex;
    gap: 12px;
}

.user-form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

.reports-flex-container {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.reports-controls-col {
    flex: 0 0 350px;
}

.reports-preview-col {
    flex: 1;
    min-width: 0;
}

@media (max-width: 1200px) {
    .reports-flex-container {
        flex-direction: column;
    }

    .reports-controls-col {
        flex: 1;
        width: 100%;
    }
}


/* High-priority Balance Colors */
td.balance-cell.positive,
.balance-value.positive,
.positive {
    color: #10b981 !important;
}

td.balance-cell.negative,
.balance-value.negative,
.negative {
    color: #ef4444 !important;
}



/* Selection Modal Styling Improvements */
.fieldset-title-small {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.color-selection-grid {
    display: flex;
    gap: 30px;
    padding: 15px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.color-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.color-item span {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
}

.color-item input[type="color"] {
    width: 100%;
    height: 38px;
    padding: 2px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: var(--transition);
}

.color-item input[type="color"]:hover {
    border-color: var(--accent);
}

.preview-badge-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px;
    background: rgba(0, 0, 0, 0.03);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
}

#sel-badge-preview {
    padding: 8px 20px;
    font-size: 14px;
    border-radius: 20px;
    font-weight: 600;
    display: inline-block;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

/* --- FINAL RESTORATION OF DASHBOARD & PERSONAL STYLES (v1.0.3) --- */
.positive {
    color: #10b981 !important;
    font-weight: 700 !important;
}

.negative {
    color: #ef4444 !important;
    font-weight: 700 !important;
}

.balance-value.positive {
    color: #10b981 !important;
}

.balance-value.negative {
    color: #ef4444 !important;
}

/* --- PREMIUM KM REPORT STYLES --- */
.pdf-paper {
    background: #ffffff !important;
    padding: 60px !important;
    border-radius: 16px !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15) !important;
    max-width: 900px !important;
    margin: 30px auto !important;
    color: #1a1a1a !important;
    font-family: 'Inter', -apple-system, sans-serif !important;
    min-height: 800px;
}

.pdf-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-end !important;
    border-bottom: 2px solid #1a1a1a !important;
    padding-bottom: 30px !important;
    margin-bottom: 40px !important;
}

.pdf-branding {
    max-width: 65% !important;
}

.pdf-branding .pdf-title {
    font-family: 'Outfit', 'Inter', sans-serif !important;
    font-size: 28px !important;
    font-weight: 800 !important;
    margin: 0 !important;
    color: #1a1a1a !important;
    text-transform: uppercase !important;
    letter-spacing: -0.02em !important;
    padding-right: 15px !important;
}

.pdf-branding .pdf-author {
    margin: 4px 0 0 0 !important;
    font-size: 18px !important;
    color: #666 !important;
    font-weight: 500 !important;
}

.pdf-meta {
    background: #f8f9fa !important;
    padding: 16px 24px !important;
    border-radius: 12px !important;
    border: 1px solid #eee !important;
    display: flex !important;
    flex-direction: row !important;
    gap: 35px !important;
    align-items: flex-start !important;
}

.meta-item label {
    display: block !important;
    font-size: 10px !important;
    text-transform: uppercase !important;
    color: #999 !important;
    letter-spacing: 0.15em !important;
    font-weight: 800 !important;
    margin-bottom: 2px !important;
}

.meta-item span {
    font-size: 18px !important;
    font-weight: 800 !important;
    color: #1a1a1a !important;
    white-space: nowrap !important;
}

.pdf-content {
    margin-bottom: 40px !important;
}

.pdf-table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 30px 0 !important;
}

.pdf-table th {
    text-align: left !important;
    padding: 12px 0 !important;
    border-bottom: 1px solid #eee !important;
    font-size: 12px !important;
    text-transform: uppercase !important;
    color: #999 !important;
    letter-spacing: 0.1em !important;
    font-weight: 700 !important;
}

.pdf-table td {
    padding: 20px 0 !important;
    border-bottom: 1px solid #f0f0f0 !important;
    font-size: 15px !important;
    color: #1a1a1a !important;
}

.pdf-table td:nth-child(2) {
    font-weight: 700 !important;
    /* Bold for Location */
}

.pdf-table td:last-child {
    text-align: right !important;
    font-weight: 600 !important;
}

.pdf-total-box {
    background: #f8f9fa !important;
    border-radius: 12px !important;
    padding: 24px 30px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-top: 50px !important;
}

.pdf-total-box .total-label {
    font-size: 14px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    color: #555 !important;
    letter-spacing: 0.05em !important;
}

.pdf-total-box .total-value {
    font-size: 42px !important;
    font-weight: 900 !important;
    color: #1a1a1a !important;
    font-family: 'Outfit', sans-serif !important;
}

.pdf-footer-note {
    margin-top: 30px !important;
    font-size: 12px !important;
    color: #999 !important;
    text-align: left !important;
}

/* Fix for Personal Space subview loading */
.personal-subview {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.personal-subview.active {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* --- Project Enhancements Alpha 1.0.0 --- */

/* File Dropzone */
.file-dropzone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 30px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    background: rgba(var(--text-main-rgb), 0.02);
    margin-bottom: 20px;
}

.file-dropzone:hover,
.file-dropzone.dragover {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.05);
}

.file-dropzone .icon {
    font-size: 32px;
    display: block;
    margin-bottom: 10px;
}

.file-dropzone p {
    font-size: 14px;
    color: var(--text-muted);
}

.file-dropzone p span {
    color: var(--accent);
    font-weight: 600;
}

/* File List */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    gap: 12px;
    transition: var(--transition);
}

.file-item:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.file-icon {
    font-size: 20px;
}

.file-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.file-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
}

.file-name:hover {
    color: var(--accent);
}

.file-meta {
    font-size: 11px;
    color: var(--text-muted);
}

.project-name-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* AI Summary Box */
.ai-summary-box {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.btn-ai-generate {
    margin-top: 10px;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: white;
    border: none;
    padding: 10px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-ai-generate:hover {
    box-shadow: 0 6px 15px rgba(99, 102, 241, 0.4);
    filter: brightness(1.1);
}

/* Status Subcategories Tags */
.status-tag {
    position: relative;
    overflow: hidden;
}

.status-tag::after {
    content: attr(data-subcategory);
    position: absolute;
    top: 0;
    right: 0;
    font-size: 8px;
    padding: 2px 4px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 0 0 0 4px;
    opacity: 0.7;
}

/* Loading State for buttons */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-top: -8px;
    margin-left: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
}

/* --- Warehouse Map --- */
#view-map canvas {
    display: block;
    cursor: grab;
    background: #ffffff;
}

#view-map canvas:active {
    cursor: grabbing;
}

.map-layout-vertical {
    height: calc(100vh - 180px);
}

#map-toolbar button {
    transition: var(--transition);
}

#map-toolbar button:hover {
    background: var(--accent);
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.3);
}

#map-toolbar button.edit-active {
    background: var(--danger-color) !important;
    color: white !important;
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.4);
}

#map-tooltip {
    position: fixed;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    color: #f8fafc;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    pointer-events: none;
    display: none;
    z-index: 10000;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
    font-family: 'Inter', sans-serif;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.context-menu {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    padding: 5px 0;
    z-index: 2000;
    animation: fadeIn 0.2s var(--ease-out-expo);
}

.context-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.context-menu li {
    padding: 10px 15px;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.context-menu li:hover {
    background: rgba(var(--text-main-rgb), 0.05);
    padding-left: 18px;
}

.context-menu li.menu-danger {
    color: var(--danger-color);
}

.context-menu li.menu-danger:hover {
    background: rgba(231, 76, 60, 0.1);
}

.search-dropdown .search-item {
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition-fast);
}

.search-dropdown .search-item:hover {
    background: rgba(var(--text-main-rgb), 0.05);
}

.search-dropdown .type-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--bg-color);
    color: var(--text-muted);
}

.pdf-control-card {
    border-radius: 16px !important;
    overflow: hidden !important;
}

.pdf-control-card .card-header {
    border-radius: 0 !important;
}

.pdf-footer-note {
    display: none !important;
}

/* --- Premium Bento Theme Switch --- */
.theme-switch-container {
    margin-bottom: 30px;
    padding: 0 10px;
    display: flex;
    justify-content: center;
}

.theme-pill-switch {
    position: relative;
    width: 100%;
    height: 40px;
    background: rgba(var(--text-main-rgb), 0.05);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    display: flex;
    cursor: pointer;
    overflow: hidden;
    transition: var(--transition);
    backdrop-filter: blur(2px);
}

.switch-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    color: var(--text-muted);
    font-size: 14px;
    transition: color 0.3s ease;
}

.switch-option i {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.switch-option.active {
    color: white;
}

.switch-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: calc(50% - 6px);
    height: calc(100% - 6px);
    background: var(--accent);
    border-radius: 17px;
    z-index: 1;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.3);
}

[data-theme="dark"] .switch-slider {
    transform: translateX(100%);
}

.switch-glow {
    position: absolute;
    width: 40px;
    height: 40px;
    background: var(--accent);
    filter: blur(3px);
    opacity: 0.15;
    z-index: 0;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] .switch-glow {
    transform: translateX(100%);
}

/* Icons Animation */
.light-opt.active i {
    transform: scale(1.2) rotate(15deg);
}

.dark-opt.active i {
    transform: scale(1.2) rotate(-15deg);
}

/* --- Collapsed Sidebar Support --- */
.sidebar.collapsed .theme-switch-container {
    padding: 0 4px;
}

.sidebar.collapsed .theme-pill-switch {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    margin: 0 auto;
}

.sidebar.collapsed .switch-slider {
    width: calc(100% - 6px);
    height: calc(100% - 6px);
    transform: none !important;
    border-radius: 10px;
}

.sidebar.collapsed .switch-option {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
}

.sidebar.collapsed .switch-option.active {
    opacity: 1;
    display: flex;
}

.sidebar.collapsed .switch-glow {
    width: 44px;
    height: 44px;
    transform: none !important;
}

.toggle-track {
    width: 44px;
    height: 24px;
    background: #e2e8f0;
    border-radius: 20px;
    position: relative;
    transition: all 0.3s ease;
}

[data-theme="dark"] .toggle-track {
    background: var(--accent);
}

.toggle-thumb {
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .toggle-thumb {
    left: 23px;
    background: var(--sidebar-bg);
}

.toggle-thumb i {
    font-size: 10px;
}

.sun-icon {
    color: #f59e0b;
    display: block;
}

.moon-icon {
    color: #818cf8;
    display: none;
}

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

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

.toggle-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

/* Dev Tool Grid Scrolling */
#dev-table-grid {
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
}

#dev-table-grid::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

#dev-table-grid::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 10px;
}

#dev-table-grid .gridjs-wrapper {
    border-radius: 0;
    border: none;
}

#dev-table-grid thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
}

/* ============================================================
   Cualby Cosmic Pulse & Orbit Global Loader
   ============================================================ */
.loader-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.loader-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.loader-backdrop-blur {
    position: absolute;
    inset: 0;
    background: rgba(6, 10, 20, 0.72);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
}

.loader-card-glass {
    position: relative;
    z-index: 2;
    background: rgba(18, 24, 39, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 28px;
    padding: 36px 32px 28px;
    width: 90%;
    max-width: 360px;
    box-shadow: 
        0 25px 60px -10px rgba(0, 0, 0, 0.75),
        0 0 35px rgba(99, 102, 241, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transform: scale(0.92) translateY(10px);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-sizing: border-box;
}

.loader-overlay.active .loader-card-glass {
    transform: scale(1) translateY(0);
}

/* Cosmic Orbit Container */
.loader-animation-container {
    position: relative;
    width: 110px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

/* Central Glowing Sparkle Core */
.loader-core-icon {
    position: relative;
    z-index: 3;
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #4f46e5, #06b6d4);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 0 25px rgba(79, 70, 229, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.4);
    animation: coreBreathing 2.4s ease-in-out infinite alternate;
}

.loader-core-icon svg {
    width: 26px;
    height: 26px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.core-pulse-glow {
    position: absolute;
    inset: -6px;
    border-radius: 20px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.5) 0%, transparent 70%);
    z-index: -1;
    animation: pulseHalo 2s ease-in-out infinite;
}

/* Orbit Rings */
.loader-orbit-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid transparent;
    pointer-events: none;
}

.loader-orbit-ring.ring-1 {
    width: 76px;
    height: 76px;
    border-top-color: #6366f1;
    border-right-color: #38bdf8;
    animation: orbitSpinCW 1.8s linear infinite;
    filter: drop-shadow(0 0 6px rgba(99, 102, 241, 0.7));
}

.loader-orbit-ring.ring-2 {
    width: 96px;
    height: 96px;
    border-bottom-color: #ec4899;
    border-left-color: #818cf8;
    animation: orbitSpinCCW 2.6s linear infinite;
    filter: drop-shadow(0 0 6px rgba(236, 72, 153, 0.6));
}

.loader-orbit-ring.ring-3 {
    width: 112px;
    height: 112px;
    border-top-color: rgba(56, 189, 248, 0.4);
    border-left-color: rgba(99, 102, 241, 0.3);
    border-style: dashed;
    animation: orbitSpinCW 6s linear infinite;
}

/* Floating Sparkle Particles */
.loader-sparkle-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 10px #38bdf8, 0 0 20px #6366f1;
}

.loader-sparkle-dot.dot-1 {
    top: 6px;
    right: 18px;
    animation: floatDot1 3s ease-in-out infinite alternate;
}

.loader-sparkle-dot.dot-2 {
    bottom: 8px;
    left: 20px;
    animation: floatDot2 2.5s ease-in-out infinite alternate;
}

/* Keyframe Animations */
@keyframes orbitSpinCW {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes orbitSpinCCW {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}

@keyframes coreBreathing {
    0% { transform: scale(0.96); box-shadow: 0 0 18px rgba(79, 70, 229, 0.4); }
    100% { transform: scale(1.05); box-shadow: 0 0 30px rgba(56, 189, 248, 0.7); }
}

@keyframes pulseHalo {
    0%, 100% { opacity: 0.4; transform: scale(0.95); }
    50% { opacity: 0.8; transform: scale(1.15); }
}

@keyframes floatDot1 {
    0% { transform: translate(0, 0) scale(0.8); opacity: 0.5; }
    100% { transform: translate(-6px, 10px) scale(1.2); opacity: 1; }
}

@keyframes floatDot2 {
    0% { transform: translate(0, 0) scale(1.1); opacity: 0.9; }
    100% { transform: translate(8px, -8px) scale(0.7); opacity: 0.4; }
}

/* Text Styling */
.loader-text-wrap {
    width: 100%;
}

.loader-app-name {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #ffffff 40%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0 0 8px 0;
}

.loader-dynamic-text {
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.45;
    color: #cbd5e1;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 16px 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.loader-dynamic-text.fade-swap {
    opacity: 0;
    transform: translateY(-4px);
}

/* Animated Shimmer Progress Track */
.loader-progress-track {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.loader-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, transparent, #6366f1 35%, #38bdf8 65%, transparent);
    background-size: 200% 100%;
    animation: progressShimmer 1.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    border-radius: 4px;
}

@keyframes progressShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* --- Tiny Theme Switch Override --- */
.theme-switch-container {
    margin-bottom: 20px !important;
    padding: 0 16px !important;
    justify-content: flex-start !important;
}

.theme-pill-switch {
    width: 52px !important;
    height: 26px !important;
    border-radius: 13px !important;
}

.switch-option {
    font-size: 11px !important;
}

.switch-slider {
    top: 2px !important;
    left: 2px !important;
    width: 22px !important;
    height: 22px !important;
    border-radius: 11px !important;
}

[data-theme='dark'] .switch-slider {
    transform: translateX(26px) !important;
}

.switch-glow {
    width: 26px !important;
    height: 26px !important;
}

[data-theme='dark'] .switch-glow {
    transform: translateX(26px) !important;
}

/* --- Premium Project Dashboard Styles --- */
.projects-dashboard-view {
    padding: 30px;
}

.project-dashboard-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 20px;
    margin-top: 20px;
}

.dashboard-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.kpi-hero {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.15) 0%, rgba(var(--accent-rgb), 0.05) 100%);
    border: 1px solid rgba(var(--accent-rgb), 0.2);
    position: relative;
    overflow: hidden;
}

.hero-header {
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    z-index: 1;
}

.hero-icon-wrapper {
    width: 64px;
    height: 64px;
    background: var(--accent);
    color: white;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    box-shadow: 0 8px 20px rgba(var(--accent-rgb), 0.3);
}

.hero-title label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.kpi-hero .kpi-value {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--text-main);
}

.hero-footer {
    margin-top: 30px;
    position: relative;
    z-index: 1;
}

.hero-progress-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin-top: 15px;
    overflow: hidden;
}

.hero-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, #a5b4fc 100%);
    box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.5);
    border-radius: 10px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.leaderboard-card {
    display: flex;
    flex-direction: column;
}

.leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.header-text h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.header-text p {
    font-size: 13px;
    color: var(--text-muted);
}

.header-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 215, 0, 0.1);
    color: #ffd700;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 18px;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.leaderboard-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.item-info {
    display: flex;
    align-items: center;
    font-size: 14px;
}

.item-rank {
    font-weight: 800;
    color: var(--accent);
    width: 30px;
    font-size: 12px;
}

.item-name {
    font-weight: 600;
    flex: 1;
    color: var(--text-main);
}

.item-count {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.item-progress-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    overflow: hidden;
}

.item-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, rgba(var(--accent-rgb), 0.3) 100%);
    border-radius: 4px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- EngiData Inspired Bento Layouts --- */
.bento-section {
    margin-bottom: 24px;
}

.bento-section-title {
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bento-section-title i {
    color: var(--accent);
    font-size: 16px;
}

.bento-section-title-mini {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.bento-header-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px 30px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
}

.header-main-info {
    display: flex;
    gap: 24px;
    flex: 1;
    align-items: flex-end;
}

.header-label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.close-btn {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
}

.close-btn:hover {
    background: rgba(231, 76, 60, 0.1);
    color: var(--danger-color);
    transform: rotate(90deg);
}

.close-btn i {
    pointer-events: none;
}

.header-id-input,
.header-desc-input {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-weight: 800;
    font-size: 20px;
    padding: 12px 20px;
    width: 100%;
    outline: none;
    border-radius: 12px;
    transition: all 0.2s;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03);
}

.header-id-input:focus,
.header-desc-input:focus {
    border-color: var(--accent);
    background: var(--card-bg);
    box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.1), inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.header-desc-input {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
}

.header-status-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-width: 60px;
}

.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.grid-3-col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.bento-row-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
}

.device-row {
    display: flex;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.device-row:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.row-label {
    background: rgba(var(--accent-rgb), 0.08);
    color: var(--accent);
    padding: 14px 18px;
    font-weight: 800;
    font-size: 12px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 115px;
    border-right: 1px solid var(--border-color);
    letter-spacing: 0.5px;
}

.row-content {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 14px 18px;
}

@media (max-width: 1100px) {
    .row-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

.info-item label {
    display: block;
    font-size: 10px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
}

.info-item input {
    width: 100%;
    background: var(--bg-color) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    padding: 7px 12px !important;
    color: var(--text-main) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    outline: none !important;
    transition: all 0.2s ease !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.03) !important;
}

.info-item input:focus {
    border-color: var(--accent) !important;
    background: var(--card-bg) !important;
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15), inset 0 1px 3px rgba(0, 0, 0, 0.02) !important;
}

.info-item span {
    font-weight: 600;
    color: var(--text-main);
}

.form-grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-grid-2-col label,
.form-grid-3-col label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.form-grid-2-col input,
.form-grid-3-col input {
    width: 100%;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    color: var(--text-main);
}

.form-grid-3-col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

/* --- Modal Tabs & Interactive Components --- */
.modal-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 0;
}

.tab-btn {
    padding: 16px 24px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tab-btn i {
    font-size: 14px;
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.05);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

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

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

.modern-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}

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

.modern-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 34px;
    border: 1px solid var(--border-color);
}

.modern-switch .slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 4px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.modern-switch input:checked+.slider {
    background-color: var(--accent);
}

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

/* --- EngiData Table View Enhancements --- */
.engi-table-view tr:hover td {
    background: rgba(255, 255, 255, 0.02) !important;
    transition: background 0.2s;
}

.gridjs-search-input {
    background: rgba(0, 0, 0, 0.2) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
}

/* Dashboard To-Do Section */
.hub-top-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    align-items: start;
    margin-bottom: 10px;
}

@media (max-width: 1400px) {
    .hub-top-grid {
        grid-template-columns: 1fr;
    }
}

.todo-section {
    background: rgba(var(--text-main-rgb), 0.02);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 280px;
}

.todo-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.btn-add-todo {
    background: rgba(var(--accent-rgb), 0.1);
    color: var(--accent);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-add-todo i {
    font-size: 14px;
}

.btn-add-todo:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(var(--accent-rgb), 0.3);
}

.todo-list-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 5px;
}

.todo-section-full {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    height: auto;
    display: flex;
    flex-direction: column;
    min-height: auto;
    box-shadow: none;
}

.todo-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: rgba(var(--text-main-rgb), 0.03);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    transition: all 0.3s var(--ease-out-expo);
    cursor: pointer;
    margin-bottom: 12px;
}

.todo-item:hover {
    background: rgba(var(--text-main-rgb), 0.06);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.todo-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.todo-item.completed .todo-checkbox {
    background: var(--accent);
    border-color: var(--accent);
}

.todo-item.completed .todo-checkbox::after {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    color: white;
    font-size: 10px;
}

.todo-text {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
    transition: all 0.2s ease;
}

.todo-item.completed .todo-text {
    opacity: 0.5;
    text-decoration: line-through;
}

.btn-delete-todo {
    opacity: 0;
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    transition: all 0.2s ease;
}

.todo-item:hover .btn-delete-todo {
    opacity: 1;
}

.btn-delete-todo:hover {
    color: #ef4444;
}

/* Dashboard 2-Column Layout */
.hub-main-layout-3col {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 25px;
    margin-top: 20px;
    z-index: 2;
    position: relative;
    align-items: start;
}

@media (max-width: 1400px) {
    .hub-main-layout-3col {
        grid-template-columns: 1fr 340px;
        gap: 20px;
    }
}

@media (max-width: 1000px) {
    .hub-main-layout-3col {
        grid-template-columns: 1fr;
        gap: 25px;
    }
}

.hub-col {
    display: flex;
    flex-direction: column;
    gap: 30px;
}


/* Fix header alignment for all hub sections */
.hub-section .section-header,
.todo-section-full .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    width: 100%;
}

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

.btn-focus-session {
    background: rgba(var(--accent-rgb), 0.1);
    color: var(--accent);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-focus-session:hover {
    background: var(--accent);
    color: white;
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 5px 15px rgba(var(--accent-rgb), 0.3);
}

/* Focus Modal Styling */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.focus-modal-content {
    max-width: 1400px;
    border-radius: 32px;
    padding: 40px;
    text-align: center;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10001;
}

.focus-modal-inner .hub-section-label {
    font-size: 18px;
    margin-bottom: 30px;
    display: block;
}

.timer-circle.large {
    width: 250px;
    height: 250px;
    margin: 0 auto 20px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible;
}

.timer-circle.large .timer-time {
    font-size: 52px;
    font-weight: 800;
    letter-spacing: -2px;
    position: absolute;
    z-index: 2;
}

.timer-circle.large svg {
    transform: rotate(-90deg);
    width: 250px;
    height: 250px;
    position: absolute;
    top: 0;
    left: 0;
    transition: all 0.2s ease;
}

.todo-item.completed .todo-checkbox {
    background: var(--accent);
    border-color: var(--accent);
}

.todo-item.completed .todo-checkbox::after {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    color: white;
    font-size: 10px;
}

.todo-text {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
    transition: all 0.2s ease;
}

.todo-item.completed .todo-text {
    opacity: 0.5;
    text-decoration: line-through;
}

.btn-delete-todo {
    opacity: 0;
    color: var(--text-muted);
    background: transparent;
    border: none;
    padding: 5px;
    transition: all 0.2s ease;
}

.todo-item:hover .btn-delete-todo {
    opacity: 1;
}

.btn-delete-todo:hover {
    color: #ef4444;
}

/* Dashboard 2-Column Layout */
.hub-main-layout-3col {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 25px;
    margin-top: 20px;
    z-index: 2;
    position: relative;
    align-items: start;
}

@media (max-width: 1400px) {
    .hub-main-layout-3col {
        grid-template-columns: 1fr 340px;
        gap: 20px;
    }
}

@media (max-width: 1000px) {
    .hub-main-layout-3col {
        grid-template-columns: 1fr;
        gap: 25px;
    }
}

.hub-col {
    display: flex;
    flex-direction: column;
    gap: 30px;
}


/* Fix header alignment for all hub sections */
.hub-section .section-header,
.todo-section-full .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    width: 100%;
}

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

.btn-focus-session {
    background: rgba(var(--accent-rgb), 0.1);
    color: var(--accent);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-focus-session:hover {
    background: var(--accent);
    color: white;
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 5px 15px rgba(var(--accent-rgb), 0.3);
}

/* Focus Modal Styling */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.focus-modal-content {
    max-width: 1400px;
    border-radius: 32px;
    padding: 40px;
    text-align: center;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10001;
}

.focus-modal-inner .hub-section-label {
    font-size: 18px;
    margin-bottom: 30px;
    display: block;
}

.timer-circle.large {
    width: 250px;
    height: 250px;
    margin: 0 auto 20px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible;
}

.timer-circle.large .timer-time {
    font-size: 52px;
    font-weight: 800;
    letter-spacing: -2px;
    position: absolute;
    z-index: 2;
}

.timer-circle.large svg {
    transform: rotate(-90deg);
    width: 250px;
    height: 250px;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Focus Modal Premium Enhancements */
.premium-glass {
    background: var(--card-bg);
    backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid var(--border-color);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    border-radius: 40px;
    width: 95%;
    max-width: 960px;
    padding: 0;
    overflow: hidden;
    color: var(--text-main);
}

.focus-modal-content.premium-glass {
    max-width: 1400px;
}

/* Enhanced contrast for specific modes */
[data-theme-mode="dark"] .premium-glass {
    background: rgba(var(--text-main-rgb), 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

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

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

.focus-header-info i {
    color: var(--accent);
    font-size: 20px;
}

.focus-header-info .hub-section-label {
    margin: 0 !important;
    font-size: 18px;
    letter-spacing: 1px;
    color: var(--text-main);
}

.modal-close-btn {
    background: rgba(var(--text-main-rgb), 0.05);
    border: none;
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.focus-modal-body {
    display: grid;
    grid-template-columns: 50% 25% 25%;
    gap: 0;
    padding: 40px;
    min-height: 440px;
}

@media (max-width: 800px) {
    .premium-glass {
        width: 100%;
        height: 100%;
        border-radius: 0;
        max-width: none;
    }

    .focus-modal-header {
        padding: 20px;
    }

    .focus-modal-body {
        grid-template-columns: 1fr;
        padding: 20px;
        gap: 30px;
        overflow-y: auto;
    }
}

.timer-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 10px;
}

@media (max-width: 800px) {
    .timer-section {
        padding-right: 0;
        border-right: none;
    }
}

.timer-modes-pill {
    background: rgba(var(--text-main-rgb), 0.05);
    padding: 6px;
    border-radius: 16px;
    display: flex;
    gap: 5px;
    margin-top: 30px;
}

.timer-mode-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px 20px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.timer-mode-modal.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.3);
}

.btn-timer {
    background: rgba(var(--text-main-rgb), 0.05);
    border: none;
    color: var(--text-main);
    width: 48px;
    height: 48px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.btn-timer.main {
    background: var(--accent);
    color: white;
    width: 64px;
    height: 64px;
    font-size: 24px;
}

.timer-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}

/* Music Section */
.focus-sidebar-music {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-left: 32px;
}

@media (max-width: 800px) {
    .focus-sidebar-music {
        padding-left: 0;
        border-top: 1px solid var(--border-color);
        padding-top: 20px;
        margin-top: 20px;
    }
}

.music-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.music-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(var(--text-main-rgb), 0.1);
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

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

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

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

.lofi-player-container {
    width: 100%;
    height: 250px;
    border-radius: 24px;
    overflow: hidden;
    background: rgba(var(--text-main-rgb), 0.05);
    border: 1px solid var(--border-color);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.lofi-player-container.hidden {
    height: 0;
    opacity: 0;
    border: none;
    margin: 0;
}

.lofi-player-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.lofi-status-text {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
    margin-top: -5px;
}

/* MOBILE BOTTOM NAVIGATION - PREMIUM FLOATING DESIGN */
@media (max-width: 1024px) {
    .sidebar {
        width: calc(100% - 48px) !important;
        max-width: 360px !important;
        height: 64px !important;
        position: fixed !important;
        top: unset !important;
        bottom: 24px !important;
        bottom: calc(24px + env(safe-area-inset-bottom)) !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        right: auto !important;
        flex-direction: row !important;
        padding: 0 8px !important;
        margin: 0 !important;
        background: rgba(255, 255, 255, 0.7) !important;
        backdrop-filter: blur(30px) saturate(200%) !important;
        -webkit-backdrop-filter: blur(30px) saturate(200%) !important;
        border: 0.5px solid rgba(255, 255, 255, 0.5) !important;
        border-radius: 32px !important;
        z-index: 10000 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1), 0 5px 15px rgba(0, 0, 0, 0.05) !important;
    }

    [data-theme="dark"] .sidebar {
        background: rgba(20, 20, 22, 0.65) !important;
        border-color: rgba(255, 255, 255, 0.1) !important;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4) !important;
    }

    .sidebar-nav {
        display: grid !important;
        grid-template-columns: 1fr 1fr 1fr !important;
        width: 100% !important;
        height: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        gap: 8px !important;
    }

    .nav-item {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 2px !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        color: #8E8E93 !important;
        height: 48px !important;
        width: 100% !important;
        border-radius: 20px !important;
        transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
        position: relative !important;
        margin: auto 0 !important;
        -webkit-tap-highlight-color: transparent !important;
    }

    .nav-item i,
    .nav-item svg {
        font-size: 20px !important;
        margin: 0 !important;
        width: auto !important;
        height: 20px !important;
        z-index: 2 !important;
        transition: inherit !important;
    }

    .nav-label {
        font-size: 9px !important;
        font-weight: 600 !important;
        display: block !important;
        opacity: 0.6 !important;
        margin: 0 !important;
        color: inherit !important;
        z-index: 2 !important;
        letter-spacing: 0.3px !important;
    }

    .nav-item.active {
        color: var(--accent) !important;
        background: rgba(var(--accent-rgb), 0.1) !important;
    }

    .nav-item.active i,
    .nav-item.active svg {
        transform: scale(1.15) !important;
    }

    .nav-item.active .nav-label {
        opacity: 1 !important;
        font-weight: 700 !important;
    }

    /* Clean sweep of all desktop active indicators */
    .nav-item::before,
    .nav-item::after,
    .nav-item.active::before,
    .nav-item.active::after {
        display: none !important;
    }

    /* Hide sidebar elements that don't belong in bottom nav */
    .sidebar-header,
    .sidebar-footer,
    .btn-toggle,
    .sidebar-profile,
    .app-version,
    .sidebar-welcome,
    .sidebar-clock,
    .sidebar-date,
    .sidebar-greeting {
        display: none !important;
    }

    /* Adjust main content to not be covered */
    .main-content {
        margin-left: 0 !important;
        margin-bottom: 0 !important;
        padding-bottom: 120px !important;
        height: 100vh !important;
        width: 100% !important;
        overflow-y: auto !important;
    }

    .content-view {
        padding: 16px 16px !important;
        min-height: 100vh !important;
    }
}

/* --- PREMIUM CALENDAR REDESIGN (Bento & Modern Card style) --- */

/* Parent calendar card container padding adjustment */
.calendar-card {
    padding: 24px !important;
}

/* Redesigned calendar header */
.calendar-card .calendar-header {
    background: transparent !important;
    border-bottom: none !important;
    padding: 0 0 24px 0 !important;
    margin-bottom: 0 !important;
    backdrop-filter: none !important;
}

.calendar-card .calendar-header h1 {
    font-size: 28px !important;
    font-weight: 800 !important;
    font-family: 'Outfit', sans-serif !important;
    color: var(--text-main) !important;
    letter-spacing: -0.5px;
    margin: 0 !important;
}

.calendar-card #calendar-month-year {
    font-size: 22px !important;
    font-weight: 700 !important;
    color: var(--text-main) !important;
    margin: 0 !important;
}

/* Redesigned calendar navigation buttons */
.calendar-nav {
    display: flex;
    gap: 8px;
    align-items: center;
}

.calendar-nav button {
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid var(--border-color) !important;
    background: var(--card-bg) !important;
    color: var(--text-main) !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: var(--shadow-sm);
}

.calendar-nav button#today-btn {
    border-radius: 20px !important;
    width: auto !important;
    padding: 0 16px !important;
    height: 40px !important;
}

.calendar-nav button:hover {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: var(--text-on-accent) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.2);
}

/* Days of the week headers spacing and styling */
.calendar-card .calendar-grid-header {
    border-bottom: none !important;
    padding-bottom: 16px !important;
    margin-bottom: 8px !important;
    font-size: 12px !important;
    text-transform: uppercase !important;
    letter-spacing: 1.5px !important;
    color: var(--text-muted) !important;
    font-weight: 700 !important;
    display: grid !important;
    grid-template-columns: 50px repeat(7, 1fr) !important;
}

/* Redesigned calendar days grid with spacing gaps */
.calendar-card .calendar-days-grid {
    display: grid !important;
    grid-template-columns: 50px repeat(7, 1fr) !important;
    gap: 12px !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    overflow: visible !important;
}

/* Calendar Week Number Column styling */
.calendar-week-number {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(var(--text-main-rgb), 0.015) !important;
    border-radius: 16px !important;
    border: 1px solid rgba(var(--text-main-rgb), 0.04) !important;
    color: var(--accent) !important;
    font-weight: 800 !important;
    font-size: 11px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    min-height: 120px !important;
    padding: 12px !important;
    box-sizing: border-box !important;
    opacity: 0.8;
}

.week-header-label {
    color: var(--accent) !important;
    font-weight: 800 !important;
    text-align: center;
}

/* Redesigned day card item */
.calendar-card .calendar-day {
    background: rgba(var(--text-main-rgb), 0.03) !important;
    border: 1px solid rgba(var(--text-main-rgb), 0.05) !important;
    border-radius: 16px !important;
    min-height: 120px !important;
    padding: 12px !important;
    position: relative !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.01) !important;
}

/* Hover effect on day cards */
.calendar-card .calendar-day:hover {
    background: rgba(var(--text-main-rgb), 0.05) !important;
    border-color: var(--accent) !important;
    transform: translateY(-2px) !important;
    box-shadow: var(--shadow-md) !important;
}

/* Disable the old bottom line and top line indicators */
.calendar-card .calendar-day::after,
.calendar-card .calendar-day:hover::after,
.calendar-card .calendar-day::before,
.calendar-card .calendar-day.today::before {
    display: none !important;
    content: none !important;
}

/* Today (Active) day box styling */
.calendar-card .calendar-day.today {
    background: #ff85d2 !important;
    /* Vibrant modern pink from user design */
    border-color: #ff85d2 !important;
    color: #1e1b29 !important;
    /* Muted dark text for high contrast */
    box-shadow: 0 6px 20px rgba(255, 133, 210, 0.4) !important;
}

.calendar-card .calendar-day.today .day-number {
    color: #1e1b29 !important;
    font-weight: 800 !important;
    font-size: 15px !important;
}

/* Contrast adjustment for shift badges on Today card */
.calendar-card .calendar-day.today .day-hours-badge {
    background: #ffffff !important;
    color: #ff85d2 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
}

.calendar-card .calendar-day.today .day-hours-badge.target-reached {
    background: #ffffff !important;
    color: #10b981 !important;
}

/* Muted state for days of the other months */
.calendar-card .calendar-day.other-month {
    opacity: 0.45 !important;
    background: rgba(var(--text-main-rgb), 0.01) !important;
    border: 1px dashed rgba(var(--text-main-rgb), 0.1) !important;
    box-shadow: none !important;
}

.calendar-card .calendar-day.other-month:hover {
    transform: none !important;
    background: rgba(var(--text-main-rgb), 0.02) !important;
    border-color: rgba(var(--text-main-rgb), 0.15) !important;
}

/* General spacing helper inside day cells */
.calendar-card .day-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.calendar-card .day-number {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
}

/* Drag-and-drop styling for GTK file items */
.file-item {
    cursor: grab !important;
}

.file-item.dragging {
    cursor: grabbing !important;
    opacity: 0.4 !important;
    border: 1px dashed var(--primary) !important;
    background: rgba(var(--primary-rgb), 0.05) !important;
    transform: scale(0.98);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Fix for GridJS search wrapper container in Warehouse Database & Projects Grid */
#warehouse-data-grid .gridjs-search,
#projects-grid .gridjs-search {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    width: auto !important;
}

/* Workstation Editor Premium Segmented Tabs styling */
#warehouse-edit-modal .modal-tabs,
#warehouse-add-modal .modal-tabs {
    padding: 6px !important;
    border-bottom: none !important;
    display: flex !important;
    gap: 6px !important;
    background: rgba(var(--text-main-rgb), 0.06) !important;
    border-radius: 12px !important;
    margin: 12px 32px 24px 32px !important;
    border: 1px solid var(--border-color) !important;
    justify-content: flex-start !important;
    width: fit-content !important;
}

#warehouse-edit-modal .tab-btn,
#warehouse-add-modal .tab-btn {
    padding: 10px 20px !important;
    border: none !important;
    border-bottom: none !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    color: var(--text-muted) !important;
    background: transparent !important;
    transition: all 0.2s ease !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    cursor: pointer !important;
}

#warehouse-edit-modal .tab-btn:hover,
#warehouse-add-modal .tab-btn:hover {
    color: var(--text-main) !important;
    background: rgba(var(--text-main-rgb), 0.04) !important;
}

#warehouse-edit-modal .tab-btn.active,
#warehouse-add-modal .tab-btn.active {
    background: var(--accent) !important;
    color: #1a1a1a !important;
    /* Sage green contrast text */
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.2) !important;
}

/* Vault Password Actions Horizontal alignment */
.pass-actions {
    display: flex !important;
    flex-direction: row !important;
    gap: 6px !important;
    align-items: center !important;
}

#personal-passwords .table-container,
#personal-reminders .table-container {
    width: 100% !important;
}

/* Vault Table CSS Grid Layout (Task List Grid Style) */
#personal-passwords .card .modern-table {
    display: block !important;
    width: 100% !important;
    background: transparent !important;
    border-collapse: collapse !important;
    border: none !important;
}

#personal-passwords .card .modern-table thead,
#personal-passwords .card .modern-table tbody {
    display: block !important;
    width: 100% !important;
}

#personal-passwords .card .modern-table thead tr {
    display: grid !important;
    grid-template-columns: 1.2fr 1.8fr 1.2fr 180px !important;
    gap: 16px !important;
    align-items: center !important;
    width: 100% !important;
    padding: 10px 18px !important;
    border-bottom: 1px solid var(--border-color) !important;
    margin-bottom: 10px !important;
}

#personal-passwords .card .modern-table tbody tr {
    display: grid !important;
    grid-template-columns: 1.2fr 1.8fr 1.2fr 180px !important;
    gap: 16px !important;
    align-items: center !important;
    width: 100% !important;
    padding: 14px 18px !important;
    margin-bottom: 8px !important;
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

#personal-passwords .card .modern-table tbody tr:hover {
    background: rgba(var(--text-main-rgb), 0.02) !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

#personal-passwords .card .modern-table th {
    display: flex !important;
    align-items: center !important;
    background: transparent !important;
    border: none !important;
    color: var(--text-muted) !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    padding: 0 !important;
}

#personal-passwords .card .modern-table td {
    display: flex !important;
    align-items: center !important;
    border: none !important;
    padding: 0 !important;
    color: var(--text-main) !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

#personal-passwords .card .modern-table th.actions-col,
#personal-passwords .card .modern-table td.actions-col {
    justify-content: flex-end !important;
    overflow: visible !important;
    width: 100% !important;
}

#personal-passwords .actions-wrapper {
    display: flex !important;
    flex-direction: row !important;
    gap: 8px !important;
    align-items: center !important;
    justify-content: flex-end !important;
    width: 100% !important;
}

#personal-passwords .actions-wrapper .delete-btn {
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 4px 8px !important;
    font-size: 14px !important;
}

/* Personal Space Navigation Menu Capsule styling */
#view-personal header .project-sub-nav {
    margin-bottom: 0 !important;
}



/* Remove Double/Outer Nesting Container style in Personal Space */
#view-personal .board-container {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

/* Calendar Work Place Badge styling */
.day-badge-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.day-place-badge {
    background: rgba(var(--text-main-rgb), 0.04);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    max-width: 75px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: 1px solid var(--border-color);
}

.day-place-badge:hover {
    background: rgba(var(--text-main-rgb), 0.08);
    color: var(--text-main);
}


/* â”€â”€ Users View â€“ Full-Width Table â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
/* -- Users View display logic inherited from .content-view -- */

#view-users:not(.active) {
    display: none !important;
}

#view-users .card.table-container,
#view-users #users-table-view,
#view-users #users-table-view .card {
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
}

#view-users #users-table {
    width: 100% !important;
    table-layout: auto;
}

#view-users #users-table th,
#view-users #users-table td {
    white-space: nowrap;
}

#view-users #users-table th:nth-child(3),
#view-users #users-table td:nth-child(3) {
    width: 100%;
    /* Full Name column gets all remaining space */
    white-space: normal;
}

/* â”€â”€ Personal View â€“ Keep nav horizontal â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
#view-personal .settings-nav,
#view-personal nav.settings-nav {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    border-right: none !important;
    border-bottom: 1px solid var(--border-color) !important;
    width: 100% !important;
    padding: 8px 0 12px 0 !important;
    margin-bottom: 20px !important;
}



/* â”€â”€ Selection Master-Detail Layout â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.sel-master-detail {
    display: flex;
    flex-direction: column;
    min-height: 400px;
    margin-top: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
}

/* Top: category nav (horizontal) inside header */
.sel-categories {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    margin: 0 24px;
    flex: 1;
    justify-content: center;
    padding: 0 !important;
}

.sel-cat-btn {
    padding: 10px 24px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: rgba(var(--text-main-rgb), 0.03);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 42px;
}

.sel-cat-btn:hover {
    background: rgba(var(--text-main-rgb), 0.06);
    color: var(--text-main);
    border-color: var(--accent);
}

.sel-cat-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.3);
}

.sel-cat-icon {
    font-size: 15px;
    flex-shrink: 0;
}

/* Right: detail panel */
.sel-detail {
    flex: 1;
    min-width: 0;
    padding: 16px 20px;
    overflow-y: auto;
}

.sel-panel {
    display: none;
    animation: settingsFadeIn 0.2s ease-out;
}

.sel-panel.active {
    display: block;
}

/* ── Selection Overview Grid (Status, Priority, Project Categories, Work Places) ── */
.sel-overview-grid {
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    align-items: flex-start;
    width: 100%;
}

.sel-overview-grid.active {
    display: grid !important;
}

.sel-overview-col {
    background: rgba(var(--text-main-rgb), 0.015);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.2s ease;
}

.sel-overview-col:hover {
    border-color: rgba(var(--accent-rgb), 0.35);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

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

.sel-overview-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sel-overview-title h4 {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.sel-overview-count {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.12);
    padding: 1px 7px;
    border-radius: 10px;
}

.sel-quick-add-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sel-quick-add-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    transform: scale(1.08);
}

.sel-overview-item-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 40px;
}

/* ── Client Columns Layout ── */
.sel-client-container {
    display: none;
    gap: 20px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.sel-client-container.active {
    display: flex !important;
}

.sel-client-group-col {
    flex: 1;
    min-width: 230px;
    background: rgba(var(--text-main-rgb), 0.01);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sel-client-group-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 2px;
}

.sel-client-group-header h4 {
    margin: 0;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.7px;
}

.sel-client-group-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Premium Global Tooltip */
#global-tooltip {
    position: fixed;
    background: rgba(15, 23, 42, 0.85);
    /* Slate 900 glass */
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    color: #f8fafc;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    pointer-events: none;
    display: none;
    z-index: 99999;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
    font-family: 'Inter', sans-serif;
    transition: opacity 0.15s ease, transform 0.15s ease;
    white-space: nowrap;
}

/* Cozy AG Grid Theme overrides */
.ag-theme-quartz,
.ag-theme-quartz-dark {
    --ag-background-color: var(--card-bg) !important;
    --ag-header-background-color: rgba(var(--text-main-rgb), 0.03) !important;
    --ag-border-color: var(--border-color) !important;
    --ag-row-hover-color: rgba(var(--accent-rgb), 0.08) !important;
    --ag-font-family: 'Inter', sans-serif !important;
    --ag-foreground-color: var(--text-main) !important;
    --ag-header-foreground-color: var(--text-main) !important;
    --ag-secondary-foreground-color: var(--text-muted) !important;
    --ag-card-background-color: var(--card-bg) !important;
    --ag-control-panel-background-color: var(--bg-main) !important;
    --ag-font-size: 13px !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    border: 1px solid var(--border-color) !important;
}

.ag-theme-quartz .ag-header-cell,
.ag-theme-quartz-dark .ag-header-cell {
    font-weight: 700 !important;
    letter-spacing: 0.5px !important;
}

.ag-theme-quartz .ag-row,
.ag-theme-quartz-dark .ag-row {
    border-bottom-color: var(--border-color) !important;
}

.ag-theme-quartz .ag-paging-panel,
.ag-theme-quartz-dark .ag-paging-panel {
    border-top: 1px solid var(--border-color) !important;
    font-weight: 600 !important;
}

.ag-theme-quartz .ag-checkbox-input-wrapper.ag-checked::after,
.ag-theme-quartz-dark .ag-checkbox-input-wrapper.ag-checked::after {
    color: var(--accent) !important;
}

/* Drag and Drop visual feedback */
.file-list.drag-hover,
.gtk-sidebar.drag-hover,
.pdf-sidebar.drag-hover {
    border: 2px dashed var(--accent) !important;
    background: rgba(var(--accent-rgb), 0.05) !important;
    transition: all 0.2s ease-in-out;
}

/* Mobile Projects View styling */
#projects-mobile-view {
    display: none;
    padding: 10px 0;
}

.mobile-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mobile-section-title {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.3px;
}

@media (max-width: 768px) {
    #projects-mobile-view {
        display: block !important;
    }

    #view-projects header,
    #projects-table-view,
    #projects-kanban-view,
    #projects-dashboard-view,
    #projects-stats-dashboard {
        display: none !important;
    }
}

/* Mobile Settings View styling */
#mobile-vault-panel {
    display: none;
}

@media (max-width: 768px) {
    #mobile-vault-panel {
        display: block !important;
    }

    #view-settings .settings-sidebar {
        display: none !important;
    }

    #view-settings .settings-layout {
        flex-direction: column !important;
    }

    #settings-general {
        display: block !important;
    }

    #settings-logs,
    #settings-security,
    #settings-system,
    #settings-selection {
        display: none !important;
    }
}

/* --- Projects View 100% Height & Form Centering Layout --- */
#view-projects {
    height: calc(100vh - 120px) !important;
    min-height: 0 !important;
}

#view-projects .board-container {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    height: calc(100% - 20px) !important;
}

#projects-table-view {
    flex: 1 !important;
    flex-direction: column !important;
    min-height: 0 !important;
    height: 100% !important;
}

#projects-grid {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    height: 100% !important;
}

#projects-today-prio-view {
    flex: 1 !important;
    flex-direction: column !important;
    min-height: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
}

#projects-today-prio-view .today-prio-wrapper {
    flex: 1 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    gap: 24px !important;
    margin-top: 20px !important;
    min-height: 0 !important;
    height: calc(100% - 20px) !important;
    overflow: hidden !important;
}

#projects-today-prio-view .today-prio-card,
#projects-today-prio-view .today-prio-reference {
    overflow: hidden !important;
    min-height: 0 !important;
}

#projects-today-prio-view .todo-list-container {
    max-height: none !important;
}

#project-form-view {
    flex: 1 !important;
    flex-direction: column !important;
    min-height: 0 !important;
    height: 100% !important;
}

#edit-project-form {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    height: 100% !important;
    overflow-y: auto !important;
}

#edit-project-form .tab-pane {
    flex: 1 !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    padding-top: 16px !important;
}

/* =============================================
   QUICK STATUS CHANGE DROPDOWN
   ============================================= */

.status-quick-trigger {
    transition: transform 0.15s ease, box-shadow 0.15s ease !important;
    user-select: none;
}

.status-quick-trigger:hover {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2) !important;
}

.status-quick-trigger:active {
    transform: scale(0.98);
}

.status-quick-dropdown {
    position: fixed;
    z-index: 99999;
    min-width: 200px;
    max-width: 260px;
    background: var(--card-bg, #1e2233);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 12px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.35),
        0 8px 24px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    padding: 6px;
    backdrop-filter: blur(16px);
    animation: statusDropdownIn 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

@keyframes statusDropdownIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.95);
    }

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

.status-quick-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main, #e0e0e0);
    transition: all 0.12s ease;
    position: relative;
}

.status-quick-option i {
    font-size: 12px;
    width: 16px;
    text-align: center;
    color: var(--opt-color, #808080);
}

.status-quick-option:hover {
    background: var(--opt-color, #808080);
    color: var(--opt-font, #fff);
    transform: translateX(3px);
}

.status-quick-option:hover i {
    color: var(--opt-font, #fff);
}

.status-quick-option.active {
    background: color-mix(in srgb, var(--opt-color, #808080) 18%, transparent);
    color: var(--opt-color, #808080);
    font-weight: 600;
}

.status-quick-option.active::after {
    content: '\2713';
    position: absolute;
    right: 12px;
    font-size: 13px;
    color: var(--opt-color, #808080);
}

.status-quick-option.active:hover {
    background: var(--opt-color, #808080);
    color: var(--opt-font, #fff);
}

.status-quick-option.active:hover::after {
    color: var(--opt-font, #fff);
}

/* Separator line at top of dropdown */
.status-quick-dropdown::before {
    content: '';
    display: block;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-color, #6c63ff), transparent);
    margin-bottom: 4px;
    border-radius: 2px;
}

/* =============================================
   PROJECT COMMENTS TAB
   ============================================= */

.comments-tab-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 24px;
    height: 100%;
    overflow-y: auto;
}

/* ---- Add Comment Area ---- */
.comment-add-area {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}

.comment-author-avatar {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color, #6c63ff), var(--accent-color, #a78bfa));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(108, 99, 255, 0.3);
}

.comment-input-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.comment-input-wrapper textarea {
    width: 100%;
    min-height: 60px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1.5px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-main);
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    line-height: 1.4;
}

.comment-input-wrapper textarea:focus {
    border-color: var(--primary-color, #6c63ff);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.12);
}

.comment-input-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.comment-hint {
    font-size: 11.5px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ---- Comments Timeline ---- */
.comments-timeline {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    flex: 1;
}

.comment-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    animation: commentSlideIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes commentSlideIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }

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

.comment-item-new {
    animation: commentSlideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.comment-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color, #6c63ff) 0%, var(--accent-color, #a78bfa) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.comment-body {
    flex: 1;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px 12px;
    position: relative;
    transition: box-shadow 0.2s ease;
    border-left: 3px solid var(--primary-color, #6c63ff);
}

.comment-body:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.comment-author {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
}

.comment-date {
    font-size: 11.5px;
    color: var(--text-muted);
    flex: 1;
}

.comment-delete-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    opacity: 0;
    transition: all 0.15s ease;
    padding: 0;
}

.comment-body:hover .comment-delete-btn {
    opacity: 1;
}

.comment-delete-btn:hover {
    background: rgba(231, 76, 60, 0.12);
    color: #e74c3c;
}

.comment-content {
    font-size: 13px;
    color: var(--text-secondary, var(--text-main));
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ---- Empty State ---- */
.comments-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 48px 24px;
    color: var(--text-muted);
    text-align: center;
}

.comments-empty-state i {
    font-size: 36px;
    opacity: 0.3;
}

.comments-empty-state p {
    margin: 0;
    font-size: 14px;
    opacity: 0.7;
}

/* ---- Loading State ---- */
.comments-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 24px;
    color: var(--text-muted);
    font-size: 13px;
}

/* =============================================
   CLIENT CRM MODULE
   ============================================= */

/* ---- Layout ---- */
.crm-layout {
    display: flex;
    gap: 0;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    margin-top: 0px;
    background: var(--card-bg);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

/* ---- Left Sidebar (Client List) ---- */
.crm-sidebar {
    width: 300px;
    min-width: 240px;
    max-width: 340px;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.crm-search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 13px;
    color: var(--text-muted);
}

.crm-search-wrap input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-main);
    font-size: 13px;
    width: 180px;
}

.crm-list-loading {
    padding: 30px;
    text-align: center;
    color: var(--text-muted);
    font-size: 20px;
}

/* ---- Client Card ---- */
.crm-client-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.15s ease;
}

.crm-client-card:hover {
    background: rgba(var(--primary-rgb, 108, 99, 255), 0.06);
}

.crm-client-card.active {
    background: rgba(var(--primary-rgb, 108, 99, 255), 0.1);
    border-left: 3px solid var(--primary-color, #6c63ff);
}

.crm-client-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color, #6c63ff), var(--accent-color, #a78bfa));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.crm-client-info {
    flex: 1;
    min-width: 0;
}

.crm-client-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crm-client-sub {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crm-client-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-items: flex-end;
}

.crm-badge {
    font-size: 10.5px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 3px;
}

.crm-badge i {
    font-size: 9px;
}

/* ---- Right: Detail Panel ---- */
.crm-detail-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.crm-detail-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 14px;
    color: var(--text-muted);
}

.crm-detail-placeholder i {
    font-size: 40px;
    opacity: 0.25;
}

.crm-detail-placeholder p {
    font-size: 14px;
    opacity: 0.6;
}

/* ---- Detail Header ---- */
.crm-detail-header {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 24px 28px 16px;
    border-bottom: 1px solid var(--border-color);
}

.crm-detail-avatar {
    width: 58px;
    height: 58px;
    min-width: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color, #6c63ff) 0%, var(--accent-color, #a78bfa) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(108, 99, 255, 0.3);
}

.crm-detail-info {
    flex: 1;
    min-width: 0;
}

.crm-detail-info h2 {
    margin: 0 0 3px;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-main);
}

.crm-company {
    margin: 0 0 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.crm-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.crm-meta-link {
    font-size: 12px;
    color: var(--primary-color, #6c63ff);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(108, 99, 255, 0.08);
    padding: 4px 10px;
    border-radius: 20px;
    transition: background 0.15s;
}

.crm-meta-link:hover {
    background: rgba(108, 99, 255, 0.18);
}

.crm-detail-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ---- Stats Row ---- */
.crm-stats-row {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-color);
}

.crm-stat-card {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-right: 1px solid var(--border-color);
}

.crm-stat-card:last-child {
    border-right: none;
}

.crm-stat-card i {
    font-size: 20px;
    color: var(--primary-color, #6c63ff);
    opacity: 0.7;
}

.crm-stat-card div {
    display: flex;
    flex-direction: column;
}

.crm-stat-card span {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1;
}

.crm-stat-card small {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ---- Detail Tabs ---- */
.crm-detail-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-color);
    padding: 0 20px;
    background: var(--card-bg);
}

.crm-tab-btn {
    padding: 12px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.crm-tab-btn:hover {
    color: var(--text-main);
}

.crm-tab-btn.active {
    color: var(--primary-color, #6c63ff);
    border-bottom-color: var(--primary-color, #6c63ff);
    font-weight: 700;
}

.crm-tab-pane {
    display: none;
    padding: 16px 24px;
}

.crm-tab-pane.active {
    display: block;
}

/* ---- Section Header ---- */
.crm-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ---- Inline Form ---- */
.crm-inline-form {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    animation: commentSlideIn 0.2s ease;
}

.crm-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.crm-form-grid input,
.crm-form-grid select,
.crm-select {
    padding: 9px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-main);
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s;
    width: 100%;
}

.crm-form-grid input:focus,
.crm-form-grid select:focus {
    border-color: var(--primary-color, #6c63ff);
}

/* ---- Contacts ---- */
.crm-contacts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.crm-contact-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
    transition: box-shadow 0.15s;
    animation: commentSlideIn 0.2s ease;
}

.crm-contact-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.09);
}

.crm-contact-rank {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-color, #6c63ff);
    background: rgba(108, 99, 255, 0.1);
    border-radius: 20px;
    padding: 3px 10px;
    white-space: nowrap;
    min-width: 70px;
    text-align: center;
}

.crm-contact-avatar {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #3b82f6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.crm-contact-info {
    flex: 1;
}

.crm-contact-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.crm-contact-role {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.crm-contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

/* ---- Hours Log ---- */
.crm-hours-total {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.crm-hours-total strong {
    color: var(--text-main);
    font-size: 15px;
}

.crm-hours-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.crm-hours-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    animation: commentSlideIn 0.2s ease;
}

.crm-hours-date {
    font-size: 12px;
    color: var(--text-muted);
    min-width: 90px;
}

.crm-hours-amount {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color, #6c63ff);
    min-width: 60px;
}

.crm-hours-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.crm-hours-project {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.crm-hours-note {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}

/* ---- Projects ---- */
.crm-projects-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.crm-project-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    animation: commentSlideIn 0.2s ease;
}

.crm-project-status {
    width: 10px;
    height: 10px;
    min-width: 10px;
    border-radius: 50%;
}

.crm-project-info {
    flex: 1;
}

.crm-project-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-main);
}

.crm-project-meta {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ---- Shared CRM ---- */
.crm-delete-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    opacity: 0;
    transition: all 0.15s ease;
    padding: 0;
    flex-shrink: 0;
}

.crm-contact-item:hover .crm-delete-btn,
.crm-hours-item:hover .crm-delete-btn {
    opacity: 1;
}

.crm-delete-btn:hover {
    background: rgba(231, 76, 60, 0.12);
    color: #e74c3c;
}

.crm-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 48px 24px;
    color: var(--text-muted);
    text-align: center;
    height: 100%;
}

.crm-empty-state i {
    font-size: 36px;
    opacity: 0.25;
}

.crm-empty-state p {
    margin: 0;
    font-size: 14px;
    opacity: 0.7;
}

.crm-list-placeholder {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    opacity: 0.7;
}

.crm-add-btn {
    height: 32px;
    padding: 0 12px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* CRM Modal overlay visible state */
#crm-client-modal {
    align-items: center;
    justify-content: center;
}

#crm-client-modal .modal-container {
    animation: statusDropdownIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* CRM Group & Sub-Clients Styles */
.crm-badge.group-badge {
    color: var(--accent) !important;
    background: rgba(var(--accent-rgb), 0.12) !important;
    padding: 2px 7px !important;
    border-radius: 10px !important;
    font-weight: 700 !important;
}

.crm-parent-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--accent);
    margin-top: 3px;
    background: rgba(var(--accent-rgb), 0.08);
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.crm-group-banner, .crm-parent-banner {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 8px;
    margin-top: 6px;
}

.crm-group-banner {
    background: rgba(var(--accent-rgb), 0.15);
    color: var(--accent);
    border: 1px solid rgba(var(--accent-rgb), 0.3);
}

.crm-parent-banner {
    background: rgba(var(--text-main-rgb), 0.05);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.crm-parent-banner a {
    color: var(--accent);
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

.crm-subclients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.crm-subclient-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 14px;
    transition: all 0.2s ease;
}

.crm-subclient-card:hover {
    border-color: rgba(var(--accent-rgb), 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.crm-subclient-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #3b82f6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.crm-subclient-info {
    flex: 1;
    min-width: 0;
}

.crm-subclient-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crm-subclient-company {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 2px;
}

.crm-subclient-badges {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}

.crm-subclient-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.crm-subclient-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.crm-subclient-checkbox-label:hover {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.05);
}

.crm-subclient-checkbox-label input[type="checkbox"] {
    accent-color: var(--accent);
    width: 15px;
    height: 15px;
    cursor: pointer;
}

.crm-subclient-box-content {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.crm-subclient-box-content strong {
    font-size: 12px;
    color: var(--text-main);
}

.crm-subclient-box-content small {
    font-size: 10px;
    color: var(--text-muted);
}

.crm-project-client-badge {
    font-size: 10px;
    font-weight: 700;
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.1);
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 6px;
}

/* Settings Clients Pills in CRM Modal & Detail */
.crm-settings-client-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
    transition: all 0.2s ease;
    user-select: none;
}

.crm-settings-client-pill:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

.crm-settings-client-pill.selected,
.crm-settings-client-pill:has(input:checked) {
    border-color: var(--client-color, var(--accent));
    background: rgba(var(--accent-rgb), 0.1);
    color: var(--accent);
}

.crm-settings-client-pill input[type="checkbox"] {
    accent-color: var(--accent);
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.crm-settings-client-pill .pill-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.crm-mapped-clients-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.crm-mapped-client-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    border: 1px solid var(--client-color, var(--border-color));
    background: rgba(var(--text-main-rgb), 0.04);
    color: var(--text-main);
}

.crm-mapped-client-badge .badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--client-color, var(--accent));
}

/* Quick Access Folders and Drag & Drop Styles */
.folder-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, 14px);
    grid-template-rows: repeat(2, 14px);
    gap: 4px;
    width: 38px;
    height: 38px;
    padding: 3px;
    background: rgba(var(--text-main-rgb), 0.05);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-sizing: border-box;
    justify-content: center;
    align-content: center;
}

.folder-preview-grid img,
.folder-preview-grid .folder-mini-fallback {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    object-fit: contain;
}

.folder-preview-grid .folder-mini-fallback {
    background: rgba(var(--text-main-rgb), 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    color: var(--text-muted);
}

/* Wrapper for custom icon + its fallback — counts as ONE grid cell */
.folder-preview-grid .folder-mini-icon-cell {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.folder-preview-grid .folder-mini-icon-cell img {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    object-fit: contain;
}

.folder-preview-grid .folder-mini-icon-cell .folder-mini-fallback {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    background: rgba(var(--text-main-rgb), 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 6px;
    color: var(--text-muted);
}

.hub-link-wrapper.dragging {
    opacity: 0.4 !important;
    transform: scale(0.95);
}

.hub-link-wrapper.drag-over-merge .hub-link-tile {
    border-color: var(--accent) !important;
    background: rgba(var(--accent-rgb), 0.15) !important;
    transform: scale(0.95);
    box-shadow: 0 0 15px rgba(var(--accent-rgb), 0.3) !important;
}

.hub-link-wrapper.drag-over-before::before {
    content: '';
    position: absolute;
    top: 0;
    left: -8px;
    width: 4px;
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    box-shadow: 0 0 8px var(--accent);
    animation: dragPulse 1s infinite alternate;
    z-index: 10;
}

.hub-link-wrapper.drag-over-after::after {
    content: '';
    position: absolute;
    top: 0;
    right: -8px;
    width: 4px;
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    box-shadow: 0 0 8px var(--accent);
    animation: dragPulse 1s infinite alternate;
    z-index: 10;
}

@keyframes dragPulse {
    from {
        opacity: 0.6;
    }

    to {
        opacity: 1;
    }
}

/* iOS Folder Modal CSS */
.folder-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.25);
    /* Elegant, clean slate-tinted dim overlay (no blur) */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s;
}

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

.folder-modal-content {
    width: 90%;
    max-width: 360px;
    background: rgba(30, 30, 35, 0.75) !important;
    /* Premium dark glass */
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 28px !important;
    padding: 24px !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25) !important;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transform: scale(0.9);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(20px) !important;
    /* Frosted glass effect restricted only inside the modal */
    -webkit-backdrop-filter: blur(20px) !important;
}

[data-theme="light"] .folder-modal-content {
    background: rgba(255, 255, 255, 0.85) !important;
    /* Premium light glass */
    border-color: rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.1) !important;
}

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

.folder-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.folder-title-input {
    font-size: 24px !important;
    font-weight: 800 !important;
    background: transparent !important;
    border: none !important;
    border-bottom: 2px solid transparent !important;
    box-shadow: none !important;
    color: var(--text-main) !important;
    padding: 6px 4px !important;
    /* Aligned vertically with grid content */
    border-radius: 8px !important;
    width: 100%;
    outline: none !important;
    transition: all 0.25s ease !important;
    font-family: inherit;
}

.folder-title-input:hover {
    background: rgba(var(--text-main-rgb), 0.05) !important;
}

.folder-title-input:focus {
    background: rgba(var(--text-main-rgb), 0.08) !important;
    border-bottom: 2px solid var(--accent) !important;
}

.folder-close-btn {
    background: rgba(var(--text-main-rgb), 0.06) !important;
    border: none !important;
    color: var(--text-main) !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 600;
}

.folder-close-btn:hover {
    background: rgba(var(--text-main-rgb), 0.15) !important;
    transform: scale(1.05);
}

.folder-links-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 12px !important;
    min-height: 90px;
    max-height: 320px;
    overflow-y: auto;
    overflow-x: hidden !important;
    padding: 6px !important;
}

.folder-links-grid .hub-link-tile {
    background: rgba(var(--text-main-rgb), 0.03) !important;
    border: 1px solid rgba(var(--text-main-rgb), 0.05) !important;
    border-radius: 16px !important;
    padding: 14px 10px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.folder-links-grid .hub-link-tile:hover {
    background: rgba(var(--text-main-rgb), 0.07) !important;
    border-color: var(--accent) !important;
    transform: translateY(-4px) scale(1.02) !important;
    box-shadow: 0 10px 20px rgba(var(--accent-rgb), 0.12) !important;
}

.folder-links-grid .hub-link-tile img {
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px !important;
    object-fit: contain !important;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1) !important;
    transition: transform 0.2s ease !important;
}

.folder-links-grid .hub-link-tile:hover img {
    transform: scale(1.05);
}

.folder-links-grid .hub-link-icon-fallback {
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(var(--accent-rgb), 0.1) !important;
    color: var(--accent) !important;
    box-shadow: 0 3px 8px rgba(var(--accent-rgb), 0.06) !important;
    transition: transform 0.2s ease !important;
}

/* Allow inline display:none to win over !important flex */
.folder-links-grid .hub-link-icon-fallback[style*="display: none"],
.folder-links-grid .hub-link-icon-fallback[style*="display:none"] {
    display: none !important;
}

.folder-links-grid .hub-link-tile:hover .hub-link-icon-fallback {
    transform: scale(1.05);
}

.folder-links-grid .hub-link-label {
    font-size: 11px !important;
    font-weight: 600 !important;
    color: inherit;
    max-width: 100% !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Dropzone when dragging out of folder */
.folder-drag-out-zone {
    border: 1.5px dashed rgba(var(--text-main-rgb), 0.2) !important;
    border-radius: 16px !important;
    padding: 14px !important;
    text-align: center !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    color: var(--text-muted) !important;
    transition: all 0.25s ease !important;
    background: rgba(var(--text-main-rgb), 0.01) !important;
    margin-top: 12px;
    letter-spacing: 0.2px;
}

.folder-drag-out-zone.drag-hover {
    border-color: #ff4d4d !important;
    background: rgba(255, 77, 77, 0.1) !important;
    color: #ff4d4d !important;
    box-shadow: 0 0 15px rgba(255, 77, 77, 0.2) !important;
    transform: scale(1.02);
}


/* Focus Modal Sidebar Layout */
.focus-sidebar {
    padding-left: 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow: hidden;
}

@media (max-width: 800px) {
    .focus-sidebar {
        padding-left: 0;
    }
}

/* Today's Priorities in Focus Modal */
.focus-prio-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    min-height: 0;
    padding-right: 32px;
    border-right: 1px solid var(--border-color);
    overflow: hidden;
}

.focus-sidebar-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.focus-sidebar-header i {
    color: var(--accent);
    font-size: 14px;
}

.focus-prio-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    flex: 1;
    padding-right: 4px;
}

.focus-prio-list::-webkit-scrollbar {
    width: 4px;
}

.focus-prio-list::-webkit-scrollbar-thumb {
    background: rgba(var(--text-main-rgb), 0.2);
    border-radius: 4px;
}

.focus-prio-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    background: rgba(var(--text-main-rgb), 0.03);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.focus-prio-item:hover {
    background: rgba(var(--accent-rgb), 0.08);
    border-color: rgba(var(--accent-rgb), 0.3);
}

.focus-prio-item.done {
    opacity: 0.5;
}

.focus-prio-item.done .focus-prio-label span:first-child {
    text-decoration: line-through;
}

.focus-prio-check {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: var(--accent);
}

.focus-prio-item.done .focus-prio-check {
    background: var(--accent);
    color: white;
}

.focus-prio-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.focus-prio-label span:first-child {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.focus-prio-project {
    font-size: 10.5px;
    color: var(--accent);
    opacity: 0.85;
}

.focus-prio-placeholder {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    padding: 12px;
    font-style: italic;
}

/* Music Tabs in Focus Modal */
.music-tabs {
    display: flex;
    gap: 4px;
    background: rgba(var(--text-main-rgb), 0.06);
    border-radius: 10px;
    padding: 3px;
}

.music-tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.music-tab.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.3);
}

.focus-music-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lofi-toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

/* Spotify Embed UI */
.spotify-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.spotify-url-field {
    flex: 1;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(var(--text-main-rgb), 0.04);
    color: var(--text-main);
    padding: 0 10px;
    font-size: 12px;
    outline: none;
    transition: border-color 0.2s;
}

.spotify-url-field:focus {
    border-color: #1DB954;
}

.btn-spotify-load {
    height: 36px;
    padding: 0 14px;
    border-radius: 8px;
    background: #1DB954;
    color: white;
    border: none;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-spotify-load:hover {
    background: #1aa34a;
    transform: scale(1.03);
}

.spotify-player-container {
    border-radius: 12px;
    overflow: hidden;
    min-height: 60px;
}

.spotify-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
    background: rgba(var(--text-main-rgb), 0.03);
    border: 1px dashed var(--border-color);
    border-radius: 12px;
}


/* Focus Modal Middle Column: Timer */
.focus-timer-col {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-left: 32px;
    padding-right: 32px;
    border-right: 1px solid var(--border-color);
    overflow: hidden;
}

@media (max-width: 800px) {
    .focus-prio-section {
        padding-right: 0;
        border-right: none;
    }

    .focus-timer-col {
        padding-left: 0;
        padding-right: 0;
        border-right: none;
    }
}

/* AG Grid double-click hint: pointer cursor on rows */
.ag-theme-quartz .ag-row,
.ag-theme-quartz-dark .ag-row {
    cursor: pointer;
}

.ag-theme-quartz .ag-row:hover,
.ag-theme-quartz-dark .ag-row:hover {
    background: rgba(var(--accent-rgb, 99, 102, 241), 0.05) !important;
}

/* Warehouse Map Station Details Sliding Card */
.map-station-card {
    position: absolute;
    top: 20px;
    right: -360px;
    /* Hidden by default */
    width: 320px;
    bottom: 20px;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 20;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: var(--text-main);
}

.map-station-card.active {
    right: 20px;
    /* Slide in */
}

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

.map-station-card-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.map-station-card-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    transition: color 0.2s;
    padding: 5px;
}

.map-station-card-close:hover {
    color: var(--text-main);
}

.map-station-card-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.map-station-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.map-station-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    font-weight: 700;
}

.map-station-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.map-station-label-value {
    display: flex;
    flex-direction: column;
}

.map-station-label {
    font-size: 11px;
    color: var(--text-muted);
}

.map-station-value {
    font-size: 13px;
    font-weight: 500;
}

.map-station-copy-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(var(--text-main-rgb), 0.03);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.map-station-copy-row code {
    font-family: monospace;
    font-size: 12px;
    color: #a29bfe;
}

.map-station-copy-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    transition: color 0.2s;
}

.map-station-copy-btn:hover {
    color: var(--accent);
}

/* Keyboard Shortcuts styling */
kbd.kbd-key {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 0 0 2px var(--bg-color) inset;
    color: var(--text-main);
    display: inline-block;
    font-family: var(--font-mono, monospace);
    font-size: 11px;
    line-height: 1.4;
    margin: 0 2px;
    padding: 2px 6px;
    white-space: nowrap;
}

/* Whiteboard / Moodboard Styles */
.whiteboard-container {
    user-select: none;
    outline: none;
}

.whiteboard-toolbar button {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.whiteboard-toolbar button:hover {
    background: rgba(var(--accent-rgb), 0.1) !important;
    color: var(--accent) !important;
    border-color: var(--accent) !important;
}

.whiteboard-toolbar button.active {
    background: var(--accent) !important;
    color: #ffffff !important;
    border-color: var(--accent) !important;
}

#whiteboard-svg {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 50000px !important;
    height: 50000px !important;
    pointer-events: none !important;
    overflow: visible !important;
    z-index: 1 !important;
}

.wb-connection-group {
    pointer-events: auto !important;
}

.wb-line {
    stroke: #3b82f6 !important;
    stroke-width: 2.5 !important;
    fill: none !important;
    cursor: pointer !important;
    pointer-events: stroke !important;
}

.wb-line-hover-overlay {
    stroke: transparent !important;
    stroke-width: 16 !important;
    fill: none !important;
    cursor: pointer !important;
    pointer-events: stroke !important;
}

.wb-line-handle {
    cursor: move !important;
    pointer-events: auto !important;
}

.wb-element {
    box-sizing: border-box;
    cursor: move;
    transition: outline 0.15s ease, box-shadow 0.15s ease;
    z-index: 2;
}

.wb-element.selected {
    outline: 2px solid var(--accent) !important;
    box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.2), var(--shadow-lg) !important;
}

/* Hide controls by default, show on hover/selection */
.wb-element .wb-delete-btn,
.wb-element .wb-resize-handle,
.wb-element .wb-port {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease, background-color 0.15s ease;
}

.wb-element:hover .wb-delete-btn,
.wb-element:hover .wb-resize-handle,
.wb-element:hover .wb-port,
.wb-element.selected .wb-delete-btn,
.wb-element.selected .wb-resize-handle,
.wb-element.selected .wb-port {
    opacity: 1;
    pointer-events: auto;
}

/* While dragging a connection, illuminate all ports across all elements */
#whiteboard-viewport.wb-connecting .wb-element .wb-port {
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: scale(1.3) !important;
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.35) !important;
    background: var(--accent) !important;
    border-color: #ffffff !important;
    z-index: 9999 !important;
}

#whiteboard-viewport.wb-connecting .wb-port-top,
#whiteboard-viewport.wb-connecting .wb-port-bottom {
    transform: translateX(-50%) scale(1.3) !important;
}

#whiteboard-viewport.wb-connecting .wb-port-left,
#whiteboard-viewport.wb-connecting .wb-port-right {
    transform: translateY(-50%) scale(1.3) !important;
}

#whiteboard-viewport.wb-connecting .wb-port:hover {
    transform: scale(1.6) !important;
    box-shadow: 0 0 0 5px rgba(var(--accent-rgb), 0.6) !important;
}

.wb-port {
    transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.wb-port:hover {
    background: var(--accent) !important;
    border-color: var(--text-main) !important;
}

.wb-port-top:hover,
.wb-port-bottom:hover {
    transform: translateX(-50%) scale(1.4) !important;
}

.wb-port-left:hover,
.wb-port-right:hover {
    transform: translateY(-50%) scale(1.4) !important;
}

.wb-delete-btn:hover {
    transform: scale(1.25) !important;
    background: #ff3333 !important;
}

.wb-resize-handle:hover {
    transform: scale(1.25) rotate(90deg) !important;
    color: var(--accent-hover, var(--accent)) !important;
}

.wb-line {
    transition: stroke-width 0.15s ease, stroke 0.15s ease, filter 0.15s ease;
}

.wb-connection-group:hover .wb-line {
    stroke-width: 4px !important;
    stroke: #ff4d4d !important;
    filter: drop-shadow(0 0 4px rgba(255, 77, 77, 0.4));
}

/* Whiteboard Context Menu */
.wb-context-menu {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 6px;
    box-shadow: var(--shadow-xl);
    min-width: 170px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.wb-context-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.wb-context-menu-item:hover {
    background: rgba(var(--accent-rgb), 0.1);
    color: var(--accent);
}

.wb-context-menu-separator {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

.wb-context-color-grid {
    display: flex;
    gap: 6px;
    padding: 6px 12px;
    justify-content: space-between;
}

.wb-context-color-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.wb-context-color-dot:hover {
    transform: scale(1.2);
}

.wb-context-color-dot.active {
    border-color: var(--text-main) !important;
}

/* Connector Line Drag Handle Style */
.wb-connection-group .wb-line-handle,
.wb-connection-group .wb-line-end-handle {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, r 0.15s ease, fill 0.15s ease, stroke 0.15s ease;
}

.wb-connection-group:hover .wb-line-handle,
.wb-connection-group:hover .wb-line-end-handle {
    opacity: 1;
    pointer-events: auto;
}

.wb-line-handle {
    transition: r 0.15s ease, fill 0.15s ease, stroke 0.15s ease, opacity 0.15s ease;
}

.wb-line-handle:hover {
    r: 7.5px !important;
    fill: var(--accent) !important;
    stroke: white !important;
}

.wb-line-end-handle {
    transition: r 0.15s ease, fill 0.15s ease, stroke 0.15s ease, opacity 0.15s ease;
}

.wb-line-end-handle:hover {
    r: 6.5px !important;
    fill: var(--accent) !important;
}

/* Whiteboard Text Element visual styling */
.wb-element-text {
    border: 1px dashed transparent;
    border-radius: 6px;
    background-color: transparent;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.wb-element-text:hover {
    border-color: rgba(var(--accent-rgb), 0.3) !important;
    background-color: rgba(var(--accent-rgb), 0.02) !important;
}

.wb-element-text.selected {
    border-color: var(--accent) !important;
    background-color: rgba(var(--accent-rgb), 0.04) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1), var(--shadow-sm) !important;
}

/* Whiteboard Text and Shapes Grabbing improvements */
.wb-element .wb-content {
    pointer-events: none;
    user-select: none;
}

.wb-element.editing .wb-content {
    pointer-events: auto;
    user-select: text;
}

.wb-element:not(.editing) {
    cursor: grab !important;
}

.wb-element:not(.editing):active {
    cursor: grabbing !important;
}

/* --- COZY DASHBOARD WIDGETS --- */

/* Coffee Cup Animation & Styling */
.hub-cozy-coffee-widget {
    margin-left: 20px;
}

.cozy-coffee-cup {
    color: var(--accent);
    filter: drop-shadow(0 4px 12px rgba(var(--accent-rgb), 0.15));
    transition: transform 0.3s ease;
}

.cozy-coffee-cup:hover {
    transform: scale(1.08) rotate(2deg);
}

.steam {
    stroke: var(--accent);
    animation: steam-rise 2.5s infinite ease-in-out;
}

.steam-1 {
    animation-delay: 0.2s;
}

.steam-2 {
    animation-delay: 1.0s;
}

.steam-3 {
    animation-delay: 1.8s;
}

@keyframes steam-rise {
    0% {
        transform: translateY(6px);
        opacity: 0;
    }

    30% {
        opacity: 0.35;
    }

    60% {
        opacity: 0.15;
    }

    100% {
        transform: translateY(-8px);
        opacity: 0;
    }
}

/* Water Tracker styling */
.water-glass {
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
    color: var(--text-muted);
    opacity: 0.45;
}

.water-glass:hover {
    transform: translateY(-3px) scale(1.15);
    color: var(--accent);
    opacity: 0.85;
}

.water-glass.filled {
    color: var(--accent);
    opacity: 1;
    filter: drop-shadow(0 2px 6px rgba(var(--accent-rgb), 0.4));
}

.water-glass.filled .water-fill {
    fill: var(--accent);
    stroke: var(--accent);
    stroke-width: 0.5px;
    animation: water-bubble 4s infinite ease-in-out;
}

.water-glass.splash-animate svg {
    animation: water-splash 0.5s ease-out;
}

@keyframes water-splash {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3) translateY(-4px);
    }

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

/* Ambient sound rows & sliders styling */
.ambient-sound-row-mini .ambient-sound-btn {
    transition: all 0.3s ease;
}

.ambient-sound-row-mini .ambient-sound-btn:hover {
    background: rgba(var(--accent-rgb), 0.08) !important;
    color: var(--accent) !important;
    border-color: rgba(var(--accent-rgb), 0.35) !important;
    transform: scale(1.05);
}

.ambient-sound-row-mini .ambient-sound-btn.active {
    background: var(--accent) !important;
    color: white !important;
    border-color: var(--accent) !important;
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.25) !important;
}

.ambient-volume-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: rgba(var(--text-main-rgb), 0.08);
    outline: none;
    transition: background 0.3s ease;
}

.ambient-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    transition: transform 0.15s ease;
    border: none;
}

.ambient-volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.3);
}

/* Mini Pomodoro styling */
.pomo-mini-card {
    transition: var(--transition);
}

.pomo-mini-card:hover {
    border-color: rgba(var(--accent-rgb), 0.25) !important;
    box-shadow: var(--shadow-sm);
}

.btn-timer-mini {
    transition: all 0.3s ease;
}

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

.btn-timer-mini.main:hover {
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.25);
    opacity: 0.95;
}

.timer-mode-mini {
    transition: all 0.2s ease;
}

.timer-mode-mini.active {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* --- Workstation Single Screen Editor Grid --- */
.editor-bento-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 20px;
}

.editor-col-left,
.editor-col-right {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Bento Tabs in Workstation Editor */
.bento-tab-header {
    display: flex;
    gap: 6px;
    background: rgba(var(--text-main-rgb), 0.04);
    padding: 5px;
    border-radius: 14px;
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
}

.bento-tab-btn {
    flex: 1;
    padding: 9px 14px;
    border-radius: 10px;
    border: none;
    font-weight: 700;
    font-size: 12px;
    color: var(--text-muted);
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.bento-tab-btn:hover {
    color: var(--text-main);
    background: rgba(var(--text-main-rgb), 0.03);
}

.bento-tab-btn.active {
    background: var(--card-bg) !important;
    color: var(--accent) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

.ws-tab-pane,
.printer-tab-pane {
    display: none;
}

.ws-tab-pane.active,
.printer-tab-pane.active {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

@media (max-width: 850px) {
    .editor-bento-grid {
        grid-template-columns: 1fr !important;
    }
}

/* --- Workstation Label Printing & Preview Styles --- */
.print-theme-selector .tab-btn {
    border: none;
    background: transparent;
    padding: 10px;
    font-weight: 700;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.print-theme-selector .tab-btn.active {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .print-theme-selector .tab-btn.active {
    background: var(--accent) !important;
    color: #1e1b29 !important;
}

[data-theme="light"] .print-theme-selector .tab-btn.active {
    background: var(--accent) !important;
    color: #ffffff !important;
}

/* Cualby Modern Label Template */
.label-template-cualby {
    font-family: 'Outfit', 'Inter', sans-serif;
    background: #fff !important;
    color: #1e293b !important;
    padding: 24px !important;
    border-radius: 12px !important;
    border: 2px solid #e2e8f0 !important;
    max-width: 480px;
    margin: 0 auto;
    text-align: left;
    box-sizing: border-box;
}

.label-template-cualby .label-header {
    background: #1e1b29 !important;
    color: #ffffff !important;
    padding: 16px 20px !important;
    margin: -24px -24px 20px -24px !important;
    border-radius: 10px 10px 0 0 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.label-template-cualby .label-header h1 {
    font-size: 26px !important;
    font-weight: 800 !important;
    margin: 0 !important;
    letter-spacing: -0.5px !important;
    color: #ffffff !important;
}

.label-template-cualby .label-header span {
    font-size: 10px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    background: rgba(255, 255, 255, 0.15) !important;
    padding: 4px 8px !important;
    border-radius: 20px !important;
    color: #ffffff !important;
}

.label-template-cualby .label-section {
    margin-bottom: 16px !important;
    padding-bottom: 12px !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

.label-template-cualby .label-section:last-child {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    border-bottom: none !important;
}

.label-template-cualby .label-section-title {
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #6366f1 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 8px !important;
    display: block !important;
}

.label-template-cualby .label-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
}

.label-template-cualby .label-item {
    display: flex !important;
    flex-direction: column !important;
}

.label-template-cualby .label-item label {
    font-size: 10px !important;
    color: #64748b !important;
    font-weight: 600 !important;
    margin-bottom: 2px !important;
}

.label-template-cualby .label-item span,
.label-template-cualby .label-item code {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #0f172a !important;
}

.label-template-cualby .label-item code {
    font-family: monospace !important;
    background: #f1f5f9 !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    width: fit-content !important;
}

.label-template-cualby .client-pill {
    display: inline-block !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    background: #e2e8f0 !important;
    color: #475569 !important;
    padding: 3px 8px !important;
    border-radius: 12px !important;
    margin-right: 4px !important;
    margin-bottom: 4px !important;
}

.label-template-cualby .printer-card {
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    padding: 8px 12px !important;
    margin-bottom: 8px !important;
    text-align: left !important;
}

.label-template-cualby .printer-card.zebra {
    border-left: 4px solid #f39c12 !important;
}

.label-template-cualby .printer-card.lexmark {
    border-left: 4px solid #6366f1 !important;
}

/* Excel Label Template */
.label-template-excel {
    font-family: 'Arial', 'Courier New', monospace !important;
    background: #fff !important;
    color: #000 !important;
    padding: 20px !important;
    border: 3px solid #000 !important;
    max-width: 480px;
    margin: 0 auto;
    text-align: left;
    box-sizing: border-box;
}

.label-template-excel table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-bottom: 12px !important;
}

.label-template-excel table,
.label-template-excel th,
.label-template-excel td {
    border: 1px solid #000 !important;
}

/* --- Project Status Activity Timeline & Modal Enhancements --- */
.project-timeline-container {
    width: 100%;
    padding: 12px 6px 6px 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.timeline-horizontal-track {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding-bottom: 8px;
    min-width: max-content;
}

.timeline-step {
    display: flex;
    flex-direction: column;
    position: relative;
    min-width: 170px;
}

.timeline-marker {
    display: flex;
    align-items: center;
    position: relative;
    height: 24px;
    margin-bottom: 8px;
}

.marker-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent, #8da47e);
    border: 3px solid var(--card-bg, #fff);
    box-shadow: 0 0 0 2px rgba(var(--accent-rgb, 141, 164, 126), 0.4);
    z-index: 2;
}

.pulsing-dot {
    background: #10b981 !important;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.3) !important;
    animation: timelinePulse 2s infinite;
}

@keyframes timelinePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.marker-line {
    position: absolute;
    left: 14px;
    right: -20px;
    top: 50%;
    height: 2px;
    background: var(--border-color, rgba(255, 255, 255, 0.1));
    transform: translateY(-50%);
    z-index: 1;
}

.timeline-box {
    background: rgba(var(--accent-rgb, 141, 164, 126), 0.04);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: var(--radius-md, 8px);
    padding: 10px 12px;
    transition: all 0.2s ease;
}

.timeline-step.is-latest .timeline-box {
    background: rgba(var(--accent-rgb, 141, 164, 126), 0.09);
    border-color: rgba(var(--accent-rgb, 141, 164, 126), 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.timeline-date {
    font-size: 10px;
    color: var(--text-muted, #888);
    font-weight: 600;
}

.status-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(141, 164, 126, 0.15);
    color: var(--accent, #8da47e);
}

.status-badge.status-in-progress,
.status-badge.status-in_progress {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.status-badge.status-completed,
.status-badge.status-finish,
.status-badge.status-done {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.status-badge.status-planned,
.status-badge.status-new {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.status-badge.status-waiting,
.status-badge.status-hold {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.timeline-transition {
    font-size: 11px;
    color: var(--text-main, #333);
    display: flex;
    align-items: center;
    gap: 6px;
}

.prev-status {
    color: var(--text-muted, #888);
    text-decoration: line-through;
}

.arrow-icon {
    font-size: 9px;
    color: var(--accent, #8da47e);
}

.curr-status {
    font-weight: 700;
}

.timeline-empty-state {
    padding: 16px;
    text-align: center;
}

.timeline-node.start-node {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: rgba(var(--accent-rgb, 141, 164, 126), 0.06);
    padding: 10px 18px;
    border-radius: 20px;
    border: 1px dashed var(--border-color, rgba(255, 255, 255, 0.15));
}

.timeline-dot.pulsing {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent, #8da47e);
    animation: timelinePulse 2s infinite;
}

.timeline-content {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.timeline-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main, #333);
}

.timeline-sub {
    font-size: 11px;
    color: var(--text-muted, #888);
}

.label-template-excel td {
    padding: 6px 10px !important;
    font-size: 11px !important;
    vertical-align: top !important;
    color: #000 !important;
}

.label-template-excel .cell-header {
    font-weight: bold !important;
    background: #eaeaea !important;
    width: 32% !important;
    text-transform: uppercase !important;
}

.label-template-excel .excel-title-cell {
    font-size: 22px !important;
    font-weight: bold !important;
    text-align: center !important;
    padding: 10px !important;
    background: #eaeaea !important;
}

.label-template-excel .excel-section-header {
    font-weight: bold !important;
    text-align: center !important;
    background: #dcdcdc !important;
    font-size: 12px !important;
    text-transform: uppercase !important;
}

.label-template-excel .client-list {
    font-weight: bold !important;
}

/* ==========================================
   METRO START SCREEN QUICK ACCESS CONTROLS
   ========================================== */

/* Tile Action Container (Hidden - managed via Right-Click Context Menu) */
.hub-tile-actions {
    display: none !important;
}

.hub-link-wrapper:hover .hub-tile-actions {
    opacity: 1 !important;
    transform: scale(1.05);
}

.btn-tile-action {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    min-height: 26px !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    font-size: 12px !important;
    transition: transform 0.15s ease, background 0.15s ease !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35) !important;
    border: none !important;
}

.btn-tile-action i {
    font-size: 11px !important;
    color: #ffffff !important;
    display: block !important;
    line-height: 1 !important;
    pointer-events: none !important;
}

.btn-tile-action.resize-btn {
    background: #1e293b !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
}

.btn-tile-action.resize-btn:hover {
    background: var(--accent) !important;
    transform: scale(1.15) !important;
}

.btn-tile-action.delete-btn {
    background: #dc2626 !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.btn-tile-action.delete-btn:hover {
    background: #ef4444 !important;
    transform: scale(1.15) !important;
}

/* Metro Tile Right-Click Context Menu */
.metro-context-menu {
    position: fixed !important;
    z-index: 999999 !important;
    min-width: 220px !important;
    background: rgba(18, 24, 38, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 16px !important;
    padding: 8px !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(var(--accent-rgb), 0.2) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    animation: metroMenuPop 0.15s cubic-bezier(0.16, 1, 0.3, 1) !important;
    transform-origin: top left !important;
}

[data-theme="light"] .metro-context-menu {
    background: rgba(255, 255, 255, 0.96) !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.2) !important;
}

@keyframes metroMenuPop {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-6px);
    }

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

.metro-menu-item {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 10px 14px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: var(--text-main) !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease !important;
    user-select: none !important;
}

.metro-menu-item i {
    font-size: 14px !important;
    width: 18px !important;
    text-align: center !important;
    color: var(--accent) !important;
}

.metro-menu-item:hover {
    background: rgba(var(--accent-rgb), 0.14) !important;
    color: var(--text-main) !important;
    transform: translateX(3px) !important;
}

.metro-menu-item.danger {
    color: #ef4444 !important;
}

.metro-menu-item.danger i {
    color: #ef4444 !important;
}

.metro-menu-item.danger:hover {
    background: rgba(239, 68, 68, 0.15) !important;
}

.metro-menu-divider {
    height: 1px !important;
    background: rgba(var(--text-main-rgb), 0.1) !important;
    margin: 4px 6px !important;
}

/* Metro Color Picker Modal Elements */
.metro-color-options {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 10px !important;
    padding: 10px 0 !important;
}

.metro-color-swatch {
    height: 44px !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    border: 2px solid transparent !important;
    transition: transform 0.2s ease, border-color 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: white !important;
    font-size: 14px !important;
}


.metro-color-swatch:hover {
    transform: scale(1.08) !important;
    border-color: white !important;
}

.metro-color-swatch.active {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.4) !important;
}

/* Text & Tile Style Modal Section */
.metro-color-picker-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.metro-color-section-header {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.metro-color-section-header i {
    color: var(--accent);
    font-size: 12px;
}

.metro-color-text-section {
    margin-top: 10px;
    padding-top: 14px;
    border-top: 1px solid rgba(var(--text-main-rgb), 0.12);
}

.metro-text-color-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.metro-text-color-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px 6px;
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    font-size: 16px;
}

.metro-text-color-swatch span {
    font-size: 10px;
    font-weight: 700;
    color: inherit;
    opacity: 0.9;
}

.metro-text-color-swatch:hover {
    transform: scale(1.06);
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.2);
}

.metro-text-color-swatch.active {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.35) !important;
    background: rgba(var(--accent-rgb), 0.15) !important;
}

/* Vault Segmented Tab Bar */
.vault-segmented-tabs {
    display: flex;
    background: rgba(var(--text-main-rgb), 0.06);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    gap: 4px;
}

.vault-tab-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    background: transparent;
    color: var(--text-muted);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
}

.vault-tab-btn:hover {
    color: var(--text-main);
    background: rgba(var(--text-main-rgb), 0.05);
}

.vault-tab-btn.active {
    background: var(--accent) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.25) !important;
}

/* Whiteboard Floating Action Bar */
.wb-floating-bar {
    position: absolute;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 6px 10px;
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(12px);
    transform: translate(-50%, -100%);
    pointer-events: auto;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.wb-floating-bar button {
    background: transparent;
    border: none;
    color: var(--text-main);
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.wb-floating-bar button:hover {
    background: rgba(var(--accent-rgb), 0.12);
    color: var(--accent);
}

.wb-floating-bar button.active {
    background: var(--accent);
    color: #ffffff;
}

.wb-bar-divider {
    width: 1px;
    height: 18px;
    background: var(--border-color);
    margin: 0 4px;
}

.wb-bar-section {
    display: flex;
    align-items: center;
    gap: 3px;
}

.wb-color-palette {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 2px;
}

.wb-color-swatch {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    cursor: pointer;
    border: 1.5px solid rgba(255,255,255,0.4);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.wb-color-swatch:hover {
    transform: scale(1.25);
}

.wb-color-swatch.active {
    transform: scale(1.25);
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.wb-custom-bg-swatch {
    background: conic-gradient(from 180deg at 50% 50%, #ff0000 0deg, #ff8800 50deg, #ffff00 100deg, #00ff00 160deg, #00ffff 210deg, #0000ff 270deg, #ff00ff 320deg, #ff0000 360deg);
    overflow: hidden;
}

.wb-custom-bg-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    border: none;
    padding: 0;
    margin: 0;
}

.wb-custom-bg-icon {
    font-size: 7px;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.85);
    pointer-events: none;
    z-index: 1;
}

.wb-font-size-btn {
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 4px 6px !important;
    min-width: 22px;
    height: 24px;
}

/* Moodboard Canvas Background Themes (Infinite Viewport Grid) */
.canvas-grid-dots {
    background-image: radial-gradient(circle, rgba(var(--text-main-rgb), 0.15) 1.2px, transparent 1.2px) !important;
    background-repeat: repeat !important;
}

.canvas-grid-square {
    background-image: 
        linear-gradient(to right, rgba(var(--text-main-rgb), 0.08) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(var(--text-main-rgb), 0.08) 1px, transparent 1px) !important;
    background-repeat: repeat !important;
}

.canvas-grid-blank {
    background-image: none !important;
}

/* Moodboard Header Actions & Controls */
.wb-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* 1. Segmented Grid Style Switcher */
.wb-segmented-control {
    display: inline-flex;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 3px;
    gap: 2px;
    height: 32px;
    box-sizing: border-box;
    box-shadow: var(--shadow-sm);
}

.wb-seg-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 11.5px;
    font-weight: 500;
    padding: 0 10px;
    height: 100%;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
    outline: none;
}

.wb-seg-btn i {
    font-size: 11px;
    opacity: 0.75;
    transition: opacity 0.15s ease;
}

.wb-seg-btn:hover {
    color: var(--text-main);
    background: rgba(var(--text-main-rgb), 0.05);
}

.wb-seg-btn.active {
    background: var(--accent);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(var(--accent-rgb), 0.35);
}

.wb-seg-btn.active i {
    color: #ffffff;
    opacity: 1;
}

/* 2. Header Action Buttons */
.wb-header-divider {
    width: 1px;
    height: 18px;
    background: var(--border-color);
    margin: 0 2px;
}

.wb-action-btn {
    height: 32px;
    padding: 0 12px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-main);
    font-size: 11.5px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    outline: none;
    box-shadow: var(--shadow-sm);
}

.wb-action-btn i {
    font-size: 11.5px;
    transition: transform 0.15s ease, color 0.15s ease;
}

.wb-action-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.06);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

/* Snap Button Active State */
#wb-snap-toggle.active {
    background: rgba(var(--accent-rgb), 0.12);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}

#wb-snap-toggle.active i {
    color: var(--accent);
}

.wb-badge-snap {
    font-size: 9.5px;
    padding: 1px 5px;
    border-radius: 10px;
    background: rgba(var(--text-main-rgb), 0.08);
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.15s ease;
}

#wb-snap-toggle.active .wb-badge-snap {
    background: var(--accent);
    color: #ffffff;
}

/* Specific button styles */
.wb-action-btn-templates i {
    color: var(--accent);
}

.wb-action-btn-export i {
    color: #10b981;
}

.wb-action-btn-export:hover {
    border-color: #10b981;
    color: #10b981;
    background: rgba(16, 185, 129, 0.08);
}

.wb-action-btn-save {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(var(--accent-rgb), 0.35);
}

.wb-action-btn-save:hover {
    opacity: 0.92;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(var(--accent-rgb), 0.45);
}

/* Template Card Hover */
.wb-template-card:hover {
    border-color: var(--accent) !important;
    background: rgba(var(--accent-rgb), 0.06) !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Task Card Hover & Elements */
.wb-element-task {
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.wb-element-task:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-lg) !important;
}

.wb-task-picker-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    cursor: pointer;
    transition: all 0.15s ease;
}

.wb-task-picker-item:hover {
    background: rgba(var(--accent-rgb), 0.08);
    border-color: var(--accent);
}

/* PuTTY Screen Object Styling */
.wb-element-putty {
    background: #7d9b73;
    border: 2px solid rgba(0, 0, 0, 0.25);
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.35), 0 8px 10px -6px rgba(0, 0, 0, 0.25);
    font-family: 'Consolas', 'Courier New', 'Fira Code', monospace;
    display: flex;
    flex-direction: column;
    overflow: visible !important;
    user-select: none;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.wb-element-putty.selected {
    box-shadow: 0 0 0 3px var(--accent), 0 12px 30px rgba(0,0,0,0.45) !important;
}

.wb-putty-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px 6px;
    font-weight: 700;
    font-size: 13.5px;
    color: inherit;
    letter-spacing: 0.5px;
    border-bottom: 1px dashed currentColor;
    opacity: 0.95;
}

.wb-putty-screencode,
.wb-putty-screentitle {
    outline: none;
    color: inherit;
}

.wb-putty-fields-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 8px 14px 10px;
    overflow-y: auto;
    flex: 1;
    color: inherit;
}

.wb-putty-field-row {
    position: relative;
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 13px;
    color: inherit;
    min-height: 22px;
    padding: 2px 4px;
    border-radius: 4px;
    transition: background 0.15s ease;
}

.wb-putty-field-row:hover {
    background: rgba(0, 0, 0, 0.15);
}

.wb-putty-field-label {
    font-weight: 700;
    outline: none;
    white-space: nowrap;
    color: inherit;
    cursor: text;
}

.wb-putty-field-value {
    font-weight: 500;
    outline: none;
    flex: 1;
    border-bottom: 1.5px solid currentColor;
    padding-bottom: 1px;
    min-width: 30px;
    color: inherit;
    white-space: pre-wrap;
    word-break: break-all;
    cursor: text;
}

.wb-putty-field-del {
    border: none;
    background: transparent;
    color: #fca5a5;
    cursor: pointer;
    font-size: 11px;
    padding: 0 4px;
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.wb-putty-field-row:hover .wb-putty-field-del {
    opacity: 1;
}

.wb-putty-field-del:hover {
    transform: scale(1.2);
    color: #ff4d4d;
}

.wb-putty-actions {
    display: flex;
    gap: 8px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed rgba(254, 243, 199, 0.25);
    font-family: inherit;
}

.wb-putty-add-field-btn,
.wb-putty-quick-edit-btn {
    border: 1px dashed rgba(254, 243, 199, 0.45);
    background: rgba(0, 0, 0, 0.15);
    color: #fef3c7;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    transition: all 0.15s ease;
}

.wb-putty-add-field-btn:hover,
.wb-putty-quick-edit-btn:hover {
    background: rgba(0, 0, 0, 0.3);
    border-color: #fef3c7;
    transform: translateY(-1px);
}

/* Field Ports */
.wb-field-port {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.15s ease;
}

.wb-element:hover .wb-field-port,
.wb-element.selected .wb-field-port {
    opacity: 0.85;
    pointer-events: auto;
}

#whiteboard-viewport.wb-connecting .wb-field-port {
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: translateY(-50%) scale(1.3) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.4) !important;
    background: #ef4444 !important;
}

.wb-field-port:hover,
#whiteboard-viewport.wb-connecting .wb-field-port:hover {
    transform: translateY(-50%) scale(1.7) !important;
    background: #ff1111 !important;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.9) !important;
}

/* Flow Simulation Styles */
.wb-element-sim-active {
    box-shadow: 0 0 0 3px #10b981, 0 0 35px rgba(16, 185, 129, 0.5) !important;
    transform: scale(1.02);
    transition: all 0.3s ease;
    z-index: 99 !important;
}

.wb-element-sim-target {
    box-shadow: 0 0 0 3px #3b82f6, 0 0 35px rgba(59, 130, 246, 0.5) !important;
    transform: scale(1.02);
    transition: all 0.3s ease;
    z-index: 99 !important;
}

.wb-putty-field-row.sim-active {
    background: rgba(16, 185, 129, 0.35) !important;
    border-radius: 4px;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
    transition: all 0.2s ease;
}

.wb-putty-field-row.sim-target {
    background: rgba(59, 130, 246, 0.35) !important;
    border-radius: 4px;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
    transition: all 0.2s ease;
}

.wb-flow-pulse-particle {
    fill: #f59e0b;
    filter: drop-shadow(0 0 8px #f59e0b) drop-shadow(0 0 16px rgba(245, 158, 11, 0.8));
}

/* Multi-Board Tabs & Switcher */
.wb-boards-tabs-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(var(--text-main-rgb), 0.04);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2px 4px;
    max-width: 50vw;
    overflow-x: auto;
    scrollbar-width: none;
}

.wb-boards-tabs-bar::-webkit-scrollbar {
    display: none;
}

.wb-board-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    height: 28px;
    border-radius: 14px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 11.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
    user-select: none;
}

.wb-board-tab:hover {
    color: var(--text-main);
    background: rgba(var(--text-main-rgb), 0.06);
}

.wb-board-tab.active {
    background: var(--card-bg);
    color: var(--accent);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.wb-board-tab-name {
    outline: none;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wb-board-tab-name[contenteditable="true"] {
    background: rgba(var(--accent-rgb), 0.15);
    border-radius: 4px;
    padding: 0 4px;
    cursor: text;
}

.wb-board-tab-menu-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 10px;
    cursor: pointer;
    padding: 2px 3px;
    border-radius: 50%;
    opacity: 0.6;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wb-board-tab-menu-btn:hover {
    opacity: 1;
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.12);
}

.wb-add-board-btn {
    height: 32px;
    padding: 0 12px;
    border-radius: 16px;
    border: 1px dashed var(--border-color);
    background: transparent;
    color: var(--text-muted);
    font-size: 11.5px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.wb-add-board-btn:hover {
    border-color: var(--accent);
    border-style: solid;
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.06);
}

/* Board Context Menu / Dropdown */
.wb-board-menu-dropdown {
    position: fixed;
    z-index: 10000;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 5px;
    min-width: 150px;
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(12px);
    display: none;
    flex-direction: column;
    gap: 2px;
}

.wb-board-menu-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    font-size: 12px;
    color: var(--text-main);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.wb-board-menu-dropdown-item:hover {
    background: rgba(var(--accent-rgb), 0.1);
    color: var(--accent);
}

/* Modal Field Groups for Moodboard New Board */
.wb-field-group {
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

.wb-field-label {
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    color: var(--accent) !important;
    margin: 0 0 2px 0 !important;
    display: block !important;
    position: static !important;
    pointer-events: auto !important;
}

.wb-input-styled {
    width: 100% !important;
    padding: 10px 14px !important;
    border-radius: 8px !important;
    border: 1px solid var(--border-color) !important;
    background-color: var(--card-bg) !important;
    color: var(--text-main) !important;
    font-size: 13.5px !important;
    font-family: inherit !important;
    outline: none !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
    box-sizing: border-box !important;
}

.wb-input-styled:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15) !important;
}

.wb-new-board-tmpl-opt {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 12px 8px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    cursor: pointer;
    transition: all 0.18s ease;
    user-select: none;
    box-sizing: border-box;
}

.wb-new-board-tmpl-opt:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.wb-new-board-tmpl-opt.active {
    border-color: var(--accent) !important;
    border-width: 1.5px !important;
    background: rgba(var(--accent-rgb), 0.1) !important;
    box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.25) !important;
}

/* Analytics & Productivity Velocity Module Styles */
.analytics-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.analytics-kpi-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}

.analytics-kpi-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.kpi-icon-box {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.kpi-details {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.kpi-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
    font-family: 'Outfit', sans-serif;
}

.kpi-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(var(--text-main-rgb), 0.08);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.kpi-progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.8s ease;
}

.analytics-charts-row {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

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

.analytics-card.flex-2 {
    flex: 2;
    min-width: 320px;
}

.analytics-card.flex-1 {
    flex: 1;
    min-width: 280px;
}

.analytics-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.analytics-card-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
}

.analytics-card-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(var(--accent-rgb), 0.1);
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chart-svg-wrapper {
    position: relative;
    width: 100%;
}

.chart-legend {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 100px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.donut-chart-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.donut-svg-holder {
    width: 170px;
    height: 170px;
}

.donut-legend-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.donut-legend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(var(--text-main-rgb), 0.02);
}

.legend-color-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.legend-text-label {
    flex-grow: 1;
    color: var(--text-main);
    font-weight: 500;
}

.legend-count-val {
    font-weight: 700;
    color: var(--text-main);
}

/* Bento Live Widgets in Home View */
.bento-widget-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
}

.bento-widget-card:hover {
    border-color: rgba(var(--accent-rgb), 0.3);
    box-shadow: var(--shadow-md);
}

.bento-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.bento-widget-title {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 8px;
}

.bento-deadline-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(var(--text-main-rgb), 0.03);
    border: 1px solid rgba(var(--text-main-rgb), 0.04);
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.bento-deadline-item:hover {
    background: rgba(var(--accent-rgb), 0.12);
    border-color: rgba(var(--accent-rgb), 0.25);
    transform: translateX(3px);
}

.bento-deadline-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.bento-deadline-tag {
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.streak-container {
    display: flex;
    align-items: center;
    gap: 16px;
}

.streak-flame-box {
    font-size: 32px;
}

.streak-val {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
}

/* Live Widgets Unified Stack */
.live-widgets-section {
    margin-bottom: 0 !important;
}

.live-widgets-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
}

.live-widgets-stack .bento-widget-card {
    margin-bottom: 0;
}

.hub-reminders-col {
    gap: 0 !important;
}

/* ============================================================
   FLOATING CLOUD SUB-MENU ("Chmurka" Popover Capsule)
   ============================================================ */
.top-sub-bar {
    position: fixed;
    top: 66px;
    left: 50%;
    height: auto;
    min-height: 42px;
    width: auto;
    max-width: calc(100vw - 28px);
    background: var(--sidebar-bg);
    border-radius: 24px;
    border: 1px solid rgba(var(--accent-rgb), 0.25);
    display: flex;
    align-items: center;
    padding: 4px 10px;
    z-index: 1002;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.45), 0 0 15px rgba(var(--accent-rgb), 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-sizing: border-box;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px) scale(0.96);
    transition: left 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.top-sub-bar.cloud-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

/* Floating cloud indicator triangle pointing to active top-menu item */
.top-sub-bar::before {
    content: '';
    position: absolute;
    top: -6px;
    left: var(--arrow-offset, 20px);
    width: 10px;
    height: 10px;
    background: var(--sidebar-bg);
    border-left: 1px solid rgba(var(--accent-rgb), 0.25);
    border-top: 1px solid rgba(var(--accent-rgb), 0.25);
    transform: rotate(45deg);
    border-radius: 2px;
    transition: left 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.top-sub-bar .sub-bar-group {
    display: none;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    animation: fadeInSubBar 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.top-sub-bar .sub-bar-group.active {
    display: flex;
}

@keyframes fadeInSubBar {
    from {
        opacity: 0;
        transform: translateY(-3px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sub-bar-title {
    display: none;
}

.sub-bar-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}
.sub-bar-nav::-webkit-scrollbar {
    display: none;
}

.sub-bar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 4px;
}

/* Pill buttons inside sub-bar */
.top-sub-bar .sub-nav-item,
.top-sub-bar .settings-nav-item {
    display: flex;
    align-items: center !important;
    justify-content: center !important;
    height: 30px !important;
    width: auto !important;
    padding: 0 14px !important;
    border-radius: 20px !important;
    border: none !important;
    background: transparent !important;
    color: var(--text-muted) !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    cursor: pointer !important;
    transition: all var(--transition-fast) ease !important;
    white-space: nowrap !important;
    box-shadow: none !important;
    margin: 0 !important;
    text-decoration: none !important;
    position: relative;
}

.top-sub-bar .sub-nav-item:hover,
.top-sub-bar .settings-nav-item:hover {
    color: var(--accent) !important;
    background: rgba(var(--accent-rgb), 0.06) !important;
}

.top-sub-bar .sub-nav-item.active,
.top-sub-bar .settings-nav-item.active {
    background: var(--card-bg) !important;
    color: var(--accent) !important;
    box-shadow: var(--shadow-sm) !important;
    border: none !important;
}

.top-sub-bar .sub-nav-item .counter,
.top-sub-bar .settings-nav-item .counter {
    margin-left: 6px !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    padding: 2px 6px !important;
    border-radius: 8px !important;
    background: rgba(var(--accent-rgb), 0.1) !important;
    color: var(--accent) !important;
    transition: all var(--transition-fast) ease !important;
}

.top-sub-bar .sub-nav-item.active .counter,
.top-sub-bar .settings-nav-item.active .counter {
    background: var(--accent) !important;
    color: white !important;
}

.top-sub-bar button.primary,
.top-sub-bar .primary {
    height: 30px !important;
    padding: 0 16px !important;
    border-radius: 20px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    border: none !important;
    background: var(--accent) !important;
    color: white !important;
    cursor: pointer !important;
    box-shadow: var(--shadow-sm) !important;
    transition: all var(--transition-fast) ease !important;
    margin: 0 !important;
}

.top-sub-bar button.primary:hover,
.top-sub-bar .primary:hover {
    opacity: 0.92 !important;
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.25) !important;
}

.top-sub-bar button.btn-secondary,
.top-sub-bar .btn-secondary {
    height: 30px !important;
    padding: 0 14px !important;
    border-radius: 20px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid rgba(var(--accent-rgb), 0.2);
    background: var(--card-bg);
    color: var(--text-main);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast) ease;
    margin: 0 !important;
}

.top-sub-bar button.btn-secondary:hover,
.top-sub-bar .btn-secondary:hover {
    color: var(--accent);
    border-color: rgba(var(--accent-rgb), 0.4);
    background: rgba(var(--accent-rgb), 0.06);
}

.top-sub-bar .sub-nav-item.dynamic-tab {
    position: relative !important;
    padding-right: 30px !important;
}

.top-sub-bar .sub-nav-item.dynamic-tab .tab-close {
    position: absolute !important;
    right: 8px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 16px !important;
    height: 16px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 12px !important;
    line-height: 1 !important;
    color: var(--text-muted) !important;
    transition: all var(--transition-fast) ease !important;
}

.top-sub-bar .sub-nav-item.dynamic-tab .tab-close:hover {
    background: rgba(var(--danger-color-rgb), 0.1) !important;
    color: var(--danger-color) !important;
}

.top-sub-bar .crm-search-wrap,
.top-sub-bar .map-search-container {
    margin: 0 !important;
    height: 30px !important;
    border-radius: 20px !important;
    background: var(--card-bg) !important;
    border: 1px solid rgba(var(--accent-rgb), 0.15) !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 0 12px !important;
}

.top-sub-bar .crm-search-wrap input,
.top-sub-bar .map-search-container input {
    border: none !important;
    background: transparent !important;
    color: var(--text-main) !important;
    font-size: 11px !important;
    outline: none !important;
    padding: 0 !important;
    width: 130px;
}

/* Main content margin with compact sleek clearance for floating cloud popover */
.main-content {
    margin-top: 104px !important;
    height: calc(100vh - 104px) !important;
    padding: 4px 18px !important;
    box-sizing: border-box;
}

/* Responsiveness */
@media (max-width: 768px) {
    .top-sub-bar {
        top: 56px;
        max-width: calc(100vw - 16px);
        padding: 4px 8px;
    }

    .main-content {
        margin-top: 96px !important;
        height: calc(100vh - 96px) !important;
        padding: 6px 10px !important;
    }
}

/* ============================================================
   PROJECT FORM ACTIONS BAR (Relocated below columns)
   ============================================================ */
.project-form-actions-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    margin-bottom: 6px;
    padding: 0 4px;
}

.project-form-actions-bar button {
    height: 34px !important;
    padding: 0 14px !important;
    border-radius: 10px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    cursor: pointer !important;
    transition: all var(--transition-fast) ease !important;
    box-sizing: border-box !important;
}

.project-form-actions-bar .btn-danger {
    background: rgba(var(--danger-color-rgb, 239, 68, 68), 0.15) !important;
    color: var(--danger-color, #ef4444) !important;
    border: 1px solid rgba(var(--danger-color-rgb, 239, 68, 68), 0.3) !important;
}

.project-form-actions-bar .btn-danger:hover {
    background: var(--danger-color, #ef4444) !important;
    color: white !important;
    border-color: var(--danger-color, #ef4444) !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35) !important;
}

.project-form-actions-bar .btn-secondary {
    background: var(--card-bg) !important;
    color: var(--text-muted) !important;
    border: 1px solid var(--border-color) !important;
}

.project-form-actions-bar .btn-secondary:hover {
    background: rgba(var(--accent-rgb), 0.08) !important;
    color: var(--accent) !important;
    border-color: rgba(var(--accent-rgb), 0.4) !important;
}

.project-form-actions-bar .btn-primary {
    background: var(--accent) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(var(--accent-rgb), 0.3) !important;
}

.project-form-actions-bar .btn-primary:hover {
    opacity: 0.92 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 20px rgba(var(--accent-rgb), 0.45) !important;
}

/* ============================================================
   WORKSTATION EDITOR & ADD MODAL (85-90% Background Opacity)
   ============================================================ */
#warehouse-edit-modal,
#warehouse-add-modal {
    background: rgba(0, 0, 0, 0.75) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
}

#warehouse-edit-modal .modal-content,
#warehouse-add-modal .modal-content {
    background: rgba(18, 20, 32, 0.90) !important;
    backdrop-filter: blur(28px) !important;
    -webkit-backdrop-filter: blur(28px) !important;
    border: 1px solid rgba(var(--accent-rgb), 0.25) !important;
    border-radius: 20px !important;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.8), 0 0 30px rgba(var(--accent-rgb), 0.15) !important;
    overflow: hidden !important;
}

[data-theme="light"] #warehouse-edit-modal .modal-content,
[data-theme="light"] #warehouse-add-modal .modal-content {
    background: rgba(255, 255, 255, 0.90) !important;
    border-color: rgba(var(--accent-rgb), 0.3) !important;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.25), 0 0 30px rgba(var(--accent-rgb), 0.1) !important;
}

#warehouse-edit-modal .modal-header,
#warehouse-add-modal .modal-header {
    background: rgba(0, 0, 0, 0.2) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

[data-theme="light"] #warehouse-edit-modal .modal-header,
[data-theme="light"] #warehouse-add-modal .modal-header {
    background: rgba(0, 0, 0, 0.03) !important;
}

#warehouse-edit-modal .modal-footer,
#warehouse-add-modal .modal-footer {
    background: rgba(0, 0, 0, 0.25) !important;
    border-top: 1px solid var(--border-color) !important;
}

[data-theme="light"] #warehouse-edit-modal .modal-footer,
[data-theme="light"] #warehouse-add-modal .modal-footer {
    background: rgba(0, 0, 0, 0.03) !important;
}

#warehouse-edit-modal .bento-row-card,
#warehouse-add-modal .bento-row-card,
#warehouse-add-modal .bento-header-card {
    background: rgba(26, 30, 48, 0.85) !important;
    border: 1px solid var(--border-color) !important;
}

[data-theme="light"] #warehouse-edit-modal .bento-row-card,
[data-theme="light"] #warehouse-add-modal .bento-row-card,
[data-theme="light"] #warehouse-add-modal .bento-header-card {
    background: rgba(245, 247, 250, 0.90) !important;
    border: 1px solid var(--border-color) !important;
}

/* ============================================================
   HUB LIVE WEATHER WIDGET
   ============================================================ */
.hub-weather-widget {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 18px;
    background: rgba(var(--card-bg-rgb, 18, 20, 32), 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(var(--accent-rgb), 0.2);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.25s ease;
    cursor: pointer;
    user-select: none;
}

[data-theme="light"] .hub-weather-widget {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.hub-weather-widget:hover {
    border-color: rgba(var(--accent-rgb), 0.45);
    box-shadow: 0 6px 24px rgba(var(--accent-rgb), 0.15);
    transform: translateY(-1px);
}

.weather-icon-box {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: rgba(var(--accent-rgb), 0.12);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.hub-weather-widget:hover .weather-icon-box {
    transform: scale(1.08) rotate(6deg);
}

.weather-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.weather-main-line {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.weather-temp {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
    line-height: 1;
}

.weather-desc {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    text-transform: capitalize;
}

.weather-sub-line {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
}

.weather-sub-line i {
    font-size: 10px;
    opacity: 0.8;
}

.weather-divider {
    opacity: 0.35;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MOODBOARD — RICH CONTEXT MENU V2
   ═══════════════════════════════════════════════════════════════════════════ */

@keyframes wb-ctx-fade-in {
    from {
        opacity: 0;
        transform: scale(0.93) translateY(-4px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.wb-context-menu {
    position: fixed;
    display: none;
    z-index: 10000;
    min-width: 228px;
    max-width: 268px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 6px 0;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 12px 32px -4px rgba(0, 0, 0, 0.14),
        0 0 0 1px rgba(0, 0, 0, 0.04);
    overflow: visible;
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 13.5px;
}

.wb-context-menu--visible {
    display: block;
    animation: wb-ctx-fade-in 0.14s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* ─── Section headers ──────────────────────────────────────────────────── */
.wb-ctx-section {
    padding: 6px 14px 3px 14px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: var(--text-muted);
    opacity: 0.7;
    pointer-events: none;
    user-select: none;
}

/* ─── Dividers ─────────────────────────────────────────────────────────── */
.wb-ctx-divider {
    height: 1px;
    background: var(--border-color);
    margin: 5px 10px;
    opacity: 0.6;
}

/* ─── Menu items ───────────────────────────────────────────────────────── */
.wb-ctx-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px;
    cursor: pointer;
    border-radius: 0;
    transition: background 0.1s ease;
    color: var(--text-main);
    font-size: 13.5px;
    font-weight: 500;
    position: relative;
    outline: none;
    user-select: none;
}

.wb-ctx-item:hover,
.wb-ctx-item:focus {
    background: rgba(var(--accent-rgb), 0.08);
    color: var(--accent);
}

.wb-ctx-item:hover > i:first-child,
.wb-ctx-item:focus > i:first-child {
    opacity: 1;
}

.wb-ctx-item > i:first-child {
    width: 16px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.8;
    transition: opacity 0.1s;
    font-size: 13px;
}

.wb-ctx-item > span {
    flex: 1;
    line-height: 1.4;
}

/* kbd shortcut chips */
.wb-ctx-item kbd {
    display: inline-block;
    padding: 1px 5px;
    font-family: 'Outfit', monospace;
    font-size: 10px;
    font-weight: 600;
    border-radius: 4px;
    background: rgba(var(--text-main-rgb), 0.07);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    line-height: 1.5;
    margin-left: 4px;
    vertical-align: middle;
}

/* badge pill */
.wb-ctx-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 20px;
    background: rgba(var(--accent-rgb), 0.15);
    color: var(--accent);
    margin-left: 4px;
}

/* ─── Submenu flyout ───────────────────────────────────────────────────── */
.wb-ctx-item--submenu {
    position: relative;
}

.wb-ctx-arrow {
    font-size: 9px !important;
    opacity: 0.45;
    margin-left: auto;
    flex-shrink: 0;
    width: auto !important;
}

.wb-ctx-submenu {
    display: none;
    position: absolute;
    left: calc(100% + 4px);
    top: -6px;
    min-width: 200px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 6px 0;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 12px 32px -4px rgba(0, 0, 0, 0.13);
    z-index: 10001;
    animation: wb-ctx-fade-in 0.12s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.wb-ctx-item--submenu:hover > .wb-ctx-submenu,
.wb-ctx-item--submenu:focus-within > .wb-ctx-submenu {
    display: block;
}

/* Flip submenu to the left if near right viewport edge */
@media (max-width: 600px) {
    .wb-ctx-submenu {
        left: auto;
        right: calc(100% + 4px);
    }
}

/* ─── Dark mode overrides ──────────────────────────────────────────────── */
.dark-mode .wb-context-menu {
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.3),
        0 12px 32px -4px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.04);
}

/* ═══════════════════════════════════════════════════════════════════════════
   MOODBOARD — TEXT COLOR PICKER & POPOVER
   ═══════════════════════════════════════════════════════════════════════════ */
.wb-text-color-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.wb-text-color-btn {
    padding: 4px 6px !important;
    min-width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.wb-text-color-preview-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5px;
    pointer-events: none;
}

.wb-text-color-letter {
    font-family: inherit;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    color: var(--text-main);
}

.wb-text-color-bar {
    width: 14px;
    height: 3px;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    transition: background 0.15s ease;
}

.wb-text-color-popover {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px;
    box-shadow:
        0 10px 25px -5px rgba(0, 0, 0, 0.25),
        0 8px 10px -6px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(16px);
    z-index: 10002;
    width: 186px;
    box-sizing: border-box;
    animation: wb-ctx-fade-in 0.14s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.wb-popover-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
}

.wb-popover-reset-btn {
    background: transparent !important;
    border: none !important;
    font-size: 10.5px !important;
    font-weight: 600 !important;
    color: var(--accent) !important;
    cursor: pointer !important;
    padding: 1px 6px !important;
    border-radius: 4px !important;
    height: auto !important;
    transition: opacity 0.15s ease;
}

.wb-popover-reset-btn:hover {
    opacity: 0.8;
    background: rgba(var(--accent-rgb), 0.1) !important;
}

.wb-text-color-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-bottom: 8px;
}

.wb-text-color-swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: pointer;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-sizing: border-box;
}

.wb-text-color-swatch:hover {
    transform: scale(1.25);
    z-index: 2;
}

.wb-text-color-swatch.active {
    transform: scale(1.2);
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.4);
}

.wb-text-color-swatch.is-default {
    background: rgba(var(--text-main-rgb), 0.1) !important;
    border-color: var(--border-color);
}

.wb-popover-custom-row {
    border-top: 1px solid var(--border-color);
    padding-top: 7px;
    margin-top: 2px;
}

.wb-custom-color-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    width: 100%;
    user-select: none;
}

.wb-custom-color-label:hover {
    color: var(--accent);
}

.wb-custom-color-input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: pointer;
    background: transparent;
    padding: 0;
    outline: none;
    overflow: hidden;
}

.wb-custom-color-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.wb-custom-color-input::-webkit-color-swatch {
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   Home Tab - Floating Corner Feedback Button & Modal
   ========================================================================== */
.home-feedback-btn {
    position: fixed;
    bottom: 22px;
    left: 84px;
    z-index: 90;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 24px;
    background: var(--card-bg);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.home-feedback-btn i {
    color: var(--accent);
    font-size: 14px;
    transition: transform 0.2s ease;
}

.home-feedback-btn:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15), 0 0 14px rgba(var(--accent-rgb), 0.25);
    color: var(--accent);
}

.home-feedback-btn:hover i {
    transform: scale(1.2);
}

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

@media (max-width: 768px) {
    .home-feedback-btn {
        left: 16px;
        bottom: 74px;
    }
}

.feedback-modal-input:focus,
.feedback-modal-textarea:focus {
    border-color: var(--accent) !important;
    background-color: var(--bg-color) !important;
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15) !important;
}

/* ==========================================================================
   Admin - Outlook-Style Messages Inbox (2-Pane)
   ========================================================================== */
.outlook-inbox-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
    min-height: 550px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg, 16px);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

/* Inbox Top Header Bar */
.outlook-inbox-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(var(--text-main-rgb), 0.02);
    gap: 16px;
    flex-wrap: wrap;
}

.outlook-inbox-title-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.outlook-inbox-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.outlook-inbox-badge-unread {
    background: var(--accent);
    color: var(--text-on-accent, #fff);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
}

.outlook-inbox-filters {
    display: flex;
    align-items: center;
    background: rgba(var(--text-main-rgb), 0.05);
    padding: 3px;
    border-radius: 20px;
    gap: 2px;
}

.outlook-filter-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.outlook-filter-btn:hover {
    color: var(--text-main);
}

.outlook-filter-btn.active {
    background: var(--card-bg);
    color: var(--text-main);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.outlook-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 6px 14px;
    min-width: 240px;
}

.outlook-search-box i {
    color: var(--text-muted);
    font-size: 12px;
}

.outlook-search-box input {
    border: none;
    background: transparent;
    color: var(--text-main);
    font-size: 12px;
    outline: none;
    width: 100%;
}

/* Inbox 2-Pane Split Body */
.outlook-inbox-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Left Pane: Message List */
.outlook-messages-list-pane {
    width: 360px;
    min-width: 300px;
    max-width: 420px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background: rgba(var(--text-main-rgb), 0.015);
    overflow-y: auto;
}

.outlook-msg-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    position: relative;
    transition: background 0.15s ease;
}

.outlook-msg-item:hover {
    background: rgba(var(--accent-rgb), 0.05);
}

.outlook-msg-item.active {
    background: rgba(var(--accent-rgb), 0.12);
    border-left: 4px solid var(--accent);
    padding-left: 12px;
}

.outlook-msg-item.unread {
    background: rgba(var(--accent-rgb), 0.04);
}

.outlook-msg-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

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

.outlook-msg-top-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 3px;
}

.outlook-msg-sender {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 170px;
}

.outlook-msg-item.unread .outlook-msg-sender {
    font-weight: 800;
}

.outlook-msg-date {
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.outlook-msg-snippet {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.outlook-msg-item.unread .outlook-msg-snippet {
    color: var(--text-main);
    font-weight: 500;
}

.outlook-unread-dot {
    position: absolute;
    top: 18px;
    right: 12px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
}

/* Right Pane: Message Preview */
.outlook-message-preview-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--card-bg);
    overflow-y: auto;
}

.outlook-empty-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
    padding: 40px;
    gap: 12px;
}

.outlook-empty-preview i {
    font-size: 48px;
    opacity: 0.3;
    color: var(--accent);
}

.outlook-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(var(--text-main-rgb), 0.015);
    gap: 16px;
    flex-wrap: wrap;
}

.outlook-preview-sender-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.outlook-preview-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.outlook-preview-details h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
}

.outlook-preview-email {
    font-size: 12px;
    color: var(--accent);
    text-decoration: none;
}

.outlook-preview-date {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.outlook-preview-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.outlook-preview-body {
    padding: 24px;
    flex: 1;
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-main);
    white-space: pre-wrap;
    word-break: break-word;
}

.outlook-preview-body-card {
    background: rgba(var(--text-main-rgb), 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px 24px;
    font-size: 14px;
    line-height: 1.65;
}

@media (max-width: 900px) {
    .outlook-inbox-body {
        flex-direction: column;
    }
    .outlook-messages-list-pane {
        width: 100%;
        max-width: none;
        max-height: 300px;
    }
}