@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

body {
    font-family: 'Poppins', sans-serif;
    background: #f5f5f5;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100vw;
    z-index: 1050;
    min-height: 64px;
    height: 64px;
    background: #343A40 !important;
    background-image: none !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid #e0e0e0;
}

.navbar .container-fluid {
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    position: relative;
}

.navbar .navbar-brand,
.navbar .nav-link {
    color: #fff !important;
}

.navbar .nav-link:hover {
    color: #2196f3 !important;
}

.btn-primary {
    background: #007BFF !important;
    background-image: none !important;
    border-color: #007BFF !important;
}

.btn-primary:hover {
    background: #0056b3 !important;
    background-image: none !important;
    border-color: #0056b3 !important;
}

.btn-success {
    background: #28A745 !important;
    background-image: none !important;
    border-color: #28A745 !important;
}

.btn-success:hover {
    background: #1e7e34 !important;
    background-image: none !important;
    border-color: #1e7e34 !important;
}

.btn-danger {
    background: #DC3545 !important;
    background-image: none !important;
    border-color: #DC3545 !important;
}

.btn-danger:hover {
    background: #c82333 !important;
    background-image: none !important;
    border-color: #c82333 !important;
}

.btn-info {
    background: #17A2B8 !important;
    background-image: none !important;
    border-color: #17A2B8 !important;
}

.btn-info:hover {
    background: #138496 !important;
    background-image: none !important;
    border-color: #138496 !important;
}

.btn-secondary {
    background: #6C757D !important;
    background-image: none !important;
    border-color: #6C757D !important;
}

.btn-secondary:hover {
    background: #545b62 !important;
    background-image: none !important;
    border-color: #545b62 !important;
}

.btn-warning {
    background: #FFC107 !important;
    background-image: none !important;
    border-color: #FFC107 !important;
}

.btn-warning:hover {
    background: #e0a800 !important;
    background-image: none !important;
    border-color: #e0a800 !important;
}

.card {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    background: #fff;
}

.card-header {
    background: #E9ECEF !important;
    background-image: none !important;
}

.card-header.bg-primary {
    background: #007BFF !important;
    background-image: none !important;
}

.card-header.bg-success {
    background: #28A745 !important;
    background-image: none !important;
}

.card-header.bg-info {
    background: #17A2B8 !important;
    background-image: none !important;
}

.card-header.bg-secondary {
    background: #6C757D !important;
    background-image: none !important;
}

.card-header.bg-warning {
    background: #FFC107 !important;
    background-image: none !important;
}

.card-header.bg-danger {
    background: #DC3545 !important;
    background-image: none !important;
}

.progress-bar {
    background-image: none !important;
}

.progress-bar.bg-primary {
    background: #007BFF !important;
    background-image: none !important;
}

.progress-bar.bg-success {
    background: #28A745 !important;
    background-image: none !important;
}

.progress-bar.bg-info {
    background: #17A2B8 !important;
    background-image: none !important;
}

.progress-bar.bg-secondary {
    background: #6C757D !important;
    background-image: none !important;
}

.progress-bar.bg-warning {
    background: #FFC107 !important;
    background-image: none !important;
}

.progress-bar.bg-danger {
    background: #DC3545 !important;
    background-image: none !important;
}

.badge {
    background-image: none !important;
}

.badge.bg-primary {
    background: #007BFF !important;
    background-image: none !important;
}

.badge.bg-success {
    background: #28A745 !important;
    background-image: none !important;
}

.badge.bg-info {
    background: #17A2B8 !important;
    background-image: none !important;
}

.badge.bg-secondary {
    background: #6C757D !important;
    background-image: none !important;
}

.badge.bg-warning {
    background: #FFC107 !important;
    background-image: none !important;
}

.badge.bg-danger {
    background: #DC3545 !important;
    background-image: none !important;
}

.alert-primary {
    background: #cce7ff !important;
    background-image: none !important;
    border-color: #b3d9ff !important;
    color: #004085 !important;
}

.alert-success {
    background: #d4edda !important;
    background-image: none !important;
    border-color: #c3e6cb !important;
    color: #155724 !important;
}

.alert-info {
    background: #d1ecf1 !important;
    background-image: none !important;
    border-color: #bee5eb !important;
    color: #0c5460 !important;
}

.alert-secondary {
    background: #e2e3e5 !important;
    background-image: none !important;
    border-color: #d6d8db !important;
    color: #383d41 !important;
}

.alert-warning {
    background: #fff3cd !important;
    background-image: none !important;
    border-color: #ffeaa7 !important;
    color: #856404 !important;
}

.alert-danger {
    background: #f8d7da !important;
    background-image: none !important;
    border-color: #f5c6cb !important;
    color: #721c24 !important;
}

.list-group-item-primary {
    background: #cce7ff !important;
    background-image: none !important;
    color: #004085 !important;
}

.list-group-item-success {
    background: #d4edda !important;
    background-image: none !important;
    color: #155724 !important;
}

.list-group-item-info {
    background: #d1ecf1 !important;
    background-image: none !important;
    color: #0c5460 !important;
}

.list-group-item-secondary {
    background: #e2e3e5 !important;
    background-image: none !important;
    color: #383d41 !important;
}

.list-group-item-warning {
    background: #fff3cd !important;
    background-image: none !important;
    color: #856404 !important;
}

.list-group-item-danger {
    background: #f8d7da !important;
    background-image: none !important;
    color: #721c24 !important;
}

.modal-header {
    background: #f8f9fa !important;
    background-image: none !important;
}

.modal-footer {
    background: #f8f9fa !important;
    background-image: none !important;
}

.dropdown-menu {
    background: #fff !important;
    background-image: none !important;
}

.dropdown-item:hover {
    background: #f8f9fa !important;
    background-image: none !important;
}

.page-link {
    background: #fff !important;
    background-image: none !important;
}

.page-link:hover {
    background: #e9ecef !important;
    background-image: none !important;
}

.page-item.active .page-link {
    background: #007BFF !important;
    background-image: none !important;
}

.tooltip-inner {
    background: #000 !important;
    background-image: none !important;
}

.popover {
    background: #fff !important;
    background-image: none !important;
}

.popover-header {
    background: #f8f9fa !important;
    background-image: none !important;
}

.breadcrumb {
    background: #f8f9fa !important;
    background-image: none !important;
}

.jumbotron {
    background: #e9ecef !important;
    background-image: none !important;
}

.well {
    background: #f8f9fa !important;
    background-image: none !important;
}

.panel {
    background: #fff !important;
    background-image: none !important;
}

.panel-heading {
    background: #f8f9fa !important;
    background-image: none !important;
}

.panel-primary > .panel-heading {
    background: #007BFF !important;
    background-image: none !important;
}

.panel-success > .panel-heading {
    background: #28A745 !important;
    background-image: none !important;
}

.panel-info > .panel-heading {
    background: #17A2B8 !important;
    background-image: none !important;
}

.panel-warning > .panel-heading {
    background: #FFC107 !important;
    background-image: none !important;
}

.panel-danger > .panel-heading {
    background: #DC3545 !important;
    background-image: none !important;
}

.nav-pills > li > a {
    background: #f8f9fa !important;
    background-image: none !important;
}

.nav-pills > li.active > a {
    background: #007BFF !important;
    background-image: none !important;
}

.nav-tabs > li > a {
    background: #f8f9fa !important;
    background-image: none !important;
}

.nav-tabs > li.active > a {
    background: #fff !important;
    background-image: none !important;
}

.navbar-brand {
    position: static !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #fff !important;
    font-weight: 600 !important;
    font-size: 1.3rem !important;
    letter-spacing: 0.5px !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1) !important;
    font-family: 'Poppins', sans-serif !important;
    transition: none !important;
    height: 64px;
    display: flex;
    align-items: center;
    z-index: 1;
}

.navbar-toggle {
    background: transparent !important;
    background-image: none !important;
}

.navbar-collapse {
    background: transparent !important;
    background-image: none !important;
}

.navbar-form {
    background: transparent !important;
    background-image: none !important;
}

.navbar-text {
    color: #fff !important;
}

.navbar-link {
    color: #fff !important;
}

.navbar-btn {
    background: transparent !important;
    background-image: none !important;
}

.navbar-nav > li > a {
    color: #fff !important;
}

.navbar-nav > li.active > a {
    background: rgba(255, 255, 255, 0.1) !important;
    background-image: none !important;
}

.navbar-nav > li.open > a {
    background: rgba(255, 255, 255, 0.1) !important;
    background-image: none !important;
}

.navbar-nav > li.disabled > a {
    color: #999 !important;
}

.navbar-nav > li.dropdown > a {
    color: #fff !important;
}

.navbar-nav > li.dropdown.open > a {
    background: rgba(255, 255, 255, 0.1) !important;
    background-image: none !important;
}

.navbar-nav > li.dropdown.disabled > a {
    color: #999 !important;
}

.navbar-nav > li.dropdown-header {
    color: #999 !important;
}

.navbar-nav > li.divider {
    background: #e5e5e5 !important;
    background-image: none !important;
}

.navbar-nav > li > a:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    background-image: none !important;
}

.navbar-nav > li > a:focus {
    background: rgba(255, 255, 255, 0.1) !important;
    background-image: none !important;
}

.navbar-nav > li.active > a:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    background-image: none !important;
}

.navbar-nav > li.active > a:focus {
    background: rgba(255, 255, 255, 0.15) !important;
    background-image: none !important;
}

.navbar-nav > li.open > a:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    background-image: none !important;
}

.navbar-nav > li.open > a:focus {
    background: rgba(255, 255, 255, 0.15) !important;
    background-image: none !important;
}

.navbar-nav > li.disabled > a:hover {
    background: transparent !important;
    background-image: none !important;
}

.navbar-nav > li.disabled > a:focus {
    background: transparent !important;
    background-image: none !important;
}

.navbar-nav > li.dropdown > a:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    background-image: none !important;
}

.navbar-nav > li.dropdown > a:focus {
    background: rgba(255, 255, 255, 0.1) !important;
    background-image: none !important;
}

.navbar-nav > li.dropdown.open > a:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    background-image: none !important;
}

.navbar-nav > li.dropdown.open > a:focus {
    background: rgba(255, 255, 255, 0.15) !important;
    background-image: none !important;
}

.navbar-nav > li.dropdown.disabled > a:hover {
    background: transparent !important;
    background-image: none !important;
}

.navbar-nav > li.dropdown.disabled > a:focus {
    background: transparent !important;
    background-image: none !important;
}

.navbar-nav > li.dropdown-header:hover {
    background: transparent !important;
    background-image: none !important;
}

.navbar-nav > li.dropdown-header:focus {
    background: transparent !important;
    background-image: none !important;
}

.navbar-nav > li.divider:hover {
    background: #e5e5e5 !important;
    background-image: none !important;
}

.navbar-nav > li.divider:focus {
    background: #e5e5e5 !important;
    background-image: none !important;
}

/* Original Sidebar Styles - Only changing active state colors */
.main-sidebar {
    top: 64px;
    height: calc(100vh - 64px);
    transition: none !important;
    position: fixed;
    left: 0;
    z-index: 1040;
    background: #fff;
    padding-top: 0;
    width: 230px;
    -webkit-box-shadow: 1px 3px 7px rgba(0, 0, 0, 0.3);
    box-shadow: 1px 3px 7px rgba(0, 0, 0, 0.3);
    overflow: hidden; /* 防止整个侧边栏滚动，让内部.sidebar处理滚动 */
}

.sidebar {
    padding-bottom: 10px;
    font-size: 16px;
    height: calc(100vh - 64px); /* 全屏高度减去导航栏高度 */
    overflow-y: auto; /* 允许垂直滚动 */
    overflow-x: hidden; /* 隐藏水平滚动 */
}

.sidebar-menu {
    list-style: none;
    margin: 0 0 0 0;
    padding: 0;
    white-space: nowrap;
    overflow: visible; /* 修改为可见，允许内容显示 */
}

.sidebar-menu:hover {
    overflow: visible;
}

.sidebar-menu > li {
    position: relative;
    margin: 0;
    padding: 0;
}

.sidebar-menu > li > a {
    padding: 0;
    text-align: left;
    margin-bottom: 0;
    height: 70px;
    display: flex;
    align-items: center;
    padding-left: 15px;
    padding-right: 15px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    background-color: #fff;
    font-size: 15px;
}

.sidebar-menu > li > a:hover {
    background-color: #f8f9fa;
    color: #007BFF;
}

/* Quantum Able Active State Colors - Border on right side */
.sidebar-menu > li.active > a {
    background-color: #e3f2fd !important;
    color: #007bff !important;
    border-right: 3px solid #007bff !important;
}

.sidebar-menu > li > a > i {
    padding-right: 6px;
    display: inline;
    width: 20px;
    text-align: center;
}

.nav-level {
    padding: 10px 25px 10px 15px;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    color: #999;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.treeview {
    position: relative;
}

.treeview > a {
    position: relative;
}

.waves-effect {
    position: relative;
    cursor: pointer;
    display: inline-block;
    overflow: hidden;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.waves-dark {
    background-color: rgba(0, 0, 0, 0.2);
}

/* Icon styles - using Simple Line Icons */
.icon-home:before { content: "\e069"; font-family: 'simple-line-icons'; }
.icon-briefcase:before { content: "\e049"; font-family: 'simple-line-icons'; }
.icon-list:before { content: "\e067"; font-family: 'simple-line-icons'; }
.icon-docs:before { content: "\e04c"; font-family: 'simple-line-icons'; }
.icon-envelope:before { content: "\e086"; font-family: 'simple-line-icons'; }
.icon-people:before { content: "\e001"; font-family: 'simple-line-icons'; }

/* Content wrapper adjustments */
#content-wrapper {
    padding-top: 80px !important;
    margin-left: 230px;
    transition: margin-left 0.3s ease-in-out;
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .main-sidebar {
        top: 64px;
        height: calc(100vh - 64px);
        transition: none !important;
    }
    #content-wrapper {
        padding-top: 80px !important;
        margin-left: 0;
    }
}

/* Override existing sidebar styles */
#sidebar {
    display: none;
}

/* Hide the old sidebar toggle */
#sidebar-toggle {
    display: none;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    padding-left: 20px !important;
}

.sidebar-toggle:hover {
    color: #007bff;
}

/* Align toggle button with collapsed sidebar */
.sidebar-mini.sidebar-collapse .sidebar-toggle {
    position: static !important;
    margin: 0 !important;
    padding-left: 20px !important;
    color: #fff !important;
    transition: none !important;
}

/* Adjust navbar container for collapsed state */
.sidebar-mini.sidebar-collapse .navbar .container-fluid {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

/* Override Bootstrap container-fluid padding when sidebar is collapsed */
.sidebar-mini.sidebar-collapse .navbar .container-fluid {
    padding-left: 0 !important;
    padding-right: 1rem !important;
}

/* Position toggle button correctly */
.sidebar-mini.sidebar-collapse .sidebar-toggle {
    position: static !important;
    margin-left: 0 !important;
    margin-right: 1rem;
    transition: none !important;
}

/* Ensure navbar has relative positioning for absolute toggle button */
.sidebar-mini.sidebar-collapse .navbar {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1050;
    transition: none !important;
}

/* Position navbar brand to the right of toggle button when sidebar is collapsed */
.sidebar-mini.sidebar-collapse .navbar-brand {
    margin-left: 0 !important;
    color: #fff !important;
}

/* Collapsed Sidebar Styles */
.sidebar-mini.sidebar-collapse .main-sidebar {
    width: 70px;
}

.sidebar-mini.sidebar-collapse .main-sidebar .sidebar-menu > li > a > span,
.sidebar-mini.sidebar-collapse .main-sidebar .nav-level {
    display: none;
}

.sidebar-mini.sidebar-collapse .main-sidebar .sidebar-menu > li > a {
    padding: 0;
    text-align: center;
    margin-bottom: 0;
    height: 70px;
    width: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-mini.sidebar-collapse .main-sidebar .sidebar-menu > li > a > i {
    padding-right: 0;
    width: 100%;
    text-align: center;
    font-size: 18px;
}

.sidebar-mini.sidebar-collapse #content-wrapper {
    margin-left: 70px;
}

/* Quantum Able Active State for collapsed sidebar - Border on right side */
.sidebar-mini.sidebar-collapse .main-sidebar .sidebar-menu > li.active > a {
    background: #e3f2fd !important;
    color: #007bff !important;
    border-right: 3px solid #007bff !important;
}

/* Responsive adjustments for collapsed sidebar */
@media (max-width: 767px) {
    .sidebar-mini.sidebar-collapse .main-sidebar {
        width: 230px;
    }
    
    .sidebar-mini.sidebar-collapse .main-sidebar .sidebar-menu > li > a > span,
    .sidebar-mini.sidebar-collapse .main-sidebar .nav-level {
        display: block;
    }
    
    .sidebar-mini.sidebar-collapse .main-sidebar .sidebar-menu > li > a {
        padding: 12px 5px 12px 15px;
        text-align: left;
        height: auto;
        width: auto;
        display: block;
    }
    
    .sidebar-mini.sidebar-collapse .main-sidebar .sidebar-menu > li > a > i {
        padding-right: 6px;
        width: 20px;
        text-align: center;
    }
    
    .sidebar-mini.sidebar-collapse #content-wrapper {
        margin-left: 0;
    }
}

/* Tooltip functionality for collapsed sidebar - Quantum Able approach */
.sidebar-mini.sidebar-collapse .main-sidebar .sidebar-menu > li > a {
    position: relative;
    overflow: visible;
}

/* Quantum Able exact implementation */
.sidebar-mini.sidebar-collapse .main-sidebar .sidebar-menu > li:hover > a > span {
    display: block !important;
    position: absolute !important;
    width: 190px !important;
    left: 70px !important;
    top: 0 !important;
    padding: 0 5px 0 20px !important;
    background: #fff !important;
    color: #666 !important;
    box-shadow: 2px 1px 5px 1px rgba(128, 128, 128, 0.28) !important;
    white-space: nowrap !important;
    z-index: 1000 !important;
    border-top-right-radius: 4px !important;
    border-bottom-right-radius: 4px !important;
    font-size: 15px !important;
    line-height: 1.2 !important;
    height: 70px !important;
    display: flex !important;
    align-items: center !important;
}

.navbar .container-fluid {
    display: flex;
    align-items: center;
    padding: 0 !important;
    margin: 0 !important;
    position: relative;
}

/* Remove sidebar-collapse-specific navbar-brand and toggle rules */
.sidebar-mini.sidebar-collapse .navbar-brand,
.sidebar-mini.sidebar-collapse .sidebar-toggle {
    position: static !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #fff !important;
    transition: none !important;
}

/* Force base style for .navbar-brand and .sidebar-toggle */
.navbar-brand {
    position: static !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #fff !important;
    font-weight: 600 !important;
    font-size: 1.3rem !important;
    letter-spacing: 0.5px !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1) !important;
    font-family: 'Poppins', sans-serif !important;
    transition: none !important;
    height: 64px;
    display: flex;
    align-items: center;
    z-index: 1;
}

.sidebar-toggle {
    position: static !important;
    margin: 0 1rem 0 0 !important;
    color: #fff !important;
    transition: none !important;
    z-index: 2;
}

.navbar-nav.ms-auto {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    display: flex;
    align-items: center;
    margin: 0 !important;
    padding: 0 !important;
}
