/* Pagination Spacing */
.pagination-wrap {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

.pagination {
    display: inline-flex;
    gap: 0.25rem;
}

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 0.5rem;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-2);
    text-decoration: none;
    transition: all var(--dur) var(--ease);
}

.pagination a:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.pagination .active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* Admin Profile Dropdown Styling */
.admin-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    right: 10px;
    width: 220px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--sh-lg);
    padding: 0.5rem;
    display: none;
    z-index: 10000;
    animation: slideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-dropdown.show {
    display: block;
}

.admin-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-2);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--r-sm);
    transition: all var(--dur) var(--ease);
}

.admin-dropdown-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.admin-dropdown-item.logout {
    color: var(--danger);
    border-top: 1px solid var(--border);
    margin-top: 0.25rem;
    border-radius: 0 0 var(--r-sm) var(--r-sm);
}

.admin-dropdown-item.logout:hover {
    background: var(--danger-light);
    color: var(--danger);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ══════════════════════════════════════════
     DATATABLES STYLING OVERRIDES
   ══════════════════════════════════════════ */

/* Wrapper */
.dataTables_wrapper {
    position: relative;
    padding: 0;
}

/* Hide default search and page length if we want custom or make them extremely premium */
.dataTables_wrapper .dataTables_filter {
    float: right;
    margin-bottom: 1.25rem;
    margin-right: 1.25rem;
    margin-top: 1rem;
}

.dataTables_wrapper .dataTables_filter label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dataTables_wrapper .dataTables_filter input {
    border: 1.5px solid var(--border);
    border-radius: var(--r-md);
    padding: 0.4rem 0.8rem;
    outline: none;
    font-size: 13px;
    transition: all var(--dur) var(--ease);
    background: var(--card);
    color: var(--text);
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.dataTables_wrapper .dataTables_length {
    float: left;
    margin-bottom: 1.25rem;
    margin-left: 1.25rem;
    margin-top: 1rem;
}

.dataTables_wrapper .dataTables_length label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.dataTables_wrapper .dataTables_length select {
    border: 1.5px solid var(--border);
    border-radius: var(--r-sm);
    padding: 0.25rem 1.5rem 0.25rem 0.5rem;
    outline: none;
    font-size: 13px;
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236B7280' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
}

/* Info and Paginate Footer Section */
.dataTables_wrapper .dataTables_info {
    float: left;
    margin: 1.5rem 1.25rem;
    font-size: 13px;
    color: var(--text-3);
    font-weight: 500;
}

.dataTables_wrapper .dataTables_paginate {
    float: right;
    margin: 1.5rem 1.25rem;
    display: inline-flex;
    gap: 0.25rem;
}

/* Override default paginate button styling completely */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 0.6rem !important;
    border-radius: var(--r-sm) !important;
    border: 1px solid var(--border) !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    color: var(--text-2) !important;
    background: var(--card) !important;
    cursor: pointer !important;
    transition: all var(--dur) var(--ease) !important;
    margin: 0 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--primary-light) !important;
    color: var(--primary) !important;
    border-color: var(--primary) !important;
    box-shadow: none !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--primary) !important;
    color: var(--white) !important;
    border-color: var(--primary) !important;
    box-shadow: none !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active {
    background: var(--surface) !important;
    color: var(--text-3) !important;
    border-color: var(--border) !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

/* Beautiful custom Processing overlay */
.dataTables_wrapper .dataTables_processing {
    position: absolute;
    top: 50% !important;
    left: 50% !important;
    width: 200px !important;
    margin-left: -100px !important;
    margin-top: -25px !important;
    height: auto !important;
    padding: 1rem !important;
    background: var(--card) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--r-md) !important;
    box-shadow: var(--sh-lg) !important;
    color: var(--primary) !important;
    font-weight: 600 !important;
    font-size: 13.5px !important;
    text-align: center !important;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    backdrop-filter: blur(4px);
}

.dataTables_wrapper .dataTables_processing::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--primary-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* Clear Float fixes */
.dataTables_wrapper::after {
    content: "";
    clear: both;
    display: block;
}

/* Table Style Overrides to override jQuery DataTables defaults */
table.dataTable {
    border-collapse: collapse !important;
    width: 100% !important;
    margin: 0 !important;
}

table.dataTable th,
table.dataTable td {
    box-sizing: border-box;
}

table.dataTable.no-footer {
    border-bottom: 1px solid var(--border) !important;
}

/* Interactive custom filters styling */
.table-filters {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border);
    background: #FAFBFC;
    border-top-left-radius: var(--r-lg);
    border-top-right-radius: var(--r-lg);
    flex-wrap: wrap;
}

.table-filters .filter-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.table-filters .filter-item label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-3);
}

.table-filters .form-control {
    padding: 0.4rem 2rem 0.4rem 0.8rem;
    font-size: 13px;
    border-radius: var(--r-md);
    min-width: 150px;
    height: 36px;
}

.table-filters .filter-search {
    flex: 1;
    min-width: 250px;
}

.table-filters .filter-search input {
    height: 36px;
    padding-left: 2.25rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%239CA3AF' viewBox='0 0 24 24'%3E%3Cpath d='M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 0.75rem center;
}

/* ══════════════════════════════════════════
     SIDEBAR RESPONSIVE
   ══════════════════════════════════════════ */

@media (max-width: 768px) {
    .app-sidebar {
        position: fixed;
        left: -280px;
        top: 60px;
        height: calc(100vh - 60px);
        width: 280px;
        background: var(--card);
        z-index: 9999;
        transition: left var(--dur) var(--ease);
    }

    .app-sidebar.active {
        left: 0;
    }

    .mobile-overlay {
        display: none;
    }

    .mobile-overlay.active {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9998;
    }
}