/* DrivePasundan Crextio Ultra-Modern Theme System (Dark & Light Mode) */
:root, html[data-theme="dark"] {
    --bg-main: #0b0f19;
    --bg-card: #151c2c;
    --bg-sidebar: #0f1623;
    --bg-hover: rgba(99, 102, 241, 0.14);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-heading: #ffffff;
    --primary: #6366f1;
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --accent: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 15px 35px -5px rgba(0, 0, 0, 0.45);
}

/* Light Theme Variables (Modern Vercel/Linear Crisp Slate Canvas) */
html[data-theme="light"], .light-theme {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-hover: rgba(99, 102, 241, 0.06);
    --border-color: rgba(226, 232, 240, 0.9);
    --text-main: #334155;
    --text-muted: #64748b;
    --text-heading: #0f172a;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
}

/* Global 0ms Instant Touch Latency & Native App Ergonomics */
html, body {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

button, a, input, select, textarea, .btn, .sidebar-link, .mobile-nav-item, .file-card, .folder-card, .dropdown-item, .card-custom, .tag-badge {
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent !important;
}

/* Fast-tap native response */
button, a, .btn, .sidebar-link, .mobile-nav-item, .file-card, .folder-card, .dropdown-item, .mobile-fab-main-btn {
    -webkit-user-select: none;
    user-select: none;
    cursor: pointer;
}

/* Fast Momentum Touch Scrolling on Mobile */
.overflow-auto, .overflow-y-auto, .table-responsive, #content-wrapper, #sidebar, .ai-chat-messages-container {
    -webkit-overflow-scrolling: touch;
}

body {
    background-color: var(--bg-main) !important;
    color: var(--text-main) !important;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    transition: background-color 0.2s ease, color 0.2s ease;
}

html[data-theme="dark"] body {
    background-image: radial-gradient(ellipse at 80% 0%, rgba(251, 191, 36, 0.06), rgba(99, 102, 241, 0.06));
    background-attachment: fixed;
}


/* Text & Typography Overrides */
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--text-heading) !important;
    font-weight: 700;
    letter-spacing: -0.02em;
}

p, span, label, div {
    color: var(--text-main);
}

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

/* Sidebar & Navigation Layout */
#wrapper {
    display: flex;
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
}

#sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    z-index: 1040;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    flex-shrink: 0;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

#sidebar::-webkit-scrollbar,
#sidebar nav::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

#sidebar nav {
    scrollbar-width: none;
    -ms-overflow-style: none;
}



#content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background-color: var(--bg-main);
}

/* Top Navbar */
.navbar-custom {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 0.85rem 1.5rem;
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 1030;
}

/* Brand Logo */
.brand-logo {
    font-weight: 800;
    font-size: 1.3rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Sidebar Nav Links */
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    color: var(--text-muted) !important;
    text-decoration: none;
    font-weight: 500;
    border-radius: 14px;
    margin: 0.25rem 0.75rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background-color: var(--bg-hover);
    color: var(--primary) !important;
    transform: translateX(3px);
}

/* Active Sidebar Link */
.sidebar-link.active {
    background: linear-gradient(135deg, #6366f1, #4f46e5) !important;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.35);
    border-left: 3px solid #a5b4fc;
}

.sidebar-link.active i, .sidebar-link.active span {
    color: #ffffff !important;
}

.sidebar-link i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

/* Storage Bar */
.storage-box {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin: 1rem;
}

/* Crextio Glassmorphic Cards & Content */
.card-custom, .card-crextio {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-xl) !important;
    box-shadow: var(--shadow-sm);
    color: var(--text-main) !important;
    backdrop-filter: blur(16px);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-custom-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Folder Card */
.folder-card {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg);
    padding: 1.1rem;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s, border-color 0.25s;
    cursor: pointer;
    position: relative;
}

.folder-card:hover, .folder-card.drag-target-hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary) !important;
    background-color: var(--bg-hover) !important;
}

.folder-icon {
    font-size: 2.2rem;
}

/* File Card */
.file-card {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg);
    padding: 1.1rem;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s, box-shadow 0.25s;
}

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

.file-card .btn-group {
    position: relative;
    z-index: 30 !important;
}

.file-card .btn-group .btn, .file-card .btn-group a.btn {
    min-width: 36px !important;
    min-height: 36px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    touch-action: manipulation !important;
    cursor: pointer !important;
    position: relative;
    z-index: 31 !important;
}

.file-card .dropdown-menu,
.folder-card .dropdown-menu {
    z-index: 1090 !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.45) !important;
}

.file-item-col:has(.dropdown-menu.show),
.file-card:has(.dropdown-menu.show),
.folder-card:has(.dropdown-menu.show) {
    z-index: 1080 !important;
    position: relative !important;
}

.file-thumbnail {
    height: 140px;
    background-color: var(--bg-main);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-color);
}

/* Breadcrumb High Contrast Styling */
.breadcrumb {
    --bs-breadcrumb-divider-color: var(--text-muted) !important;
}
.breadcrumb-item, .breadcrumb-item a {
    color: var(--text-muted) !important;
}
.breadcrumb-item a:hover {
    color: var(--primary) !important;
}
.breadcrumb-item.active, .breadcrumb-item.active span, .breadcrumb-item.active a {
    color: var(--text-heading) !important;
    font-weight: 700 !important;
}
.breadcrumb-item+.breadcrumb-item::before {
    color: var(--text-muted) !important;
    opacity: 0.8 !important;
    font-weight: bold !important;
}

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

/* Tag Badges (Gmail-style) */
.tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 8px;
    color: #ffffff !important;
    text-decoration: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}

.tag-badge:hover {
    opacity: 0.9;
}

/* Floating Bulk Action Bar */
.bulk-action-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    background: var(--bg-card);
    border: 1px solid var(--primary);
    border-radius: 50px;
    padding: 0.65rem 1.5rem;
    box-shadow: 0 15px 35px rgba(0,0,0,0.45);
    z-index: 1050;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.bulk-action-bar.show {
    transform: translateX(-50%) translateY(0);
}

/* Table Override for Dark & Light Themes */
.table, .table-custom {
    --bs-table-bg: transparent !important;
    --bs-table-accent-bg: transparent !important;
    --bs-table-striped-bg: rgba(0, 0, 0, 0.02) !important;
    --bs-table-hover-bg: var(--bg-hover) !important;
    --bs-table-color: var(--text-main) !important;
    --bs-table-border-color: var(--border-color) !important;
    color: var(--text-main) !important;
    background-color: transparent !important;
    margin-bottom: 0;
}

.table th, .table td, .table-custom th, .table-custom td {
    background-color: transparent !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
    padding: 0.95rem 1.1rem;
    vertical-align: middle;
}

.table th, .table-custom th {
    color: var(--text-muted) !important;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border-color) !important;
}

.table tbody tr:hover td {
    background-color: var(--bg-hover) !important;
}

/* Form Controls & Inputs */
.form-control, .form-select {
    background-color: var(--bg-main) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
    border-radius: 14px;
    padding: 0.65rem 1rem;
}

.form-control::placeholder {
    color: var(--text-muted) !important;
}

.form-control:focus, .form-select:focus {
    background-color: var(--bg-main) !important;
    border-color: var(--primary) !important;
    color: var(--text-main) !important;
    box-shadow: 0 0 0 0.25rem rgba(99, 102, 241, 0.25) !important;
}

/* Modals */
.modal-content {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-xl) !important;
    color: var(--text-main) !important;
    box-shadow: var(--shadow-lg);
}

.modal-header, .modal-footer {
    border-color: var(--border-color) !important;
}

html[data-theme="light"] .btn-close {
    filter: none !important;
}

html[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Dropdown Menus */
.dropdown-menu, .dropdown-menu-dark {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 16px !important;
    box-shadow: var(--shadow-lg) !important;
    padding: 0.5rem;
}

.dropdown-item {
    color: var(--text-main) !important;
    border-radius: 10px;
    padding: 0.5rem 0.85rem;
}

.dropdown-item:hover, .dropdown-item:focus {
    background-color: var(--bg-hover) !important;
    color: var(--primary) !important;
}

/* Universal Light/Dark Theme Responsive Adapters */
html[data-theme="light"] .bg-dark,
html[data-theme="light"] .bg-dark-subtle {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
}

html[data-theme="light"] .bg-dark.bg-opacity-50,
html[data-theme="light"] .bg-dark.bg-opacity-25,
html[data-theme="light"] .bg-dark.bg-opacity-75,
html[data-theme="light"] .bg-dark.bg-opacity-60,
html[data-theme="light"] .bg-dark.bg-opacity-10 {
    background-color: var(--bg-hover) !important;
    color: var(--text-main) !important;
}

html[data-theme="light"] .text-light,
html[data-theme="light"] .text-white:not(.badge):not(.btn-primary):not(.btn-success):not(.btn-danger):not(.sidebar-link.active) {
    color: var(--text-heading) !important;
}

html[data-theme="light"] .border-secondary {
    border-color: var(--border-color) !important;
}

html[data-theme="light"] .input-group-text.bg-dark {
    background-color: var(--bg-hover) !important;
    color: var(--text-muted) !important;
    border-color: var(--border-color) !important;
}

html[data-theme="light"] .modal-content {
    background-color: var(--bg-card) !important;
    color: var(--text-heading) !important;
}

html[data-theme="light"] .dropdown-menu {
    background-color: var(--bg-card) !important;
    border-color: var(--border-color) !important;
}

html[data-theme="light"] .dropdown-item {
    color: var(--text-main) !important;
}

html[data-theme="light"] .dropdown-item:hover {
    background-color: var(--bg-hover) !important;
    color: var(--primary) !important;
}

html[data-theme="dark"] .dropdown-menu {
    background-color: var(--bg-card) !important;
    border-color: var(--border-color) !important;
}

html[data-theme="dark"] .dropdown-item {
    color: var(--text-main) !important;
}

html[data-theme="dark"] .dropdown-item:hover {
    background-color: var(--bg-hover) !important;
    color: var(--primary) !important;
}

html[data-theme="light"] pre,
html[data-theme="light"] code,
html[data-theme="light"] .pdf-thumb-item,
html[data-theme="light"] .list-group-item {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

html[data-theme="dark"] pre,
html[data-theme="dark"] code {
    background-color: #0d1117 !important;
    color: #e6edf3 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Universal List Group & Notification Item Theme Styles */
.list-group-item {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

.list-group-item-action:hover,
.list-group-item-action:focus {
    background-color: var(--bg-hover) !important;
    color: var(--text-heading) !important;
}

html[data-theme="dark"] .list-group-item {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

html[data-theme="dark"] .list-group-item-action:hover,
html[data-theme="dark"] .list-group-item-action:focus {
    background-color: var(--bg-hover) !important;
    color: var(--text-heading) !important;
}

/* Drag and Drop Zone */
.drop-zone {
    border: 2px dashed var(--primary);
    border-radius: var(--radius-xl);
    background-color: var(--bg-hover);
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.drop-zone:hover, .drop-zone.dragover {
    background-color: rgba(99, 102, 241, 0.15);
    border-color: var(--accent);
}

/* Floating Action Button (FAB) on Mobile */
.mobile-fab-upload {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.5);
    border: none;
    z-index: 1030;
    font-size: 1.4rem;
}

/* Backdrop Overlay for Mobile Sidebar */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1039;
    display: none;
}
.sidebar-backdrop.show {
    display: block;
}

/* Responsive Off-Canvas Sidebar & Layout adjustments */
.navbar-custom {
    position: sticky !important;
    top: 0 !important;
    z-index: 1060 !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    gap: 1rem;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(16px);
}


.navbar-search-form {
    width: 320px;
    max-width: 400px;
}

.navbar-right-controls {
    position: relative;
    z-index: 1065 !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Perfect 1:1 Circle Avatar Profile Button */
.avatar-profile-btn {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    max-width: 38px !important;
    max-height: 38px !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
    aspect-ratio: 1 / 1 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.avatar-profile-btn img,
.avatar-profile-btn div {
    width: 100% !important;
    height: 100% !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    aspect-ratio: 1 / 1 !important;
}

@media (max-width: 768px) {
    #sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        max-width: 85vw;
        height: 100vh;
        z-index: 1050 !important;
        box-shadow: 6px 0 25px rgba(0,0,0,0.6);
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    #sidebar.show {
        left: 0 !important;
    }
    .navbar-custom {
        padding: 0.65rem 0.85rem;
    }
    .navbar-search-form {
        width: 100% !important;
    }
    .navbar-right-controls {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    #closeSidebarBtn {
        z-index: 1060 !important;
    }

    /* Mobile Collapsible Speed Dial FAB Container */
    .mobile-fab-container {
        position: fixed;
        bottom: 24px;
        right: 24px;
        z-index: 1080 !important;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 12px;
    }

    .mobile-fab-main-btn {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: linear-gradient(135deg, #6366f1, #4f46e5);
        color: #ffffff;
        border: none;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        box-shadow: 0 10px 25px rgba(99, 102, 241, 0.5);
        cursor: pointer;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
    }

    .mobile-fab-main-btn:active {
        transform: scale(0.92);
    }

    .mobile-fab-main-btn.active {
        background: #ef4444 !important;
        transform: rotate(135deg);
    }

    .mobile-fab-menu {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 10px;
        opacity: 0;
        visibility: hidden;
        transform: translateY(20px) scale(0.85);
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        pointer-events: none;
    }

    .mobile-fab-container.open .mobile-fab-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1);
        pointer-events: auto;
    }

    /* Universal Mobile Responsiveness & Preview Modal Polish */
    .modal-dialog {
        margin: 0.5rem auto !important;
        max-width: 96vw !important;
    }
    
    .modal-content {
        border-radius: var(--radius-lg) !important;
    }

    #previewTab {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch;
    }

    #previewTab .nav-item {
        flex: 0 0 auto !important;
    }

    #previewTab .nav-link {
        padding: 0.6rem 1rem !important;
        font-size: 0.85rem !important;
    }

    .container-fluid {
        padding: 0.85rem !important;
    }

    .card-custom-header, .navbar-custom {
        padding: 0.75rem 1rem !important;
    }

    .folder-card, .file-card {
        padding: 0.85rem !important;
    }
}

/* Multi-Mode View Engine Styles */
/* File Card Actions Responsiveness */
.file-card {
    overflow: visible !important;
    word-break: break-word;
}
.file-card .btn-group {
    max-width: 100% !important;
    flex-wrap: nowrap !important;
    position: relative;
    z-index: 30;
}
.file-card .btn-group .btn {
    padding: 0.25rem 0.4rem !important;
    min-width: 28px !important;
    min-height: 28px !important;
    font-size: 0.75rem !important;
    flex-shrink: 1 !important;
}

/* 1. List View (Compact Single Row) */
.view-mode-list .file-card {
    padding: 0.6rem 1rem !important;
}

/* 2. Gallery View (Focus on High-Res Thumbnails) */
.view-mode-gallery .file-thumbnail {
    height: 220px !important;
}

/* 3. Large Icons Grid View */
.view-mode-large .file-thumbnail {
    height: 180px !important;
}

/* 4. Small Icons Grid View */
.view-mode-small .file-thumbnail {
    height: 90px !important;
}
.view-mode-small .file-card .file-date-span {
    display: none !important;
}
.view-mode-small .file-card .btn-group .btn {
    padding: 0.2rem 0.35rem !important;
    min-width: 24px !important;
    min-height: 24px !important;
    font-size: 0.68rem !important;
}
.view-mode-small .file-card .dropdown-menu {
    min-width: 190px !important;
    font-size: 0.8rem !important;
    z-index: 1095 !important;
}

/* Database Explorer Table List Theme Item */
.db-table-list-item {
    background-color: var(--bg-main) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-color) !important;
    transition: all 0.2s ease;
    text-decoration: none !important;
}
.db-table-list-item:hover {
    background-color: var(--bg-hover) !important;
    color: var(--text-heading) !important;
}
.db-table-list-item.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover)) !important;
    border-color: var(--primary) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.bg-indigo {
    background-color: rgba(99, 102, 241, 0.12) !important;
    color: var(--primary) !important;
    border: 1px solid rgba(99, 102, 241, 0.25) !important;
}

/* Crextio Glassmorphism Modern Aesthetic Profile Styling */
.profile-hero-banner {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.18) 0%, rgba(168, 85, 247, 0.18) 50%, rgba(245, 158, 11, 0.18) 100%);
    border: 1px solid var(--border-color);
    border-radius: 28px;
    padding: 2.2rem;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg);
}

.profile-avatar-xl {
    width: 140px;
    height: 140px;
    border-radius: 28px !important;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: #ffffff;
    font-size: 3rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.45);
    border: 4px solid var(--bg-card);
}

.crextio-nav-pills .nav-link {
    border-radius: 30px !important;
    padding: 0.65rem 1.35rem !important;
    font-weight: 600 !important;
    color: var(--text-muted) !important;
    transition: all 0.25s ease !important;
    background: transparent;
}
.crextio-nav-pills .nav-link.active {
    background: var(--primary) !important;
    color: #ffffff !important;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4) !important;
}

.crextio-stat-widget {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.25rem;
}

/* Top Layer Elevation System for Modals, Dropdowns, Collapses, & Tooltips */
/* 1. Modals & Dialogs Always on Top */
.modal-backdrop {
    z-index: 1085 !important;
}
.modal {
    z-index: 1090 !important;
}
.modal-dialog {
    z-index: 1095 !important;
}

/* 2. Dropdown Menus & Selects Layering */
.dropdown-menu, .dropdown-menu-dark, .select2-dropdown {
    z-index: 1090 !important;
}

/* Navbar Top Right User Profile & Filter Dropdowns Highest Elevation Rule */
.navbar-custom .dropdown-menu,
.navbar-right-controls .dropdown-menu {
    z-index: 1095 !important;
}

/* 3. Collapse Containers Layering */
.collapse.show, .collapsing {
    position: relative;
    z-index: 1050 !important;
}

/* 4. Tooltips & Popovers */
.tooltip, .popover {
    z-index: 1100 !important;
}

/* SweetAlert2 Dynamic Dark & Light Theme Integration */
.swal2-container {
    z-index: 99999 !important;
}

.swal2-popup {
    background: var(--bg-card) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 20px !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4) !important;
    padding: 1.5rem !important;
}

html[data-theme="light"] .swal2-popup {
    background: #ffffff !important;
    color: #1f2937 !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12) !important;
}

.swal2-title {
    color: var(--text-heading) !important;
    font-family: 'Inter', sans-serif !important;
    font-weight: 700 !important;
    font-size: 1.25rem !important;
}

.swal2-html-container,
.swal2-content {
    color: var(--text-main) !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 0.95rem !important;
}

.swal2-toast {
    background: var(--bg-card) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35) !important;
    border-radius: 14px !important;
}

html[data-theme="light"] .swal2-toast {
    background: #ffffff !important;
    color: #1f2937 !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1) !important;
}

.swal2-styled.swal2-confirm {
    border-radius: 24px !important;
    font-weight: 600 !important;
    padding: 0.65rem 1.4rem !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35) !important;
}

.swal2-styled.swal2-cancel {
    border-radius: 24px !important;
    font-weight: 600 !important;
    padding: 0.65rem 1.4rem !important;
    background-color: var(--bg-main) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-color) !important;
}

/* 5. Card & Wrapper Overflow Container Fix */
.folder-card, .file-card, .card-custom, .card-crextio {
    overflow: visible;
}

/* Card & Sidebar Dynamic Active Stacking Rule */
.file-card:has(.dropdown-menu.show),
.folder-card:has(.dropdown-menu.show),
.file-item-col:has(.dropdown-menu.show),
.card-custom:has(.dropdown-menu.show),
.card-crextio:has(.dropdown-menu.show),
#sidebar:has(.dropdown-menu.show) {
    z-index: 1080 !important;
    position: relative !important;
}

/* ==========================================================================
   DriveAI Modern Responsive Workspace & Chat System (Dark & Light Serasi)
   ========================================================================== */
:root, html[data-theme="dark"] {
    --ai-bg-pane: var(--bg-card);
    --ai-bg-box: #0f1623;
    --ai-bg-bot-bubble: #111726;
    --ai-border-bot-bubble: rgba(255, 255, 255, 0.08);
    --ai-input-bg: #0b0f19;
    --ai-chip-bg: rgba(99, 102, 241, 0.12);
    --ai-chip-border: rgba(99, 102, 241, 0.25);
    --ai-chip-text: #a5b4fc;
    --ai-viewer-bg: #090d16;
    --ai-header-bg: rgba(255, 255, 255, 0.03);
}

/* Document & Image Viewer Container Scrollable Behavior */
#docViewerContainer {
    overflow-y: auto !important;
    overflow-x: auto !important;
    max-height: 100%;
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.3) transparent;
}
#docViewerContainer::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
#docViewerContainer::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.35);
    border-radius: 4px;
}
#docViewerContainer::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

html[data-theme="light"], .light-theme {
    --ai-bg-pane: #ffffff;
    --ai-bg-box: #f8fafc;
    --ai-bg-bot-bubble: #f1f5f9;
    --ai-border-bot-bubble: #e2e8f0;
    --ai-input-bg: #f8fafc;
    --ai-chip-bg: rgba(99, 102, 241, 0.08);
    --ai-chip-border: rgba(99, 102, 241, 0.2);
    --ai-chip-text: #4f46e5;
    --ai-viewer-bg: #e2e8f0;
    --ai-header-bg: #f8fafc;
}

/* Page Layout Fix for Desktop & Mobile Full-Screen Chat Viewport */
@media (min-width: 992px) {
    .ai-page-container {
        height: calc(100vh - 75px);
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    .ai-workspace-wrapper {
        flex: 1;
        min-height: 0;
    }
    .ai-pane-doc-col, .ai-pane-chat-col {
        height: 100%;
        display: flex;
        flex-direction: column;
    }
}

@media (max-width: 991.98px) {
    .ai-page-container {
        height: calc(100vh - 68px) !important;
        max-height: calc(100vh - 68px) !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
        padding: 0.5rem !important;
    }
    .ai-workspace-wrapper {
        flex: 1 !important;
        height: 100% !important;
        min-height: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }
}


/* Mobile Native App Top Header (< 992px) */
/* High-Contrast Active Dropdown Item & White Icon Override */
.dropdown-item.active i,
.dropdown-item:active i {
    color: #ffffff !important;
}

.dropdown-menu-dark .dropdown-item.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(79, 70, 229, 0.45)) !important;
    color: #ffffff !important;
    border-left: 3px solid #818cf8 !important;
}

.ai-mobile-app-header {
    display: none;
    background: var(--ai-bg-pane);
    border-bottom: 1px solid var(--border-color);
    padding: 6px 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    flex-shrink: 0;
}

.ai-mobile-back-btn, .ai-mobile-action-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--ai-bg-box);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 0.88rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.ai-mobile-back-btn:active, .ai-mobile-action-btn:active {
    transform: scale(0.92);
    background: var(--primary);
    color: #ffffff !important;
}

.ai-msg-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

@media (max-width: 991.98px) {
    .ai-mobile-app-header {
        display: flex !important;
    }
    
    /* Hide desktop workspace card and desktop segmented bar on mobile */
    .ai-page-container > .card-custom.d-desktop-header,
    .ai-page-container > .ai-mobile-segmented-bar {
        display: none !important;
    }
}

/* Mobile Segmented Control Tab Bar */
.ai-mobile-segmented-bar {
    background: var(--ai-bg-pane);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: 3px;
    display: flex;
    gap: 3px;
}


@media (max-width: 991.98px) {
    .ai-mobile-segmented-bar {
        display: flex;
        width: 100%;
        margin-bottom: 0.75rem;
    }
}

.ai-segmented-btn {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.ai-segmented-btn.active {
    background: var(--primary);
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

/* AI Workspace Main Panes */
.ai-pane-card {
    background-color: var(--ai-bg-pane) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 18px !important;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    transition: all 0.25s ease;
}

.ai-header-box {
    background-color: var(--ai-header-bg) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

/* Pulse Dot Animation for Online Status */
.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse-dot-anim 1.8s infinite;
}

@keyframes pulse-dot-anim {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Quick Prompts Horizontal Scrollbar */
.ai-quick-prompts-wrapper {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.ai-quick-prompts-wrapper::-webkit-scrollbar {
    height: 4px;
}
.ai-quick-prompts-wrapper::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.ai-chip-btn {
    white-space: nowrap;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.4rem 0.85rem;
    border-radius: 20px;
    background-color: var(--ai-chip-bg) !important;
    border: 1px solid var(--ai-chip-border) !important;
    color: var(--ai-chip-text) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ai-chip-btn:hover {
    background-color: var(--primary) !important;
    color: #ffffff !important;
    border-color: var(--primary) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.ai-chat-messages-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden !important;
    padding-right: 4px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
}

.ai-chat-messages-container::-webkit-scrollbar {
    width: 5px;
}
.ai-chat-messages-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

/* Assistant Bubble */
.ai-msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(135deg, #a855f7, #6366f1);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

.ai-msg-content-bot {
    background-color: var(--ai-bg-bot-bubble) !important;
    border: 1px solid var(--ai-border-bot-bubble) !important;
    color: var(--text-main) !important;
    border-radius: 18px;
    border-top-left-radius: 4px;
    padding: 0.9rem 1.1rem;
    max-width: 88%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    position: relative;
    transition: border-color 0.2s ease;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    white-space: normal !important;
}

.ai-msg-content-bot *,
.ai-msg-content-user * {
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    max-width: 100% !important;
}

.ai-msg-content-bot * {
    color: var(--text-main);
}

/* User Bubble */
.ai-msg-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.ai-msg-content-user {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #ffffff !important;
    border-radius: 18px;
    border-top-right-radius: 4px;
    padding: 0.9rem 1.15rem;
    max-width: 85%;
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.3);
}

.ai-msg-content-user * {
    color: #ffffff !important;
}

/* Action toolbar on Bot Messages */
.ai-msg-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.75;
    transition: opacity 0.2s ease;
}

.ai-msg-content-bot:hover .ai-msg-actions {
    opacity: 1;
}

.ai-action-icon-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 3px 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.ai-action-icon-btn:hover {
    color: var(--primary);
    background: var(--bg-hover);
}

/* Typing Wave Dots */
.ai-typing-container {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: var(--ai-bg-bot-bubble);
    border: 1px solid var(--ai-border-bot-bubble);
    border-radius: 20px;
    width: fit-content;
}

.ai-typing-dot {
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    animation: ai-wave 1.3s infinite ease-in-out;
}

.ai-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}
.ai-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes ai-wave {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

/* Bottom Chat Input Bar - Ultra-Modern Glassmorphic Pill Container */
.ai-input-bar {
    background: var(--bg-card) !important;
    border: 1.5px solid rgba(99, 102, 241, 0.25) !important;
    border-radius: 30px !important;
    padding: 5px 8px 5px 16px !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(16px) !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative;
    z-index: 50;
    margin-top: 0.5rem;
}

html[data-theme="light"] .ai-input-bar {
    background: #ffffff !important;
    border: 1.5px solid rgba(99, 102, 241, 0.25) !important;
    box-shadow: 0 8px 24px -4px rgba(99, 102, 241, 0.12), 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

.ai-input-bar:focus-within {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25), 0 10px 30px -5px rgba(99, 102, 241, 0.3) !important;
    transform: translateY(-1px);
}

.ai-input-icon {
    font-size: 1.15rem;
    color: #6366f1 !important;
    flex-shrink: 0;
}

.ai-input-field,
.ai-input-field:focus,
.ai-input-field:active,
.ai-input-field:hover {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 0.5rem 0 !important;
    font-size: 0.95rem !important;
    font-weight: 400 !important;
    color: var(--text-main) !important;
    flex-grow: 1;
    min-width: 0;
}

.ai-input-field::placeholder {
    color: var(--text-muted) !important;
    font-size: 0.9rem !important;
    opacity: 0.75;
}

.ai-send-btn {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #6366f1, #4f46e5) !important;
    color: #ffffff !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1rem !important;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.45) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    flex-shrink: 0 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    position: relative;
    z-index: 60 !important;
    touch-action: manipulation !important;
}

.ai-send-btn i {
    pointer-events: none !important;
    transition: transform 0.2s ease;
}

.ai-send-btn:hover:not(:disabled) {
    transform: scale(1.06);
    background: linear-gradient(135deg, #4f46e5, #4338ca) !important;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6) !important;
}

.ai-send-btn:active:not(:disabled) {
    transform: scale(0.92) !important;
}

.ai-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
}


/* Mobile specific Pane Hiding/Showing & Full Viewport Flex Height */
@media (max-width: 991.98px) {
    .ai-pane-doc-col.d-mobile-none,
    .ai-pane-chat-col.d-mobile-none {
        display: none !important;
    }
    .ai-pane-doc-col, .ai-pane-chat-col {
        flex: 1 !important;
        height: 100% !important;
        min-height: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }
    .ai-pane-card {
        flex: 1 !important;
        height: 100% !important;
        min-height: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        border-radius: 0 !important;
        border: none !important;
        padding: 0.5rem 0.5rem calc(0.85rem + env(safe-area-inset-bottom, 16px)) 0.5rem !important;
        overflow: hidden !important;
    }
    .ai-chat-messages-container {
        flex: 1 !important;
        overflow-y: auto !important;
        overscroll-behavior: contain !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 0.5rem 0.25rem !important;
        margin-bottom: 0.25rem !important;
    }

    .ai-input-bar {
        margin-bottom: max(10px, env(safe-area-inset-bottom, 12px)) !important;
    }

    /* Hide permanent big header box on mobile to give 85% screen height to chat log */
    .ai-pane-card > .ai-header-box {
        display: none !important;
    }

    /* Hide global top navbar on mobile AI Chat page to reclaim 60px vertical height */
    .navbar-custom:has(~ .ai-page-container),
    #content-wrapper:has(.ai-page-container) .navbar-custom {
        display: none !important;
    }

    .ai-page-container {
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: hidden !important;
    }

    .ai-page-container > .card-custom {
        margin: 0 !important;
        border-radius: 0 !important;
        padding: 0.5rem 0.75rem !important;
        border-bottom: 1px solid var(--border-color) !important;
    }
}

/* Hide Floating FAB & Bottom Nav ONLY on AI Workspace Page */
body:has(.ai-page-container) .mobile-fab-container,
body:has(.ai-page-container) .mobile-bottom-nav,
.ai-page-container ~ .mobile-fab-container,
.ai-page-container ~ .mobile-bottom-nav {
    display: none !important;
}



/* ==========================================================================
   DrivePasundan Ultra-Comfort Mobile Ergonomics System (HP Optimized)
   ========================================================================== */
@media (max-width: 768px) {
    /* Prevent iOS/Android auto-zoom on form inputs */
    input, select, textarea, .form-control, .form-select {
        font-size: 16px !important;
        touch-action: manipulation;
    }

    /* Remove ugly grey tap highlights on touch screens & fast response */
    * {
        -webkit-tap-highlight-color: transparent;
    }

    /* Fast smooth scrolling on content container */
    html, body {
        overscroll-behavior-y: auto;
    }

    /* Active touch feedback for interactive elements */
    .btn:active, a.btn:active, .sidebar-link:active, .mobile-nav-item:active, .mobile-fab-main-btn:active {
        transform: scale(0.96) !important;
        transition: transform 0.08s ease !important;
    }

    /* Touch target sizes - minimum 44px height for comfortable thumb tap */
    .btn, a.btn, .sidebar-link {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    /* Content wrapper clearance for bottom navigation */
    #content-wrapper {
        padding-bottom: 92px !important;
    }

    /* Hide mobile bottom navigation bar on AI Chat page to give 100% screen height to chat log */
    #content-wrapper:has(.ai-page-container) {
        padding-bottom: 0 !important;
        height: 100vh !important;
        overflow: hidden !important;
    }
    body:has(.ai-page-container) .mobile-bottom-nav {
        display: none !important;
    }

    /* Sleek Floating Bottom Navigation Bar */
    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100vw;
        height: 64px;
        background: var(--bg-card);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 -6px 25px rgba(0, 0, 0, 0.2);
        z-index: 1045;
        backdrop-filter: blur(20px);
        display: flex;
        align-items: center;
        justify-content: space-around;
        padding: 0 4px;
    }

    .mobile-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: var(--text-muted);
        text-decoration: none;
        padding: 4px 0;
        font-size: 0.72rem;
        font-weight: 600;
        gap: 3px;
        transition: all 0.2s ease;
        border: none;
        background: transparent;
        cursor: pointer;
        min-height: 52px;
    }

    .mobile-nav-item i {
        font-size: 1.2rem;
        transition: transform 0.2s ease;
    }

    .mobile-nav-item.active, .mobile-nav-item:active {
        color: var(--primary) !important;
    }

    .mobile-nav-item.active i {
        transform: translateY(-2px);
    }

    .mobile-nav-center-btn {
        width: 48px;
        height: 48px;
        border-radius: 50%;
        background: linear-gradient(135deg, #6366f1, #4f46e5);
        color: #ffffff !important;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 6px 18px rgba(99, 102, 241, 0.45);
        margin-top: -18px;
        border: 3px solid var(--bg-card);
        font-size: 1.25rem;
    }

    /* Floating Action Button Clearance */
    .mobile-fab-container {
        bottom: 84px !important;
        right: 18px !important;
    }

    /* Mobile Modal Improvements */
    .modal-dialog {
        margin: 0.5rem auto !important;
        max-width: 95vw !important;
    }

    .modal-content {
        border-radius: 20px !important;
    }

    /* Card Touch Target Sizes */
    .btn-group .btn, .dropdown-toggle {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* Mobile Small Phone Optimizations (< 576px) */
@media (max-width: 575.98px) {
    .container-fluid {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        padding-top: 1rem !important;
    }

    /* Compact Mobile Card Row Layout */
    .file-card, .folder-card {
        padding: 0.85rem !important;
        border-radius: 16px !important;
    }

    .file-thumbnail {
        height: 115px !important;
    }

    .file-card .btn-group .btn {
        min-width: 40px !important;
        min-height: 40px !important;
        font-size: 0.9rem !important;
    }

    .dropdown-menu {
        max-width: 92vw !important;
    }
}

@media (min-width: 769px) {
    .mobile-bottom-nav {
        display: none !important;
    }
}

/* Custom Theme-Adaptive Styles for Live User Share Modal (Light & Dark Mode) */
.user-share-modal .modal-content {
    background-color: var(--bg-card) !important;
    color: var(--text-heading) !important;
    border: 1px solid var(--border-color) !important;
}

.user-share-modal .modal-header,
.user-share-modal .modal-footer {
    border-color: var(--border-color) !important;
}

.user-share-modal .item-target-banner {
    background-color: var(--bg-hover) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
}

.user-share-modal .item-target-banner .item-name {
    color: var(--text-heading) !important;
}

.user-share-modal .item-target-banner .item-label {
    color: var(--text-muted) !important;
}

.user-share-modal .share-input-group .input-group-text {
    background-color: var(--bg-hover) !important;
    border-color: var(--border-color) !important;
    color: var(--text-muted) !important;
}

.user-share-modal .share-input-group .form-control {
    background-color: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-heading) !important;
}

.user-share-modal .share-input-group .form-control::placeholder {
    color: var(--text-muted) !important;
    opacity: 0.7;
}

.user-share-modal .selected-users-box {
    background-color: var(--bg-hover) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
}

.user-share-modal .existing-share-item {
    background-color: var(--bg-hover) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-sm) !important;
    color: var(--text-heading) !important;
}

.user-share-modal .existing-share-item .user-name {
    color: var(--text-heading) !important;
}

.user-share-modal .existing-share-item .user-email {
    color: var(--text-muted) !important;
}

.user-share-modal .search-results-dropdown {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
}

.user-share-modal .search-results-dropdown .list-group-item {
    background-color: var(--bg-card) !important;
    color: var(--text-heading) !important;
    border-color: var(--border-color) !important;
}

.user-share-modal .search-results-dropdown .list-group-item:hover {
    background-color: var(--bg-hover) !important;
}

/* ==========================================================================
   DataTables Custom Styling System (Dark & Light Glassmorphism Harmony)
   ========================================================================== */
.dataTables_wrapper {
    padding: 16px 0;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    color: var(--text-muted) !important;
    font-size: 0.82rem;
    font-weight: 500;
}

.dataTables_wrapper .dataTables_filter {
    text-align: right;
}

.dataTables_wrapper .dataTables_filter input {
    background-color: var(--bg-main) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-heading) !important;
    border-radius: 20px !important;
    padding: 6px 14px !important;
    font-size: 0.82rem;
    outline: none;
    margin-left: 8px;
    transition: all 0.2s ease;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25) !important;
}

.dataTables_wrapper .dataTables_length select {
    background-color: var(--bg-main) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-heading) !important;
    border-radius: 12px !important;
    padding: 4px 10px !important;
    font-size: 0.82rem;
    margin: 0 6px;
    outline: none;
}

/* Bootstrap 5 DataTables Pagination Custom Styling */
.dataTables_wrapper .pagination {
    gap: 4px;
    margin-top: 8px;
    margin-bottom: 0;
    justify-content: flex-end;
}

.dataTables_wrapper .page-item .page-link {
    border-radius: 8px !important;
    border: 1px solid var(--border-color) !important;
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
    font-size: 0.8rem !important;
    font-weight: 600;
    padding: 6px 12px !important;
    transition: all 0.2s ease;
    box-shadow: none !important;
}

.dataTables_wrapper .page-item.active .page-link,
.dataTables_wrapper .dataTables_paginate .paginate_button.active,
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary) !important;
    background-color: var(--primary) !important;
    color: #ffffff !important;
    border-color: var(--primary) !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35) !important;
}

.dataTables_wrapper .page-item:hover:not(.active):not(.disabled) .page-link,
.dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.disabled) {
    background-color: var(--bg-hover) !important;
    color: var(--primary) !important;
    border-color: var(--primary) !important;
}

.dataTables_wrapper .page-item.disabled .page-link,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    background-color: var(--bg-card) !important;
    color: var(--text-muted) !important;
    opacity: 0.4;
    border-color: var(--border-color) !important;
    cursor: not-allowed;
}

table.dataTable {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    margin-top: 12px !important;
    margin-bottom: 12px !important;
    width: 100% !important;
}

table.dataTable thead th {
    border-bottom: 1px solid var(--border-color) !important;
    color: var(--text-muted) !important;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 16px !important;
    background-color: transparent !important;
}

table.dataTable tbody td {
    border-bottom: 1px solid var(--border-color) !important;
    padding: 12px 16px !important;
    color: var(--text-main) !important;
    vertical-align: middle;
}

table.dataTable tbody tr {
    background-color: transparent !important;
    transition: background-color 0.15s ease;
}

table.dataTable tbody tr:hover {
    background-color: var(--bg-hover) !important;
}

/* Light Theme Overrides for DataTables Controls */
html[data-theme="light"] .dataTables_wrapper .dataTables_filter input,
html[data-theme="light"] .dataTables_wrapper .dataTables_length select {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

html[data-theme="light"] .dataTables_wrapper .page-item .page-link {
    background-color: #ffffff !important;
    border-color: #e2e8f0 !important;
    color: #334155 !important;
}

html[data-theme="light"] .dataTables_wrapper .page-item.active .page-link {
    background-color: var(--primary) !important;
    color: #ffffff !important;
}



