/**
 * DataTables Custom Styling
 * Shared styles for consistent DataTables appearance across all pages
 */

/* DataTables Wrapper */
.dataTables_wrapper {
    padding: 10px 0;
}

/* Top controls (Show entries / Search) */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 15px;
    margin-left: 15px;
}

.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
    display: flex;
    align-items: center;
    margin-bottom: 0;
    font-weight: normal;
    white-space: nowrap;
}

.dataTables_wrapper .dataTables_length select {
    margin: 0 8px;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    height: 34px;
    min-width: 60px;
}

.dataTables_wrapper .dataTables_filter input {
    padding: 4px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    height: 34px;
    margin-right: 15px;
}

/* Top controls row alignment */
.dataTables_wrapper .row:first-child {
    align-items: center;
    margin-bottom: 10px;
}

/* Bottom controls (Info / Pagination) */
.dataTables_wrapper .dataTables_info {
    padding-top: 8px;
    margin-left: 15px;
}

.dataTables_wrapper .dataTables_paginate {
    margin-right: 15px;
    margin-top: 5px;
}

/* Fix Bootstrap pagination gaps */
.dataTables_wrapper .dataTables_paginate .pagination {
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    margin: 0;
    padding: 0;
}

.dataTables_wrapper .dataTables_paginate .pagination li,
.dataTables_wrapper .dataTables_paginate .pagination .page-item {
    margin: 0 !important;
    padding: 0 !important;
    float: none;
}

.dataTables_wrapper .dataTables_paginate .pagination .page-link {
    padding: 8px 14px;
    margin: 0;
    margin-left: -1px;
    border-radius: 0;
    border: 1px solid #ddd;
    background: #fff;
    color: #5a7391;
    font-weight: 500;
}

.dataTables_wrapper .dataTables_paginate .pagination li:first-child .page-link {
    border-radius: 4px 0 0 4px;
    margin-left: 0;
}

.dataTables_wrapper .dataTables_paginate .pagination li:last-child .page-link {
    border-radius: 0 4px 4px 0;
}

.dataTables_wrapper .dataTables_paginate .pagination .page-link:hover {
    background: #f0f0f0;
    border-color: #ddd;
    color: #333;
    z-index: 1;
}

.dataTables_wrapper .dataTables_paginate .pagination .active .page-link,
.dataTables_wrapper .dataTables_paginate .pagination .active .page-link:hover {
    background: #28a745;
    color: white;
    border-color: #28a745;
    z-index: 2;
}

.dataTables_wrapper .dataTables_paginate .pagination .disabled .page-link,
.dataTables_wrapper .dataTables_paginate .pagination .disabled .page-link:hover {
    color: #ccc;
    background: #fff;
    cursor: default;
}

/* Legacy DataTables paginate_button class support */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 8px 14px !important;
    margin: 0 !important;
    margin-left: -1px !important;
    border-radius: 0 !important;
    border: 1px solid #ddd !important;
    background: #fff !important;
    color: #5a7391 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:first-child {
    border-radius: 4px 0 0 4px !important;
    margin-left: 0 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:last-child {
    border-radius: 0 4px 4px 0 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #28a745 !important;
    color: white !important;
    border-color: #28a745 !important;
}

/* Custom Status Badges */
.badge-status {
    border-radius: 50rem !important;
    /* Pill shape */
    padding: 6px 14px !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.badge-status-pending {
    background-color: #fff3cd !important;
    color: #856404 !important;
    border: 1px solid #ffeeba !important;
}

.badge-status-approved {
    background-color: #d4edda !important;
    color: #155724 !important;
    border: 1px solid #c3e6cb !important;
}

.badge-status-rejected {
    background-color: #f8d7da !important;
    color: #721c24 !important;
    border: 1px solid #f5c6cb !important;
}

.badge-status-secondary {
    background-color: #e2e3e5 !important;
    color: #383d41 !important;
    border: 1px solid #d6d8db !important;
}

/* Action Buttons */
.action-buttons-wrapper {
    display: flex;
    gap: 8px;
    justify-content: flex-start;
    /* Align left */
}

.btn-action-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    line-height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-action-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}