/**
 * Bookings index + create — load LAST in master.blade.php (after select2 theme).
 */

/* ── Index filters (form-control-sm) ─────────────────────────────────── */
#filterForm {
    --booking-field-height: 31px;
}

#filterForm input.form-control.form-control-sm,
#filterForm select.form-control.form-control-sm,
#filterForm input.form-control.form-control-sm[type="date"],
#filterForm .select2-container--bootstrap4 .select2-selection--single {
    height: var(--booking-field-height) !important;
    min-height: var(--booking-field-height) !important;
    max-height: var(--booking-field-height) !important;
    box-sizing: border-box !important;
    font-size: 0.875rem !important;
    line-height: 1.25 !important;
    padding-top: 0.25rem !important;
    padding-bottom: 0.25rem !important;
}

#filterForm .select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered,
#filterForm .select2-container--bootstrap4 .select2-selection--single .select2-selection__placeholder {
    line-height: 1.25 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: 0.5rem;
    padding-right: 1.75rem;
}

#filterForm .select2-container--bootstrap4 {
    display: block;
    width: 100% !important;
}

#filterForm .form-row > [class*="col-"] {
    display: flex;
    flex-direction: column;
}

.bookings-toolbar .select2-container--bootstrap4 .select2-selection--single,
.bookings-toolbar input.form-control.form-control-sm[type="date"] {
    height: var(--booking-field-height) !important;
    min-height: var(--booking-field-height) !important;
    max-height: var(--booking-field-height) !important;
}

/* ── Create form — one height for every control type ─────────────────── */
#bookingCreateForm {
    --booking-field-height: 38px;
}

#bookingCreateForm input.form-control:not(textarea),
#bookingCreateForm select.form-control:not(.select2-hidden-accessible),
#bookingCreateForm input.form-control[type="date"],
#bookingCreateForm input.form-control[type="time"],
#bookingCreateForm input.form-control[type="number"],
#bookingCreateForm .select2-container--bootstrap4 .select2-selection--single {
    height: var(--booking-field-height) !important;
    min-height: var(--booking-field-height) !important;
    max-height: var(--booking-field-height) !important;
    box-sizing: border-box !important;
    font-size: 1rem !important;
    line-height: 1.25 !important;
    padding: 0.375rem 0.75rem !important;
    border: 1px solid #ced4da !important;
    border-radius: 0.25rem !important;
}

#bookingCreateForm input.form-control[readonly],
#bookingCreateForm input.form-control:read-only,
#bookingCreateForm .select2-container--bootstrap4.select2-container--disabled .select2-selection--single {
    background-color: #e9ecef !important;
    opacity: 1 !important;
}

#bookingCreateForm .select2-container--bootstrap4 {
    display: block;
    width: 100% !important;
}

#bookingCreateForm .select2-container--bootstrap4 .select2-selection--single {
    display: flex !important;
    align-items: center !important;
    padding: 0 !important;
    background-color: #fff;
    overflow: hidden;
}

#bookingCreateForm .select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered,
#bookingCreateForm .select2-container--bootstrap4 .select2-selection--single .select2-selection__placeholder {
    line-height: 1.25 !important;
    height: auto !important;
    max-height: 100% !important;
    padding: 0 1.75rem 0 0.75rem !important;
    margin: 0 !important;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #495057;
}

#bookingCreateForm .select2-container--bootstrap4 .select2-selection--single .select2-selection__placeholder {
    color: #6c757d;
}

#bookingCreateForm .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow {
    position: absolute !important;
    top: 0 !important;
    right: 3px !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
}

#bookingCreateForm .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow b {
    position: static !important;
    margin: 0 !important;
}

#bookingCreateForm .select2-container--bootstrap4 .select2-search--dropdown .select2-search__field {
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
}

/* Customer/Employee row: hint below customer should not shrink employee field */
#bookingCreateForm .booking-create-party-row > [class*="col-"] > .form-group {
    margin-bottom: 0.5rem;
}

#bookingCreateForm .booking-create-party-row .form-text {
    min-height: 1.25rem;
    margin-top: 0.25rem;
    margin-bottom: 0;
}
