/* Modern UI Theme */
:root {
    --primary: #2f855a;
    /* Vortex Green */
    --secondary: #4fd1c5;
    /* Vortex Teal */
    --success: #2f855a;
    --warning: #ecc94b;
    --danger: #e53e3e;
    --background: #f7fafc;
    --bs-nav-link-color: var(--secondary) !important;


    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --border-radius: 0.375rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --box-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    --transition: all 0.2s ease-in-out;
}

/* Base styles */
body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.9rem;
    background-color: #f5f7fa;
    color: var(--gray-800);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navigation styles */
.modern-header {
    background: linear-gradient(135deg, var(--primary) 0%, #38a169 100%) !important;
    padding: 0.5rem 1rem;
    /* Reduced from 0.3rem 1rem */
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    height: 60px;
    /* Fixed height for consistency */
}

.brand-icon {
    background: var(--primary) !important;
    border: 2px solid white;
    border-radius: 12px;
    padding: 10px;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.15),
        0 2px 4px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    position: relative;
    overflow: hidden;
}

.brand-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    transition: left 0.5s;
}

.brand-icon:hover::before {
    left: 100%;
}

.brand-icon:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.2),
        0 4px 10px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.brand-icon i {
    color: var(--secondary);
    font-size: 1.4rem;
    font-weight: 600;
    z-index: 1;
    position: relative;
}

.brand-icon-large {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.brand-icon-large:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.navbar-brand span {
    font-size: 1.3rem;
    color: white !important;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.navbar-brand:hover .brand-icon {
    transform: rotate(5deg) scale(1.1);
}

.modern-nav {
    border-bottom: none !important;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08) !important;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
    position: fixed;
    top: 60px;
    /* Match header height */
    left: 0;
    right: 0;
    z-index: 1020;
    height: 65px;
    /* Fixed height */
}

.nav-container {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.nav-scroll-btn {
    background: rgba(47, 133, 90, 0.1);
    border: 1px solid rgba(47, 133, 90, 0.2);
    color: var(--primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin: 0 10px;
    flex-shrink: 0;
}

.nav-scroll-btn:hover {
    background: rgba(var(--bs-primary-rgb), 0.2);
    transform: scale(1.1);
}

.nav-scroll-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.nav-scroll-btn i {
    font-size: 1.2rem;
}

.horizontal-nav {
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 0 1rem;
    /* Show scrollbars for better UX */
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--bs-primary-rgb), 0.3) transparent;
    scroll-behavior: smooth;
    position: relative;
    /* Ensure proper scrolling */
    min-width: 0;
    /* Hide scrollbar but keep functionality */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.horizontal-nav::-webkit-scrollbar {
    display: none;
}

/* Custom scrollbar for webkit browsers */
.horizontal-nav::-webkit-scrollbar {
    height: 4px;
}

.horizontal-nav::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 2px;
}

.horizontal-nav::-webkit-scrollbar-thumb {
    background: rgba(var(--bs-primary-rgb), 0.3);
    border-radius: 2px;
}

.horizontal-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--bs-primary-rgb), 0.5);
}

/* Add scroll indicators with better visibility */
.horizontal-nav::before,
.horizontal-nav::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 4px;
    /* Account for scrollbar */
    width: 30px;
    pointer-events: none;
    z-index: 2;
    transition: opacity 0.3s ease;
}

.horizontal-nav::before {
    left: 0;
    background: linear-gradient(90deg, rgba(248, 250, 252, 0.95) 0%, rgba(248, 250, 252, 0) 100%);
}

.horizontal-nav::after {
    right: 0;
    background: linear-gradient(270deg, rgba(248, 250, 252, 0.95) 0%, rgba(248, 250, 252, 0) 100%);
}

.horizontal-nav .nav-item {
    white-space: nowrap;
    margin-right: 4px;
    flex-shrink: 0;
    /* Ensure items don't compress */
    min-width: fit-content;
}

.horizontal-nav .nav-link {
    color: var(--gray-700);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 1rem 1.2rem;
    border-bottom: 3px solid transparent;
    border-radius: 8px 8px 0 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    position: relative;
    background: transparent;
    text-decoration: none;
    /* Ensure proper sizing */
    min-width: fit-content;
    white-space: nowrap;
}

.nav-icon {
    margin-right: 0.5rem;
    font-size: 1rem;
    opacity: 0.7;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.horizontal-nav .nav-link:hover {
    color: var(--primary);
    background: linear-gradient(135deg, rgba(var(--bs-primary-rgb), 0.15) 0%, rgba(var(--bs-primary-rgb), 0.1) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.horizontal-nav .nav-link:hover .nav-icon {
    opacity: 1;
    transform: scale(1.1);
}

.horizontal-nav .nav-link.active {
    color: var(--primary);
    background: linear-gradient(135deg, rgba(var(--bs-primary-rgb), 0.2) 0%, rgba(var(--bs-primary-rgb), 0.1) 100%);
    border-bottom: 3px solid var(--primary);
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.horizontal-nav .nav-link.active .nav-icon {
    opacity: 1;
    color: var(--primary);
}

.horizontal-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, var(--primary) 0%, var(--primary) 70%, transparent 70%);
    border-radius: 40%;
    box-shadow: 0 0 10px rgba(47, 133, 90, 0.4);
}

@keyframes pulse-dot {

    0%,
    100% {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }

    50% {
        transform: translateX(-50%) scale(1.2);
        opacity: 0.8;
    }
}

/* Spacer to prevent content from being hidden under fixed navbars */
.fixed-nav-spacer {
    height: 125px;
    /* Combined height of header (60px) and nav (65px) */
}

/* Content area */
.content-wrapper {
    padding: 1.5rem;
    flex: 1;
}

/* Cards and tables */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-weight: 600;
    padding: 1rem 1.25rem;
}

.table {
    margin-bottom: 0;
}

.table th {
    position: sticky;
    top: 0;
    z-index: 1;
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
}

.table-hover tbody tr:hover {
    background-color: rgba(67, 97, 238, 0.05);
}

/* Form elements */
.form-control,
.form-select {
    border-radius: var(--border-radius);
    border-color: var(--gray-300);
    padding: 0.5rem 0.75rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 0.25rem rgba(67, 97, 238, 0.25);
}

.btn {
    border-radius: var(--border-radius);
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: var(--transition);
}

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

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: #38a169 !important;
    /* Slightly darker green */
    border-color: #38a169 !important;
    color: white !important;
}

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

.btn-secondary:hover,
.btn-secondary:focus,
.btn-secondary:active {
    background-color: #38b2ac;
    border-color: #38b2ac;
    color: white;
}

/* Loading indicator */
#loadingIndicator {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem 0;
}

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

/* Chart container */
.chart-container {
    position: relative;
    margin: auto;
    height: 300px;
    width: 100%;
}

canvas {
    max-width: 100%;
}

/* Department charts specific fixes - RESET AND CLEAN APPROACH */

/* IMPORTANT: Let Bootstrap handle the grid completely */
#chartsSection .row {
    margin-right: -15px;
    margin-left: -15px;
}

#chartsSection .col-lg-6 {
    /* Let Bootstrap handle all responsive behavior */
    padding: 0 15px;
    margin-bottom: 1rem;
}

#chartsSection .col-md-12 {
    /* Let Bootstrap handle mobile behavior */
    padding: 0 15px;
}

/* Fix chart containers for proper desktop layout */
@media (min-width: 992px) {
    #chartsSection .row {
        display: flex;
        flex-wrap: wrap;
        /* Allow proper wrapping */
        align-items: stretch;
        /* Equal height columns */
    }

    #chartsSection .col-lg-6 {
        flex: 0 0 calc(50% - 30px);
        /* Account for padding */
        max-width: calc(50% - 30px);
        display: flex;
        flex-direction: column;
    }

    #chartsSection .card {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 400px;
        width: 100%;
        /* Ensure full width */
    }

    #chartsSection .card-body {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        padding: 1rem;
        /* Add proper padding */
    }

    #chartsSection canvas {
        max-width: 100%;
        max-height: 350px;
        width: auto !important;
        height: auto !important;
    }
}

/* Mobile responsive behavior */
@media (max-width: 991.98px) {
    #chartsSection .col-lg-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    #chartsSection .card {
        min-height: 300px;
    }

    #chartsSection canvas {
        max-height: 250px;
    }
}

/* Stats cards */
.stats-card {
    transition: all 0.3s ease;
    border-radius: var(--border-radius);
    overflow: hidden;
}

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

.stats-card .icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.stats-card .title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.stats-card .value {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0;
}

.stats-card .trend {
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.stats-card .trend-up {
    color: var(--success);
}

.stats-card .trend-down {
    color: var(--danger);
}

/* Footer */
.footer {
    background-color: #fff;
    padding: 1rem 0;
    font-size: 0.875rem;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .modern-header {
        height: 56px;
        /* Reduced height for mobile */
    }

    .modern-nav {
        top: 56px;
        /* Match mobile header height */
        height: 60px;
        /* Slightly reduced for mobile */
    }

    .fixed-nav-spacer {
        height: 116px;
        /* Combined height for mobile */
    }

    /* Make horizontal nav more touch-friendly on mobile */
    .horizontal-nav {
        padding: 0 0.5rem;
        /* Show scrollbar on mobile for better UX */
        scrollbar-width: auto;
    }

    .horizontal-nav::-webkit-scrollbar {
        height: 6px;
        /* Slightly thicker on mobile */
    }

    .horizontal-nav .nav-item {
        flex-shrink: 0;
        white-space: nowrap;
        margin-right: 2px;
    }

    .horizontal-nav .nav-link {
        padding: 0.8rem 1rem;
        font-size: 0.8rem;
        min-width: fit-content;
    }

    /* Remove gradient indicators on mobile to avoid confusion */
    .horizontal-nav::before,
    .horizontal-nav::after {
        display: none;
    }

    /* Style for mobile navigation when collapsed */
    #navbarContent .horizontal-nav {
        flex-direction: column;
        margin-top: 1rem;
        padding: 0;
        overflow-x: visible;
        overflow-y: auto;
        max-height: 60vh;
    }

    #navbarContent .horizontal-nav .nav-item {
        width: 100%;
        margin-right: 0;
        margin-bottom: 2px;
    }

    #navbarContent .horizontal-nav .nav-link {
        padding: 0.75rem 1rem;
        color: var(--secondary);
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        border-radius: 6px;
        margin-bottom: 2px;
    }

    #navbarContent .horizontal-nav .nav-link:hover {
        background-color: rgba(var(--bs-primary-rgb), 0.15);
        color: var(--secondary);
    }

    #navbarContent .horizontal-nav .nav-link.active {
        background-color: rgba(var(--bs-primary-rgb), 0.2);
        border-bottom: 1px solid rgba(var(--bs-primary-rgb), 0.3);
        color: var(--secondary);
    }

    /* Ensure the collapsed menu appears properly */
    .navbar-collapse.show {
        max-height: 80vh;
        overflow-y: auto;
    }
}

@media (max-width: 767.98px) {
    .brand-icon {
        width: 32px;
        height: 32px;
        padding: 8px;
    }

    .brand-icon i {
        font-size: 1.1rem;
    }

    .navbar-brand span {
        font-size: 1.1rem;
    }

    .horizontal-nav .nav-link {
        padding: 0.7rem 0.9rem;
        font-size: 0.8rem;
    }

    .nav-icon {
        margin-right: 0.4rem;
        font-size: 0.9rem;
    }
}

/* Enhanced table styles */
.table-hover tbody tr:hover {
    background-color: rgba(67, 97, 238, 0.05);
}

.table th {
    position: sticky;
    top: 0;
    z-index: 1;
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1);
}

/* Stat cards */
.stats-card {
    transition: all 0.3s ease;
    border-radius: var(--border-radius);
    overflow: hidden;
}

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

/* Enhanced card styles */
.card {
    transition: all 0.2s ease-in-out;
}

.card-header {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.card-header h5 {
    margin-bottom: 0;
    font-weight: 600;
}

/* Table cell highlighting */
.table td.text-danger {
    background-color: rgba(230, 57, 70, 0.05);
}

/* Chart container enhancements */
#graphContainer {
    background-color: #fff;
}

#graphContainer .card-body {
    padding: 1rem;
}

/* Filter form enhancements */
#filterForm .input-group-text {
    background-color: #f8f9fa;
}

#filterForm .form-control:focus,
#filterForm .form-select:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 0.25rem rgba(67, 97, 238, 0.25);
}

/* Print styles */
@media print {

    .navbar,
    .footer,
    .btn,
    .form-check,
    .dropdown {
        display: none !important;
    }

    .card {
        border: none !important;
        box-shadow: none !important;
    }

    .card-header,
    .card-footer {
        background-color: transparent !important;
    }

    .table {
        width: 100% !important;
    }

    .table th {
        background-color: #f5f5f5 !important;
        color: #000 !important;
    }
}

/* Responsive adjustments for the TILL page */
@media (max-width: 992px) {
    #statCards .card {
        margin-bottom: 1rem;
    }

    .table-responsive {
        max-height: 500px;
        overflow-y: auto;
    }
}

@media (max-width: 768px) {
    .card-header {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .card-header .btn-group,
    .card-header .form-check {
        margin-top: 0.5rem;
    }

    #filterForm .col-md-3 {
        margin-bottom: 1rem;
    }
}

/* Animation for loading indicator */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

#loadingIndicator .spinner-border {
    animation: pulse 1.5s infinite ease-in-out;
}

/* Tooltip styling */
.tooltip-inner {
    background-color: rgba(0, 0, 0, 0.8);
    padding: 8px 12px;
    border-radius: 4px;
}

/* Button hover effects */
.btn-primary:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    color: var(--secondary);
}

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

/* Table column highlighting */
.table th.bg-light,
.table td.bg-light {
    background-color: rgba(248, 249, 250, 0.5) !important;
}

/* Improved scrollbar for table */
.table-responsive::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Add responsive styles for the username and logout button */
@media (max-width: 576px) {
    .navbar-nav .nav-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .navbar-nav .btn-sm {
        margin-top: 5px;
        margin-left: 25px;
        /* Align with the username text */
    }
}

/* Add these styles to fix the hamburger menu */
.navbar-toggler {
    z-index: 1040;
    /* Higher than other elements */
    position: relative;
    /* Ensure it's positioned properly */
    border: none;
    padding: 0.5rem;
}

.navbar-toggler:focus {
    outline: none;
    box-shadow: none;
}

/* Ensure the collapsed menu appears above other content */
.navbar-collapse.show {
    display: block !important;
    z-index: 1035;
    background-color: var(--secondary);
    /* Match your header background */
    padding: 15px;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    margin-top: 10px;
    color: white;
}

.navbar-collapse.show .nav-link {
    color: white !important;
}

/* Ensure the navbar-collapse has proper styling */
.navbar-collapse {
    transition: all 0.3s ease;
}

/* Add smooth scrolling for navigation */
.horizontal-nav {
    scroll-padding-left: 20px;
    scroll-padding-right: 20px;
}

/* Add scroll hint for better UX */
.modern-nav::after {
    content: '← Scroll →';
    position: absolute;
    bottom: 2px;
    right: 10px;
    font-size: 0.7rem;
    color: var(--gray-400);
    pointer-events: none;
    opacity: 0.7;
    font-style: italic;
}

@media (max-width: 991.98px) {
    .nav-scroll-btn {
        display: none !important;
    }

    .horizontal-nav {
        /* Show scrollbar on mobile */
        scrollbar-width: thin;
        scrollbar-color: rgba(47, 133, 90, 0.3) transparent;
    }

    .horizontal-nav::-webkit-scrollbar {
        display: block;
        height: 4px;
    }

    .horizontal-nav::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.05);
        border-radius: 2px;
    }

    .horizontal-nav::-webkit-scrollbar-thumb {
        background: rgba(47, 133, 90, 0.3);
        border-radius: 2px;
    }

    .modern-nav::after {
        content: '← Swipe →';
        font-size: 0.65rem;
    }
}

@media (max-width: 767.98px) {
    .modern-nav::after {
        display: none;
        /* Hide on very small screens */
    }
}

/* Department Performance Button Styles - Clean Outline Style */
.btn-group .btn-outline-primary {
    border: 2px solid var(--primary);
    color: var(--secondary);
    background: transparent;
    transition: all 0.3s ease;
}

.btn-group .btn-outline-primary:hover {
    background-color: var(--secondary);
    border-color: var(--secondary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-group .btn-outline-info {
    border: 2px solid var(--secondary);
    color: var(--secondary);
    background: transparent;
    transition: all 0.3s ease;
}

.btn-group .btn-outline-info:hover {
    background-color: var(--secondary);
    border-color: var(--secondary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 209, 197, 0.2);
}

.btn-group .btn-outline-secondary {
    border: 2px solid var(--gray-400);
    color: var(--gray-600);
    background: transparent;
    transition: all 0.3s ease;
}

.btn-group .btn-outline-secondary:hover {
    background-color: var(--gray-500);
    border-color: var(--gray-500);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(173, 181, 189, 0.3);
}

/* Enhanced button group styling */
.btn-group .btn {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    border-width: 2px;
    position: relative;
    overflow: hidden;
}

.btn-group .btn i {
    font-size: 0.9rem;
    margin-right: 0.3rem;
}

/* Subtle animation for button groups */
.btn-group:hover .btn {
    opacity: 0.7;
}

.btn-group .btn:hover {
    opacity: 1 !important;
    z-index: 2;
}

/* Department table action buttons container */
.text-center .btn-group {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    overflow: hidden;
}

.text-center .btn-group .btn:first-child {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}

.text-center .btn-group .btn:last-child {
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
}

/* Special styling for department performance buttons */
.departmental-performance .btn-group .btn {
    min-width: 85px;
    text-align: center;
}

/* Pulse animation for active buttons */
@keyframes button-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--bs-primary-rgb), 0.4);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(var(--bs-primary-rgb), 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(var(--bs-primary-rgb), 0);
    }
}

.btn-group .btn:active {
    animation: button-pulse 0.6s;
}

/* Modal button styling consistency */
.modal .btn-group .btn-outline-primary,
.modal .btn-group .btn-outline-info,
.modal .btn-group .btn-outline-secondary {
    border-width: 1px;
    font-size: 0.75rem;
    padding: 0.35rem 0.7rem;
}

/* Table action buttons in modals */
.table .btn-group {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.table .btn-group .btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-width: 1px;
}

/* Table Sorting Styles */
.sortable {
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    position: relative;
}

.sortable:hover {
    background-color: rgba(248, 249, 250, 0.8);
    color: var(--secondary);
}

.sortable:hover i {
    transform: scale(1.2);
}

.sortable[data-order="asc"] {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--secondary);
}

.sortable[data-order="desc"] {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--secondary);
}

.sortable i {
    transition: transform 0.2s ease;
    font-size: 0.8rem;
}

.sortable .ms-1 {
    margin-left: 0.25rem;
}

/* Column highlighting animation */
.highlight-column {
    animation: highlightPulse 1s ease-in-out;
    background-color: rgba(var(--bs-primary-rgb), 0.1) !important;
    transition: background-color 0.3s ease;
}

@keyframes highlightPulse {
    0% {
        background-color: rgba(var(--bs-primary-rgb), 0.3);
    }

    50% {
        background-color: rgba(var(--bs-primary-rgb), 0.2);
    }

    100% {
        background-color: rgba(var(--bs-primary-rgb), 0.1);
    }
}

/* Global Accessibility Overrides: Ensure brand yellow (text-primary) visibility on light backgrounds */
.table .text-primary:not(.spinner-border):not(.spinner-border-sm),
.modal .text-primary:not(.spinner-border):not(.spinner-border-sm),
.card-body .text-primary:not(.spinner-border):not(.spinner-border-sm) {
    color: #000000 !important;
    font-weight: bold !important;
}

/* Ensure links with primary color maintain contrast and indicate interactivity */
.table a.text-primary:hover,
.modal a.text-primary:hover,
.card-body a.text-primary:hover {
    color: #333333 !important;
    text-decoration: underline !important;
}

/* Enhanced discoverability for clickable data in tables (non-bold columns) */
.table td a:not(.btn):not(.fw-bold):not(.text-primary),
.table td [onclick]:not(.btn):not(.fw-bold):not(.text-primary),
.table td .customer-link:not(.fw-bold),
.table td .revenue-detail:not(.fw-bold) {
    border-bottom: 1px solid rgba(0, 0, 0, 0.5);
    padding-bottom: 1px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.table td a:not(.btn):not(.fw-bold):not(.text-primary):hover,
.table td [onclick]:not(.btn):not(.fw-bold):not(.text-primary):hover,
.table td .customer-link:not(.fw-bold):hover,
.table td .revenue-detail:not(.fw-bold):hover {
    border-bottom: 1px solid black;
    color: black !important;
    text-decoration: underline !important;
}