.nav-link.active {
    background-color: #ffc107 !important;
    color: #000 !important;
    font-weight: bold;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    transition: all 0.2s ease;
}

.toggle-icon {
    transition: transform 0.3s ease;
    color: #ced4da;
    text-shadow: none;
    filter: none;
    line-height: 1;
}

.collapse.show .toggle-icon {
    transform: rotate(180deg);
}

.list-unstyled.ps-3 .nav-link {
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.list-unstyled.ps-3 .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-left-color: #ffc107;
    padding-left: 1.25rem;
}

.menu-item-icon {
    width: 20px;
    text-align: center;
}

/* Base layout styles migrated from layout.html */
html {
    height: 100%;
    margin: 0;
    overflow: hidden;
    font-family: 'Segoe UI', sans-serif;
    background-color: #f5f5f5;
    font-size: 0.9rem;
}

body {
    background: linear-gradient(to right, #eef2f3, #d9e4f5);
    font-family: 'Segoe UI', sans-serif;
    padding: 0px;
}

.fixed-btn {
    min-width: 110px;
    text-align: center;
}

.dashboard-card {
    border-radius: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.table th i {
    font-size: 1rem;
    vertical-align: middle;
}

.list-group-item {
    border: none;
    background: #f9fbff;
    border-radius: 0.5rem;
    margin-bottom: 0.4rem;
    padding: 0.7rem 1rem;
}

#app-container {
    display: flex;
    height: 100%;
    overflow: hidden;
}

.form-check-input {
    width: 1.3em;
    height: 1.3em;
    cursor: pointer;
}

#content-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

#sidebarMenu {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1045;
    transition: transform 0.3s ease-in-out, width 0.3s ease-in-out;
    overflow: hidden;
}

#sidebarMenu .offcanvas-body {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

#sidebarMenu .offcanvas-body::-webkit-scrollbar {
    width: 8px;
}

#sidebarMenu .offcanvas-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

#sidebarMenu .offcanvas-body::-webkit-scrollbar-track {
    background: transparent;
}

#content {
    flex: 1;
    overflow: auto;
    padding: 1.25rem;
    height: 100vh;
}

.breadcrumb-item+.breadcrumb-item::before {
    color: #6c757d;
}

.card.shadow-sm {
    border: none;
    border-radius: 10px;
}

.card-header {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 10px 10px 0 0;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

.btn-outline-primary {
    color: #667eea;
    border-color: #667eea;
}

.btn-outline-primary:hover {
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
}

.chart-container {
    position: relative;
    height: 320px;
}

.progress {
    height: 8px;
    border-radius: 10px;
}

.metric-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.table > :not(caption) > * > * {
    padding: 0.65rem 0.75rem;
}

.header-icon {
    transition: transform 0.2s ease;
}

.header-icon:hover {
    transform: scale(1.08);
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.75rem 0;
}

.page-header .page-title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: #3b82f6;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-header .page-title i {
    color: #3b82f6;
    font-size: 1.1rem;
}

.page-header .page-subtitle {
    margin: 0.1rem 0 0 0;
    color: #6b7280;
    font-size: 0.9rem;
}

/* Default page heading fallback for pages without .page-header */
#content h1,
#content h2,
#content h3,
#content h4 {
    color: #3b82f6;
    font-weight: 700;
}

.dropdown-menu {
    border-radius: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.search-input {
    width: 100%;
    padding: 0.5rem 2.2rem 0.5rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    font-size: 0.9rem;
    color: #212529;
    background-color: #fff;
}

.search-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #007bff;
    cursor: pointer;
}

.search-input::placeholder {
    color: #6c757d;
    opacity: 1;
}

.popular-searches {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1050;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 0.375rem;
    width: 100%;
    max-height: 180px;
    overflow-y: auto;
}

.popular-searches li {
    padding: 0.5rem;
    cursor: pointer;
}

.popular-searches li:hover {
    background: #f8f9fa;
}

.search-wrapper {
    position: relative;
    width: 250px;
}

/* Collapsed state helpers */
.sidebar-collapsed-on-load #sidebarMenu {
    width: 75px !important;
    overflow: hidden !important;
}

.sidebar-collapsed-on-load #content-wrapper {
    margin-left: 75px !important;
}

.sidebar-collapsed-on-load .sidebar-toggle-btn {
    left: 80px !important;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
}

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

.sidebar-collapsed-on-load #sidebarMenu .nav-link {
    font-size: 0 !important;
    justify-content: center !important;
}

.sidebar-collapsed-on-load #sidebarMenu .nav-link > span {
    font-size: 0 !important;
}

.sidebar-collapsed-on-load #sidebarMenu .nav-link > span i:first-child,
.sidebar-collapsed-on-load #sidebarMenu .nav-link > span .bi:first-child,
.sidebar-collapsed-on-load #sidebarMenu .nav-link > i:first-child,
.sidebar-collapsed-on-load #sidebarMenu .nav-link > .bi:first-child {
    font-size: 1.1rem !important;
}

.sidebar-collapsed-on-load #sidebarMenu .nav-link .badge {
    display: none !important;
}

/* Submenu and offcanvas tweaks (from menu fragments) */
.submenu-item .submenu-toggle {
    cursor: pointer;
    font-weight: 500;
}

.submenu-item .submenu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.submenu {
    background-color: rgba(0, 0, 0, 0.2);
    border-left: 2px solid #ffc107;
    margin-left: 0.5rem;
}

.submenu li {
    margin-bottom: 0.25rem;
}

.submenu .nav-link {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
}

.submenu .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.15);
    padding-left: 1.5rem;
    transition: all 0.2s ease;
}

.offcanvas-header button:hover {
    transform: rotate(90deg) scale(1.1);
}

.offcanvas-title {
    letter-spacing: 0.5px;
}

.collapse.show + .nav-link .toggle-icon {
    transform: rotate(180deg);
}

