/* ===== OMOCaptcha Admin - Global Styles ===== */
body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: #f7f9fb;
}

/* ===================== DataTables ===================== */
table.dataTable {
    border-collapse: collapse !important;
    border-spacing: 0;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Header — chỉ áp dụng cho bảng chính, KHÔNG cho dark-table */
table.dataTable:not(#datatable-history-used-gift):not(#DataTables-Package):not(#DataTables-apps):not(#DataTables-Jobs):not(#DataTables-showWithdrawAffiliate):not(#DataTables-HistoryRef) thead th {
    padding: 0.8rem 1rem !important;
    vertical-align: middle !important;
    white-space: nowrap;
    font-size: 0.75rem !important;
    background: rgba(88, 28, 135, 0.4) !important;
}

/* Body cells — chỉ áp dụng cho bảng chính, KHÔNG cho dark-table (dùng rowCallback JS) */
/* table.dataTable:not(#datatable-history-used-gift):not(#DataTables-Package):not(#DataTables-apps) tbody td {
    padding: 0.75rem 1rem !important;
    color: #495057 !important;
    font-size: 0.8125rem !important;
    border-bottom: 1px solid #f1f3f5 !important;
    vertical-align: middle !important;
} */

/* Remove border from last row */
table.dataTable tbody tr:last-child td {
    border-bottom: none !important;
}

/* Row hover — KHÔNG áp dụng cho dark-table (dùng JS/tailwind hover) */
/* table.dataTable:not(#datatable-history-used-gift):not(#DataTables-Package):not(#DataTables-apps) tbody tr:hover > td {
    background-color: #e9ecef !important;
} */

/* Empty state — KHÔNG áp dụng cho dark-table */
table.dataTable:not(#datatable-history-used-gift):not(#DataTables-Package):not(#DataTables-apps) tbody tr td.dataTables_empty {
    text-align: center !important;
    color: #adb5bd !important;
    padding: 3rem 1rem !important;
    font-size: 0.875rem !important;
    background-color: transparent !important;
    border-bottom: none !important;
}

/* Sort icons hidden */
table.dataTable thead th.sorting:before,
table.dataTable thead th.sorting:after,
table.dataTable thead th.sorting_asc:before,
table.dataTable thead th.sorting_desc:before,
table.dataTable thead th.sorting_asc:after,
table.dataTable thead th.sorting_desc:after {
    display: none !important;
}

/* Wrapper — hide built-in filter/length (we use custom filter bar), keep info + paginate */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    display: none !important;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    padding: 12px 16px;
    font-size: 0.8125rem;
    color: #6c757d;
}

/* Paginate container */
.dataTables_wrapper .dataTables_paginate {
    display: flex;
    justify-content: flex-end;
}
.dataTables_wrapper .dataTables_paginate .pagination {
    margin: 0;
    gap: 4px;
}
.dataTables_wrapper .dataTables_paginate .page-item .page-link {
    border: 1px solid #e9ecef;
    border-radius: 0.375rem !important;
    color: #495057;
    background: #fff;
    padding: 0.35rem 0.7rem;
    font-size: 0.8125rem;
    min-width: 32px;
    text-align: center;
    transition: all 0.15s ease;
}
.dataTables_wrapper .dataTables_paginate .page-item .page-link:hover {
    background: #f1f3f5;
    color: #4f46e5;
    border-color: #e0e7ff;
}
.dataTables_wrapper .dataTables_paginate .page-item.active .page-link {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #fff;
    font-weight: 600;
}
.dataTables_wrapper .dataTables_paginate .page-item.disabled .page-link {
    color: #adb5bd;
    background: #f8f9fa;
    border-color: #e9ecef;
    opacity: 0.6;
}
.dataTables_wrapper .dataTables_paginate .page-item.active .page-link:focus {
    box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.2);
}

/* Info + paginate row: align on same line */
.dataTables_wrapper .row:last-child {
    align-items: center;
    border-top: 1px solid #f1f3f5;
    margin: 0;
    padding: 0;
}

.dataTables_wrapper {
    padding: 0 !important;
}

.dataTables_wrapper .dataTables_processing {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* ===================== Sidebar ===================== */
.admin-sidebar {
    width: 260px;
    min-height: 100vh;
    background: #ffffff;
    border-right: 1px solid #e9ecef;
    transition: width 0.3s ease, min-width 0.3s ease;
}
.admin-sidebar .nav-link {
    color: #6c757d;
    border-radius: 0.5rem;
    margin-bottom: 2px;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}
.admin-sidebar .nav-link i {
    width: 16px;
    text-align: center;
    flex-shrink: 0;
    font-size: 0.875rem;
}
.admin-sidebar .nav-link:hover {
    background-color: #f8f9fa;
    color: #4f46e5;
}
.admin-sidebar .nav-link.active {
    background-color: #eef2ff !important;
    color: #4f46e5 !important;
    border-color: #e0e7ff !important;
    font-weight: 600;
}

/* Sub-nav items */
.admin-sidebar .ps-4 .nav-link {
    font-size: 0.8125rem;
    padding: 0.375rem 0.75rem;
}
.admin-sidebar .ps-4 .nav-link.active {
    background-color: #eef2ff !important;
    color: #4f46e5 !important;
}

/* Divider labels */
.admin-sidebar small.text-muted.fw-bold {
    font-size: 0.6875rem;
    letter-spacing: 0.08em;
    color: #adb5bd;
}

/* Sidebar scrollbar */
.admin-sidebar nav::-webkit-scrollbar {
    width: 4px;
}
.admin-sidebar nav::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 4px;
}
.admin-sidebar nav::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

.collapsed {
    width: 68px;
    min-width: 68px;
}
.collapsed .nav-link {
    justify-content: center;
    padding: 0.5rem;
}
.collapsed .nav-link span {
    display: none !important;
}
.collapsed .admin-sidebar-logo {
    justify-content: center;
}
.collapsed .admin-sidebar-logo a {
    justify-content: center;
}
.collapsed .admin-sidebar-logo-text {
    display: none !important;
}

/* ===================== Card ===================== */
.card {
    border-radius: 0.75rem;
    border: 1px solid #e9ecef;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.card-header {
    background: #fff;
}
.card-body {
    padding: 1.25rem;
}

/* Card header border-bottom style */
.card-header {
    border-bottom: 1px solid #e9ecef;
}

/* ===================== Badge ===================== */
.badge {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.3em 0.65em;
    border-radius: 0.375rem;
}

/* Subtle badge variants */
.badge-success-subtle {
    background-color: #d1e7dd;
    color: #0f5132;
}
.badge-danger-subtle {
    background-color: #f8d7da;
    color: #842029;
}
.badge-warning-subtle {
    background-color: #fff3cd;
    color: #664d03;
}
.badge-primary-subtle {
    background-color: #cfe2ff;
    color: #004ac6;
}
.badge-info-subtle {
    background-color: #cff4fc;
    color: #0c4c6a;
}
.badge-secondary-subtle {
    background-color: #e9ecef;
    color: #495057;
}

/* ===================== Modal ===================== */
.modal-content {
    border-radius: 0.75rem;
    border: none;
    box-shadow: 0 0.5rem 1.5rem rgba(0,0,0,0.15);
}
.modal-header {
    border-radius: 0.75rem 0.75rem 0 0;
    border-bottom: 1px solid #e9ecef;
}
.modal-footer {
    border-radius: 0 0 0.75rem 0.75rem;
    border-top: 1px solid #e9ecef;
}
.modal-backdrop.show {
    opacity: 0.45;
}

/* ===================== Action Dropdown ===================== */
.action-dropdown-menu {
    min-width: 190px;
    border-radius: 0.5rem;
    border: 1px solid #e9ecef;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.1);
}
.action-dropdown-menu .dropdown-item {
    color: #495057;
    border-radius: 0.25rem;
    margin: 2px 4px;
    font-size: 0.8125rem;
    padding: 0.4rem 0.75rem;
}
.action-dropdown-menu .dropdown-item:hover {
    background-color: #f1f3f5;
    color: #0d6efd;
}
.action-dropdown-menu .dropdown-divider {
    margin: 0.25rem 0.5rem;
}

/* ===================== Table Column Widths ===================== */
/* ID column — narrow */
table.dataTable td.col-id,
table.dataTable th.col-id {
    width: 60px;
    min-width: 60px;
    max-width: 80px;
    text-align: center;
}
/* Date column */
table.dataTable td.col-date,
table.dataTable th.col-date {
    white-space: nowrap;
    width: 140px;
}
/* Action column — narrow, right-aligned */
table.dataTable td.col-action,
table.dataTable th.col-action {
    width: 120px;
    min-width: 100px;
    text-align: right;
}

/* Status badge in table */
table.dataTable .badge {
    font-size: 0.6875rem;
}

/* Monospace for codes/IDs */
table.dataTable code {
    font-size: 0.8125rem;
    background: #f1f3f5;
    padding: 0.15em 0.4em;
    border-radius: 0.25rem;
    color: #495057;
}

/* ===================== Dark Table (user pages) ===================== */
table.dataTable.dark-table {
    border-collapse: collapse !important;
    border-spacing: 0;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}
table.dataTable.dark-table thead th {
    padding: 0.75rem 1rem !important;
    vertical-align: middle !important;
    white-space: nowrap;
    font-size: 0.8125rem !important;
    background: rgba(88, 28, 135, 0.4) !important;
    color: rgba(255,255,255,0.9) !important;
    border-bottom: 1px solid rgba(255,255,255,0.1) !important;
}
table.dataTable.dark-table tbody td {
    padding: 0.75rem 1rem !important;
    color: rgba(255,255,255,0.85) !important;
    font-size: 0.8125rem !important;
    background: rgba(88, 28, 135, 0.4) !important;
    border-bottom: 1px solid rgba(255,255,255,0.05) !important;
    vertical-align: middle !important;
}
table.dataTable.dark-table tbody tr:last-child td {
    border-bottom: none !important;
}
table.dataTable.dark-table tbody tr:hover > td {
    background-color: rgba(88, 28, 135, 0.7) !important;
}

/* ===================== Scrollbar ===================== */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* ===================== Misc ===================== */
.file-custom {
    cursor: pointer;
}

.image-preview-box {
    width: 128px;
    height: 128px;
    border: 2px dashed #d0d7de;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f8f9fa;
    color: #6c757d;
    font-size: 0.875rem;
    text-align: center;
}
.image-preview-box img {
    width: 100%;
    height: 100%;
    -o-object-fit: cover;
       object-fit: cover;
}

/* Select2 Bootstrap 5 fixes */
.select2-container--bootstrap-5 .select2-selection {
    border-radius: 0.375rem !important;
    border-color: #ced4da !important;
}

/* Custom border radius helpers */
.rounded-4 { border-radius: 0.875rem !important; }
.rounded-3 { border-radius: 0.75rem !important; }

/* Card hover effect */
.card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Stats card */
.stat-card {
    border: 1px solid #e9ecef;
    border-radius: 0.75rem;
    transition: box-shadow 0.2s ease;
}
.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Table — striped rows from Bootstrap are enough,
   adding subtle left border accent on hover for action rows */
table.dataTable tbody tr:hover td.col-action {
    background-color: #f8f9fa !important;
}

