.bg-gradient-primary {
    background-color: #24346a !important;
    background-size: cover;
}

body {
    overflow-x: hidden;
    font-family: 'auto';
    background: var(--light-bg);
    padding-top: var(--navbar-height);
}

/* ==========================================
   GLOBAL THEME STYLES
   Primary Color: bg-gradient-primary (#24346a)
   ========================================== */

:root {
    /* Layout Dimensions */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --navbar-height: 56px;


    /* Primary Colors */
    --primary-color: #23346a;
    --primary-dark: #1a2850;
    --primary-light: #3a4f8f;
    --primary-gradient: linear-gradient(135deg, #23346a 0%, #3a4f8f 100%);

    /* Secondary Colors */
    --secondary-color: #6c757d;
    --secondary-light: #adb5bd;
    --secondary-dark: #495057;

    /* Accent Colors */
    --accent-orange: #f28b39;
    --accent-teal: #39a79e;
    --accent-blue: #2b6fcb;

    /* Success, Warning, Danger, Info */
    --success-color: #28a745;
    --success-light: #d4edda;
    --warning-color: #ffc107;
    --warning-light: #fff3cd;
    --danger-color: #dc3545;
    --danger-light: #f8d7da;
    --info-color: #17a2b8;
    --info-light: #d1ecf1;

    /* Neutral Colors */
    --white: #ffffff;
    --light-bg: #f5f8ff;
    --light-gray: #f8f9fa;
    --gray: #dee2e6;
    --dark-gray: #6c757d;
    --text-dark: #212529;
    --text-muted: #6c757d;

    /* Spacing & Sizing */
    --border-radius-sm: 0.25rem;
    --border-radius: 0.375rem;
    --border-radius-lg: 0.5rem;
    --border-radius-xl: 1rem;

    /* Shadows */
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);

    /* Transitions */
    --transition-base: all 0.3s ease;
    --transition-fast: all 0.15s ease;
}

/* ==========================================
   BUTTON STYLES
   ========================================== */

/* Primary Buttons */
.btn-primary,
.btn-primary:focus {
    background: var(--primary-gradient) !important;
    border: none !important;
    color: var(--white) !important;
    font-weight: 500;
    transition: var(--transition-base);
    box-shadow: 0 2px 4px rgba(36, 52, 106, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2e4488 0%, #24346a 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(36, 52, 106, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(36, 52, 106, 0.2);
}

/* Secondary Buttons */
.btn-secondary,
.btn-secondary:focus {
    background-color: var(--secondary-color) !important;
    border-color: var(--secondary-color) !important;
    color: var(--white) !important;
    font-weight: 500;
    transition: var(--transition-base);
}

.btn-secondary:hover {
    background-color: var(--secondary-dark) !important;
    border-color: var(--secondary-dark) !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Outline Primary Buttons */
/* .btn-outline-primary {
    border: 2px solid var(--primary-color) !important;
    color: var(--primary-color) !important;
    background: #414b5a !important;
    font-weight: 500;
    transition: var(--transition-base);
}

.btn-outline-primary:hover {
    background: var(--primary-gradient) !important;
    color: var(--white) !important;
    border-color: var(--primary-color) !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
} */

/* Outline Light Buttons */
.btn-outline-light {
    border: 2px solid rgba(255, 255, 255, 0.8) !important;
    color: var(--white) !important;
    /* background: #414b5a !important; */
    font-weight: 500;
    transition: var(--transition-base);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: var(--white) !important;
    color: var(--white) !important;
}

/* Success Buttons */
.btn-success {
    background-color: var(--success-color) !important;
    border-color: var(--success-color) !important;
    color: var(--white) !important;
    font-weight: 500;
    transition: var(--transition-base);
}

.btn-success:hover {
    background-color: #218838 !important;
    border-color: #1e7e34 !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Warning Buttons */
.btn-warning {
    background-color: var(--warning-color) !important;
    border-color: var(--warning-color) !important;
    color: var(--text-dark) !important;
    font-weight: 500;
    transition: var(--transition-base);
}

.btn-warning:hover {
    background-color: #e0a800 !important;
    border-color: #d39e00 !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Danger Buttons */
.btn-danger {
    background-color: var(--danger-color) !important;
    border-color: var(--danger-color) !important;
    color: var(--white) !important;
    font-weight: 500;
    transition: var(--transition-base);
}

.btn-danger:hover {
    background-color: #c82333 !important;
    border-color: #bd2130 !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Info Buttons */
.btn-info {
    background-color: var(--info-color) !important;
    border-color: var(--info-color) !important;
    color: var(--white) !important;
    font-weight: 500;
    transition: var(--transition-base);
}

.btn-info:hover {
    background-color: #138496 !important;
    border-color: #117a8b !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Button Sizes */
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border-radius: var(--border-radius-sm);
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.125rem;
    border-radius: var(--border-radius-lg);
}

/* Rounded Pill Buttons */
.btn.rounded-pill {
    border-radius: 50rem !important;
}

/* Disabled State */
.btn:disabled,
.btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ==========================================
   CARD STYLES
   ========================================== */

.card {
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
    background: var(--white);
}

.card:hover {
    box-shadow: var(--shadow);
}

.card-header {
    background-color: var(--white);
    border-bottom: 1px solid var(--gray);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.card-header.bg-primary {
    background: var(--primary-gradient) !important;
    color: var(--white);
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    background-color: var(--light-gray);
    border-top: 1px solid var(--gray);
    padding: 0.75rem 1.25rem;
}

/* Card with Shadow */
.card.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

.card.shadow {
    box-shadow: var(--shadow) !important;
}

.card.shadow-lg {
    box-shadow: var(--shadow-lg) !important;
}

/* ==========================================
   TABLE STYLES
   ========================================== */

.table {
    width: 100%;
    margin-bottom: 1rem;
    color: #333;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.table thead th {
    vertical-align: bottom;
    border-bottom: 1px solid #f0f0f0;
    padding: 0.6rem 1rem;
    font-weight: 500;
    text-transform: none;
    font-size: 0.85rem;
    letter-spacing: 0;
    color: #555;
    background: #f8f9fa;
}

.table tbody td {
    padding: 0.6rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.85rem;
    color: #333;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Table Striped */
.table-striped tbody tr:nth-of-type(odd) {
    background-color: #fafbfc;
}

/* Table Hover */
.table-hover tbody tr:hover {
    background-color: rgba(35, 52, 106, 0.04);
    cursor: pointer;
}

/* Table Bordered */
.table-bordered {
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
}

.table-bordered th,
.table-bordered td {
    border: 1px solid #f0f0f0;
}

/* Table Header Variants */
.table thead.table-light {
    background-color: #f8f9fa;
}

.table thead.table-dark {
    background: linear-gradient(135deg, #23346a 0%, #3a4f8f 100%);
    color: #fff;
}

.table thead.table-dark th {
    color: #fff;
    font-weight: 500;
    border-bottom: none;
}

.table thead.table-primary {
    background: linear-gradient(135deg, #23346a 0%, #3a4f8f 100%);
    color: #fff;
}

.table thead.table-primary th {
    color: #fff;
    font-weight: 500;
    border-bottom: none;
}

/* Responsive Table */
.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
}

/* Table Alignment */
.table.text-center td,
.table.text-center th {
    text-align: center;
}

.table.align-middle td {
    vertical-align: middle;
}

/* Table Small */
.table-sm th,
.table-sm td {
    padding: 0.5rem;
    font-size: 0.875rem;
}

/* Table Actions */
.table td .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* ==========================================
   FORM STYLES
   ========================================== */

.form-control,
.form-select {
    border: 1px solid var(--gray);
    border-radius: var(--border-radius);
    padding: 0.5rem 0.75rem;
    transition: var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(36, 52, 106, 0.15);
    outline: 0;
}

.form-control-sm,
.form-select-sm {
    padding: 0.375rem 0.625rem;
    font-size: 0.875rem;
    border-radius: var(--border-radius-sm);
}

.form-control-lg,
.form-select-lg {
    padding: 0.75rem 1rem;
    font-size: 1.125rem;
    border-radius: var(--border-radius-lg);
}

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

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

/* ==========================================
   MODAL STYLES
   ========================================== */

.modal-header {
    background: linear-gradient(135deg, #23346a 0%, #3a4f8f 100%);
    color: #fff;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.75rem 1rem;
    border: none;
}

.modal-header.bg-primary {
    background: var(--primary-gradient) !important;
    color: var(--white);
}

.modal-title {
    font-weight: 600;
    font-size: 1.125rem;
}

.modal-body {
    padding: 1.5rem;
}

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

/* ==========================================
   BADGE STYLES
   ========================================== */

.badge {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--border-radius);
}

.badge.bg-primary {
    background: var(--primary-gradient) !important;
}

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

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

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

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

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

/* Badge Rounded Pill */
.badge.rounded-pill {
    border-radius: 50rem;
}

/* ==========================================
   ALERT STYLES
   ========================================== */

.alert {
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
}

.alert-success {
    background-color: var(--success-light);
    border-color: #c3e6cb;
    color: #155724;
}

.alert-warning {
    background-color: var(--warning-light);
    border-color: #ffeaa7;
    color: #856404;
}

.alert-danger {
    background-color: var(--danger-light);
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-info {
    background-color: var(--info-light);
    border-color: #bee5eb;
    color: #0c5460;
}

.alert-primary {
    background-color: rgba(36, 52, 106, 0.1);
    border-color: rgba(36, 52, 106, 0.2);
    color: var(--primary-color);
}

/* ==========================================
   DROPDOWN STYLES
   ========================================== */

.dropdown-menu {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 0.5rem 0;
}

.dropdown-item {
    padding: 0.5rem 1.25rem;
    transition: var(--transition-fast);
    color: var(--text-dark);
}

.dropdown-item:hover {
    background-color: rgba(36, 52, 106, 0.05);
    color: var(--primary-color);
}

.dropdown-item:active {
    background-color: var(--primary-color);
    color: var(--white);
}

.dropdown-header {
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
}

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

/* ==========================================
   PAGINATION STYLES
   ========================================== */

.pagination {
    display: flex;
    padding-left: 0;
    list-style: none;
    border-radius: var(--border-radius);
}

.page-link {
    padding: 0.5rem 0.75rem;
    margin-left: -1px;
    color: var(--primary-color);
    background-color: var(--white);
    border: 1px solid var(--gray);
    transition: var(--transition-fast);
}

.page-link:hover {
    background-color: var(--light-gray);
    border-color: var(--gray);
    color: var(--primary-dark);
}

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

.page-item.disabled .page-link {
    color: var(--text-muted);
    pointer-events: none;
    background-color: var(--white);
    border-color: var(--gray);
}

/* ==========================================
   BREADCRUMB STYLES
   ========================================== */

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    list-style: none;
    background-color: var(--light-gray);
    border-radius: var(--border-radius);
}

.breadcrumb-item+.breadcrumb-item::before {
    content: "/";
    padding: 0 0.5rem;
    color: var(--text-muted);
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition-fast);
}

.breadcrumb-item a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

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

/* ==========================================
   PROGRESS BAR STYLES
   ========================================== */

.progress {
    height: 1rem;
    background-color: var(--light-gray);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.progress-bar {
    background: var(--primary-gradient);
    transition: width 0.6s ease;
}

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

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

.progress-bar.bg-danger {
    background-color: var(--danger-color) !important;
}

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

/* ==========================================
   UTILITY CLASSES
   ========================================== */

/* Background Utilities */
.bg-gradient-primary {
    background: var(--primary-gradient) !important;
}

.bg-primary-light {
    background-color: rgba(36, 52, 106, 0.1) !important;
}

/* Text Utilities */
.text-primary {
    color: var(--primary-color) !important;
}

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

/* Border Utilities */
.border-primary {
    border-color: var(--primary-color) !important;
}

/* Shadow Utilities */
.shadow-primary {
    box-shadow: 0 0.5rem 1rem rgba(36, 52, 106, 0.15) !important;
}

/* Hover Effects */
.hover-lift {
    transition: var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Rounded Utilities */
.rounded-lg {
    border-radius: var(--border-radius-lg) !important;
}

.rounded-xl {
    border-radius: var(--border-radius-xl) !important;
}

/* ==========================================
   CUSTOM SCROLLBAR
   ========================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: var(--border-radius);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

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

@media (max-width: 767.98px) {
    .card-header {
        padding: 0.75rem 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .table thead th {
        font-size: 0.75rem;
        padding: 0.5rem;
    }

    .table tbody td {
        font-size: 0.875rem;
        padding: 0.5rem;
    }
}

/* Desktop sidebar */
@media (min-width: 992px) {
    #sidebar {
        width: var(--sidebar-width);
        top: var(--navbar-height);
        height: calc(100vh - var(--navbar-height));
        display: flex !important;
        flex-direction: column;
        visibility: visible !important;
        transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    #sidebar .sidebar-content {
        flex: 1 1 auto;
        overflow-y: auto;
        overflow-x: hidden;
        min-height: 0;
    }

    #sidebar .sidebar-footer {
        flex-shrink: 0;
    }

    body.sidebar-collapsed #sidebar {
        width: var(--sidebar-collapsed-width);
    }

    body.sidebar-collapsed .content-wrapper {
        margin-left: var(--sidebar-collapsed-width);
    }

    body.sidebar-collapsed .service-text,
    body.sidebar-collapsed .badge {
        opacity: 0;
        transition: opacity 0.2s ease;
    }

    .service-text,
    .badge {
        transition: opacity 0.3s ease;
    }

    body.sidebar-collapsed .service-link {
        justify-content: center;
    }

    .content-wrapper {
        margin-left: var(--sidebar-width);
        transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
}

/* Mobile sidebar */
@media (max-width: 991.98px) {
    #sidebar {
        top: var(--navbar-height);
        z-index: 1040;
        height: calc(100vh - var(--navbar-height));
        display: flex;
        flex-direction: column;
        transform: translateX(-100%);
        transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        visibility: visible;
        left: 0;
        width: 280px;
        will-change: transform;
    }

    #sidebar.show {
        transform: translateX(0);
    }

    #sidebar .sidebar-content {
        flex: 1 1 auto;
        overflow-y: auto;
        overflow-x: hidden;
        min-height: 0;
    }

    #sidebar .sidebar-footer {
        flex-shrink: 0;
    }

    .content-wrapper {
        margin-left: 0 !important;
    }

    /* Backdrop for mobile sidebar */
    body::before {
        content: '';
        position: fixed;
        top: var(--navbar-height);
        left: 0;
        width: 100%;
        height: calc(100vh - var(--navbar-height));
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1039;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94), visibility 0.35s;
        pointer-events: none;
    }

    body.sidebar-open::before {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
}

/* Drag and drop styles */
.draggable-service {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.draggable-service.dragging {
    opacity: 0.4;
    transform: scale(0.95);
}

.draggable-service.drag-over {
    background-color: rgba(255, 255, 255, 0.1);
    border-left: 3px solid rgba(255, 255, 255, 0.8);
}

.draggable-service[draggable="true"] {
    cursor: grab !important;
}

.draggable-service[draggable="true"]:active {
    cursor: grabbing !important;
}

.draggable-service[draggable="true"] .service-link {
    pointer-events: none !important;
}

.service-link {
    transition: all 0.2s ease;
    border-radius: 0.5rem;
    margin: 0 0.5rem;
}

.service-link:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateX(4px);
}

.service-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    border-left: 3px solid white;
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* Sidebar search bar */
.sidebar-search {
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar-search .input-group {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 6px;
    overflow: hidden;
}

.sidebar-search .input-group-text {
    border: none;
    padding-left: 12px;
    padding-right: 4px;
}

.sidebar-search .form-control {
    border: none;
    box-shadow: none !important;
    font-size: 0.875rem;
}

.sidebar-search .form-control::placeholder {
    color: #999;
}

.sidebar-search .btn {
    border: none;
    background: transparent;
    color: #666;
    padding: 0 10px;
}

.sidebar-search .btn:hover {
    color: #333;
    background: rgba(0, 0, 0, 0.05);
}

/* Hide search bar when sidebar is collapsed on desktop */
body.sidebar-collapsed .sidebar-search {
    display: none;
}

/* Scrollbar styling */
.sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

a {
    text-decoration: none !important;
}


/* =====================================================
   GLOBAL TABLE RESET & LAYOUT
===================================================== */
.table {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.table-responsive {
    border-radius: 10px;
    overflow: hidden;
}

/* =====================================================
   TABLE HEADER
===================================================== */
.table thead th {
    background: linear-gradient(180deg, #4b5563, #374151);
    color: #ffffff !important;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border: none !important;
    padding: 14px 12px;
    white-space: nowrap;
}

/* =====================================================
   TABLE BODY
===================================================== */
.table tbody td {
    padding: 14px 12px;
    font-size: 0.9rem;
    color: #374151;
    border-top: 1px solid #e5e7eb !important;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

/* =====================================================
   ALIGNMENT FIXES
===================================================== */
.table.align-middle td,
.table.align-middle th {
    vertical-align: middle !important;
}

.table.text-center td,
.table.text-center th {
    text-align: center;
}

/* =====================================================
   STATUS BADGES (GLOBAL)
===================================================== */
.table .badge {
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 999px;
}

.badge-success,
.bg-success {
    background-color: #4CAF75 !important;
}

.badge-warning,
.bg-warning {
    background-color: #E9B949 !important;
    color: #000 !important;
}

.badge-danger,
.bg-danger {
    background-color: #EF4444 !important;
}

/* =====================================================
   ACTION COLUMN
===================================================== */
.table td:last-child {
    white-space: nowrap;
}

.table .action-btn,
.table .dropdown-toggle {
    cursor: pointer;
    font-size: 18px;
    color: #6b7280;
}

/* =====================================================
   DATATABLES CONTROLS (GLOBAL)
===================================================== */
.dataTables_wrapper {
    padding: 12px;
}

.dataTables_info {
    font-size: 0.8rem;
    color: #6b7280;
}

.dataTables_paginate .pagination {
    margin: 0;
}

.dataTables_paginate .page-link {
    border-radius: 6px;
    font-size: 0.8rem;
    padding: 6px 10px;
}

/* =====================================================
   DATATABLES PAGINATION BUTTONS
===================================================== */
div.dt-container .dt-paging .dt-paging-button {
    padding: 6px 12px !important;
    margin: 0 2px !important;
    border-radius: 6px !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    color: var(--primary-color) !important;
    background-color: var(--white) !important;
    border: 1px solid var(--gray) !important;
    transition: all 0.2s ease-in-out !important;
    cursor: pointer !important;
}

div.dt-container .dt-paging .dt-paging-button:hover {
    background-color: var(--light-gray) !important;
    border-color: var(--primary-color) !important;
    color: var(--primary-dark) !important;
}

div.dt-container .dt-paging .dt-paging-button.current,
div.dt-container .dt-paging .dt-paging-button.current:hover {
    background: var(--primary-gradient) !important;
    border-color: var(--primary-color) !important;
    color: var(--white) !important;
    font-weight: 600 !important;
}

div.dt-container .dt-paging .dt-paging-button.disabled,
div.dt-container .dt-paging .dt-paging-button.disabled:hover,
div.dt-container .dt-paging .dt-paging-button.disabled:active {
    color: var(--text-muted) !important;
    background-color: var(--white) !important;
    border-color: var(--gray) !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
    pointer-events: none !important;
}

/* =====================================================
   EXPORT BUTTONS (GLOBAL)
===================================================== */
.dt-buttons {
    display: flex;
    gap: 8px;
}

/* Base button styles */
div.dt-buttons>.dt-button,
div.dt-buttons>div.dt-button-split .dt-button {
    font-size: 0.75rem !important;
    padding: 6px 12px !important;
    border-radius: 6px !important;
    text-transform: uppercase;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    transition: all 0.2s ease-in-out !important;
    background-color: #414b5a !important;
    color: #ffffff !important;
}

/* First child styling */
div.dt-buttons>.dt-button:first-child,
div.dt-buttons>div.dt-button-split .dt-button:first-child {
    margin-left: 0 !important;
}

/* Excel */
div.dt-buttons>.dt-button.buttons-excel,
div.dt-buttons>div.dt-button-split .dt-button.buttons-excel {
    color: #ffffff !important;
    background-color: #414b5a !important;
    border: 1px solid #ffffff !important;
}
div.dt-buttons>.dt-button.buttons-excel:hover,
div.dt-buttons>div.dt-button-split .dt-button.buttons-excel:hover {
    background-color: #ffffff !important;
    color: #fff !important;
    border-color: #ffffff !important;
}

/* PDF */
div.dt-buttons>.dt-button.buttons-pdf,
div.dt-buttons>div.dt-button-split .dt-button.buttons-pdf {
    color: #dc3545 !important;
    background-color: #414b5a !important;
    border: 1px solid #dc3545 !important;
}
div.dt-buttons>.dt-button.buttons-pdf:hover,
div.dt-buttons>div.dt-button-split .dt-button.buttons-pdf:hover {
    background-color: #dc3545 !important;
    color: #fff !important;
    border-color: #dc3545 !important;
}

/* Print */
div.dt-buttons>.dt-button.buttons-print,
div.dt-buttons>div.dt-button-split .dt-button.buttons-print {
    color: #0d6efd !important;
    background-color: #414b5a !important;
    border: 1px solid #0d6efd !important;
}
div.dt-buttons>.dt-button.buttons-print:hover,
div.dt-buttons>div.dt-button-split .dt-button.buttons-print:hover {
    background-color: #0d6efd !important;
    color: #fff !important;
    border-color: #0d6efd !important;
}

/* =====================================================
   STRIPED ROW REFINEMENT
===================================================== */
.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: #fcfcfd;
}

/* =====================================================
   EMPTY STATE
===================================================== */
.table tbody tr td.dataTables_empty {
    padding: 30px;
    font-size: 0.9rem;
    color: #9ca3af;
}

/* =====================================================
   DATATABLES TOP TOOLBAR FIX
===================================================== */
.dataTables_wrapper .dt-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 12px 8px;
}

/* =====================================================
   EXPORT BUTTON CONTAINER
===================================================== */
.dataTables_wrapper .dt-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

/* =====================================================
   EXPORT BUTTON BASE STYLE
===================================================== */
.dataTables_wrapper div.dt-buttons>.dt-button,
.dataTables_wrapper div.dt-buttons>div.dt-button-split .dt-button {
    font-size: 0.75rem !important;
    padding: 6px 12px !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.4 !important;
    transition: all 0.2s ease-in-out !important;
}

/* Remove weird DataTables focus outline */
.dataTables_wrapper div.dt-buttons>.dt-button:focus,
.dataTables_wrapper div.dt-buttons>div.dt-button-split .dt-button:focus {
    box-shadow: none !important;
    outline: none !important;
}

/* First child */
.dataTables_wrapper div.dt-buttons>.dt-button:first-child,
.dataTables_wrapper div.dt-buttons>div.dt-button-split .dt-button:first-child {
    margin-left: 0 !important;
}

/* =====================================================
   EXCEL BUTTON
===================================================== */
.dataTables_wrapper div.dt-buttons>.dt-button.buttons-excel,
.dataTables_wrapper div.dt-buttons>div.dt-button-split .dt-button.buttons-excel {
    color: #ffffff !important;
    border: 1px solid #ffffff !important;
    background-color: #414b5a !important;
}

.dataTables_wrapper div.dt-buttons>.dt-button.buttons-excel:hover,
.dataTables_wrapper div.dt-buttons>div.dt-button-split .dt-button.buttons-excel:hover {
    background-color: #ffffff !important;
    color: #fff !important;
    border-color: #ffffff !important;
}

/* =====================================================
   PDF BUTTON
===================================================== */
.dataTables_wrapper div.dt-buttons>.dt-button.buttons-pdf,
.dataTables_wrapper div.dt-buttons>div.dt-button-split .dt-button.buttons-pdf {
    color: #dc3545 !important;
    border: 1px solid #dc3545 !important;
    background-color: #414b5a !important;
}

.dataTables_wrapper div.dt-buttons>.dt-button.buttons-pdf:hover,
.dataTables_wrapper div.dt-buttons>div.dt-button-split .dt-button.buttons-pdf:hover {
    background-color: #dc3545 !important;
    color: #fff !important;
    border-color: #dc3545 !important;
}

/* =====================================================
   PRINT BUTTON
===================================================== */
.dataTables_wrapper div.dt-buttons>.dt-button.buttons-print,
.dataTables_wrapper div.dt-buttons>div.dt-button-split .dt-button.buttons-print {
    color: #0d6efd !important;
    border: 1px solid #0d6efd !important;
    background-color: #414b5a !important;
}

.dataTables_wrapper div.dt-buttons>.dt-button.buttons-print:hover,
.dataTables_wrapper div.dt-buttons>div.dt-button-split .dt-button.buttons-print:hover {
    background-color: #0d6efd !important;
    color: #fff !important;
    border-color: #0d6efd !important;
}

/* =====================================================
   SEARCH INPUT FIX
===================================================== */
.dataTables_wrapper .dataTables_filter input {
    border-radius: 6px;
    font-size: 0.85rem;
    padding: 6px 10px;
}

/* =====================================================
   MOBILE STACKING FIX
===================================================== */
@media (max-width: 576px) {
    .dataTables_wrapper .dt-buttons {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

/* ===== Table dropdown base ===== */
table select.custom-select,
table select.form-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    height: 36px;
    padding: 6px 36px 6px 12px;

    font-size: 0.95rem;
    font-weight: 500;
    color: #111;

    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23333' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;

    border: 2px solid #7a7a7a;
    border-radius: 4px;

    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

/* Small variant */
table select.custom-select-sm,
table select.form-select-sm {
    height: 34px;
    font-size: 0.9rem;
}

/* Hover */
table select.custom-select:hover,
table select.form-select:hover {
    border-color: #24346a;
}

/* Focus */
table select.custom-select:focus,
table select.form-select:focus {
    border-color: #24346a;
    outline: none;
    box-shadow: 0 0 0 2px rgba(36, 52, 106, 0.15);
}

/* Disabled */
table select:disabled {
    background-color: #f1f1f1;
    color: #999;
    cursor: not-allowed;
}

/* Align nicely in table */
table td {
    vertical-align: middle;
}