:root {
    --tblr-font-sans-serif: 'Inter var', -apple-system, BlinkMacSystemFont, San Francisco, Segoe UI, Roboto, Helvetica Neue, sans-serif;
}

.ti {
    display: inline-block;
    vertical-align: middle;
}

/* Global Table Sorting (Custom Refinement) */
.table-sort {
    cursor: pointer;
    padding: 0.5rem 0.25rem;
    margin: -0.5rem -0.25rem;
    transition: all 0.15s ease-in-out;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    position: relative;
}

/* Disable default Tabler/Bootstrap sorting arrows (::after and ::before) */
.table-sort::after,
.table-sort::before {
    display: none !important;
    content: none !important;
}

.table-sort:hover {
    background-color: rgba(32, 107, 196, 0.06);
    color: #206bc4 !important;
}

.table-sort .icon {
    font-size: 1rem;
    transition: transform 0.2s;
    line-height: 1;
}

/* Add a subtle highlight to the active sort icon's container */
.table-sort .ms-1 {
    display: flex;
    align-items: center;
    height: 100%;
}

/* Unified ERP Input Styling */
.erp-input {
    height: 32px !important;
    padding: 0.25rem 0.5rem !important;
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
}

/* Remove default Bootstrap/Tabler validation icons (X icon) for a cleaner look */
.form-control.is-invalid, 
.form-select.is-invalid,
.is-invalid-ts,
.is-invalid-ts .ts-control,
.was-validated .form-control:invalid,
.was-validated .form-select:invalid {
    background-image: none !important;
    padding-right: 0.5rem !important;
    border-color: #d63939 !important;
    --tblr-border-color: #d63939 !important; /* Override Tabler variable */
}

.invalid-feedback {
    font-size: 0.75rem !important;
    margin-top: 0.25rem;
    color: #d63939;
}

/* HTMX Animations */
.htmx-swapping {
    opacity: 0;
    transition: opacity 500ms ease-out;
}

.erp-input-sm {
    height: 28px !important;
    padding: 0.15rem 0.4rem !important;
    font-size: 0.8125rem !important;
}

/* Ensure consistent height for date inputs */
input[type="date"].erp-input {
    line-height: 1.1 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Custom ERP Themes */
[data-bs-theme="warm"] {
    --tblr-primary: #d97706; /* Amber 600 - Lebih tajam untuk teks/tombol */
    --tblr-primary-rgb: 217, 119, 6;
    --tblr-link-color: #d97706;
    --tblr-body-bg: #fdfaf3; /* Cream sangat tipis */
    --tblr-card-bg: #ffffff; /* Tetap putih agar konten menonjol */
    --tblr-border-color: #f1e3c4; /* Border sedikit kecokelatan halus */
}

[data-bs-theme="green"] {
    --tblr-primary: #059669; /* Emerald 600 */
    --tblr-primary-rgb: 5, 150, 105;
    --tblr-link-color: #059669;
    --tblr-body-bg: #f0fdf4; /* Mint sangat tipis */
    --tblr-card-bg: #ffffff;
    --tblr-border-color: #dcfce7; /* Border kehijauan halus */
}

/* Red Asterisk for Mandatory Fields */
.required::after {
    content: " *";
    color: #d63939; /* Standard Bootstrap/Tabler red */
    font-weight: bold;
}
