:root {
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --primary-color: #2563eb;
    --header-bg: #2563eb;
    --header-text: #ffffff;
    --table-hover-bg: rgba(0, 0, 0, 0.075);
    --sidebar-width: 60px;
}

:root.dark-mode {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --primary-color: #3b82f6;
    --header-bg: #1e293b;
    --header-text: #f1f5f9;
    --table-hover-bg: rgba(255, 255, 255, 0.1);
}

/* Custom Bootstrap extensions */
.bg-purple {
    background-color: #6f42c1 !important;
}

.text-bg-purple {
    color: #fff !important;
    background-color: #6f42c1 !important;
}

/* Force sidebar collapse menu links to correct color immediately */
.sidebar-item.dropdown-item-parent .collapse a {
    color: var(--text-main) !important;
}

html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    transition: background-color 0.3s, color 0.3s;
    overflow-x: hidden;
}

.card {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-main);
}

.table {
    color: var(--text-main);
    --bs-table-color: var(--text-main);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--border-color);
    --bs-table-hover-bg: var(--table-hover-bg);
    --bs-table-hover-color: var(--text-main);
    --bs-table-striped-color: var(--text-main);
    --bs-table-striped-bg: rgba(0, 0, 0, 0.05);
}

:root.dark-mode .table {
    --bs-table-striped-bg: rgba(255, 255, 255, 0.05);
}

/* ===== SIDEBAR NAVIGATION ===== */

/* Top navbar */
.navbar {
    height: 60px;
    padding: 0.5rem 0 !important;
    padding-left: var(--sidebar-width) !important;
    transition: none;
}

.navbar-brand {
    font-size: 1.1rem;
    padding: 0 !important;
    gap: 0.75rem !important;
    margin-right: auto !important;
}

.navbar-brand img {
    height: 40px !important;
}

/* Main sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 60px;
    height: calc(100vh - 60px);
    width: var(--sidebar-width);
    background-color: var(--bg-card);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    overflow-x: hidden;
    transition: none;
    z-index: 1020;
    will-change: width;
}

.sidebar.expanded {
    width: var(--sidebar-width);
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-item {
    position: relative;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

button.sidebar-link {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.sidebar-link:hover {
    background-color: var(--table-hover-bg);
    color: var(--primary-color);
}

.sidebar-link.active {
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    border-left: 3px solid var(--primary-color);
    padding-left: calc(1rem - 3px);
}

.sidebar-link i:first-child {
    width: 1.5rem;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-link span {
    display: none;
}

.sidebar.expanded .sidebar-link span {
    display: inline;
}

html.sidebar-expanded .sidebar-link span {
    display: inline;
}

.sidebar.expanded .sidebar-link {
    padding: 0.75rem 1rem;
}

/* Sidebar submenu */
.sidebar-item.dropdown-item-parent {
    position: relative;
}

.sidebar-item.dropdown-item-parent > .collapse,
.sidebar-item.dropdown-item-parent > .collapsing {
    position: fixed;
    top: auto;
    left: 70px;
    width: 220px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    display: none !important;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

.sidebar-item.dropdown-item-parent > .collapse.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    display: block !important;
}

.sidebar-item.dropdown-item-parent > .collapsing {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    display: block !important;
}

.sidebar.expanded .sidebar-item.dropdown-item-parent > .collapse {
    position: static;
    border: none;
    box-shadow: none;
    background-color: transparent;
    width: auto;
    opacity: 1;
    visibility: visible;
    display: none;
}

.sidebar.expanded .sidebar-item.dropdown-item-parent > .collapse.show {
    display: block;
}

html.sidebar-expanded .sidebar-item.dropdown-item-parent > .collapse {
    position: static;
    border: none;
    box-shadow: none;
    background-color: transparent;
    width: auto;
    opacity: 1;
    visibility: visible;
    display: none;
}

html.sidebar-expanded .sidebar-item.dropdown-item-parent > .collapse.show {
    display: block;
}

.sidebar-item.dropdown-item-parent .collapse li,
.sidebar-item.dropdown-item-parent .collapsing li {
    padding: 0;
    list-style: none;
}

.sidebar-item.dropdown-item-parent .collapse a,
.sidebar-item.dropdown-item-parent .collapse a:link,
.sidebar-item.dropdown-item-parent .collapse a:visited {
    display: block;
    padding: 0.5rem 1.5rem;
    color: var(--text-main) !important;
    text-decoration: none !important;
    font-size: 0.9rem;
    transition: all 0.2s;
    background-color: transparent;
    border: none;
}

.sidebar-item.dropdown-item-parent .collapsing a,
.sidebar-item.dropdown-item-parent .collapsing a:link,
.sidebar-item.dropdown-item-parent .collapsing a:visited {
    display: block;
    padding: 0.5rem 1.5rem;
    color: var(--text-main) !important;
    text-decoration: none !important;
    font-size: 0.9rem;
    background-color: transparent;
    border: none;
}

.sidebar-item.dropdown-item-parent .collapse a:hover,
.sidebar-item.dropdown-item-parent .collapse a:active {
    background-color: var(--table-hover-bg);
    color: var(--primary-color) !important;
    padding-left: 2rem;
}

.sidebar-item.dropdown-item-parent .collapse a:visited {
    color: var(--text-main) !important;
}

.sidebar-link .bi-chevron-down {
    margin-left: auto;
    transition: transform 0.3s ease;
    display: none;
}

.sidebar.expanded .sidebar-link .bi-chevron-down {
    display: inline-block;
}

html.sidebar-expanded .sidebar-link .bi-chevron-down {
    display: inline-block;
}

/* Main content adjustment */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: 60px;
    transition: none;
    padding: 1.5rem !important;
    overflow-x: hidden;
    min-height: calc(100vh - 60px);
    width: calc(100% - var(--sidebar-width));
    box-sizing: border-box;
}

/* Enable transitions only after initial render (prevents 'slide' on navigation) */
body.ui-ready .navbar {
    transition: padding-left 0.3s ease;
}

body.ui-ready .sidebar {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.ui-ready .main-content {
    transition: margin-left 0.3s ease;
}

/* Ensure tables and content don't overflow */
.main-content > * {
    max-width: 100%;
}

/* Table responsive wrapper */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 0;
}

.table {
    margin-bottom: 0;
    width: 100%;
}

/* Constrain container width but allow scrolling */
.container-fluid.main-content {
    display: block;
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
}

/* Dark mode sidebar */
:root.dark-mode .sidebar {
    background-color: var(--bg-card);
    border-color: var(--border-color);
}

:root.dark-mode .sidebar-link {
    color: var(--text-main);
}

:root.dark-mode .sidebar-item.dropdown-item-parent > .collapse {
    background-color: var(--bg-card);
    border-color: var(--border-color);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .sidebar {
        left: 0;
    }
    
    .sidebar:not(.expanded) + .main-content {
        margin-left: 60px;
    }
    
    .sidebar-item.dropdown-item-parent > .collapse {
        position: fixed;
        left: 60px;
        top: auto;
        bottom: auto;
        width: 220px;
        z-index: 1040;
    }
}


.table thead th {
    background-color: var(--bg-body);
    color: var(--text-main);
    border-bottom-color: var(--border-color);
}

.form-control, .form-select {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-main);
}

.form-control:focus, .form-select:focus {
    background-color: var(--bg-card);
    color: var(--text-main);
    border-color: var(--primary-color);
}

/* Fix for disabled inputs in dark mode */
.form-control:disabled, .form-select:disabled {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--text-muted);
    border-color: var(--border-color);
}

:root.dark-mode .form-control:disabled, 
:root.dark-mode .form-select:disabled {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border-color: var(--border-color);
}

.form-label, .form-check-label {
    color: var(--text-main);
}

.input-group-text {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-main);
}

/* Dark mode specific overrides for Bootstrap components */
html.dark-mode .dropdown-menu {
    background-color: var(--bg-card);
    border-color: var(--border-color);
}

html.dark-mode .dropdown-item {
    color: var(--text-main);
}

html.dark-mode .dropdown-item:hover {
    background-color: var(--border-color);
}

html.dark-mode .modal-content {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-main);
}

html.dark-mode .modal-header,
html.dark-mode .modal-footer {
    border-color: var(--border-color);
}

html.dark-mode .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* List Group Dark Mode */
.list-group-item {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-main);
}

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

/* Card Header Dark Mode Adaptation */
.card-header {
    background-color: rgba(0, 0, 0, 0.03);
    border-bottom-color: var(--border-color);
}

:root.dark-mode .card-header {
    background-color: rgba(255, 255, 255, 0.05);
}

.card-footer {
    background-color: rgba(0, 0, 0, 0.03);
    border-top-color: var(--border-color);
}

:root.dark-mode .card-footer {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Nav Tabs Dark Mode */
.nav-tabs .nav-link {
    color: var(--text-muted);
}

.nav-tabs .nav-link:hover {
    border-color: var(--border-color);
    color: var(--text-main);
}

.nav-tabs .nav-link.active {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    border-bottom-color: var(--bg-card);
    color: var(--primary-color);
}

:root.dark-mode .nav-tabs {
    border-bottom-color: var(--border-color);
}

/* Navbar Styling */
.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e40af 100%);
    color: var(--header-text);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 0.8rem 1rem;
}

:root.dark-mode .navbar {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.navbar .navbar-brand {
    color: #ffffff;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.navbar .navbar-brand:hover {
    transform: scale(1.02);
}

.navbar .nav-link {
    color: rgba(255, 255, 255, 0.85);
    border-radius: 50px;
    padding: 0.5rem 0.75rem !important;
    margin: 0 1px;
    transition: all 0.3s ease;
    position: relative;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.4rem;
    font-size: 0.95rem;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.navbar .nav-link.active {
    color: var(--primary-color);
    background-color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

:root.dark-mode .navbar .nav-link.active {
    color: #ffffff;
    background-color: var(--primary-color);
}

.navbar .dropdown-menu {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border: none;
    margin-top: 10px;
    padding: 0.5rem;
    animation: fadeInUp 0.3s ease;
}

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

.dropdown-item {
    border-radius: 8px;
    padding: 0.5rem 1rem;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background-color: rgba(0,0,0,0.05);
    transform: translateX(5px);
}

:root.dark-mode .dropdown-item:hover {
    background-color: rgba(255,255,255,0.1);
}

.navbar .dropdown-item {
    color: var(--text-main);
}

.navbar .dropdown-item:hover {
    background-color: var(--table-hover-bg);
}

/* Footer Styling */
footer {
    border-color: var(--border-color) !important;
    color: var(--text-muted) !important;
}

/* Bootstrap Utility Overrides for Dark Mode */
.text-muted {
    color: var(--text-muted) !important;
}

.border-top {
    border-color: var(--border-color) !important;
}

/* Alerts Dark Mode */
:root.dark-mode .alert-warning {
    background-color: #422006;
    color: #fcd34d;
    border-color: #78350f;
}

:root.dark-mode .alert-warning .alert-link {
    color: #fbbf24;
}

:root.dark-mode .alert-danger {
    background-color: #450a0a;
    color: #fca5a5;
    border-color: #7f1d1d;
}

:root.dark-mode .alert-success {
    background-color: #052e16;
    color: #86efac;
    border-color: #14532d;
}

:root.dark-mode .alert-info {
    background-color: #082f49;
    color: #7dd3fc;
    border-color: #0c4a6e;
}


/* Tom Select Dark Mode Support */
:root.dark-mode .ts-wrapper .ts-control {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
    background-image: none !important; /* Remove any bootstrap form-select background image */
}

:root.dark-mode .ts-wrapper .ts-control > input {
    color: var(--text-main) !important;
    background-color: transparent !important; /* Ensure input is transparent */
}

:root.dark-mode .ts-wrapper.focus .ts-control {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.25) !important;
}

/* Dropdown Menu */
:root.dark-mode .ts-dropdown,
:root.dark-mode .ts-dropdown .ts-dropdown-content {
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

/* Options */
:root.dark-mode .ts-dropdown .option {
    color: var(--text-main) !important;
    background-color: var(--bg-card) !important;
}

:root.dark-mode .ts-dropdown .option.active,
:root.dark-mode .ts-dropdown .option:hover {
    background-color: var(--table-hover-bg) !important;
    color: var(--text-main) !important;
}

:root.dark-mode .ts-dropdown .option.selected {
    background-color: rgba(37, 99, 235, 0.2) !important; /* Light blue for selected */
    color: var(--primary-color) !important;
}

/* Optgroups */
:root.dark-mode .ts-dropdown .optgroup-header {
    background-color: var(--bg-body) !important;
    color: var(--text-muted) !important;
}

/* Selected Items (in the input area) */
:root.dark-mode .ts-control .item {
    color: var(--text-main) !important;
}

:root.dark-mode .ts-wrapper.multi .ts-control .item {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    padding: 0 5px;
}

/* Clear Button */
:root.dark-mode .ts-control .clear-button {
    color: var(--text-muted) !important;
}

/* Fix for dropdown border in dark mode */
:root.dark-mode .ts-dropdown {
    border: 1px solid var(--border-color) !important;
}

/* Ensure the arrow/caret is visible in dark mode */
:root.dark-mode .ts-wrapper.single .ts-control::after {
    border-color: var(--text-muted) transparent transparent transparent !important;
}

:root.dark-mode .ts-wrapper.single.dropdown-active .ts-control::after {
    border-color: transparent transparent var(--text-muted) transparent !important;
}

/* Remove the arrow background from bootstrap form-select if it persists */
.ts-wrapper.form-select, 
:root.dark-mode .ts-wrapper.form-select {
    background-image: none !important;
    padding-right: 0.75rem !important; /* Reset padding if bootstrap adds space for arrow */
}

/* Hide selected item when dropdown is active (searching) to allow clean searching */
.ts-wrapper.single.dropdown-active .ts-control .item {
    display: none !important;
}

/* File Upload Drop Zone */
.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    background-color: var(--bg-body);
    cursor: pointer;
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--primary-color);
    background-color: var(--table-hover-bg);
}

.drop-zone-input {
    display: none;
}

.file-list {
    margin-top: 1rem;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    background-color: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
}



@media (min-width: 576px) {
    .w-sm-auto { width: auto !important; }

    .btn-desktop-compact {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
        line-height: 1.5;
    }
}

@media (min-width: 768px) { 
    .w-md-auto { width: auto !important; } 
    .header-actions { width: auto !important; margin-left: auto; }
}
.header-actions { width: 100%; }

.main-content { overflow-x: hidden; }

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0;
    z-index: 1040;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.mobile-bottom-nav .nav-item i {
    font-size: 1.25rem;
    margin-bottom: 0.1rem;
}

.mobile-bottom-nav .nav-item.active {
    color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.1);
}

/* Adjust main content for bottom nav */
@media (max-width: 767.98px) {
    body {
        padding-bottom: 70px; /* Height of bottom nav + spacing */
    }
    
    /* Hide sidebar completely on mobile - use bottom nav instead */
    .sidebar {
        display: none !important;
    }
    
    /* Remove sidebar padding from navbar on mobile */
    .navbar {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    /* Hide sidebar toggle button on mobile */
    #sidebarToggle {
        display: none !important;
    }
    
    /* Adjust main content - no sidebar offset on mobile */
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    /* Mobile navbar brand - show logo and name */
    .navbar-brand {
        margin-left: 0 !important;
        margin-right: auto !important;
        font-size: 1rem !important;
        max-width: calc(100% - 100px);
        overflow: hidden;
    }
    
    .navbar-brand span {
        display: inline !important;
        font-size: 0.9rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .navbar-brand img {
        height: 28px !important;
    }
    
    /* Improve mobile top bar layout */
    .navbar .container-fluid {
        justify-content: space-between;
        padding: 0 0.5rem;
    }
    
    .navbar .d-flex.align-items-center {
        position: relative;
        right: auto;
        gap: 0.25rem !important;
    }
    
    /* Smaller icons in navbar on mobile */
    .navbar .d-flex.align-items-center .btn-link,
    .navbar .d-flex.align-items-center .theme-toggle {
        width: 36px;
        height: 36px;
        padding: 6px;
    }
}

/* Header Icons */
.theme-toggle, 
.btn-link[onclick="toggleSearch()"] {
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.3s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.theme-toggle:hover,
.btn-link[onclick="toggleSearch()"]:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: rotate(15deg);
}

.btn-link[onclick="toggleSearch()"]:hover {
    transform: scale(1.1);
}

/* Enhanced Mobile Bottom Nav */
.mobile-bottom-nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: none;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    padding: 0.4rem 0.5rem;
    padding-bottom: max(0.4rem, env(safe-area-inset-bottom));
    gap: 0.25rem;
}

:root.dark-mode .mobile-bottom-nav {
    background: rgba(30, 41, 59, 0.95);
}

.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.8rem;
    border-radius: 50px;
    color: var(--text-muted);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    flex: 0 0 auto;
}

.mobile-bottom-nav .nav-item i {
    font-size: 1.1rem;
    margin-bottom: 0;
    margin-right: 0;
    transition: margin 0.3s;
}

.mobile-bottom-nav .nav-item span {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    font-size: 0.8rem;
    margin-left: 0;
}

.mobile-bottom-nav .nav-item.active {
    background-color: var(--primary-color);
    color: #ffffff;
    flex: 1 1 auto;
}

.mobile-bottom-nav .nav-item.active::after {
    display: none;
}

.mobile-bottom-nav .nav-item.active i {
    margin-right: 0;
}

.mobile-bottom-nav .nav-item.active span {
    max-width: 150px;
    opacity: 1;
    margin-left: 6px;
}

/* Mobile Bottom Nav Button Styling */
.mobile-bottom-nav button.nav-item {
    border: none;
    background: transparent;
    cursor: pointer;
}

/* Mobile More Menu (Offcanvas) */
#mobileMoreMenu {
    --bs-offcanvas-height: auto;
    max-height: 70vh;
    border-radius: 1rem 1rem 0 0;
    background-color: var(--bg-card);
}

#mobileMoreMenu .offcanvas-header {
    border-bottom: 1px solid var(--border-color);
}

#mobileMoreMenu .offcanvas-title {
    color: var(--text-main);
    font-weight: 600;
}

.mobile-menu-item {
    color: var(--text-main);
    transition: all 0.2s ease;
}

.mobile-menu-item:hover,
.mobile-menu-item:active {
    background-color: var(--table-hover-bg);
    color: var(--primary-color);
}

.mobile-menu-item i {
    color: var(--primary-color);
}

.mobile-menu-item span {
    color: var(--text-main);
    font-weight: 500;
}

/* DataTables Pagination Dark Mode */
:root.dark-mode .pagination .page-link {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-main);
}

:root.dark-mode .pagination .page-link:hover {
    background-color: var(--border-color);
    color: var(--text-main);
    border-color: var(--border-color);
}

:root.dark-mode .pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
}

:root.dark-mode .pagination .page-item.disabled .page-link {
    background-color: var(--bg-body);
    border-color: var(--border-color);
    color: var(--text-muted);
}

/* DataTables Length and Filter inputs in Dark Mode */
:root.dark-mode .dataTables_wrapper .dataTables_length select,
:root.dark-mode .dataTables_wrapper .dataTables_filter input {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-main);
}

:root.dark-mode .dataTables_wrapper .dataTables_info {
    color: var(--text-muted) !important;
}

:root.dark-mode .dataTables_wrapper .dataTables_paginate {
    color: var(--text-muted) !important;
}

/* Breadcrumbs */
.breadcrumb {
    background-color: transparent;
    padding: 0 !important;
    border-radius: 0;
    box-shadow: none;
    border: none;
    font-size: 0.9rem;
    margin-bottom: 1.5rem !important;
    margin-left: 0;
    margin-right: 0;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb-item.active {
    color: var(--text-muted);
}

:root.dark-mode .breadcrumb {
    background-color: transparent;
    border-color: transparent;
    --bs-breadcrumb-divider-color: var(--text-muted);
}
/* ===== NORMALIZED LAYOUT STYLES ===== */

/* Page Header - Standard title + actions section */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-header h1 {
    margin-bottom: 0;
    flex: 1;
    min-width: 200px;
}

.page-header-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Sidebar Card - Consistent styling for left column cards */
.sidebar-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.sidebar-card .card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: var(--text-main);
}

.sidebar-card .card-body {
    padding: 1rem;
}

.sidebar-card .card-footer {
    background-color: transparent;
    border-top: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Content Card - Main content area cards */
.content-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.content-card .card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

.content-card .card-body {
    padding: 1rem;
}

.content-card .card-body.p-0 {
    padding: 0 !important;
}

.content-card .card-footer {
    background-color: transparent;
    border-top: 1px solid var(--border-color);
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Table in Cards - Remove padding, full width */
.content-card .table-responsive {
    margin-bottom: 0;
}

.content-card .table {
    margin-bottom: 0;
}

.content-card .table thead {
    background-color: transparent;
    font-weight: 600;
    color: var(--text-main);
}

.content-card .table thead th {
    padding: 0.4rem 0.75rem;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-main);
}

.content-card .table tbody td {
    padding: 0.4rem 0.75rem;
}

.content-card .table tbody tr:hover {
    background-color: var(--table-hover-bg);
}

.content-card .table tfoot td {
    padding: 0.4rem 0.75rem;
    background-color: transparent;
    border-top: 2px solid var(--border-color);
}

/* Compact Form Row - Horizontal form inputs */
.form-row-compact {
    display: grid;
    grid-auto-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .form-row-compact {
        grid-auto-flow: column;
        grid-auto-columns: minmax(0, 1fr);
    }
}

.form-row-compact .form-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.form-row-compact .form-control,
.form-row-compact .form-select,
.form-row-compact .input-group {
    font-size: 0.95rem;
}

.form-row-compact .input-group .input-group-text {
    background-color: var(--bg-body);
    border-color: var(--border-color);
    color: var(--text-main);
}

/* Input Group Standardization */
.input-group .input-group-text {
    background-color: var(--bg-body);
    border-color: var(--border-color);
    color: var(--text-main);
}

.form-control,
.form-select {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-main);
}

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

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

/* Card Styling Standardization */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card.shadow-sm {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

.card.border-0 {
    border: none;
}

.card-header {
    background-color: transparent;
    border-color: var(--border-color);
    color: var(--text-main);
    padding: 0.75rem 1rem;
    font-weight: 600;
}

.card-body {
    color: var(--text-main);
}

.card-footer {
    background-color: transparent;
    border-color: var(--border-color);
    color: var(--text-muted);
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
}

/* Badge Standardization */
.badge {
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* Alert Standardization */
.alert {
    border: 1px solid;
    margin-bottom: 1.5rem;
}

.alert-info {
    background-color: #cfe2ff;
    border-color: #b6d4fe;
    color: #084298;
}

:root.dark-mode .alert-info {
    background-color: rgba(13, 110, 253, 0.15);
    border-color: rgba(13, 110, 253, 0.3);
    color: #7dd3fc;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffecb5;
    color: #664d03;
}

:root.dark-mode .alert-warning {
    background-color: rgba(255, 193, 7, 0.15);
    border-color: rgba(255, 193, 7, 0.3);
    color: #fcd34d;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c2c7;
    color: #842029;
}

:root.dark-mode .alert-danger {
    background-color: rgba(220, 38, 38, 0.15);
    border-color: rgba(220, 38, 38, 0.3);
    color: #fca5a5;
}

.alert-success {
    background-color: #d1e7dd;
    border-color: #badbcc;
    color: #0f5132;
}

:root.dark-mode .alert-success {
    background-color: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
    color: #86efac;
}

/* Button Standardization */
.btn {
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.btn-outline-secondary {
    color: var(--text-muted);
    border-color: var(--border-color);
}

.btn-outline-secondary:hover {
    background-color: var(--border-color);
    border-color: var(--border-color);
    color: var(--text-main);
}

:root.dark-mode .btn-outline-secondary {
    color: var(--text-main);
}

/* Form Text Styling */
.form-text {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .page-header h1 {
        font-size: 1.25rem;
        min-width: auto;
    }

    .page-header-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .page-header-actions .btn {
        flex: none;
        width: 100%;
        min-width: 0;
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.35rem;
    }
    
    /* If odd number of buttons, last one spans full width */
    .page-header-actions .btn:last-child:nth-child(odd) {
        grid-column: span 2;
    }

    .form-row-compact {
        grid-template-columns: 1fr;
    }
}

/* Extra small screens - icon only buttons */
@media (max-width: 400px) {
    .page-header-actions .btn {
        padding: 0.6rem;
    }
    
    .page-header-actions .btn span {
        display: none !important;
    }
    
    .page-header-actions .btn i {
        font-size: 1.1rem;
        margin: 0 !important;
    }
}

/* ===== SCROLL TO TOP BUTTON ===== */
.scroll-to-top {
    position: fixed;
    bottom: 90px; /* Above mobile nav */
    right: 1rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1035;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

@media (min-width: 768px) {
    .scroll-to-top {
        bottom: 2rem;
    }
}

/* ===== SKELETON LOADING ANIMATIONS ===== */
.skeleton {
    background: linear-gradient(90deg, var(--bg-body) 25%, var(--border-color) 50%, var(--bg-body) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-text:last-child {
    width: 70%;
}

.skeleton-circle {
    border-radius: 50%;
}

.skeleton-card {
    min-height: 120px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== IMPROVED CARD HOVER EFFECTS ===== */
.card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

:root.dark-mode .card.card-hover:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* ===== PULL TO REFRESH INDICATOR ===== */
.pull-to-refresh {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    background: var(--bg-card);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1025;
    transition: transform 0.3s ease;
}

.pull-to-refresh.pulling {
    transform: translateX(-50%) translateY(10px);
}

.pull-to-refresh.refreshing {
    transform: translateX(-50%) translateY(10px);
}

.pull-to-refresh .spinner-border {
    width: 1.5rem;
    height: 1.5rem;
}

/* ===== IMPROVED FOCUS STATES (Accessibility) ===== */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

/* ===== SMOOTH PAGE TRANSITIONS ===== */
.main-content {
    animation: fadeIn 0.3s ease;
}

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

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .scroll-to-top {
        transition: none;
    }
}

/* ===== BETTER EMPTY STATES ===== */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h5 {
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.empty-state p {
    margin-bottom: 1.5rem;
}

/* ===== NOTIFICATION BADGE ===== */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ===== QUICK ACTION BUTTONS (Mobile) ===== */
.quick-actions {
    display: none;
}

@media (max-width: 767.98px) {
    .quick-actions {
        display: block;
        position: fixed;
        bottom: 80px;
        right: 1rem;
        z-index: 1030;
    }
    
    .quick-action-btn {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
        font-size: 1.25rem;
    }
    
    /* Hide scroll-to-top when quick actions are present */
    .quick-actions ~ .scroll-to-top,
    body:has(.quick-actions) .scroll-to-top {
        bottom: 150px;
    }
}

/* ===== KEYBOARD SHORTCUT STYLING ===== */
kbd {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-family: inherit;
    color: var(--text-main);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

:root.dark-mode kbd {
    background: var(--bg-card);
    border-color: var(--border-color);
}

/* ===== IMPROVED TOUCH TARGETS ===== */
@media (max-width: 767.98px) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .dropdown-item {
        padding: 0.75rem 1rem;
    }
    
    .form-control,
    .form-select {
        min-height: 44px;
        font-size: 16px; /* Prevents iOS zoom on focus */
    }
    
    /* Better spacing for touch */
    .table td,
    .table th {
        padding: 0.75rem;
    }
}

/* ===== OFFLINE INDICATOR ===== */
.offline-indicator {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: #f59e0b;
    color: #000;
    text-align: center;
    padding: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 1025;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.offline-indicator.visible {
    transform: translateY(0);
}

/* ===== STATUS BADGE IMPROVEMENTS ===== */
.badge {
    font-weight: 500;
    padding: 0.4em 0.7em;
}

.badge-status {
    font-size: 0.8rem;
    text-transform: capitalize;
}

/* ===== BETTER CARD SHADOWS ===== */
.content-card {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
}

:root.dark-mode .content-card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.15);
}

/* ===== IMPROVED PAGE HEADER ===== */
.page-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.page-header-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ===== SMOOTH IMAGE LOADING ===== */
img {
    opacity: 1;
    transition: opacity 0.3s ease;
}

img[loading="lazy"] {
    opacity: 0;
}

img[loading="lazy"].loaded,
img:not([loading="lazy"]) {
    opacity: 1;
}

/* ===== PWA INSTALL PROMPT ===== */
.pwa-install-prompt {
    position: fixed;
    bottom: 90px;
    left: 1rem;
    right: 1rem;
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    z-index: 1045;
    animation: slideUp 0.3s ease;
    border: 1px solid var(--border-color);
}

@media (min-width: 768px) {
    .pwa-install-prompt {
        bottom: 1.5rem;
        left: auto;
        right: 1.5rem;
        max-width: 340px;
    }
}

.pwa-install-content {
    padding: 1rem;
}

.pwa-install-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), #1e40af);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.pwa-install-text {
    flex: 1;
    min-width: 0;
}

.pwa-install-text strong {
    display: block;
    color: var(--text-main);
    margin-bottom: 2px;
}

.pwa-install-text small {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.pwa-install-actions {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.pwa-install-actions .btn-link {
    font-size: 0.75rem;
    padding: 0;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== CONNECTION STATUS BANNER ===== */
.connection-status {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #000;
    z-index: 1025;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.connection-status.visible {
    transform: translateY(0);
}

.connection-status-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.connection-status-content i {
    font-size: 1rem;
}

/* Online status (green) */
.connection-status.online {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
}

/* ===== CONNECTION DOT (for navbar) ===== */
.connection-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    display: inline-block;
    margin-right: 4px;
}

.connection-dot.offline {
    background: #ef4444;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ===== OFFLINE MODE STYLES ===== */
body.offline-mode .btn-primary:not(.offline-safe),
body.offline-mode form[enctype="multipart/form-data"] .btn {
    opacity: 0.6;
    pointer-events: none;
}

body.offline-mode .offline-hidden {
    display: none !important;
}

body.offline-mode .offline-visible {
    display: block !important;
}

/* ===== SYNC STATUS INDICATOR ===== */
.sync-status {
    position: fixed;
    top: 70px;
    right: 1rem;
    background: var(--bg-card);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    z-index: 1040;
    transform: translateX(calc(100% + 2rem));
    transition: transform 0.3s ease;
}

.sync-status.visible {
    transform: translateX(0);
}

.sync-status .spinner-border {
    width: 1rem;
    height: 1rem;
}

/* ===== SYNC PROGRESS INDICATOR ===== */
.sync-progress {
    position: fixed;
    top: 70px;
    right: 1rem;
    background: var(--bg-card);
    border-radius: 50px;
    padding: 0.5rem 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    z-index: 1050;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.sync-progress.visible {
    opacity: 1;
    transform: translateY(0);
}

.sync-progress-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-main);
}

/* ===== PENDING CHANGES BADGE ===== */
.pending-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #f59e0b;
    color: #000;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ===== OFFLINE MODE STYLES ===== */
body.offline-mode .online-only {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

body.offline-mode .online-only::after {
    content: 'Niet beschikbaar offline';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    white-space: nowrap;
}

/* ===== HAPTIC FEEDBACK SIMULATION ===== */
@media (max-width: 767.98px) {
    .btn:active,
    .nav-item:active,
    .mobile-menu-item:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
}

/* ===== SMOOTH SCROLLING ===== */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}
/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0;
    z-index: 1040;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.mobile-bottom-nav .nav-item i {
    font-size: 1.25rem;
    margin-bottom: 0.1rem;
}

.mobile-bottom-nav .nav-item.active {
    color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.1);
}

/* Adjust main content for bottom nav */
@media (max-width: 767.98px) {
    body {
        padding-bottom: 70px; /* Height of bottom nav + spacing */
    }
}

/* Standardize Page Titles */
h1, .page-header h1 {
    font-size: 1.75rem !important;
    font-weight: 600;
    color: var(--text-main);
}

@media (max-width: 768px) {
    h1, .page-header h1 {
        font-size: 1.5rem !important;
    }
}
