/*
Template Name: Velzon - Admin & Dashboard Template
Author: Themesbrand
Website: https://themesbrand.com/
Contact: support@themesbrand.com
File: Custom Css File
*/

/*TENANT BLOCK
*/
body.tenant-locked {
    pointer-events: none;
}
body.tenant-locked .modal {
    pointer-events: auto;
}
/*
 * =====================================================
 * FORM CONTROL ALIGNMENT FIX
 * Bootstrap 5 + Velzon + Select2 + Flatpickr
 * FINAL – STABLE
 * =====================================================
 */

:root {
    --form-control-height: 38px;
    --form-control-font-size: 0.875rem;
    --form-control-line-height: 1.5;
}

/* =====================================================
 * BASE INPUT & SELECT (BS5)
 * ===================================================== */
.form-control,
.form-select {
    height: var(--form-control-height);
    padding: 0.375rem 0.75rem;
    font-size: var(--form-control-font-size);
    line-height: var(--form-control-line-height);
    padding-top: 0.45rem;
}

/* 🔥 IMPORTANT: FORCE SINGLE SELECT TO STAY 1 ROW */
.form-select:not([multiple]):not([size]) {
    height: var(--form-control-height) !important;
    overflow: hidden;
    white-space: nowrap;
}

/* Prevent legacy CSS from breaking selects */
select.form-select {
    min-height: var(--form-control-height);
}

/* =====================================================
 * SELECT2 SINGLE
 * ===================================================== */
.select2-container .select2-selection--single {
    height: var(--form-control-height);
    display: flex;
    align-items: center;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
}

/* Text inside Select2 */
.select2-container .select2-selection__rendered {
    display: flex;
    align-items: center;
    height: 100%;
    padding-left: 0.75rem;
    padding-right: 2rem;
    padding-top: 0.3rem; 
    font-size: var(--form-control-font-size);
    line-height: var(--form-control-line-height);
}

/* Arrow */
.select2-container .select2-selection__arrow {
    height: 100%;
    display: flex;
    align-items: center;
    top: 0;
}

/* =====================================================
 * FLATPICKR
 * ===================================================== */
.flatpickr-input {
    height: var(--form-control-height);
    font-size: var(--form-control-font-size);
}

/* =====================================================
 * FORM SWITCH (CLIENT TOGGLE)
 * ===================================================== */
.form-switch {
    display: flex;
    align-items: center;
    height: var(--form-control-height);
}

.form-switch .form-check-input {
    margin-top: 0;
}

/* =====================================================
 * MODAL SPACING (VELZON CONSISTENT)
 * ===================================================== */
.modal-body .mb-3 {
    margin-bottom: 1rem;
}

/* =====================================================
 * TEXTAREA SHOULD NOT BE FIXED HEIGHT
 * ===================================================== */
textarea.form-control {
   /* height: auto !important;
    min-height: 50px;
    line-height: 1.5;*/
    resize: vertical;
}
.notes textarea {
    resize: vertical;      /* hanya atas-bawah */
    min-height: 120px;     /* tinggi minimal */
    max-height: 400px;     /* optional */
}
.tnc textarea {
    resize: vertical;      /* hanya atas-bawah */
    min-height: 180px;     /* tinggi minimal */

}
.desc textarea {
    resize: vertical;      /* hanya atas-bawah */
    min-height: 75px;     /* tinggi minimal */
}

/* ===============================
   Invoice Overdue Styling
================================ */
.font-overdue {
    color: var(--vz-danger);
    background-color: rgba(220, 53, 69, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
}

/* ===============================
   Pager: Secondary Active Style
================================ */
.pagination .page-item.active .page-link {
    background-color: var(--vz-secondary) !important;
    border-color: var(--vz-secondary) !important;
    color: #fff !important;
}
/* ===============================
   LIST RESPONSIVE –TABLE QUOTE + INVOICE BS5 FINAL
================================ */

.item-card {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 1rem;
    align-items: stretch;
}

@media (max-width: 992px) {
    .item-card {
        grid-template-columns: 1fr;
    }
}

.item-summary {
    border-left: 1px solid #e9ebec;
    padding-left: 1rem;
    font-size: 0.875rem;
}

.item-summary .row {
    margin-bottom: 0.25rem;
}

.item-summary strong {
    font-size: 1rem;
}
/* ===============================
   INPUT GROUP LABEL FIX WIDTH
   (BS5 + Velzon)
================================ */

/* ======================================================
   Input-group toggle (Client/User permissive search)
   BS5 + Velzon safe
   ====================================================== */

.input-group-text.ig-toggle-switch {
    width: 48px;
    height: 38px;
    padding: 0;
}
.ig-label {
    min-width: 110px;      /* ubah sesuai kebutuhan */
    justify-content: flex-end; /* text rata kanan */
    white-space: nowrap;
}
.ig-label-desc {
   /* min-width: 110px; */
    min-height: 75px;
    resize: vertical;     /* ubah sesuai kebutuhan */
    justify-content: flex-end; /* text rata kanan */
    white-space: nowrap;
}

/* Pastikan switch benar-benar center */
.input-group-text.ig-toggle-switch .form-check {
    margin: 0;
    padding: 0;
}

.input-group-text.ig-toggle-switch .form-check-input {
    margin: 0;
}

/* =====================================================
   CUSTOM ICON SIDEBAR – VELZON SAFE
===================================================== */

.custom-icon-sidebar {
    position: fixed;
    top: var(--vz-header-height, 100px);
    left: 0;
    width: 64px;
    height: calc(100vh - var(--vz-header-height, 100px));
    z-index: 1000;

    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 1rem;
}

/* ICON */
.custom-icon-sidebar a {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;
    margin-bottom: 10px;

    font-size: 20px;
    text-decoration: none;
    transition: all .2s ease;
}

/* DARK MODE */
html[data-sidebar-custom="dark"] .custom-icon-sidebar {
    background-color: var(--vz-sidebar-bg);
}
html[data-sidebar-custom="dark"] .custom-icon-sidebar a {
    color: var(--vz-sidebar-text);
}
html[data-sidebar-custom="dark"] .custom-icon-sidebar a:hover,
html[data-sidebar-custom="dark"] .custom-icon-sidebar a.active {
    background-color: var(--vz-sidebar-hover-bg);
    color: var(--vz-sidebar-active-text);
}

/* LIGHT MODE */
html[data-sidebar-custom="light"] .custom-icon-sidebar {
    background-color: #fff;
    border-right: 1px solid #eee;
}
html[data-sidebar-custom="light"] .custom-icon-sidebar a {
    color: #495057;
}
html[data-sidebar-custom="light"] .custom-icon-sidebar a:hover,
html[data-sidebar-custom="light"] .custom-icon-sidebar a.active {
    background-color: #f3f6f9;
    color: #0d6efd;
}

/* SHIFT CONTENT */
body[data-layout="horizontal"] .main-content {
    margin-left: 64px;
}

/* HIDE TOPBAR "MORE" MENU */
.horizontal-menu .navbar-nav .more-menu {
    display: none !important;
}


.page-title-box {
    position: sticky;
    top: var(--vz-header-height, 70px);
    z-index: 9;
    background: var(--vz-body-bg);
}

/* ==========================================
 * FIX SELECT2 INSIDE INPUT-GROUP (BS5)
 * ========================================== */
.input-group > .select2-container {
    flex: 1 1 auto !important;
    width: 1% !important; /* BS5 trick */
    min-width: 0 !important;
}

.input-group > .select2-container .select2-selection--single {
    height: var(--form-control-height) !important;
    border-radius: 0 0.375rem 0.375rem 0 !important;
}

/* Ensure toggle stays aligned */
.input-group-text {
    height: var(--form-control-height);
    display: flex;
    align-items: center;
    justify-content: center;
}
/* =========================================
   ITEM TABLE - BS5 + RESPONSIVE
========================================= */

.table.items {
    table-layout: auto;
    width: 100%;
}

/* Default cell */
.table.items td {
    vertical-align: top;
    padding: .5rem .75rem;
}


/* ================================
   ICON COLUMN
================================ */
.table.items td.td-icon {
    width: 20px;
    min-width: 10px;
    text-align: center;
}



/* ================================
   AMOUNT COLUMN
================================ */
.table.items td.td-amount {
    width: 160px;
    min-width: 140px;
    text-align: right;
}

/* =================================
   AMOUNT TEXT ALIGN
================================= */
.amount {
    text-align: right;
}

.amount.last {
    padding-right: 1rem;
}

/* =================================
   MOBILE OPTIMIZATION
================================= */
@media (max-width: 768px) {

    .table.items td {
        min-width: unset;
        padding: .5rem;
    }

    .table.items td.td-quantity {
        width: 100px;
    }

    .table.items td.td-amount {
        width: 120px;
    }

    .table.items td.td-icon {
        width: 15px;
    }


}
/* =====================================================
 * PROJECT-TIMELINE
 * ===================================================== */
.range-btn.active {
    background-color: #405189;
    color: #fff;
}
#validation-weight,
#validation-progress {
    transition: all 0.2s ease;
    opacity: 0.9;
}

#validation-weight.text-success,
#validation-progress.text-success {
    opacity: 1;
}
.saving {
    background-color: #fff3cd !important; /* kuning */
}

.saved {
    background-color: #d1e7dd !important; /* hijau */
}

.error {
    background-color: #f8d7da !important; /* merah */
}
.row-invalid {
    background-color: #f8d7da !important;
}

.row-valid {
    background-color: #d1e7dd !important;
}

.row-warning {
    background-color: #fff3cd !important;
}
.validation-icon {
    font-size: 14px;
    min-width: 16px;
    text-align: center;
}

.child-name-input.saving {
    background-color: #fff3cd;
}

.child-name-input.saved {
    background-color: #d1e7dd;
}

.child-name-input.error {
    background-color: #f8d7da;
}

#timeline-saving-indicator {
    transition: all .2s ease;
}

/* WEEK STATUS COLOR */
.week-cell.not_started { background-color: #e2e8f0; }
.week-cell.ongoing { background: #fff3cd; }
.week-cell.finished { background: #d1e7dd; }
.week-cell.overdue { background: #f8d7da !important; }
.week-cell.overdue {
    background-color: #f8d7da !important;
    border: 1px solid #dc3545;
    position: relative;
}
.week-status-toggle {
    cursor: pointer;
    transition: .2s;
}

.week-status-toggle:hover {
    transform: scale(1.2);
}

/* ---------- REQUIRED ---------- */

.form-label:has(+ input[required]),
.form-label:has(+ select[required]),
.form-label:has(+ textarea[required]) {
    position: relative;
}

.form-label:has(+ input[required])::after,
.form-label:has(+ select[required])::after,
.form-label:has(+ textarea[required])::after {
    content: " *";
    color: #dc3545;
}