/* ===================================================================
   TRIVONE ERP - REUSABLE DATA TABLE COMPONENT STYLES
   Matches ArchitectUI DataTables layout (dom: 'lBfrtip') + Dark Mode
   =================================================================== */

.dt-container {
    width: 100%;
}

.dt-toolbar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.dt-toolbar__top {
    display: flex;
    align-items: center;
    width: 100%;
}

.dt-toolbar__bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.dt-toolbar__left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.dt-toolbar__right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.dt-length {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #495057;
}

.dt-length-select {
    width: 70px;
    height: 33px;
    padding: 2px 8px;
    font-size: 13px;
    border-radius: 4px;
    border: 1px solid #ced4da;
    background-color: #fff;
    color: #495057;
}

.dt-buttons {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.dt-buttons .btn {
    font-size: 12px;
    height: 33px;
    padding: 4px 11px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.15s ease-in-out;
}

/* Columns Selector Button - Dark Navy Blue */
.dt-buttons .dt-btn-colvis,
.dt-buttons .btn-primary {
    background-color: #002050 !important;
    border-color: #002050 !important;
    color: #ffffff !important;
    font-weight: 600;
}

.dt-buttons .dt-btn-colvis:hover,
.dt-buttons .btn-primary:hover {
    background-color: #1a2d5a !important;
    border-color: #1a2d5a !important;
    color: #ffffff !important;
}

/* Export Buttons (Print, PDF, Excel, CSV, Copy) - Clean Light Style */
.dt-buttons .dt-btn-export {
    background-color: #ffffff !important;
    border: 1px solid #ced4da !important;
    color: #495057 !important;
    font-weight: 500;
}

.dt-buttons .dt-btn-export:hover {
    background-color: #f4f6f9 !important;
    border-color: #adb5bd !important;
    color: #212529 !important;
}

.dt-buttons .dt-btn-export i {
    font-size: 12px;
    color: #555e68;
    margin-right: 3px;
}

.dt-buttons .dt-btn-export:hover i {
    color: #002050;
}

.dt-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dt-search-label {
    font-size: 13px;
    color: #495057;
    margin-bottom: 0;
    white-space: nowrap;
    user-select: none;
}

.dt-search-input {
    height: 33px;
    padding: 4px 30px 4px 10px;
    font-size: 13px;
    border-radius: 4px;
    border: 1px solid #ced4da;
    background-color: #fff;
    color: #495057;
    min-width: 200px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.dt-search-input:focus {
    outline: none;
    border-color: #213368;
    box-shadow: 0 0 0 2px rgba(33, 51, 104, 0.15);
}

.dt-search-clear {
    position: absolute;
    right: 8px;
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0;
    font-size: 12px;
}

.dt-search-clear:hover {
    color: #ef4444;
}

/* Column Visibility Dropdown */
.dt-colvis-menu {
    max-height: 280px;
    overflow-y: auto;
    padding: 8px;
    min-width: 180px;
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.dt-colvis-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.dt-colvis-item:hover {
    background-color: #f1f5f9;
}

/* Table Column Headers & Sorting */
.dt-th-sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 22px !important;
    white-space: nowrap;
}

.dt-th-sortable:hover {
    background-color: rgba(33, 51, 104, 0.05);
}

.dt-sort-indicator {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    opacity: 0.45;
}

.dt-sort-indicator.active {
    opacity: 1;
    color: #213368;
}

/* Clickable Table Rows */
.dt-row-clickable {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.dt-row-clickable:hover td {
    background-color: rgba(33, 51, 104, 0.04) !important;
}

/* Table Footer & Pagination */
.dt-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid #edf2f7;
}

.dt-info {
    font-size: 13px;
    color: #64748b;
}

.dt-pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 3px;
}

.dt-page-item .dt-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    color: #334155;
    background-color: #ffffff;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.dt-page-item .dt-page-link:hover:not(:disabled) {
    background-color: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}

.dt-page-item.active .dt-page-link {
    background-color: #213368;
    border-color: #213368;
    color: #ffffff;
}

.dt-page-item.disabled .dt-page-link {
    opacity: 0.45;
    cursor: not-allowed;
    background-color: #f8fafc;
}

/* Toast Copy Feedback */
.dt-copy-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #0f172a;
    color: #ffffff;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: dtFadeIn 0.25s ease-out;
}

@keyframes dtFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================================================
   DARK THEME OVERRIDES FOR DATA TABLE
   =================================================================== */
body.dark-theme .dt-buttons .dt-btn-colvis {
    background-color: #0f3460 !important;
    border-color: #0f3460 !important;
    color: #ffffff !important;
}

body.dark-theme .dt-buttons .dt-btn-export {
    background-color: #131d35 !important;
    border-color: #22304e !important;
    color: #cbd5e1 !important;
}

body.dark-theme .dt-buttons .dt-btn-export i {
    color: #94a3b8 !important;
}

body.dark-theme .dt-buttons .dt-btn-export:hover {
    background-color: #1e293b !important;
    border-color: #38bdf8 !important;
    color: #ffffff !important;
}

body.dark-theme .dt-buttons .dt-btn-export:hover i {
    color: #38bdf8 !important;
}

body.dark-theme .dt-length,
body.dark-theme .dt-search-label {
    color: #94a3b8;
}

body.dark-theme .dt-length-select,
body.dark-theme .dt-search-input {
    background-color: #0d1527 !important;
    border-color: #22304e !important;
    color: #f8fafc !important;
}

body.dark-theme .dt-search-input:focus {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2) !important;
}

body.dark-theme .dt-colvis-menu {
    background-color: #131d35 !important;
    border: 1px solid #22304e !important;
    color: #cbd5e1 !important;
}

body.dark-theme .dt-colvis-item:hover {
    background-color: #182442 !important;
    color: #ffffff !important;
}

body.dark-theme .dt-th-sortable:hover {
    background-color: rgba(56, 189, 248, 0.08) !important;
}

body.dark-theme .dt-sort-indicator.active {
    color: #38bdf8 !important;
}

body.dark-theme .dt-row-clickable:hover td {
    background-color: rgba(56, 189, 248, 0.06) !important;
}

body.dark-theme .dt-footer {
    border-top-color: #22304e !important;
}

body.dark-theme .dt-info {
    color: #94a3b8 !important;
}

body.dark-theme .dt-page-item .dt-page-link {
    background-color: #131d35 !important;
    border-color: #22304e !important;
    color: #cbd5e1 !important;
}

body.dark-theme .dt-page-item .dt-page-link:hover:not(:disabled) {
    background-color: #182442 !important;
    color: #ffffff !important;
    border-color: #38bdf8 !important;
}

body.dark-theme .dt-page-item.active .dt-page-link {
    background-color: #0284c7 !important;
    border-color: #0284c7 !important;
    color: #ffffff !important;
}

body.dark-theme .dt-page-item.disabled .dt-page-link {
    background-color: #0b1329 !important;
    opacity: 0.35 !important;
}
