/* Admin Dashboard Styles */

/* Color Theme Variables */
:root {
    /* Light Theme */
    --primary-light: #FF6B00; /* Orange */
    --secondary-light: #F5F5F5; /* Light Gray */
    --background-light: #FFFFFF; /* White */
    --surface-light: #FFFFFF; /* White */
    --text-light: #333333; /* Dark Gray */
    --text-secondary-light: #757575; /* Medium Gray */
    --border-light: #E0E0E0; /* Light Gray Border */
    --success-light: #4CAF50; /* Green */
    --error-light: #F44336; /* Red */
    --warning-light: #FF9800; /* Orange */
    --info-light: #2196F3; /* Blue */
    
    /* Dark Theme */
    --primary-dark: #FF6B00; /* Orange */
    --secondary-dark: #2A2A2A; /* Dark Gray */
    --background-dark: #121212; /* Very Dark Gray */
    --surface-dark: #1E1E1E; /* Dark Gray */
    --text-dark: #FFFFFF; /* White */
    --text-secondary-dark: #B0B0B0; /* Light Gray */
    --border-dark: #333333; /* Dark Gray Border */
    --success-dark: #4CAF50; /* Green */
    --error-dark: #F44336; /* Red */
    --warning-dark: #FF9800; /* Orange */
    --info-dark: #2196F3; /* Blue */
    
    /* Grayscale System */
    --gray-50: #FAFAFA; /* Lightest Gray */
    --gray-100: #F5F5F5;
    --gray-200: #EEEEEE;
    --gray-300: #E0E0E0;
    --gray-400: #BDBDBD;
    --gray-500: #9E9E9E;
    --gray-600: #757575;
    --gray-700: #616161;
    --gray-800: #424242;
    --gray-900: #212121; /* Darkest Gray */
    
    /* Dynamic Settings */
    --theme-color: #FF6B00;
    --background-color: #FFFFFF;
    --font-color: #333333;
    --sidebar-text-color: #333333;
    --heading-text-color: #333333;
    --label-text-color: #333333;
    --general-text-color: #333333;
    --font-style: 'Figtree', sans-serif;
    
    /* Font size settings */
    --desktop-h1-size: 36px;
    --desktop-h2-size: 30px;
    --desktop-h3-size: 24px;
    --desktop-h4-size: 20px;
    --desktop-h5-size: 18px;
    --desktop-h6-size: 16px;
    --desktop-body-size: 16px;
    
    --tablet-h1-size: 32px;
    --tablet-h2-size: 28px;
    --tablet-h3-size: 22px;
    --tablet-h4-size: 18px;
    --tablet-h5-size: 16px;
    --tablet-h6-size: 14px;
    --tablet-body-size: 14px;
    
    --mobile-h1-size: 28px;
    --mobile-h2-size: 24px;
    --mobile-h3-size: 20px;
    --mobile-h4-size: 16px;
    --mobile-h5-size: 14px;
    --mobile-h6-size: 12px;
    --mobile-body-size: 12px;
}

/* Active Theme Variables */
:root {
    --primary: var(--primary-light);
    --secondary: var(--secondary-light);
    --background: var(--background-light);
    --surface: var(--surface-light);
    --text: var(--text-light);
    --text-secondary: var(--text-secondary-light);
    --border: var(--border-light);
    --success: var(--success-light);
    --error: var(--error-light);
    --warning: var(--warning-light);
    --info: var(--info-light);
}

[data-theme="dark"] {
    --primary: var(--primary-dark);
    --secondary: var(--secondary-dark);
    --background: var(--background-dark);
    --surface: var(--surface-dark);
    --text: var(--text-dark);
    --text-secondary: var(--text-secondary-dark);
    --border: var(--border-dark);
    --success: var(--success-dark);
    --error: var(--error-dark);
    --warning: var(--warning-dark);
    --info: var(--info-dark);
}

/* Apply Theme Colors */
body {
    background-color: var(--background-color, var(--background));
    color: var(--general-text-color, var(--font-color, var(--text)));
    font-family: var(--font-style, 'Figtree', sans-serif);
    font-size: var(--desktop-body-size);
}

/* Font size styles for headings */
h1, .h1 {
    font-size: var(--desktop-h1-size);
}

h2, .h2 {
    font-size: var(--desktop-h2-size);
}

h3, .h3 {
    font-size: var(--desktop-h3-size);
}

h4, .h4 {
    font-size: var(--desktop-h4-size);
}

h5, .h5 {
    font-size: var(--desktop-h5-size);
}

h6, .h6 {
    font-size: var(--desktop-h6-size);
}

/* Responsive font sizes */
@media (max-width: 992px) {
    body {
        font-size: var(--tablet-body-size);
    }
    
    h1, .h1 {
        font-size: var(--tablet-h1-size);
    }
    
    h2, .h2 {
        font-size: var(--tablet-h2-size);
    }
    
    h3, .h3 {
        font-size: var(--tablet-h3-size);
    }
    
    h4, .h4 {
        font-size: var(--tablet-h4-size);
    }
    
    h5, .h5 {
        font-size: var(--tablet-h5-size);
    }
    
    h6, .h6 {
        font-size: var(--tablet-h6-size);
    }
}

@media (max-width: 768px) {
    body {
        font-size: var(--mobile-body-size);
    }
    
    h1, .h1 {
        font-size: var(--mobile-h1-size);
    }
    
    h2, .h2 {
        font-size: var(--mobile-h2-size);
    }
    
    h3, .h3 {
        font-size: var(--mobile-h3-size);
    }
    
    h4, .h4 {
        font-size: var(--mobile-h4-size);
    }
    
    h5, .h5 {
        font-size: var(--mobile-h5-size);
    }
    
    h6, .h6 {
        font-size: var(--mobile-h6-size);
    }
}

.btn-theme {
    background-color: var(--theme-color, var(--primary));
    border-color: var(--theme-color, var(--primary));
    color: white;
    text-decoration: none;
}

.btn-theme:hover {
    background-color: color-mix(in srgb, var(--theme-color, var(--primary)) 90%, black);
    border-color: color-mix(in srgb, var(--theme-color, var(--primary)) 90%, black);
    color: white;
    text-decoration: none;
}

.form-control:focus, .form-select:focus {
    border-color: var(--theme-color, var(--primary));
    box-shadow: 0 0 0 0.25rem rgba(255, 107, 0, 0.25);
}

.page-item.active .page-link {
    background-color: var(--theme-color, var(--primary));
    border-color: var(--theme-color, var(--primary));
    color: white;
}

.text-primary {
    color: var(--theme-color, var(--primary)) !important;
}

.bg-primary {
    background-color: var(--theme-color, var(--primary)) !important;
}

.border-primary {
    border-color: var(--theme-color, var(--primary)) !important;
}

.alert-primary {
    background-color: rgba(255, 107, 0, 0.15);
    color: var(--theme-color, var(--primary));
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Sidebar Styles */
.sidebar {
    background-color: var(--surface);
    color: var(--sidebar-text-color, var(--text));
    border-right: 1px solid var(--border);
    transition: all 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    z-index: 1040;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 250px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-muted, #6c757d);
}

/* Sidebar header */
.sidebar .sidebar-header {
    padding: 1.25rem 1rem !important;
    border-bottom: 1px solid var(--border) !important;
    background-color: var(--surface);
}

.sidebar .sidebar-header h1 {
    font-size: 1.1rem;
    letter-spacing: -0.01em;
}

/* Sidebar footer */
.sidebar .sidebar-footer {
    padding: 1rem !important;
    border-top: 1px solid var(--border) !important;
    background-color: var(--surface);
}

/* Mobile sidebar - hidden by default, shown when 'show' class is added */
@media (max-width: 767.98px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        z-index: 1050;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    /* Sidebar overlay for mobile */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1045;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
}

.sidebar .nav-link {
    color: var(--sidebar-text-color, var(--text));
    text-decoration: none;
    padding: 0.65rem 1rem;
    margin: 0.15rem 0;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.sidebar .nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    opacity: 0.8;
    transition: all 0.2s ease;
}

.sidebar .nav-link:hover {
    background-color: rgba(var(--theme-color-rgb, 255, 107, 0), 0.08);
    color: var(--theme-color, var(--primary));
}

.sidebar .nav-link:hover i {
    opacity: 1;
    color: var(--theme-color, var(--primary));
}

/* Navigation list styling */
.sidebar .nav {
    padding: 0.5rem 0.75rem;
}

.sidebar .nav-item {
    margin-bottom: 0.125rem;
}

/* Section dividers - add visual grouping */
.sidebar .nav-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted, #6c757d);
    padding: 1rem 1rem 0.5rem;
    margin-top: 0.5rem;
}

/* Desktop sidebar */
@media (min-width: 768px) {
    .sidebar {
        transform: translateX(0);
        width: 220px;
    }
    
    .sidebar.collapsed {
        width: 70px;
        overflow-x: hidden;
    }
    
    .sidebar.collapsed .sidebar-text {
        display: none;
    }
    
    .sidebar.collapsed .sidebar-header-text {
        display: none;
    }
    
    .sidebar.collapsed .px-3 {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    .sidebar.collapsed .nav-link {
        justify-content: center;
        padding: 0.75rem;
        border-radius: 0.5rem;
        margin: 0.25rem 0.5rem;
    }
    
    .sidebar.collapsed .nav-link i {
        margin-right: 0 !important;
        font-size: 1.15rem;
    }
    
    .sidebar.collapsed .nav {
        padding: 0.5rem 0;
    }
    
    /* Tooltip for collapsed sidebar */
    .sidebar.collapsed .nav-link {
        position: relative;
    }
    
    .sidebar.collapsed .nav-link::after {
        content: attr(data-title);
        position: absolute;
        left: 100%;
        top: 50%;
        transform: translateY(-50%);
        background-color: var(--text);
        color: var(--surface);
        padding: 0.5rem 0.75rem;
        border-radius: 0.375rem;
        font-size: 0.875rem;
        white-space: nowrap;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease, visibility 0.2s ease;
        margin-left: 0.5rem;
        z-index: 1050;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    }
    
    .sidebar.collapsed .nav-link:hover::after {
        opacity: 1;
        visibility: visible;
    }
    
    /* Collapsed sidebar header */
    .sidebar.collapsed .sidebar-header {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
        display: flex;
        justify-content: center;
    }
    
    .sidebar.collapsed .sidebar-header > div {
        justify-content: center;
    }
    
    .sidebar.collapsed .sidebar-logo {
        margin-right: 0 !important;
        height: 40px;
    }
    
    .sidebar.collapsed .sidebar-logo-icon {
        margin-right: 0 !important;
        width: 40px !important;
        height: 40px !important;
    }
    
    /* Collapsed sidebar footer */
    .sidebar.collapsed .sidebar-footer {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    .sidebar.collapsed .sidebar-footer .sidebar-status {
        justify-content: center;
    }
    
    .sidebar.collapsed .sidebar-footer .btn {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    .sidebar.collapsed .sidebar-footer .btn i {
        margin-right: 0 !important;
    }
    
    /* Main content adjustment for collapsed sidebar */
    .main-content.sidebar-collapsed {
        margin-left: 70px !important;
        width: calc(100% - 70px) !important;
    }
}

@media (min-width: 992px) {
    .sidebar {
        width: 250px;
    }
    
    .sidebar.collapsed {
        width: 70px;
    }
    
    .main-content.sidebar-collapsed {
        margin-left: 70px !important;
        width: calc(100% - 70px) !important;
    }
}

.sidebar .nav-link.active {
    background-color: var(--theme-color, var(--primary)) !important;
    color: white !important;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(var(--theme-color-rgb, 255, 107, 0), 0.3);
}

.sidebar .nav-link.active i {
    opacity: 1;
    color: white !important;
}

.sidebar .nav-link.hover-bg:hover {
    background-color: rgba(var(--theme-color-rgb, 255, 107, 0), 0.08);
    text-decoration: none;
}

[data-theme="dark"] .sidebar .nav-link.hover-bg:hover {
    background-color: rgba(255, 255, 255, 0.08);
    text-decoration: none;
}

[data-theme="dark"] .sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

/* Header Styles */
.header {
    background-color: var(--surface);
    color: var(--text);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    z-index: 999;
}

/* Desktop sidebar toggle button */
/* Desktop sidebar toggle - hidden on mobile, flex on desktop */
#desktop-sidebar-toggle {
    display: none; /* Hidden by default (mobile) */
    width: 40px;
    height: 40px;
    padding: 0;
    transition: all 0.2s ease;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
}

/* Show desktop toggle on medium screens and up */
@media (min-width: 768px) {
    #desktop-sidebar-toggle {
        display: flex !important;
    }
}

#desktop-sidebar-toggle:hover {
    background-color: var(--theme-color, var(--primary));
    border-color: var(--theme-color, var(--primary));
    color: white;
}

/* Main Content Styles */
.main-content {
    background-color: var(--background-color, var(--background));
    flex: 1;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
    margin-left: 0 !important; /* Override Bootstrap ms-sm-auto on mobile */
    max-width: 100%;
    transition: margin-left 0.3s ease;
}

@media (min-width: 768px) {
    .main-content {
        margin-left: 220px !important; /* Override Bootstrap ms-sm-auto */
        width: calc(100% - 220px);
    }
}

@media (min-width: 992px) {
    .main-content {
        margin-left: 250px !important; /* Override Bootstrap ms-sm-auto */
        width: calc(100% - 250px);
    }
}

/* Card Styles */
.card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: box-shadow 0.2s ease;
    margin-bottom: 1.5rem;
}

.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

/* .card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: var(--heading-text-color, var(--text));
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
} */

/* Card header with title and buttons - proper space-between layout */
/* .card-header .d-flex {
    width: 100%;
} */

/* .card-header .d-flex.justify-content-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
} */

/* .card-header .d-flex.justify-content-between > div:first-child {
    flex: 1;
    min-width: 200px;
}

.card-header .d-flex.justify-content-between > div:last-child,
.card-header .d-flex.justify-content-between > a:last-child {
    flex-shrink: 0;
} */

/* Responsive adjustments for card header */
@media (max-width: 575.98px) {
    .card-header .d-flex.justify-content-between {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .card-header .d-flex.justify-content-between > div:first-child {
        width: 100%;
        margin-bottom: 0.75rem;
    }
    
    .card-header .d-flex.justify-content-between > div:last-child,
    .card-header .d-flex.justify-content-between > a:last-child {
        width: 100%;
    }
    
    .card-header .d-flex.justify-content-between .btn {
        width: 100%;
        justify-content: center;
    }
}

.card-header h5,
.card-header h6 {
    margin-bottom: 0;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    background-color: transparent;
    border-top: 1px solid var(--border);
    padding: 1rem 1.5rem;
}

/* Page Header Styles */
.page-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
}

.page-header h1,
.page-header h2 {
    margin-bottom: 0.25rem;
}

.page-header .breadcrumb {
    margin-bottom: 0;
}

/* Page Title with Action Buttons - Proper space-between layout */
.card-header .d-flex.flex-column.flex-md-row.justify-content-between,
.page-title-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    gap: 1rem;
}

@media (min-width: 768px) {
    .card-header .d-flex.flex-column.flex-md-row.justify-content-between,
    .page-title-header {
        align-items: center;
    }
}

/* Title section */
.card-header .d-flex.flex-column.flex-md-row.justify-content-between > div:first-child,
.page-title-header > div:first-child {
    flex: 1;
    min-width: 0;
}

/* Buttons section */
.card-header .d-flex.flex-column.flex-md-row.justify-content-between > div:last-child,
.card-header .d-flex.flex-column.flex-md-row.justify-content-between > a,
.card-header .d-flex.flex-column.flex-md-row.justify-content-between > .d-flex:last-child,
.page-title-header > .btn,
.page-title-header > .d-flex {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Ensure proper alignment on mobile */
@media (max-width: 767.98px) {
    .card-header .d-flex.flex-column.flex-md-row.justify-content-between,
    .page-title-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .card-header .d-flex.flex-column.flex-md-row.justify-content-between > div:first-child,
    .page-title-header > div:first-child {
        margin-bottom: 0.75rem;
    }
    
    .card-header .d-flex.flex-column.flex-md-row.justify-content-between > .d-flex:last-child,
    .page-title-header > .d-flex {
        width: 100%;
    }
}

/* Button Styles */
.btn {
    border-radius: 0.5rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn:active {
    transform: translateY(1px);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    gap: 0.375rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-rounded {
    border-radius: 2rem;
}

.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
}

.btn-icon.btn-sm {
    width: 32px;
    height: 32px;
}

/* Form Elements */
.form-control, .form-select {
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    background-color: var(--surface);
    color: var(--text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--theme-color, var(--primary));
    box-shadow: 0 0 0 3px rgba(var(--theme-color-rgb, 255, 107, 0), 0.15);
    outline: none;
}

.form-label {
    color: var(--label-text-color, var(--text));
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-text {
    font-size: 0.8125rem;
    color: var(--text-secondary, #6c757d);
    margin-top: 0.375rem;
}

.input-group-text {
    background-color: var(--secondary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

/* Tables */
.table {
    color: var(--text);
    margin-bottom: 0;
}

.table > :not(caption) > * > * {
    background-color: transparent;
    border-bottom-color: var(--border);
    padding: 0.875rem 1rem;
}

.table thead th {
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    color: var(--text-secondary, #6c757d);
    border-bottom-width: 2px;
    white-space: nowrap;
}

.table-hover > tbody > tr {
    transition: background-color 0.15s ease;
}

.table-hover > tbody > tr:hover {
    background-color: rgba(0, 0, 0, 0.025);
}

[data-theme="dark"] .table-hover > tbody > tr:hover {
    background-color: rgba(255, 255, 255, 0.025);
}

/* Table action buttons */
.table .btn-group .btn {
    padding: 0.25rem 0.5rem;
}

.table .btn-sm {
    font-size: 0.8125rem;
}

/* Progress Bars */
.progress {
    border-radius: 0.5rem;
    height: 8px;
    background-color: var(--secondary);
}

.progress-bar {
    border-radius: 0.5rem;
    background-color: var(--theme-color, var(--primary));
}

/* Dropdowns */
.dropdown-menu {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.dropdown-item {
    color: var(--text);
    border-radius: 0.375rem;
    margin: 0.125rem 0.5rem;
    padding: 0.5rem 1rem;
}

.dropdown-item:hover, .dropdown-item:focus {
    background-color: var(--secondary);
    color: var(--text);
}

.dropdown-divider {
    border-top: 1px solid var(--border);
    margin: 0.5rem 0;
}

.dropdown-header {
    color: var(--text);
    padding: 0.75rem 1rem 0.25rem;
}

/* Badges */
.badge {
    font-weight: 600;
    padding: 0.35em 0.65em;
}

/* Alerts */
.alert {
    border-radius: 0.75rem;
    border: none;
    padding: 1rem 1.5rem;
}

.alert-success {
    background-color: rgba(76, 175, 80, 0.15);
    color: var(--success);
}

.alert-warning {
    background-color: rgba(255, 152, 0, 0.15);
    color: var(--warning);
}

.alert-danger {
    background-color: rgba(244, 67, 54, 0.15);
    color: var(--error);
}

/* Pagination */
.page-link {
    background-color: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
}

.page-link:hover {
    background-color: var(--secondary);
    border-color: var(--border);
    color: var(--theme-color, var(--primary));
}

/* Settings Tabs */
.nav-tabs {
    border-bottom: 1px solid var(--border);
}

.nav-tabs .nav-link {
    border: 1px solid transparent;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
    margin-bottom: -1px;
    transition: all 0.2s ease;
}

.nav-tabs .nav-link:hover, .nav-tabs .nav-link:focus {
    border-color: var(--border) var(--border) var(--border);
    background-color: var(--secondary);
    isolation: isolate;
}

.nav-tabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link {
    color: var(--theme-color, var(--primary));
    background-color: var(--surface);
    border-color: var(--border) var(--border) var(--surface);
    font-weight: 500;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    color: var(--heading-text-color, var(--text));
}

/* Utility Classes */
.text-secondary {
    color: var(--text-secondary) !important;
}

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

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

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

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

.bg-secondary {
    background-color: var(--secondary) !important;
}

.bg-success {
    background-color: var(--success) !important;
}

.bg-error {
    background-color: var(--error) !important;
}

.bg-warning {
    background-color: var(--warning) !important;
}

.bg-info {
    background-color: var(--info) !important;
}

.bg-surface {
    background-color: var(--surface) !important;
}

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

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

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

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

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

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

.bg-opacity-10 {
    opacity: 0.1;
}

.fw-semibold {
    font-weight: 600;
}

.fw-medium {
    font-weight: 500;
}

.rounded-pill {
    border-radius: 50rem !important;
}

.shadow-sm {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.shadow {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
}

.vh-100 {
    min-height: 100vh;
}

.hover-bg:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .hover-bg:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    .main-content {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* Password visibility toggle */
.toggle-password {
    border-radius: 0 0.5rem 0.5rem 0 !important;
}

.input-group > .form-control:not(:first-child) {
    border-top-left-radius: 0.5rem !important;
    border-bottom-left-radius: 0.5rem !important;
}

.input-group > .form-control:not(:last-child) {
    border-top-right-radius: 0.5rem !important;
    border-bottom-right-radius: 0.5rem !important;
}

#settingsTabs .nav-item .nav-link{
    color: var(--label-text-color);
}
#settingsTabs .nav-item .nav-link.active{
    color: var(--theme-color);
}

/* Profile Page Styles */
.profile-avatar {
    width: 128px;
    height: 128px;
    object-fit: cover;
    border: 3px solid var(--border);
}

/* Link Styles - Using dynamic settings */
a {
    color: var(--link-color, var(--primary));
    text-decoration: none;
}

a:hover {
    color: var(--link-hover-color, var(--primary));
    text-decoration: none;
}

/* Ensure buttons and sidebar links never have text decoration */
.btn a:hover,
.sidebar .nav-link a:hover {
    text-decoration: none;
}

/* Ensure Bootstrap link styles respect our custom colors */
.btn-link {
    color: var(--link-color, var(--primary));
    text-decoration: none;
}

.btn-link:hover {
    color: var(--link-hover-color, var(--primary));
    text-decoration: none;
}

/* Media Library Styles */
.media-item {
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 1/1; /* Fixed square aspect ratio */
    display: flex;
    flex-direction: column;
    max-width: 200px; /* Set maximum width */
    max-height: 200px; /* Set maximum height */
    width: 100%; /* Ensure it takes full width of container */
    height: 100%; /* Ensure it takes full height */
    min-width: 0; /* Fix for flexbox issues */
    min-height: 0; /* Fix for flexbox issues */
    box-sizing: border-box; /* Include padding and border in element's total width and height */
}

/* Ensure Font Awesome icons are displayed correctly */
.media-item .card-img-top i[class*="fa-"] {
    font-size: 3rem;
    color: #6c757d; /* Bootstrap text-muted color */
}

.media-item .card-img-top i.fa-file-pdf {
    color: #dc3545; /* Bootstrap danger color */
}

.media-item .card-img-top i.fa-file-word {
    color: #0d6efd; /* Bootstrap primary color */
}

.media-item .card-img-top i.fa-file-excel {
    color: #198754; /* Bootstrap success color */
}

.media-item .card-img-top i.fa-file-powerpoint {
    color: #ffc107; /* Bootstrap warning color */
}

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

.media-item.border-primary {
    border: 3px solid var(--theme-color, var(--primary)) !important;
    border-radius: 10px;
}

/* Selection indicator */
.media-item .selection-indicator {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background-color: var(--theme-color, var(--primary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s ease;
    z-index: 5;
}

.media-item.border-primary .selection-indicator {
    opacity: 1;
    transform: scale(1);
}

.media-item .selection-indicator i {
    color: white;
    font-size: 12px;
}

/* Remove button styles */
.remove-media-btn {
    position: absolute;
    top: 0;
    right: 0;
    margin: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 50%;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.media-item:hover .remove-media-btn {
    opacity: 1;
}

.remove-media-btn:hover {
    transform: scale(1.1);
}

/* Fixed size container for media items */
#media-library-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    grid-gap: 1rem;
    align-items: start;
    width: 100%;
    box-sizing: border-box;
}

#media-library-items .mb-4 {
    margin-bottom: 0;
    width: 100%;
    box-sizing: border-box;
}

.card-img-top {
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: var(--secondary);
    max-width: 200px; /* Set maximum width */
    max-height: 150px; /* Set maximum height */
    width: 100%; /* Ensure it takes full width of container */
    position: relative;
    box-sizing: border-box;
}

.card-img-top img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    width: auto;
    height: auto;
    display: block;
    position: relative;
}

/* Ensure images are properly sized even after dynamic loading */
#media-library-items .card-img-top img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    width: auto;
    height: auto;
    display: block;
}

/* Force image sizing to prevent overflow */
.media-item .card-img-top img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: cover !important;
}

/* Additional fix for grid items */
#media-library-items .col-3 {
    width: 100%;
    margin-bottom: 0;
    box-sizing: border-box;
}

/* Drag and drop styles */
#media-library-items.drag-over {
    border: 2px dashed var(--theme-color, var(--primary));
    border-radius: 0.5rem;
    background-color: rgba(255, 107, 0, 0.08);
    min-height: 200px;
    position: relative;
}

#media-library-items.drag-over::before {
    content: "Drop files here to upload";
    font-size: 1.2rem;
    color: var(--theme-color, var(--primary));
    font-weight: 500;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#media-library-items.drag-over > * {
    opacity: 0.3;
    pointer-events: none;
}

/* Empty state improvements */
#no-media-message {
    text-align: center;
    padding: 2rem;
    grid-column: 1 / -1; /* Span full width */
}

#no-media-message .upload-area {
    border: 2px dashed var(--border);
    border-radius: 0.5rem;
    padding: 2rem;
    margin: 1rem 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

#no-media-message .upload-area:hover {
    border-color: var(--theme-color, var(--primary));
    background-color: rgba(255, 107, 0, 0.03);
}

#no-media-message .upload-area.drag-over {
    border-color: var(--theme-color, var(--primary));
    background-color: rgba(255, 107, 0, 0.1);
    transform: scale(1.02);
}

#no-media-message .upload-area i {
    font-size: 3rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* Gallery reordering styles */
.gallery-item {
    cursor: move;
    transition: transform 0.2s ease;
}

.gallery-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.gallery-item.drag-over {
    border: 2px dashed var(--theme-color, var(--primary));
    border-radius: 5px;
}

.sortable-placeholder {
    height: 80px;
    width: 80px;
    background-color: rgba(0, 0, 0, 0.05);
    border: 2px dashed var(--border);
    border-radius: 5px;
    margin: 5px;
}

/* Stock Status Toggle Styles */
.form-check.form-switch {
    padding-left: 3.5rem;
}

.form-check.form-switch .form-check-input {
    height: 1.8rem;
    width: 3.2rem;
    border-radius: 2rem;
    margin-left: -3.5rem;
    background-color: #e9ecef;
    border: 1px solid #ced4da;
}

.form-check.form-switch .form-check-input:checked {
    background-color: var(--theme-color, var(--primary));
    border-color: var(--theme-color, var(--primary));
}

.form-check.form-switch .form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 107, 0, 0.25);
}

.form-check.form-switch .form-check-label {
    display: flex;
    align-items: center;
    height: 1.8rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

#stock-status-text {
    font-weight: 600;
    color: var(--text);
}

.form-check-input:checked ~ .form-check-label #stock-status-text {
    color: var(--theme-color, var(--primary));
}

/* Ensure modals have proper z-index stacking */
.modal {
    z-index: 1055;
}

.modal-backdrop {
    z-index: 1050;
}

/* Specifically ensure media library modal appears above other modals */
#mediaLibraryModal {
    z-index: 1060;
}

#mediaLibraryModal .modal-backdrop {
    z-index: 1055;
}

/* ========================================
   DRAG AND DROP UPLOAD STYLES
   ======================================== */

/* Drag highlight effect for upload areas */
.drag-highlight {
    border-color: var(--theme-color, #ff6b00) !important;
    background-color: rgba(255, 107, 0, 0.05) !important;
    transition: all 0.2s ease;
}

/* Upload area hover effect */
#main-photo-upload-area:hover,
#gallery-upload-area:hover {
    border-color: var(--theme-color, #ff6b00);
    background-color: rgba(255, 107, 0, 0.02);
}

/* Main photo preview area - make it droppable */
#main-photo-preview {
    transition: all 0.2s ease;
    min-height: 200px;
}

#main-photo-preview.drag-highlight {
    border: 2px dashed var(--theme-color, #ff6b00) !important;
    background-color: rgba(255, 107, 0, 0.05) !important;
}

/* Gallery upload area styling */
#gallery-upload-area {
    transition: all 0.2s ease;
    cursor: pointer;
}

/* Upload progress indicator */
.upload-progress-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    margin-top: 10px;
}

/* Gallery item during upload */
.gallery-item.uploading-item {
    pointer-events: none;
}

/* Gallery item drag styles (for reordering) */
.gallery-item {
    cursor: grab;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.gallery-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.gallery-item.drag-over {
    border: 2px dashed var(--theme-color, #ff6b00);
    border-radius: 8px;
}

/* Drag and drop visual feedback text */
.upload-area {
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-area:hover i,
.upload-area.drag-highlight i {
    color: var(--theme-color, #ff6b00) !important;
    transform: scale(1.1);
    transition: all 0.2s ease;
}

.upload-area:hover p,
.upload-area.drag-highlight p {
    color: var(--theme-color, #ff6b00) !important;
}

/* ========================================
   COMPREHENSIVE RESPONSIVE STYLES
   ======================================== */

/* Mobile First Responsive Adjustments */
@media (max-width: 575.98px) {
    /* Extra small devices (phones) */
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .main-content {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    
    /* Cards */
    .card {
        margin-bottom: 0.75rem;
        border-radius: 0.5rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .card-header {
        padding: 0.75rem;
    }
    
    /* Summary cards - stack on mobile */
    .col-md-3.mb-3,
    .col-md-4.mb-3 {
        margin-bottom: 0.5rem !important;
    }
    
    /* Tables */
    .table-responsive {
        font-size: 0.8rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.35rem;
        white-space: nowrap;
    }
    
    /* Hide less important columns on mobile */
    .table .hide-mobile {
        display: none;
    }
    
    /* Buttons */
    .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .btn-group-sm > .btn {
        padding: 0.2rem 0.4rem;
    }
    
    /* Forms */
    .form-control,
    .form-select {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
    }
    
    .form-label {
        font-size: 0.85rem;
        margin-bottom: 0.25rem;
    }
    
    /* Filter form - stack on mobile */
    .row.g-3 > [class*="col-md-"] {
        margin-bottom: 0.5rem;
    }
    
    /* Badges */
    .badge {
        font-size: 0.7rem;
        padding: 0.25em 0.5em;
    }
    
    /* Stat cards text */
    .card h3,
    .card .h3 {
        font-size: 1.25rem;
    }
    
    .card h6,
    .card .h6 {
        font-size: 0.75rem;
    }
    
    /* Page title */
    .h4.mb-0 {
        font-size: 1.1rem;
    }
    
    /* Alert */
    .alert {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
    
    /* Modal */
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    /* DataTables */
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        text-align: center !important;
        float: none !important;
        margin-bottom: 0.5rem;
    }
    
    .dataTables_wrapper .dataTables_filter input {
        width: 100% !important;
        margin-left: 0 !important;
    }
    
    .dataTables_wrapper .dataTables_paginate .paginate_button {
        padding: 0.25rem 0.5rem !important;
        margin: 0.1rem !important;
    }
}

@media (max-width: 767.98px) {
    /* Small devices (landscape phones) */
    .main-content {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    
    /* Header adjustments */
    header .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* User dropdown - hide text on mobile */
    #userDropdown .d-md-block {
        display: none !important;
    }
    
    /* Notification dropdown */
    .notification-dropdown {
        width: 280px;
        max-width: calc(100vw - 20px);
    }
    
    /* Filter buttons - full width on mobile */
    .d-flex.align-items-end.gap-2 {
        flex-direction: column;
        align-items: stretch !important;
        width: 100%;
    }
    
    .d-flex.align-items-end.gap-2 .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* Summary cards - 2 columns on tablet */
    .row.mb-4 > .col-md-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    /* Status summary - full width */
    .row.mb-4 > .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    /* Chart container */
    .chart-container {
        height: 200px !important;
    }
    
    /* Welcome card */
    .d-flex.gap-4 {
        flex-wrap: wrap;
        gap: 1rem !important;
    }
    
    .d-flex.gap-4 > div {
        flex: 1 1 calc(33.333% - 1rem);
        min-width: 80px;
        text-align: center;
    }
    
    /* Action buttons in welcome card */
    .text-lg-end {
        margin-top: 1rem;
    }
    
    .text-lg-end .btn {
        margin-bottom: 0.5rem;
        display: inline-block;
    }
}

/* ========================================
   MOBILE HEADER TOGGLE BUTTON
   ======================================== */

#sidebar-toggle {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    transition: all 0.2s ease;
}

#sidebar-toggle:hover {
    background-color: var(--theme-color, var(--primary));
    color: white;
    border-color: var(--theme-color, var(--primary));
}

@media (min-width: 768px) {
    #sidebar-toggle {
        display: none !important;
    }
}

/* ========================================
   MOBILE CLOSE BUTTON FOR SIDEBAR
   ======================================== */

.sidebar-close {
    display: none;
}

@media (max-width: 767.98px) {
    .sidebar-close {
        display: flex;
        position: absolute;
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background-color: transparent;
        border: none;
        color: var(--text);
        font-size: 1.25rem;
        cursor: pointer;
        z-index: 1051;
        transition: all 0.2s ease;
    }
    
    .sidebar-close:hover {
        background-color: rgba(0, 0, 0, 0.1);
        color: var(--error);
    }
}

/* ========================================
   RESPONSIVE TABLE IMPROVEMENTS
   ======================================== */

/* Mobile-friendly table cells */
@media (max-width: 767.98px) {
    .table td,
    .table th {
        min-width: 80px;
    }
    
    .table td:first-child,
    .table th:first-child {
        position: sticky;
        left: 0;
        background-color: var(--surface);
        z-index: 1;
    }
}

/* ========================================
   RESPONSIVE MODAL IMPROVEMENTS
   ======================================== */

@media (max-width: 575.98px) {
    .modal-dialog {
        max-width: calc(100% - 1rem);
        margin: 0.5rem auto;
    }
    
    .modal-content {
        border-radius: 0.75rem;
    }
    
    .modal-header {
        padding: 0.75rem 1rem;
    }
    
    .modal-title {
        font-size: 1rem;
    }
    
    .modal-body {
        padding: 0.75rem 1rem;
    }
    
    .modal-footer {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .modal-footer .btn {
        flex: 1;
        min-width: 100px;
    }
}

/* ========================================
   RESPONSIVE FORM IMPROVEMENTS
   ======================================== */

@media (max-width: 767.98px) {
    /* Stack form elements */
    .row.g-3 > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    /* Filter form specific */
    form.row.g-3 > .col-md-2,
    form.row.g-3 > .col-md-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    form.row.g-3 > .col-md-3.d-flex {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* ========================================
   RESPONSIVE CARD GRID
   ======================================== */

@media (max-width: 575.98px) {
    .row.g-4 {
        --bs-gutter-x: 0.5rem;
        --bs-gutter-y: 0.5rem;
    }
    
    .col-md-6.col-lg-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* ========================================
   TOUCH-FRIENDLY IMPROVEMENTS
   ======================================== */

@media (max-width: 767.98px) {
    /* Larger touch targets */
    .btn,
    .nav-link,
    .dropdown-item {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    .nav-link {
        justify-content: flex-start;
    }
    
    /* Checkbox and radio larger on mobile */
    .form-check-input {
        width: 1.25em;
        height: 1.25em;
    }
    
    /* Better spacing for touch */
    .form-check {
        padding-left: 1.75em;
        margin-bottom: 0.75rem;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .sidebar,
    #sidebar-toggle,
    .sidebar-overlay,
    .btn,
    .dropdown,
    .modal {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    .card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}

/* ========================================
   RESPONSIVE BUTTON UTILITIES
   ======================================== */

/* Button that is small on mobile, normal on md+ */
.btn-sm.btn-md-normal {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

@media (min-width: 768px) {
    .btn-sm.btn-md-normal {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }
}

/* Responsive heading utilities */
.h5.h4-md {
    font-size: var(--mobile-h5-size, 14px);
}

.h6.h5-md {
    font-size: var(--mobile-h6-size, 12px);
}

@media (min-width: 768px) {
    .h5.h4-md {
        font-size: var(--desktop-h4-size, 20px);
    }
    
    .h6.h5-md {
        font-size: var(--desktop-h5-size, 18px);
    }
}

/* Responsive text utilities */
.h5.h3-md {
    font-size: var(--mobile-h5-size, 14px);
}

.h6.h5-md {
    font-size: var(--mobile-h6-size, 12px);
}

@media (min-width: 768px) {
    .h5.h3-md {
        font-size: var(--desktop-h3-size, 24px);
    }
}

/* ========================================
   RESPONSIVE ACTION BUTTONS
   ======================================== */

@media (max-width: 767.98px) {
    /* Make action button groups stack nicely */
    .btn-group.btn-group-sm .btn {
        padding: 0.35rem 0.5rem;
    }
    
    /* Hide text in action buttons on very small screens */
    .btn-group .btn span.d-none.d-md-inline {
        display: none !important;
    }
}

/* ========================================
   RESPONSIVE HEADER IMPROVEMENTS
   ======================================== */

@media (max-width: 575.98px) {
    header.py-3 {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }
    
    header h1.h4 {
        font-size: 1rem;
    }
    
    header .breadcrumb {
        font-size: 0.7rem;
    }
    
    /* Smaller notification dropdown */
    .notification-dropdown {
        width: 280px;
        max-width: calc(100vw - 2rem);
    }
    
    /* User dropdown adjustments */
    #userDropdown img {
        width: 28px !important;
        height: 28px !important;
    }
}

/* ========================================
   RESPONSIVE STAT CARDS
   ======================================== */

@media (max-width: 575.98px) {
    .stat-card .card-body {
        padding: 0.75rem !important;
    }
    
    .stat-card .stat-icon {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.8rem !important;
    }
    
    .stat-card h3.h6 {
        font-size: 0.65rem !important;
    }
    
    .stat-card p.h5 {
        font-size: 0.9rem !important;
    }
}

/* ========================================
   RESPONSIVE CHART CONTAINERS
   ======================================== */

@media (max-width: 767.98px) {
    .chart-container {
        height: 200px !important;
        min-height: 180px;
    }
}

@media (max-width: 575.98px) {
    .chart-container {
        height: 180px !important;
        min-height: 150px;
    }
}

/* ========================================
   RESPONSIVE TABS (Scrollable on mobile)
   ======================================== */

.nav-tabs.flex-nowrap {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.nav-tabs.flex-nowrap::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

@media (max-width: 767.98px) {
    .nav-tabs.flex-nowrap {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 2px;
    }
    
    .nav-tabs.flex-nowrap .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}

/* ========================================
   RESPONSIVE ALERTS
   ======================================== */

@media (max-width: 575.98px) {
    .alert {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    .alert.rounded-pill {
        border-radius: 0.5rem !important;
    }
    
    .alert .btn-close {
        padding: 0.5rem;
    }
}

/* ========================================
   RESPONSIVE DATATABLE IMPROVEMENTS
   ======================================== */

@media (max-width: 767.98px) {
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        float: none;
        text-align: left;
        margin-bottom: 0.5rem;
    }
    
    .dataTables_wrapper .dataTables_filter input {
        width: 100%;
        margin-left: 0;
    }
    
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        float: none;
        text-align: center;
        margin-top: 0.5rem;
    }
    
    .dataTables_wrapper .dataTables_paginate .paginate_button {
        padding: 0.25rem 0.5rem;
    }
}

/* ========================================
   RESPONSIVE BADGE SIZES
   ======================================== */

@media (max-width: 575.98px) {
    .badge {
        font-size: 0.65rem;
        padding: 0.25em 0.5em;
    }
    
    .badge.px-3 {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
}

/* ========================================
   RESPONSIVE ACTION COLUMN
   ======================================== */

@media (max-width: 767.98px) {
    /* Smaller action buttons on mobile */
    .btn-group-sm .btn,
    td .btn-sm {
        padding: 0.25rem 0.4rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 400px) {
    /* Stack action buttons vertically on very small screens */
    .btn-group.btn-group-sm {
        flex-direction: column;
    }
    
    .btn-group.btn-group-sm .btn {
        border-radius: 0.25rem !important;
        margin-bottom: 2px;
    }
}

/* ========================================
   SAFE AREA INSETS (for notched phones)
   ======================================== */

@supports (padding: env(safe-area-inset-bottom)) {
    .sidebar {
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .main-content {
        padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
    }
}

/* ========================================
   PROFESSIONAL UI UTILITY CLASSES
   ======================================== */

/* Consistent section spacing */
.section-gap {
    margin-bottom: 1.5rem;
}

.section-gap-lg {
    margin-bottom: 2rem;
}

/* Content wrapper for consistent padding */
.content-wrapper {
    padding: 1.5rem;
}

/* Divider styles */
.divider {
    height: 1px;
    background-color: var(--border);
    margin: 1.5rem 0;
}

/* Status indicators */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.success { background-color: #10b981; }
.status-dot.warning { background-color: #f59e0b; }
.status-dot.danger { background-color: #ef4444; }
.status-dot.info { background-color: #3b82f6; }

/* Empty state styling */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-secondary, #6c757d);
}

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

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

/* Smooth scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background, #f8f9fa);
}

::-webkit-scrollbar-thumb {
    background: var(--border, #dee2e6);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary, #6c757d);
}

/* Animation utilities */
.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Hover lift effect */
.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.1);
}

/* Text truncation */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Focus visible for accessibility */
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
    outline: 2px solid var(--theme-color, var(--primary));
    outline-offset: 2px;
}
