/**
 * Uniform Table Borders
 * Eliminates Bootstrap 5's 2px black border-top / thick divider
 * Standardizes all table and modal table borders to a crisp, uniform 1px solid #e2e8f0
 */

/* 1. Global table divider fix: eliminates Bootstrap 5's 2px solid currentColor divider */
.table > :not(:first-child) {
    border-top: 1px solid #e2e8f0 !important;
}

/* 2. Standardize .table-bordered across the application */
.table-bordered {
    border-color: #e2e8f0 !important;
}
.table-bordered > :not(caption) > * {
    border-width: 1px 0 !important;
    border-color: #e2e8f0 !important;
}
.table-bordered > :not(caption) > * > * {
    border-width: 1px !important;
    border-color: #e2e8f0 !important;
}
.table-bordered thead th,
.table-bordered thead td {
    border-bottom: 1px solid #e2e8f0 !important;
    border-color: #e2e8f0 !important;
    background-color: #f8fafc !important;
    color: #475569 !important;
}

/* 3. Modal specific table-bordered enhancement */
.modal .table-bordered {
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}

/* 4. Specialized .sales-table-wrapper and .sales-table for sales/order/modal forms */
.sales-table-wrapper {
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    background: #ffffff !important;
}

.sales-table {
    width: 100% !important;
    margin-bottom: 0 !important;
    border-collapse: collapse !important;
    border: none !important;
}

.sales-table > :not(caption) > * > * {
    border-color: #e2e8f0 !important;
    border-width: 1px !important;
}

.sales-table > :not(:first-child) {
    border-top: 1px solid #e2e8f0 !important;
}

.sales-table thead th {
    background-color: #f8fafc !important;
    color: #475569 !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.4px !important;
    padding: 10px 14px !important;
    border: 1px solid #e2e8f0 !important;
    border-top: none !important;
    vertical-align: middle !important;
}

.sales-table tbody td {
    background-color: #ffffff !important;
    padding: 8px 12px !important;
    border: 1px solid #e2e8f0 !important;
    vertical-align: middle !important;
}

/* Outer border normalization inside wrapper: avoids double borders with wrapper */
.sales-table tr > th:first-child,
.sales-table tr > td:first-child {
    border-left: none !important;
}

.sales-table tr > th:last-child,
.sales-table tr > td:last-child {
    border-right: none !important;
}

.sales-table tbody tr:last-child > td {
    border-bottom: none !important;
}

/* Form inputs & select2 inside sales-table */
.sales-table td .form-control {
    border-color: #e2e8f0 !important;
    height: 38px !important;
    font-size: 13px !important;
    border-radius: 6px !important;
}

.sales-table td .input-group {
    border-radius: 6px;
}

.sales-table td .input-group .form-control {
    border-radius: 0 6px 6px 0 !important;
}

.sales-table td .input-group .input-group-text {
    border-color: #e2e8f0 !important;
    height: 38px !important;
    font-size: 13px !important;
    background-color: #f8fafc !important;
    color: #64748b !important;
}

.sales-table td .input-group > :not(:last-child):not(.dropdown-toggle) {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.sales-table td .input-group > :not(:first-child) {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

.sales-table td .select2-container {
    width: 100% !important;
}

.sales-table td .select2-container--default .select2-selection--single {
    border-color: #e2e8f0 !important;
    height: 38px !important;
    line-height: 36px !important;
    border-radius: 6px !important;
    display: flex !important;
    align-items: center !important;
}

.sales-table td .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 36px !important;
    font-size: 13px !important;
    color: #334155 !important;
    padding-left: 12px !important;
}

.sales-table td .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px !important;
}
