:root {
    /* Liquid Glass Colors & Variables - 2026 Dark Theme */
    --bs-body-bg: #0E1016; /* Solid Graphite/Charcoal */
    --bs-body-color: #a0a0b0;
    
    /* Liquid Glass Tokens (TZ 2026) */
    --glass-bg: rgba(14, 16, 22, 0.62);
    --glass-stroke: rgba(255, 255, 255, 0.10);
    --glass-stroke-top: rgba(255, 255, 255, 0.20);
    --glass-inner: inset 0 1px 0 rgba(255,255,255,0.08), inset 0 -1px 0 rgba(0,0,0,0.40);
    --glass-shadow: 0 18px 70px rgba(0,0,0,0.65);
    --glass-radius: 22px;
    --glass-blur: 18px;
    --glass-sat: 140%;

    /* Reduced Transparency Tokens (will be applied via media query) */
    --glass-bg-reduced: rgba(14, 16, 22, 0.92);
    
    /* Accents - Professional & Muted Palette */
    --primary-color: #607d8b; /* Blue Grey */
    --secondary-color: #78909c;
    --success-color: #546e7a;
    --info-color: #455a64;
    --warning-color: #90a4ae;
    --danger-color: #b0bec5;
    --light-color: #f8f9fa;
    --dark-color: #1a1c20;

    --sidebar-width: 280px;
    --border-radius: var(--glass-radius);
}

/* Reduced transparency (Accessibility) */
@media (prefers-reduced-transparency: reduce){
  :root{
    --glass-blur: 0px;
    --glass-sat: 100%;
    --glass-bg: var(--glass-bg-reduced);
  }
}

body {
    background-color: var(--bs-body-bg);
    /* NO GRADIENTS - Solid Color Only */
    background-image: none; 
    color: var(--bs-body-color);
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
}

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

/* --- Liquid Glass Card Style --- */
.card, .sidebar-wrapper, .logs-drawer, .notification-dropdown, .toast, .modal-content {
    background: var(--glass-bg) !important;
    
    /* Progressive Enhancement for Blur */
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat)) !important;
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat)) !important;
    
    border: 1px solid var(--glass-stroke) !important;
    border-top-color: var(--glass-stroke-top) !important;
    
    box-shadow: var(--glass-shadow), var(--glass-inner) !important;
        
    border-radius: var(--glass-radius) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden; /* For noise texture containment */
}

/* Noise Texture Overlay */
.card::before, .modal-content::before, .toast::before, .sidebar-wrapper::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url("data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAwIDIwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZmlsdGVyIGlkPSJub2lzZUZpbHRlciI+PGZlVHVyYnVsZW5jZSB0eXBlPSJmcmFjdGFsTm9pc2UiIGJhc2VGcmVxdWVuY3k9IjAuNjUiIG51bU9jdGF2ZXM9IjMiIHN0aXRjaFRpbGVzPSJzdGl0Y2giLz48L2ZpbHRlcj48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWx0ZXI9InVybCgjbm9pc2VGaWx0ZXIpIiBvcGFjaXR5PSIwLjUiLz48L3N2Zz4=");
    opacity: 0.06;
    pointer-events: none;
    z-index: 0;
    mix-blend-mode: overlay;
}

.card-body, .card-header, .card-footer {
    position: relative;
    z-index: 1;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent; 
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1); 
    border-radius: 3px;
    backdrop-filter: blur(4px);
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2); 
}

#wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles - Hidden by default now as we use bottom menu */
#sidebar-wrapper {
    display: none;
}

/* New Desktop Layout with Fixed Logs and Bottom Menu */
@media (min-width: 992px) {
    #wrapper {
        display: flex;
        width: 100%;
        padding-right: 350px !important; /* Space for fixed logs */
    }

    #page-content-wrapper {
        width: 100%;
        padding: 2rem;
        padding-bottom: 120px !important; /* Space for bottom menu */
    }

    /* Fixed Logs Drawer for Desktop */
    .logs-drawer {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        width: 350px !important;
        height: 100vh !important;
        transform: none !important;
        border-radius: 0 !important;
        border-left: 1px solid rgba(255, 255, 255, 0.05) !important;
        background: rgba(15, 17, 21, 0.9) !important;
        z-index: 1000 !important;
        margin-right: 0 !important;
    }

    .logs-drawer-toggle {
        display: none !important; /* No need to toggle on desktop */
    }

    /* Bottom Capsule Menu for Desktop */
    #sidebar-wrapper {
        display: flex !important;
        position: fixed !important;
        bottom: 30px !important;
        left: calc(50% - 175px) !important; /* Center considering the log panel offset */
        transform: translateX(-50%) !important;
        top: auto !important;
        width: auto !important;
        min-width: 500px !important;
        height: auto !important;
        margin: 0 !important;
        flex-direction: row !important;
        padding: 0.6rem 1.5rem !important;
        border-radius: 50px !important;
        
        /* Liquid Glass Background (Matching Mobile) */
        background: rgba(15, 17, 21, 0.6) !important;
        backdrop-filter: blur(15px) saturate(120%) !important;
        -webkit-backdrop-filter: blur(15px) saturate(120%) !important;
        border: 1px solid rgba(255, 255, 255, 0.05) !important;
        border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
        box-shadow: 0 15px 35px rgba(0,0,0,0.4), inset 0 0 15px rgba(255,255,255,0.05) !important;
        z-index: 10000 !important;
        
        justify-content: center !important;
        align-items: center !important;
    }

    #sidebar-wrapper .list-group {
        flex-direction: row !important;
        gap: 0.5rem !important; /* Smaller gap */
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #sidebar-wrapper .list-group-item {
        padding: 8px 10px !important;
        margin: 0 !important;
        border-radius: 18px !important; /* Softer radius for active state background */
        width: 100px !important;
        height: 75px !important;
        flex: 0 0 auto !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        background: transparent !important;
        border: none !important;
        color: rgba(255, 255, 255, 0.5) !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        
        font-size: 0.65rem !important;
        font-weight: 500 !important;
        text-align: center !important;
        line-height: 1.2 !important;
    }

    #sidebar-wrapper .list-group-item i {
        font-size: 1.5rem !important;
        margin: 0 0 6px 0 !important;
        display: block !important;
        line-height: 1 !important;
        transition: transform 0.3s ease !important;
    }

    #sidebar-wrapper .list-group-item.active {
        color: #fff !important;
        background: transparent !important; /* Removed background */
        box-shadow: none !important;
        border: none !important;
    }
    
    #sidebar-wrapper .list-group-item.active i {
        filter: none !important;
        color: #fff !important;
        transform: translateY(-2px) !important;
    }

    #sidebar-wrapper .list-group-item:not(.active):hover {
        background: rgba(255, 255, 255, 0.05) !important;
        color: #fff !important;
    }

    /* Hide redundant elements */
    .sidebar-heading, .mt-auto {
        display: none !important;
    }
    
    /* Ensure .d-lg-none elements are actually hidden on desktop, overriding display:flex above */
    #sidebar-wrapper .d-lg-none {
        display: none !important;
    }
}

.sidebar-heading {
    padding: 0 0 2rem 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 15px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.sidebar-heading i {
    color: var(--primary-color);
    font-size: 1.8rem;
}

#sidebar-wrapper .list-group {
    width: 100%;
    gap: 0.8rem;
}

/* Logs Drawer */
.logs-drawer {
    position: fixed !important;
    top: 1rem !important;
    right: -370px;
    width: 350px;
    height: calc(100vh - 2rem) !important;
    background: rgba(20, 20, 30, 0.4) !important; /* More transparent for liquid feel */
    z-index: 10000 !important;
    transition: right 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    overflow: visible;
    border-radius: var(--border-radius) !important;
    margin-right: 1rem;
}

.logs-drawer.open {
    right: 0;
}

.logs-drawer-toggle {
    position: absolute;
    left: -50px;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-right: none;
    border-radius: 20px 0 0 20px;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1051;
    transition: all 0.2s;
    box-shadow: -5px 0 15px rgba(0,0,0,0.2);
}

.logs-drawer-toggle i {
    font-size: 1.5rem;
}

.logs-drawer-toggle:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 55px;
    left: -55px;
}

.logs-drawer-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
}

.logs-drawer-body {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.notification-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.pdf-list-sidebar {
    max-height: 40%;
    overflow-y: auto;
    background-color: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Logs and Console Styles */
#notification-list .notification-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 8px 12px;
    opacity: 0.8;
    transition: opacity 0.3s;
}

#notification-list .notification-item:hover {
    opacity: 1;
}

.notification-time {
    color: #6c757d;
    font-size: 0.75rem;
    display: block;
    margin-bottom: 2px;
}

.notification-text {
    color: #a0a0b0;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Muted colors for specific log elements */
.notification-text .btn-danger {
    background: rgba(220, 53, 69, 0.2) !important;
    border-color: rgba(220, 53, 69, 0.3) !important;
    color: #e0e0e0 !important;
    font-size: 0.75rem !important;
}

.notification-text .btn-danger:hover {
    background: rgba(220, 53, 69, 0.4) !important;
}

/* PDF Sidebar Links Muted */
#sidebar-pdf-list .list-group-item {
    opacity: 0.7;
    transition: all 0.2s;
}

#sidebar-pdf-list .list-group-item:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.05) !important;
}

#sidebar-pdf-list i.fa-file-pdf {
    color: rgba(220, 53, 69, 0.5) !important;
}

/* Dashboard Console Muted */
.log-console-muted {
    color: #689f38 !important; /* Muted green instead of bright #81c784 */
    background: rgba(0, 0, 0, 0.4) !important;
}

.log-entry {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    opacity: 0.9;
}

/* Generated PDF icons muted */
.pdf-card-muted {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.03) !important;
}

.pdf-card-muted i.fa-file-pdf {
    color: rgba(220, 53, 69, 0.4) !important;
}

.pdf-card-muted:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.pdf-card-muted:hover i.fa-file-pdf {
    color: rgba(220, 53, 69, 0.8) !important;
}

.list-group-item {
    background-color: transparent !important;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    padding: 1rem 1.2rem;
    font-weight: 500;
    border-radius: 16px !important;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    margin-bottom: 2px;
}

#sidebar-wrapper .list-group-item i {
    width: 24px;
    margin-right: 15px;
    font-size: 1.1rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

#sidebar-wrapper .list-group-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1) !important;
    transform: translateX(5px);
}

#sidebar-wrapper .list-group-item:hover i {
    color: #fff;
    filter: drop-shadow(0 0 5px rgba(255,255,255,0.5));
}

#sidebar-wrapper .list-group-item.active {
    background: rgba(124, 136, 255, 0.2) !important;
    color: #fff;
    font-weight: 600;
    border: 1px solid rgba(124, 136, 255, 0.3);
    box-shadow: 0 4px 15px rgba(124, 136, 255, 0.15);
}

#sidebar-wrapper .list-group-item.active i {
    color: var(--primary-color);
    filter: drop-shadow(0 0 8px var(--primary-color));
}

/* Main Content */
#page-content-wrapper {
    flex: 1;
    min-width: 0;
    padding: 2rem;
    background: transparent; 
}

/* Top Bar */
.top-bar {
    display: flex;
    justify-content: center; /* Center content since frame is gone */
    align-items: center;
    margin-bottom: 2rem;
    gap: 1.5rem;
    flex-wrap: wrap;
    background: transparent !important; /* Removed background */
    backdrop-filter: none !important; /* Removed blur */
    border: none !important; /* Removed border */
    box-shadow: none !important;
    padding: 0; /* Removed padding */
    border-radius: 0;
}

/* Quick Launch Buttons & General Buttons */
.btn {
    border-radius: 12px;
    font-weight: 500;
    padding: 0.6rem 1.2rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    border: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: none !important;
}

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

/* Liquid Button Variants */
.btn-primary {
    background: rgba(63, 81, 181, 0.6);
    border: 1px solid rgba(121, 134, 203, 0.3);
    color: #fff;
    box-shadow: 0 4px 15px rgba(121, 134, 203, 0.2);
}
.btn-primary:hover {
    background: rgba(63, 81, 181, 0.8);
    box-shadow: none !important;
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-success {
    background: rgba(0, 137, 123, 0.6);
    border: 1px solid rgba(77, 182, 172, 0.3);
    color: #fff;
    box-shadow: 0 4px 15px rgba(77, 182, 172, 0.2);
}
.btn-success:hover {
    background: rgba(0, 137, 123, 0.8);
    box-shadow: none !important;
}

.btn-danger {
    background: rgba(211, 47, 47, 0.6);
    border: 1px solid rgba(229, 115, 115, 0.3);
    color: #fff;
    box-shadow: 0 4px 15px rgba(229, 115, 115, 0.2);
}
.btn-danger:hover {
    background: rgba(211, 47, 47, 0.8);
    box-shadow: none !important;
}

.btn-info {
    background: rgba(2, 136, 209, 0.6);
    border: 1px solid rgba(79, 195, 247, 0.3);
    color: #fff;
    box-shadow: 0 4px 15px rgba(79, 195, 247, 0.2);
}
.btn-info:hover {
    background: rgba(2, 136, 209, 0.8);
    box-shadow: none !important;
}

.btn-warning {
    background: rgba(245, 124, 0, 0.6);
    border: 1px solid rgba(255, 213, 79, 0.3);
    color: #212529;
    box-shadow: 0 4px 15px rgba(255, 213, 79, 0.2);
}
.btn-warning:hover {
    background: rgba(245, 124, 0, 0.8);
    box-shadow: none !important;
}

.btn-secondary {
    background: rgba(81, 45, 168, 0.6);
    border: 1px solid rgba(149, 117, 205, 0.3);
    color: #fff;
    box-shadow: 0 4px 15px rgba(149, 117, 205, 0.2);
}
.btn-secondary:hover {
    background: rgba(81, 45, 168, 0.8);
    box-shadow: none !important;
}

.btn-outline-light {
    border-color: rgba(255, 255, 255, 0.2);
    color: #b0b0c0;
    background: transparent;
}
.btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
    box-shadow: 0 0 15px rgba(255,255,255,0.1);
}

/* Search Bar */
.search-bar {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 0.6rem 1.2rem;
    display: flex;
    align-items: center;
    width: 300px;
    color: #a0a0b0;
    transition: all 0.3s;
}

.search-bar:focus-within {
    background-color: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
}

.search-bar input {
    background: transparent;
    border: none;
    color: #fff;
    width: 100%;
    margin-left: 10px;
    outline: none;
}

/* Yandex Disk Compact Styles */
.yandex-disk-list {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.yandex-disk-list.collapsed {
    max-height: 0 !important;
}

.yandex-item {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background-color 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.active-folder {
    background: rgba(124, 136, 255, 0.15) !important;
    border-left: 3px solid var(--primary-color) !important;
    color: #fff;
}

.yandex-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.yandex-item i {
    font-size: 1rem;
    color: #ffd700;
    margin-right: 12px;
    flex-shrink: 0;
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.3));
}

.yandex-section-header {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
    padding: 10px;
    border-radius: 12px;
}

.yandex-section-header:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

.yandex-section-header .chevron {
    transition: transform 0.3s;
}

.yandex-section-header.collapsed .chevron {
    transform: rotate(-90deg);
}

/* Card Header/Body Overrides */
.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem 1.5rem 1rem;
    font-weight: 600;
    color: #fff;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
}

/* Batch Action Bar */
.batch-action-bar {
    display: none; /* Default hidden */
    justify-content: space-between;
    align-items: center;
    background: rgba(124, 136, 255, 0.15);
    border: 1px solid rgba(124, 136, 255, 0.3);
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    flex-wrap: wrap;
    gap: 1rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 576px) {
    .batch-action-bar {
        position: fixed;
        top: 15px;
        left: 15px;
        right: 15px;
        z-index: 1050;
        margin-bottom: 0;
        background: rgba(30, 30, 40, 0.95);
        border-color: var(--primary-color);
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        box-shadow: 0 5px 25px rgba(0,0,0,0.6);
    }
    
    .batch-action-bar > div:first-child {
        text-align: center;
        margin-bottom: 0.5rem;
        font-size: 1.1rem;
    }
    
    .batch-action-bar .d-flex {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem !important;
    }
    
    .batch-action-bar .btn {
        width: 100%;
        padding: 0.6rem;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    /* Hide text on small screens for some buttons if needed, or adjust font */
    .batch-action-bar .btn {
        font-size: 0.9rem;
    }
    
    /* Adjust Card Header for mobile */
    .card-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }
    
    .card-header > div {
        width: 100%;
        display: flex;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 0.5rem !important;
    }
    
    .card-header .btn {
        flex: 1;
        white-space: nowrap;
        min-width: 120px; /* Prevent becoming too small */
    }

    #prima-actions {
        flex: 1;
        display: flex;
        min-width: 120px;
    }

    #reportage-actions {
        flex: 1;
        display: flex;
        min-width: 120px;
    }
}

/* Explorer List View (Default) */
.explorer-item {
    display: flex;
    align-items: center;
    padding: 0.8rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
    cursor: pointer;
}

.explorer-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.explorer-item .form-check-input {
    margin-right: 1rem;
    margin-top: 0;
    flex-shrink: 0;
}

.explorer-item i {
    margin-right: 0.8rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

#explorer-list.grid-view .explorer-item i {
    margin-right: 0;
    width: auto;
}

#explorer-list.grid-view .explorer-item .explorer-thumb-container i {
    margin-right: 0;
}

#explorer-list.grid-view .explorer-item .d-flex {
    justify-content: center;
    width: 100%;
}

#explorer-list.grid-view .explorer-item span {
    width: 100%;
    text-align: center;
    display: block;
    margin-top: 0;
}

#explorer-list.grid-view .explorer-item .text-truncate {
    width: 100%;
    text-align: center;
}

#explorer-list.grid-view .explorer-actions {
    margin-left: 0;
    justify-content: center;
    width: 100%;
}

.explorer-item .fa-folder, .explorer-item .fa-network-wired {
    color: var(--warning-color);
}

.explorer-item .fa-file {
    color: var(--info-color);
}

.explorer-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: 1rem;
}

.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 8px;
    line-height: 1;
}

/* Explorer Grid View Liquid */
#explorer-list.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.2rem;
    padding: 0.5rem;
}

#explorer-list.grid-view .explorer-item {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    height: 100%;
    position: relative;
    transition: all 0.3s ease;
}

#explorer-list.grid-view .explorer-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

#explorer-list.grid-view .explorer-item .form-check-input {
    position: absolute;
    top: 12px;
    left: 12px;
    margin: 0;
    z-index: 2;
}

#explorer-list.grid-view .explorer-item .explorer-thumb-container {
    width: 100%;
    aspect-ratio: auto;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    overflow: hidden;
    border-radius: 12px;
    background-color: rgba(0,0,0,0.3);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

#explorer-list.grid-view .explorer-item .explorer-thumb {
    width: 100%;
    height: auto;
    max-height: 250px;
    object-fit: contain;
    transition: transform 0.5s ease;
}

#explorer-list.grid-view .explorer-item:hover .explorer-thumb {
    transform: scale(1.1);
}

@media (max-width: 576px) {
    #explorer-list.grid-view {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.25rem;
        padding: 0.25rem;
    }

    #explorer-list.grid-view .explorer-item {
        padding: 0.25rem;
        border-radius: 8px;
    }

    #explorer-list.grid-view .explorer-item .explorer-thumb-container {
        min-height: 80px;
        margin-bottom: 0.25rem;
        border-radius: 6px;
    }

    #explorer-list.grid-view .explorer-item .explorer-thumb {
        max-height: 100px;
    }

    #explorer-list.grid-view .explorer-item span {
        font-size: 0.65rem;
        line-height: 1.1;
        width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #explorer-list.grid-view .explorer-item .form-check-input {
        top: 2px;
        left: 2px;
        transform: scale(1.3) !important; /* Slightly reduce scale for tight grid */
        margin: 5px !important;
    }
}

/* Explorer Breadcrumb */
.explorer-breadcrumb {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    padding: 0.8rem 1.2rem;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
}

.explorer-breadcrumb span {
    cursor: pointer;
    color: var(--accent-color);
    transition: all 0.2s;
    padding: 4px 10px;
    border-radius: 8px;
}

.explorer-breadcrumb span:hover {
    background-color: rgba(54, 153, 255, 0.15);
    color: #fff;
    text-shadow: 0 0 8px rgba(54, 153, 255, 0.6);
}

/* Log Console */
#log-console {
    background-color: rgba(10, 10, 15, 0.8);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    font-family: 'Fira Code', monospace;
    padding: 1rem;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

/* Mobile Adjustments */
@media (max-width: 991.98px) {
    #sidebar-wrapper {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        margin: 0;
        margin-left: calc(-1 * var(--sidebar-width));
        border-radius: 0;
        background: rgba(20, 20, 30, 0.95) !important;
        z-index: 9999;
    }
    
    #sidebar-wrapper.show {
        margin-left: 0;
    }
    
    #page-content-wrapper {
        padding: 1rem; 
    }

    .top-bar {
        margin-bottom: 1.5rem;
        flex-direction: column;
        align-items: stretch;
        background: transparent;
        border: none;
        padding: 0;
        backdrop-filter: none;
    }

    .search-bar {
        width: 100% !important;
        margin-bottom: 1rem;
    }

    /* .quick-launch-bar moved to end of file */
}

/* Toast Notifications */
.toast {
    background: rgba(30, 30, 45, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(15px) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
}

.toast-header {
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}

.toast-body {
    color: #e0e0e0;
}

/* Photo Grid - Liquid Style */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 0.5rem;
}

.photo-item .card {
    height: 100%;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.photo-item .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.3) !important;
    border-color: var(--primary-color) !important;
}

.photo-item img {
    width: 100%;
    height: 200px; /* Fixed height for uniform grid */
    object-fit: contain; /* Ensure full image is visible */
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* Liquid Outline Buttons for Photo Selection */
.btn-check + .btn-outline-primary {
    border-color: rgba(124, 136, 255, 0.4);
    color: rgba(255, 255, 255, 0.8);
    background: transparent;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.btn-check + .btn-outline-primary:hover {
    background: rgba(124, 136, 255, 0.1);
    color: #fff;
    box-shadow: 0 0 15px rgba(124, 136, 255, 0.2);
}

.btn-check:checked + .btn-outline-primary {
    background: rgba(124, 136, 255, 0.8);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 0 20px rgba(124, 136, 255, 0.4);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* --- Quick Launch Bar Updates --- */
.quick-launch-bar {
    display: flex;
    flex-wrap: nowrap; /* Force single row on desktop */
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    width: 100%;
    overflow-x: auto; /* Allow scrolling if screen is too narrow */
    overflow-y: visible; /* Ensure vertical overflow (hover) is visible if possible */
    padding: 20px 5px !important; /* Add padding to prevent hover cutoff */
    background: transparent !important;
    backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE 10+ */
    margin-bottom: -15px; /* Compensate for bottom padding to keep layout tight */
}

.quick-launch-bar::-webkit-scrollbar { 
    display: none; 
    width: 0;
    height: 0;
}

@media (max-width: 991.98px) {
    .quick-launch-bar {
        display: grid;
        grid-template-columns: repeat(4, 1fr); /* 4 columns to fit 7 items in 2 rows */
        gap: 0.6rem;
        width: 100%;
        margin-right: 0 !important;
        overflow-x: visible; /* Grid handles layout, no scroll needed */
    }
    
    .quick-launch-bar .btn {
        /* aspect-ratio: 1 / 1; Removed to reduce height */
        height: 80px; /* Fixed compact height */
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        white-space: normal;
        text-align: center;
        padding: 4px !important;
        font-size: 0.65rem !important;
        line-height: 1.1;
        width: 100% !important;
        border-radius: 14px !important; /* Slightly smaller radius */
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    }
    
    .quick-launch-bar .btn i {
        font-size: 1.3rem !important; /* Smaller icon */
        margin-bottom: 4px;
        margin-right: 0 !important;
        display: block;
    }
}

/* --- Bottom Navigation for Mobile (Capsule Style) --- */
@media (max-width: 991.98px) {
    /* Reset Sidebar to Bottom Floating Capsule */
    #sidebar-wrapper {
        display: flex !important;
        position: fixed !important;
        bottom: 20px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        top: auto !important;
        width: 96% !important; /* Maximize width */
        max-width: 500px !important;
        height: auto !important;
        margin: 0 !important;
        
        flex-direction: row !important;
        padding: 0.5rem 0.5rem !important; /* Reduced horizontal padding */
        border-radius: 50px !important;
        
        /* Liquid Glass Background */
        background: rgba(15, 17, 21, 0.6) !important;
        backdrop-filter: blur(15px) saturate(120%) !important;
        -webkit-backdrop-filter: blur(15px) saturate(120%) !important;
        border: 1px solid rgba(255, 255, 255, 0.05) !important;
        border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
        box-shadow: 0 15px 35px rgba(0,0,0,0.4), inset 0 0 15px rgba(255,255,255,0.05) !important;
        z-index: 10000 !important;
        
        justify-content: center !important;
        align-items: center !important;
        transition: none !important;
    }

    /* Hide Header and Logout */
    .sidebar-heading, 
    #sidebar-wrapper .mt-auto {
        display: none !important; 
    }

    /* Horizontal List Group */
    #sidebar-wrapper .list-group {
        display: grid !important;
        grid-auto-flow: column !important;
        grid-auto-columns: 1fr !important;
        gap: 0 !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Common Item Styles */
    #sidebar-wrapper .list-group-item {
        padding: 6px 2px !important; /* Slightly more padding */
        margin: 0 !important;
        border-radius: 14px !important;
        width: 100% !important; /* Fill grid cell */
        flex: none !important;
        height: 65px !important; /* Adjusted height */
        display: flex !important;
        flex-direction: column !important; /* Text under icon */
        justify-content: center !important; /* Center vertically */
        align-items: center !important;
        background: transparent !important;
        border: none !important;
        color: rgba(255, 255, 255, 0.5) !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        
        /* Show text always */
        font-size: 0.55rem !important;
        font-weight: 500 !important;
        letter-spacing: 0.1px !important;
        white-space: normal !important; /* Allow wrapping */
        line-height: 1.1 !important;
        text-align: center !important;
        overflow: hidden !important; /* Contain text */
    }
    
    #sidebar-wrapper .list-group-item i {
        font-size: 1.4rem !important; /* Larger icons */
        margin: 0 0 4px 0 !important;
        display: block !important;
        line-height: 1 !important;
    }
    
    /* Active Item Styles */
    #sidebar-wrapper .list-group-item.active {
        width: auto !important;
        flex: 1 1 0 !important;
        padding: 6px 2px !important;
        border-radius: 14px !important;
        background: transparent !important; /* Removed background */
        color: #fff !important; /* Brighter white highlight */
        box-shadow: none !important; /* Removed shadow */
        border: none !important;
        
        font-size: 0.55rem !important;
        font-weight: 700 !important;
        gap: 0 !important;
    }

    #sidebar-wrapper .list-group-item.active i {
        color: #fff !important; /* Brighter white icon */
        filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.5)) !important; /* Subtle white glow */
        font-size: 1.5rem !important;
        margin-bottom: 4px !important;
    }
    
    /* Universal override to remove background "square" on all interactions */
    #sidebar-wrapper .list-group-item:not(.active):hover,
    #sidebar-wrapper .list-group-item:not(.active):focus,
    #sidebar-wrapper .list-group-item:not(.active):active {
        background: transparent !important;
        color: #fff !important;
        box-shadow: none !important;
    }

    /* Add motion effect ONLY for devices with mouse hover */
    @media (hover: hover) {
        #sidebar-wrapper .list-group-item:not(.active):hover {
            transform: translateY(-2px);
        }
    }
    
    /* Ensure no transform on touch focus/active to prevent "double tap" issues or jumpiness */
    #sidebar-wrapper .list-group-item:not(.active):focus,
    #sidebar-wrapper .list-group-item:not(.active):active {
        transform: none !important;
    }

    /* Page Content Padding */
    #page-content-wrapper {
        padding-bottom: 120px !important;
    }
    
    /* Hide Sidebar Toggle */
    #sidebarToggle {
        display: none !important;
    }

    /* Fix Logs Drawer overlap with Bottom Menu */
    .logs-drawer {
        height: calc(100vh - 120px) !important; /* Stop above the bottom menu */
    }
}
