/* Booking status badges + summary rows + show page (customer + admin) */

.booking-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.booking-status-blue   { background: #dbeafe; color: #1e40af; }
.booking-status-cyan   { background: #cffafe; color: #155e75; }
.booking-status-purple { background: #ede9fe; color: #5b21b6; }
.booking-status-yellow { background: #fef3c7; color: #92400e; }
.booking-status-green  { background: #d1fae5; color: #065f46; }
.booking-status-red    { background: #fee2e2; color: #991b1b; }
.booking-status-gray   { background: #e5e7eb; color: #374151; }

.booking-summary-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr 180px;
    gap: 16px;
    align-items: center;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 12px;
    background: #fff;
}

.booking-summary-row:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.05); }

.booking-summary-col { min-width: 0; }
.booking-summary-label {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.booking-summary-value {
    font-size: 14px;
    color: #1a1a2e;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.booking-summary-id .booking-summary-value { color: #061D5B; font-family: monospace; }

.booking-summary-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.booking-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
}
.booking-action-view {
    background: #f0f0f0;
    color: #061D5B;
}
.booking-action-view:hover { background: #e5e5e5; }
.booking-action-edit {
    background: #061D5B;
    color: #fff;
}
.booking-action-edit:hover { opacity: 0.92; }
.booking-action-confirm {
    background: #065f46;
    color: #fff;
}
.booking-action-confirm:hover { opacity: 0.92; }
.booking-action-assign {
    background: #5b21b6;
    color: #fff;
}
.booking-action-assign:hover { opacity: 0.92; }

.booking-show-wrap {
    max-width: 1400px;
    margin: 30px auto 60px;
}
.booking-show-page,
.booking-assign-page {
    color: #1f2937;
}
.booking-show-topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}
.booking-show-topbar h1 {
    margin: 6px 0 4px;
    font-size: 24px;
    color: #061D5B;
}
.booking-show-subtitle {
    margin: 0;
    color: #6b7280;
    font-size: 13px;
}
.booking-show-topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.booking-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #6b7280;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}
.booking-back-link:hover {
    color: #061D5B;
}
.booking-show-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 22px;
    align-items: start;
}
.booking-show-main { min-width: 0; }
.booking-show-side { min-width: 0; }
.booking-summary-card { margin-bottom: 22px; }

.detail-sub {
    display: block;
    color: #9ca3af;
    font-size: 12px;
    margin-top: 2px;
}
.booking-history-by {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
}
.booking-history-note {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}
.assignment-row {
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
}
.assignment-row:last-child { border-bottom: 0; }
.assignment-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 14px;
}
.assignment-truck {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}
.assignment-by {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
}

.admin-form-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

@media (max-width: 1024px) {
    .booking-show-grid { grid-template-columns: 1fr; }
    .admin-form-row { grid-template-columns: 1fr; }
}

.booking-show-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}
.booking-show-header h1 {
    margin: 0 0 6px 0;
    font-size: 24px;
    color: #061D5B;
}
.booking-show-header p { margin: 0; color: #666; font-size: 13px; }
.booking-show-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.booking-show-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.booking-show-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 16px;
}
.booking-show-card h2 {
    font-size: 15px;
    font-weight: 700;
    color: #061D5B;
    margin: 0 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.booking-history-list {
    list-style: none;
    padding: 0 10px 0 0;
    margin: 0;
    max-height: 320px;
    overflow-y: auto;
    /* Firefox */
    scrollbar-width: thin;
    scrollbar-color: #c7d2fe transparent;
}
.booking-history-list::-webkit-scrollbar {
    width: 6px;
}
.booking-history-list::-webkit-scrollbar-track {
    background: transparent;
}
.booking-history-list::-webkit-scrollbar-thumb {
    background: #c7d2fe;
    border-radius: 999px;
}
.booking-history-list::-webkit-scrollbar-thumb:hover {
    background: #a5b4fc;
}
.booking-history-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}
.booking-history-item:last-child { border-bottom: 0; }
.booking-history-time {
    color: #888;
    min-width: 130px;
    font-size: 12px;
}

.booking-empty {
    padding: 30px;
    text-align: center;
    color: #888;
    font-size: 14px;
}

.booking-alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}
.booking-alert-success { background: #d1fae5; color: #065f46; }
.booking-alert-error   { background: #fee2e2; color: #991b1b; }

/* Payment hand-off on the customer show page */
.payment-prompt {
    margin: 0 0 12px;
    font-size: 14px;
    color: #374151;
    line-height: 1.5;
}
.payment-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}
.payment-option {
    cursor: pointer;
    user-select: none;
}
.payment-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.payment-option-body {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.payment-option:hover .payment-option-body {
    border-color: #c7d2fe;
    background: #eef2ff;
}
.payment-option input[type="radio"]:checked + .payment-option-body {
    border-color: #061D5B;
    background: #061D5B;
    color: #ffffff;
}
.payment-option-body i {
    font-size: 18px;
}
.payment-error {
    color: #b91c1c;
    font-size: 13px;
    margin: 10px 0 0;
}
.payment-recorded {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: #d1fae5;
    border-radius: 10px;
    color: #065f46;
}
.payment-recorded i {
    font-size: 22px;
}
.payment-recorded-label {
    font-size: 15px;
    font-weight: 700;
}
.payment-recorded-time {
    font-size: 12px;
    opacity: 0.85;
}

@media (max-width: 768px) {
    .booking-summary-row { grid-template-columns: 1fr 1fr; }
    .booking-summary-actions { grid-column: 1 / -1; justify-content: flex-start; }
    .booking-show-grid { grid-template-columns: 1fr; }
}

/* Customer dashboard profile form */
.dashboard-profile-form { max-width: 520px; }
.dashboard-profile-row { margin-bottom: 18px; }
.dashboard-profile-row label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
}
.dashboard-profile-row input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #D0D5DD;
    border-radius: 8px;
    font-size: 15px;
    color: #333;
    background: #fff;
    box-sizing: border-box;
}
.dashboard-profile-row input:disabled { background: #f5f5f5; color: #999; }
.dashboard-profile-error {
    display: block;
    color: #b91c1c;
    font-size: 12px;
    margin-top: 4px;
}
.dashboard-profile-actions { margin-top: 22px; }
.dashboard-profile-save {
    background: #061D5B;
    color: #fff;
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
.dashboard-profile-save:hover { opacity: 0.92; }

/* Dashboard quotation history action icons.
   Uses a unique class (.qt-action) to avoid the cascade collision with
   `.action-btn` which is defined in both custom.css and reservation.css. */
.qt-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.qt-actions form {
    display: inline-flex;
    margin: 0;
    padding: 0;
}
.qt-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 6px;
    background: #f3f4f6;
    color: #061D5B;
    font-size: 14px;
    border: 1px solid #e5e7eb;
    text-decoration: none;
    cursor: pointer;
    vertical-align: middle;
    line-height: 1;
}
.qt-action i,
.qt-action i.fas,
.qt-action i.fa-solid {
    font-family: "Font Awesome 6 Free", "FontAwesome" !important;
    font-weight: 900 !important;
    font-style: normal !important;
    font-size: 14px;
    line-height: 1;
    display: inline-block;
    -webkit-font-smoothing: antialiased;
}
.qt-action:hover {
    background: #061D5B;
    color: #ffffff;
    border-color: #061D5B;
}
.qt-action-confirm {
    background: #065f46;
    color: #ffffff;
    border-color: #065f46;
}
.qt-action-confirm:hover {
    background: #047857;
    border-color: #047857;
}

/* Customer confirm-booking modal.
   The show page only loads booking.css + frontend assets; these rules keep
   the modal self-contained so we don't have to pull in quotation-wizard.css. */
.booking-locked-msg {
    color: #666;
    font-size: 13px;
    margin: 0;
}

.confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
}
.confirm-modal[hidden] {
    display: none;
}
/* Defensive: a global `header { position: fixed }` rule from styles.css
   would otherwise pin any <header> element inside the modal to the top
   of the viewport. Force everything inside the modal to behave normally. */
.confirm-modal header {
    position: static;
    top: auto;
    width: auto;
    z-index: auto;
    background: transparent;
}
.confirm-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 29, 91, 0.45);
}
.confirm-modal-dialog {
    position: relative;
    width: calc(100% - 32px);
    max-width: 540px;
    max-height: 90vh;
    margin: 5vh auto;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.confirm-modal-dialog > .confirm-modal-head,
.confirm-modal-dialog > .confirm-modal-actions {
    flex: 0 0 auto;
}
.confirm-modal-dialog > .confirm-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.confirm-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    background: #f8faff;
    border-bottom: 1px solid #e0e6f5;
}
.confirm-modal-head h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #061D5B;
    line-height: 1.2;
}
.confirm-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 0 4px;
}
.confirm-modal-close:hover {
    color: #061D5B;
}
.confirm-modal-body {
    padding: 20px;
}
.confirm-field label,
.confirm-slots-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 6px;
}
.confirm-field input[type="date"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #1f2937;
    background: #fff;
}
.confirm-field input[type="date"]:focus {
    outline: none;
    border-color: #061D5B;
    box-shadow: 0 0 0 3px rgba(6, 29, 91, 0.12);
}

.confirm-field-checkbox {
    margin-top: 16px;
    padding: 14px 16px;
    background: #f5f7ff;
    border: 1px solid #dbe2ff;
    border-radius: 10px;
}
.confirm-field-checkbox label {
    display: flex !important;
    align-items: center;
    gap: 10px;
    margin-bottom: 0 !important;
    font-size: 14px !important;
    font-weight: 600;
    color: #061D5B !important;
    cursor: pointer;
}
.confirm-field-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #061D5B;
    cursor: pointer;
    flex-shrink: 0;
}
.confirm-field-help {
    margin: 6px 0 0 28px;
    font-size: 12px;
    color: #6b7280;
}
.confirm-slots-wrap {
    margin-top: 16px;
}
.confirm-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 48px;
}
.confirm-slots-empty,
.confirm-slots-none {
    color: #6b7280;
    font-size: 13px;
    margin: 4px 0 0;
}
.confirm-slot-btn {
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    color: #1f2937;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.confirm-slot-btn:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
}
.confirm-slot-btn.selected {
    background: #061D5B;
    color: #ffffff;
    border-color: #061D5B;
}
.confirm-modal-error {
    color: #b91c1c;
    font-size: 13px;
    margin: 12px 0 0;
}
.confirm-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid #eef0f4;
    background: #fafbfd;
}
.booking-action-btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Combined (dual-leg) confirm modal — two stacked sections for packaging
   + moving/storage. The moving section is dimmed until packaging has a
   confirmed slot, then unlocks via the `.unlocked` class. */
.confirm-modal-combined .confirm-modal-dialog {
    max-width: 640px;
}
.confirm-leg {
    padding: 22px 0;
    border-bottom: 1px dashed #d6deff;
}
.confirm-leg:first-of-type {
    padding-top: 6px;
}
.confirm-leg:last-of-type {
    border-bottom: 0;
    padding-bottom: 6px;
}
.confirm-leg-head {
    margin-bottom: 18px;
}
.confirm-leg-step {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #eef2ff;
    color: #3155E7;
}
.confirm-leg-head h4 {
    margin: 8px 0 4px;
    font-size: 17px;
    font-weight: 700;
    color: #061D5B;
}
.confirm-leg-head p {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
}
.confirm-leg-gated {
    opacity: 0.45;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.confirm-leg-gated.unlocked {
    opacity: 1;
    pointer-events: auto;
}
