/* SchedDSI Enterprise Theme */
/* Design System for Manufacturing Scheduling Application */

/*
 * Design Tokens & Variables
 * --------------------------
 */
 :root {

    --spacing-xl-plus-footer: calc(var(--spacing-xl) + var(--footer-height));

    /* Brand Colors - Professional scheduling palette */
    --primary-color: #154c79;      /* Chathams Blue - primary brand color */
    --secondary-color: #1e81b0;    /* Eastern Blue - secondary brand color */
    --accent-color: #e28743;       /* Burnt Sienna - accent/highlight color */
    --light-accent: #eab676;       /* Tacao - lighter accent */
    --lighter-accent: #76b5c5;     /* Glacier - subtle accent */
    --lightest-accent: #abdbe3;    /* Powder Blue - very light accent */

    /* Override Bootstrap's primary color to match brand */
    --bs-primary: var(--primary-color);
    --bs-primary-rgb: 21, 76, 121;
    --bs-link-color: var(--primary-color);
    --bs-link-color-rgb: 21, 76, 121;
    --bs-link-hover-color: #103a5c;
    --bs-link-hover-color-rgb: 16, 58, 92;

    /* RGB values for rgba() usage */
    --primary-color-rgb: 21, 76, 121;      /* Chathams Blue RGB */
    --secondary-color-rgb: 30, 129, 176;   /* Eastern Blue RGB */
    --deep-blue-rgb: 6, 57, 112;           /* Catalina Blue RGB */
    --success-color-rgb: 46, 139, 87;      /* Sea Green RGB */
    --warning-color-rgb: 226, 135, 67;     /* Burnt Sienna RGB */
    --danger-color-rgb: 220, 53, 69;       /* Red RGB for destructive actions */
    --error-color-rgb: 135, 62, 35;        /* Burnt Umber RGB */
    --gray-600-rgb: 112, 112, 102;         /* Gray 600 RGB */

    /* Additional Brand Colors */
    --dark-accent: #873e23;        /* Burnt Umber - dark accent */
    --darkest-color: #21130d;      /* Eternity - darkest color */
    --light-neutral: #eeeee4;      /* Green White - light background */
    --deep-blue: #063970;          /* Catalina Blue - deep blue */

    /* Semantic Colors */
    --color-success: #2e8b57;      /* Sea Green - based on palette */
    --color-warning: #e28743;      /* Burnt Sienna - accent color */
    --color-error: #873e23;        /* Burnt Umber - dark accent */
    --color-danger: #dc3545;       /* Red - for destructive actions */
    --color-info: #1e81b0;         /* Eastern Blue - secondary color */

    /* Neutral Colors */
    --color-gray-50: #f8f8f5;
    --color-gray-100: #eeeee4;     /* Green White */
    --color-gray-200: #e0e0d6;
    --color-gray-300: #d0d0c6;
    --color-gray-400: #b0b0a6;
    --color-gray-500: #909086;
    --color-gray-600: #707066;
    --color-gray-700: #505046;
    --color-gray-800: #303026;
    --color-gray-900: #21130d;     /* Eternity */

    /* Text Colors */
    --text-primary: var(--color-gray-900);
    --text-secondary: var(--color-gray-700);
    --text-tertiary: var(--color-gray-500);
    --text-on-primary: white;
    --text-on-dark: white;
    --text-on-light: var(--color-gray-900);

    /* Table Density Settings */
    --table-cell-padding-normal: 4px 8px;
    --table-cell-padding-high: 0px 2px;
    --table-header-padding-normal: 6px 8px;
    --table-header-padding-high: 1px 2px;

    /* Layout Variables */
    --navbar-height: 70px;
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 70px;
    --footer-height: 60px;

    /* Spacing Scale */
    --spacing-xs: 0.25rem;   /* 4px */
    --spacing-sm: 0.5rem;    /* 8px */
    --spacing-md: 1rem;      /* 16px */
    --spacing-lg: 1.5rem;    /* 24px */
    --spacing-xl: 2rem;      /* 32px */
    --spacing-2xl: 3rem;     /* 48px */

    /* Border Radius */
    --radius-sm: 0.25rem;    /* 4px */
    --radius-md: 0.375rem;   /* 6px */
    --radius-lg: 0.5rem;     /* 8px */
    --radius-xl: 0.75rem;    /* 12px */
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(33, 19, 13, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(33, 19, 13, 0.1), 0 2px 4px -1px rgba(33, 19, 13, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(33, 19, 13, 0.1), 0 4px 6px -2px rgba(33, 19, 13, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(33, 19, 13, 0.1), 0 10px 10px -5px rgba(33, 19, 13, 0.04);

    /* Typography */
    --font-family-base: system-ui, "Segoe UI", -apple-system,  Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-loose: 1.75;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;

    /* Z-index layers */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-toast: 1080;
    --z-loader: 1090;
}

/* Dark Mode Theming */
[data-bs-theme="dark"] {
    --primary-color: #1e81b0;     /* Eastern Blue - lighter for dark mode */
    --bs-primary: var(--primary-color);
    --bs-primary-rgb: 30, 129, 176;
    --bs-link-color: var(--primary-color);
    --bs-link-color-rgb: 30, 129, 176;
    --secondary-color: #76b5c5;    /* Glacier - lighter for visibility */
    --accent-color: #e28743;       /* Burnt Sienna - keep accent */
    --light-accent: #eab676;       /* Tacao - keep accent */
    --lighter-accent: #abdbe3;     /* Powder Blue - adjusted for dark mode */
    --lightest-accent: #eeeee4;    /* Green White - lightest in dark mode */

    --text-primary: var(--color-gray-100);
    --text-secondary: var(--color-gray-300);
    --text-tertiary: var(--color-gray-400);

    /* Dark background colors */
    --body-bg: #1a1a1a;
    --navbar-bg: #121212;
    --sidebar-bg: var(--deep-blue);
    --card-bg: #242424;
    --input-bg: #333333;
    --footer-bg: #121212;

    /* Shadows for dark mode */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.14);
}

/* Bootstrap Primary Color Overrides
 * Override Bootstrap 5.1's default blue (#0d6efd) with enterprise brand color.
 * Bootstrap 5.1 uses hardcoded properties (not CSS variables), so we override directly.
 */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #103a5c;
    border-color: #0e3250;
}

.btn-primary:focus {
    background-color: #103a5c;
    border-color: #0e3250;
    box-shadow: 0 0 0 0.25rem rgba(var(--primary-color-rgb), 0.5);
}

.btn-primary:active,
.btn-primary.active,
.show > .btn-primary.dropdown-toggle {
    background-color: #0e3250;
    border-color: #0c2a44;
}

.btn-primary:disabled,
.btn-primary.disabled {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.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: #fff;
}

.btn-outline-primary:focus {
    box-shadow: 0 0 0 0.25rem rgba(var(--primary-color-rgb), 0.5);
}

.btn-outline-primary:active,
.btn-outline-primary.active,
.show > .btn-outline-primary.dropdown-toggle {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

.border-primary {
    border-color: var(--primary-color) !important;
}

.badge.bg-primary {
    background-color: var(--primary-color) !important;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-input:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.25rem rgba(var(--primary-color-rgb), 0.25);
}

.form-switch .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

a {
    color: var(--primary-color);
}

a:hover {
    color: #103a5c;
}

.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--primary-color);
}

.nav-link.active {
    color: var(--primary-color);
}

.page-link {
    color: var(--primary-color);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-check:checked + .btn-primary,
.btn-check:active + .btn-primary {
    background-color: #0e3250;
    border-color: #0c2a44;
}

/* Base Styles */
body {
    font-family: var(--font-family-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    color: var(--text-primary);
    overflow-x: hidden;
    letter-spacing: -0.01em;
}

/* Alternative approach - ensure dropdown positioning works */

/* Typography Classes */
.heading-1, h1 {
    font-family: 'Inter', sans-serif;
    font-size: 2.25rem;
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    letter-spacing: -0.025em;
}

.heading-2, h2 {
    font-family: 'Inter', sans-serif;
    font-size: 1.875rem;
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    letter-spacing: -0.025em;
}

.heading-3, h3 {
    font-family: 'Inter', sans-serif;
    font-size: 1.5rem;
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    letter-spacing: -0.015em;
}

.heading-4, h4 {
    font-family: 'Inter', sans-serif;
    font-size: 1.25rem;
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-tight);
    letter-spacing: -0.01em;
}

.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: var(--z-loader);
    backdrop-filter: blur(2px);
    transition: all var(--transition-normal);
}

[data-bs-theme="dark"] .loading-overlay {
    background-color: rgba(17, 24, 39, 0.7);
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
}

.loading-spinner .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Navbar Styling */
.enterprise-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    background: white;
    box-shadow: var(--shadow-md);
    z-index: var(--z-fixed);
    display: flex;
    align-items: center;
    padding: 0 var(--spacing-xl);
    overflow: visible; /* Ensure dropdowns can extend beyond navbar bounds */
}

.enterprise-navbar::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: var(--sidebar-width);
    right: 0;
    height: 8px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.15), transparent);
    pointer-events: none;
    transition: left var(--transition-normal);
}

.sidebar-collapsed .enterprise-navbar::after {
    left: var(--sidebar-collapsed-width);
}

[data-bs-theme="dark"] .enterprise-navbar {
    background: var(--navbar-bg);
    border-bottom: 1px solid var(--color-gray-700);
}

[data-bs-theme="dark"] .enterprise-navbar::after {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), transparent);
}

.enterprise-navbar .logo {
    height: 40px;
    width: auto;
    margin: 5px 0 0 -5px;
}

.enterprise-navbar .nav-item {
    display: flex;
    align-items: center;
}

/* Navbar elements */
.navbar-icon-btn {
    color: var(--primary-color);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ensure navbar dropdown appears above sticky headers */
.enterprise-navbar .dropdown-menu {
    z-index: 9999 !important;
    position: absolute !important;
}

/* Ensure the dropdown container also has proper z-index and positioning */
.enterprise-navbar .dropdown {
    z-index: 9999;
    position: static; /* Ensure dropdown can position relative to viewport */
}

/* Additional fix for Bootstrap dropdown positioning */
.enterprise-navbar .dropdown.show .dropdown-menu {
    display: block !important;
    position: absolute !important;
    z-index: 9999 !important;
    transform: translate3d(0, 0, 0); /* Force hardware acceleration and new stacking context */
}

/* Styles for dropdown when moved to body */
.navbar-dropdown-moved {
    position: fixed !important;
    z-index: 99999 !important;
    display: block !important;
    min-width: 200px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15) !important;
}

.navbar-icon-btn:hover {
    background-color: rgba(30, 129, 176, 0.1);  /* Eastern Blue with transparency */
    color: var(--secondary-color);
    transform: translateY(-1px);
}

[data-bs-theme="dark"] .navbar-icon-btn {
    color: var(--light-accent);
}

[data-bs-theme="dark"] .navbar-icon-btn:hover {
    background-color: rgba(234, 182, 118, 0.1);  /* Tacao with transparency */
    color: var(--light-accent);
}

.navbar-icon {
    font-size: 1.2rem;
    color: var(--primary-color);
}

[data-bs-theme="dark"] .navbar-icon {
    color: var(--light-accent);
}

/* Sidebar Styling */
.sidebar {
    position: fixed;
    top: var(--navbar-height);
    bottom: 0;
    left: 0;
    width: var(--sidebar-width);
    background: var(--primary-color);
    z-index: var(--z-fixed);
    transition: width var(--transition-normal);
    overflow-x: hidden;
    overflow-y: auto;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
}

[data-bs-theme="dark"] .sidebar {
    background: var(--sidebar-bg);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width) !important;
}

/* Sidebar header for toggle button */
.sidebar-header {
    height: 32px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-right: var(--spacing-sm);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all var(--transition-normal);
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding-right: 0;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.875rem;
    font-weight: var(--font-weight-medium);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    white-space: nowrap;
    overflow: hidden;
    border-left: 3px solid transparent;
    transition: all var(--transition-fast);
    letter-spacing: -0.01em;
}

.sidebar .nav-link:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link.active {
    color: white;
    font-weight: var(--font-weight-medium);
    border-left: 3px solid white;
    background-color: rgba(255, 255, 255, 0.15);
}

.sidebar .nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.sidebar.collapsed .nav-link span {
    opacity: 0;
    display: none;
}

.sidebar.collapsed .nav-link {
    padding: var(--spacing-sm);
    justify-content: center;
}

.sidebar.collapsed .nav-link i {
    margin: 0;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    background: transparent;
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform var(--transition-normal);
}

.sidebar-toggle:hover {
    transform: scale(1.1);
}

.sidebar.collapsed .sidebar-toggle {
    transform: rotate(180deg);
    margin: 0;
}

.sidebar.collapsed .sidebar-toggle:hover {
    transform: rotate(180deg) scale(1.1);
}

/* Content Wrapper */
.content-wrapper {
    display: flex;
    min-height: calc(100vh - var(--navbar-height) - var(--footer-height));
    padding-top: var(--navbar-height);
    margin-top: 0;
    position: relative;
    padding-bottom: var(--footer-height);
}

/* Main Content Area */
.main-content {
    flex: 1;
    padding: var(--spacing-xl);
    padding-bottom: var(--footer-height);
    min-height: calc(100vh - var(--navbar-height) - var(--footer-height));
    margin-left: var(--sidebar-width);
    transition: margin-left var(--transition-normal);
    width: auto;
    position: relative;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--color-gray-400) var(--color-gray-100);
}

[data-bs-theme="dark"] .main-content {
    background-color: var(--body-bg);
    scrollbar-color: var(--color-gray-600) var(--color-gray-800);
}

.main-content.sidebar-collapsed {
    margin-left: var(--sidebar-collapsed-width);
}

.main-content.sidebar-expanded {
    margin-left: var(--sidebar-width);
}

/* Enterprise Footer */
.enterprise-footer {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--footer-height);
    background: white;
    border-top: 1px solid var(--color-gray-200);
    padding: 0 var(--spacing-xl);
    display: flex;
    align-items: center;
    transition: left var(--transition-normal);
    z-index: var(--z-fixed);
}

.enterprise-footer > div {
    width: 100%;
    display: flex;
    justify-content: space-between;
}

[data-bs-theme="dark"] .enterprise-footer {
    background: var(--footer-bg);
    border-top-color: var(--color-gray-700);
}

.enterprise-footer.sidebar-collapsed {
    left: var(--sidebar-collapsed-width);
}

.enterprise-footer.sidebar-expanded {
    left: var(--sidebar-width);
}

.enterprise-footer .copyright-text,
.enterprise-footer .version-text {
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

/* Navigation Dividers */
.nav-divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.1);
    margin: 0.25rem 0.75rem;
}

/* Bottom Navigation Links */
.sidebar-bottom-links {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
}

.sidebar-bottom-links .nav-link {
    height: var(--footer-height);
    display: flex;
    align-items: center;
    padding: 0 var(--spacing-lg);
    gap: var(--spacing-md);
}

.sidebar-bottom-links .nav-item {
    display: flex;
    align-items: center;
    height: var(--footer-height);
    width: 100%;
}

.sidebar-bottom-links .nav-link i {
    width: 24px;
    text-align: center;
    font-size: 1.1rem;
}

/* Mobile Responsive Styles */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-normal);
    }

    .sidebar.mobile-visible {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding-bottom: var(--footer-height);
    }

    .enterprise-footer {
        left: 0;
    }
}

/* Medium screens (tablet) specific styles */
@media (min-width: 768px) and (max-width: 991.98px) {
    .main-content.sidebar-collapsed {
        margin-left: var(--sidebar-collapsed-width);
    }

    .main-content.sidebar-expanded {
        margin-left: var(--sidebar-width);
    }

    .enterprise-footer.sidebar-collapsed {
        left: var(--sidebar-collapsed-width);
    }

    .enterprise-footer.sidebar-expanded {
        left: var(--sidebar-width);
    }
}

@media (max-width: 767.98px) {
    .main-content {
        padding: var(--spacing-md);
        padding-bottom: var(--footer-height);
    }

    .enterprise-footer {
        padding: 0 var(--spacing-md);
    }
}

/* Mobile Overlay */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: calc(var(--z-fixed) - 1);
    display: none;
    transition: opacity var(--transition-normal);
}

.mobile-overlay.active {
    display: block;
}

@media (min-width: 992px) {
    .mobile-overlay {
        display: none !important;
    }
}

/* Audit Log Modal Styling - Fixed Header/Footer with Scrollable Body */
#auditLogModal .modal-dialog {
    height: 90vh;
    max-height: 90vh;
    display: flex;
    align-items: center;
    margin: 5vh auto;
}

#auditLogModal .modal-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

#auditLogModal .modal-header {
    flex-shrink: 0;
    border-bottom: 2px solid var(--color-gray-200);
    background: var(--color-gray-50);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

[data-bs-theme="dark"] #auditLogModal .modal-header {
    background: var(--color-gray-800);
    border-bottom-color: var(--color-gray-600);
}

#auditLogModal .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
}

#auditLogModal .modal-footer {
    flex-shrink: 0;
    border-top: 2px solid var(--color-gray-200);
    background: var(--color-gray-50);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

[data-bs-theme="dark"] #auditLogModal .modal-footer {
    background: var(--color-gray-800);
    border-top-color: var(--color-gray-600);
}

/* Audit Log Content Scrolling */
#auditLogContent {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#auditLogContent .row.mb-3 {
    flex-shrink: 0;
}

#auditLogContent .table-responsive {
    flex: 1;
    overflow-y: auto;
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-md);
    background: white;
}

[data-bs-theme="dark"] #auditLogContent .table-responsive {
    border-color: var(--color-gray-600);
    background: var(--color-gray-800);
}

/* Audit Log Table Styling */
#auditLogContent .table {
    margin-bottom: 0;
}

#auditLogContent .table thead th {
    position: sticky;
    top: 0;
    background: var(--color-gray-100);
    border-bottom: 2px solid var(--color-gray-300);
    font-weight: var(--font-weight-semibold);
    z-index: 10;
}

[data-bs-theme="dark"] #auditLogContent .table thead th {
    background: var(--color-gray-700);
    border-bottom-color: var(--color-gray-500);
    color: var(--text-primary);
}

#auditLogContent .table tbody tr:hover {
    background-color: var(--color-gray-50);
}

[data-bs-theme="dark"] #auditLogContent .table tbody tr:hover {
    background-color: var(--color-gray-700);
}

/* Empty state styling */
#auditLogEmpty {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

/* Loading indicator centering */
#auditLogLoadingIndicator {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

/* Table Density Styles */
/* High density mode - compact spacing for more data on screen */
.table-density-high .excel-cell {
    padding: var(--table-cell-padding-high) !important;
}

.table-density-high .excel-header {
    padding: var(--table-header-padding-high) !important;
}

/* Ultra-compact font sizes and spacing for maximum density */
.table-density-high .excel-table {
    font-size: 9px !important;
}

.table-density-high .excel-header {
    font-size: 8px !important;
}

/* Minimal line height for maximum row packing */
.table-density-high .excel-cell {
    line-height: 1.0 !important;
    min-height: auto !important;
}

.table-density-high .excel-header {
    line-height: 1.0 !important;
    min-height: auto !important;
}

/* Remove any extra margins in high density mode */
.table-density-high .excel-table tbody tr {
    height: auto !important;
}

.table-density-high .excel-table thead tr {
    height: auto !important;
}

/* Normal density mode - comfortable spacing (default) */
.table-density-normal .excel-cell {
    padding: var(--table-cell-padding-normal) !important;
}

.table-density-normal .excel-header {
    padding: var(--table-header-padding-normal) !important;
}

/* ============================================
   Button Components
   ============================================ */

/* Professional Button Styling - Compact */
.btn-professional {
    background: var(--primary-color);
    border: none;
    color: white;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(var(--primary-color-rgb), 0.2);
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-width: 38px;
    height: 38px;
}

.btn-professional:hover {
    background: var(--deep-blue);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(var(--primary-color-rgb), 0.3);
    text-decoration: none;
}

.btn-professional:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(var(--primary-color-rgb), 0.2);
}

.btn-professional.btn-success {
    background: var(--color-success);
    box-shadow: 0 2px 4px rgba(var(--success-color-rgb), 0.2);
}

.btn-professional.btn-success:hover {
    background: #25724a;
    box-shadow: 0 4px 8px rgba(var(--success-color-rgb), 0.3);
}

.btn-professional.btn-info {
    background: var(--color-info);
    box-shadow: 0 2px 4px rgba(var(--secondary-color-rgb), 0.2);
}

.btn-professional.btn-info:hover {
    background: var(--primary-color);
    box-shadow: 0 4px 8px rgba(var(--secondary-color-rgb), 0.3);
}

.btn-professional.btn-secondary {
    background: var(--color-gray-600);
    box-shadow: 0 2px 4px rgba(var(--gray-600-rgb), 0.2);
}

.btn-professional.btn-secondary:hover {
    background: var(--color-gray-700);
    box-shadow: 0 4px 8px rgba(var(--gray-600-rgb), 0.3);
}

.btn-professional.btn-warning {
    background: #ffc107;
    color: #212529;
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.2);
}

.btn-professional.btn-warning:hover {
    background: #e0a800;
    color: #212529;
    box-shadow: 0 4px 8px rgba(255, 193, 7, 0.3);
}

.btn-professional.btn-area-filter {
    background: var(--secondary-color);
    box-shadow: 0 2px 4px rgba(var(--secondary-color-rgb), 0.2);
}

.btn-professional.btn-area-filter:hover {
    background: var(--primary-color);
    box-shadow: 0 4px 8px rgba(var(--secondary-color-rgb), 0.3);
}

/* Danger/Alert Buttons - Use bright red for urgency */
.btn-danger {
    background: var(--color-danger) !important;
    border-color: var(--color-danger) !important;
    color: white !important;
}

.btn-danger:hover {
    background: #c82333 !important;
    border-color: #bd2130 !important;
    color: white !important;
}

/* Action Buttons Container */
.action-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.action-buttons-left {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.action-buttons-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Button Group Styling */
.btn-group-unified .btn-professional {
    border-radius: 0;
}

.btn-group-unified .btn-professional:first-child {
    border-radius: 6px 0 0 6px;
}

.btn-group-unified .btn-professional:last-child {
    border-radius: 0 6px 6px 0;
}

.btn-group-unified .dropdown-toggle::after {
    margin-left: 0.25rem;
}

/* Compact dropdown */
.btn-group-unified .dropdown-toggle {
    padding-right: 0.5rem;
}
