.sp-theme-dropdown {
    position: relative;
    display: inline-block;
    margin-right: 15px;
}

.sp-theme-toggle {
    background: transparent;
    border: none;
    color: var(--sp-text-header);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.15s ease;
}

.sp-theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sp-theme-current {
    font-size: 13px;
}

.sp-theme-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--sp-bg-secondary);
    border: 1px solid var(--sp-border-color);
    border-radius: 6px;
    min-width: 120px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    list-style: none;
    padding: 6px 0;
    margin: 5px 0 0 0;
    z-index: 1100;
}

.sp-theme-dropdown.open .sp-theme-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sp-theme-menu li {
    margin: 0;
    padding: 0;
}

.sp-theme-option {
    display: block;
    padding: 10px 15px;
    color: var(--sp-text-primary);
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.sp-theme-option:hover {
    background-color: var(--sp-bg-card);
    color: var(--sp-text-primary);
    text-decoration: none;
}

.sp-theme-option.active {
    background-color: var(--sp-accent-primary);
    color: #fff;
}

/* ====================== */
/* MODAL ENHANCEMENTS     */
/* ====================== */
/* Modal backdrop */
.sp-dashboard .modal-backdrop {
    background-color: rgba(0, 0, 0, 0.6);
}

/* Modal close button enhanced */
.sp-dashboard .modal-header .close {
    color: #fff;
    opacity: 0.8;
    text-shadow: none;
    font-size: 28px;
    font-weight: 300;
    padding: 0;
    margin: 0;
    line-height: 1;
    background: transparent;
    border: none;
    cursor: pointer;
}

.sp-dashboard .modal-header .close:hover {
    opacity: 1;
}

/* Modal sizing fix */
.sp-dashboard .modal-dialog {
    max-width: 90vw;
}

.sp-dashboard .modal-lg {
    width: 900px;
    max-width: 90vw;
}

/* Upload modal specific */
.sp-dashboard #fileUploadPopup .modal-dialog, .sp-dashboard #uploaderPopup .modal-dialog {
    width: 700px;
    max-width: 90vw;
}

.sp-dashboard #fileUploadPopup .modal-content, .sp-dashboard #uploaderPopup .modal-content {
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sp-dashboard #fileUploadPopup .modal-body, .sp-dashboard #uploaderPopup .modal-body {
    overflow-y: auto;
    flex: 1;
}

/* Search modal specific */
.sp-dashboard #filterModal .modal-dialog {
    width: 800px;
    max-width: 90vw;
}

/* ====================== */
/* ICON FIXES             */
/* ====================== */
/* Custom icon definitions for missing icons */
.fa-diamond:before { content: "\f219"; }
.entypo-balance-scale:before { content: '\e85b'; }
.entypo-user-secret:before { content: '\e80a'; }
.entypo-hammer:before { content: '\e856'; }
.entypo-your_files:before { content: '\e850'; }
.entypo-upgrade:before { content: '\e808'; }
.entypo-rewards_logged_in:before { content: '\e8a8'; }
.entypo-vouchers:before { content: '\e8cb'; }
.entypo-settings:before { content: '\e855'; }

/* ====================== */
/* DROPDOWN FIX           */
/* ====================== */
/* Ensure dropdowns appear above other content */
.sp-dashboard .dropdown-menu {
    z-index: 1050;
}

.sp-dashboard .sp-dropdown-menu {
    z-index: 1050;
}

/* User dropdown fix - ensure it stays on screen */
.sp-dashboard .sp-user-dropdown + .dropdown-menu {
    right: 0;
    left: auto;
    transform: none;
}

/* ====================== */
/* SIDEBAR SUBMENU FIX    */
/* ====================== */
.sp-sidebar-item.has-submenu.submenu-open .sp-sidebar-submenu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.sp-sidebar-item.has-submenu.submenu-open .sp-sidebar-tooltip {
    display: none;
}

/* ====================== */
/* FILE PREVIEW FIX       */
/* ====================== */
.sp-dashboard .file-preview img {
    max-width: 100%;
    height: auto;
}

.sp-dashboard .file-preview-container {
    background-color: var(--sp-bg-card);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

/* Download button in file view */
.sp-dashboard .download-file-btn, .sp-dashboard a.download-btn {
    background-color: var(--sp-accent-primary);
    color: #fff;
    padding: 12px 24px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.15s ease;
}

.sp-dashboard .download-file-btn:hover, .sp-dashboard a.download-btn:hover {
    background-color: var(--sp-accent-primary);
    color: #fff;
    text-decoration: none;
}

/* ====================== */
/* HIGH SPECIFICITY CORE.CSS OVERRIDES */
/* ====================== */
/* These rules override core.css with higher specificity */

/* Sidebar width override - core.css sets 240px */
body.sp-dashboard .sidebar-menu, body.sp-dashboard .sidebar-menu.fixed, body.sp-dashboard .sidebar-menu.sp-sidebar, .page-body.sp-dashboard .sidebar-menu, .page-body.sp-dashboard .sidebar-menu.fixed {
    width: 70px;
    width: var(--sp-sidebar-width);
    background-color: var(--sp-bg-header); /* var(--sp-bg-sidebar); */
    padding: 0;
}

/* Main content offset for narrow sidebar */
body.sp-dashboard .page-container, body.sp-dashboard.page-body .page-container {
    padding-left: 70px;
    padding-left: var(--sp-sidebar-width);
}

/* Header positioning */
body.sp-dashboard .navbar-fixed-top, body.sp-dashboard .sp-header {
    margin-left: 0;
    left: 0;
}

/* Dropdown menu positioning - prevent off-screen */
body.sp-dashboard .dropdown-menu-right {
    right: 0;
    left: auto;
}

body.sp-dashboard .sp-header-right .dropdown-menu {
    right: 0;
    left: auto;
    max-width: calc(100vw - 20px);
}

/* Remove sidebar inner padding */
body.sp-dashboard .sidebar-menu-inner {
    padding: 0;
}

/* Override sidebar list styles */
body.sp-dashboard .sidebar-menu > ul, body.sp-dashboard .sidebar-menu ul.sp-sidebar-nav {
    padding: 0;
    margin: 0;
}

body.sp-dashboard .sidebar-menu > ul > li, body.sp-dashboard .sidebar-menu ul.sp-sidebar-nav > li {
    padding: 0;
    margin: 4px 0;
}

body.sp-dashboard .sidebar-menu > ul > li > a {
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Prevent sidebar link text (we only show icons) */
body.sp-dashboard .sidebar-menu > ul > li > a > span:not(.sp-sidebar-tooltip) {
    display: none;
}

/* Hide sidebar arrows/carets */
body.sp-dashboard .sidebar-menu .has-sub > a:after, body.sp-dashboard .sidebar-menu .accordion-menu > li > a:after {
    display: none;
}

/* Reset sidebar background gradients from core.css */
body.sp-dashboard .sidebar-menu {
    background-image: none;
    background-color: var(--sp-bg-sidebar);
}

/* Toolbar offset from header */
body.sp-dashboard .sp-toolbar {
    margin-top: 0;
    position: sticky;
    top: var(--sp-header-height);
	z-index: 1;
}

/* Main content area positioning */
body.sp-dashboard .sp-main {
    margin-top: var(--sp-header-height);
	margin-left: 0;
    min-height: calc(100vh - var(--sp-header-height));
}

/* File listing container */
body.sp-dashboard .fileManager, body.sp-dashboard .fileManagerIcon, body.sp-dashboard .fileManagerList {
    background-color: transparent;
}

/* Remove box shadows from core.css panels */
body.sp-dashboard .panel {
    box-shadow: none;
    border: 1px solid var(--sp-border-color);
}

/* Modal z-index fixes */
body.sp-dashboard .modal {
    z-index: 1050;
}

body.sp-dashboard .modal-backdrop {
    z-index: 1040;
}

/* Header z-index */
body.sp-dashboard .sp-header {
    z-index: 1030;
}

/* Sidebar z-index */
body.sp-dashboard .sp-sidebar {
    z-index: 1020;
}

/* Ensure tooltips appear above sidebar */
body.sp-dashboard .sp-sidebar-tooltip {
    z-index: 1025;
}

/* Remove default list bullets in sidebar */
body.sp-dashboard .sp-sidebar ul, body.sp-dashboard .sp-sidebar li {
    list-style: none;
}


/* ===== From dashboard-overrides.css ===== */

/**
 * SaberPod Dashboard Overrides
 * Integration styles and core.css overrides
 */

/* Hidden elements in new layout */
.sp-dashboard .sidebar-menu:not(.sp-sidebar) {
    display: none;
}

/* ====================== */
/* CORE.CSS OVERRIDES     */
/* ====================== */

/* Reset sidebar-menu width from core.css (240px -> 70px) */
.sp-dashboard .sidebar-menu.sp-sidebar {
    width: var(--sp-sidebar-width);
    background-color: var(--sp-bg-sidebar);
    padding: 0;
}
