/* ============================================================
   S2S Booking Form - Custom Styles
   Bootstrap 5 overrides — default-sized controls for readability
   ============================================================ */

:root {
    --s2s-brand: #B22222;
    --s2s-blue: #4a6fa5;
    --s2s-teal: #2a9d8f;
    --s2s-indigo: #6366f1;
    --s2s-green: #64748b;
    --s2s-dark: #be123c;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 0.95rem;
    background: #f1f5f9;
    line-height: 1.4;
}

/* ----- Navbar ----- */
.bg-brand { background-color: var(--s2s-brand) !important; }
.navbar { padding: 0.25rem 0.75rem; min-height: 0; }
.navbar-brand { font-size: 1rem; margin-bottom: 0; }
.navbar-text { font-size: 0.85rem; }

/* ----- Section Cards ----- */
.section-card {
    border-radius: 0.35rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-left-width: 4px !important;
    border-left-style: solid !important;
}

.section-card .card-header {
    font-size: 0.95rem;
    font-weight: 700;
    padding: 0.35rem 0.6rem;
    border-bottom: 1px solid #e2e8f0;
}

.section-card .card-body {
    padding: 0.4rem 0.6rem !important;
}

.border-start-blue  { border-left-color: var(--s2s-blue) !important; }
.border-start-teal  { border-left-color: var(--s2s-teal) !important; }
.border-start-indigo { border-left-color: var(--s2s-indigo) !important; }
.border-start-green { border-left-color: var(--s2s-green) !important; }
.border-start-dark  { border-left-color: var(--s2s-dark) !important; }

/* ----- Section-tinted backgrounds ----- */
.border-start-blue .card-body  { background: #eef3f9; }
.border-start-teal .card-body  { background: #eaf6f4; }
.border-start-indigo .card-body { background: #eeedf8; }
.border-start-green .card-body { background: #ffffff; }
.border-start-dark .card-body  { background: #fef2f2; }

/* ----- Form Labels (default size, not -sm) ----- */
.form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.1rem;
}

/* ----- Form Controls: Bootstrap defaults, minor tweaks ----- */
.form-control, .form-select {
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
}

/* White inputs pop against tinted card backgrounds */
.form-control:not([readonly]),
.form-select {
    background-color: #fff;
    border-color: #adb5bd;
}

.form-control:not([readonly]):focus {
    border-color: var(--s2s-blue);
    box-shadow: 0 0 0 2px rgba(74,111,165,0.15);
}

/* Readonly: blend into card background */
input[readonly].form-control {
    background-color: transparent !important;
    border-color: transparent;
    color: #475569;
    font-style: italic;
}

textarea.form-control {
    height: auto;
}

/* ----- Checkboxes: full Bootstrap size ----- */
.form-check-label {
    font-size: 0.88rem;
    line-height: 1.4;
}

.form-check {
    min-height: 0;
    margin-bottom: 0.1rem;
}

.form-check-input {
    width: 1.1em;
    height: 1.1em;
    margin-top: 0.15em;
}

.form-check-inline {
    margin-right: 0.5rem;
}

.form-check-input:checked + .form-check-label {
    font-weight: 700;
    color: var(--s2s-brand);
}

/* ----- Payment group (dark blue, no title) ----- */
.payment-group {
    background: #3b5998;
    border-color: #2c4a7c;
}

.payment-group .form-label {
    color: #1e3a5f;
}

/* ----- Client Action Bar ----- */
.client-action-bar {
    background: #f1f5f9;
    border-top: 1px solid #e2e8f0;
    margin: 0.3rem -0.6rem -0.4rem -0.6rem;
    padding: 0.3rem 0.6rem;
    border-radius: 0 0 0.35rem 0.35rem;
}

.readonly-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.readonly-badge .form-control {
    background: transparent !important;
    border: none;
    padding: 0;
    height: auto;
    font-size: 0.85rem;
    font-weight: 600;
    font-style: normal;
}

/* ----- Lookup row separator ----- */
.card-body > .row:first-child {
    padding-bottom: 0.25rem;
    margin-bottom: 0.3rem !important;
    border-bottom: 1px dashed #cbd5e1;
}

/* ----- Row gaps: moderate ----- */
.row.g-2 { --bs-gutter-y: 0.3rem; --bs-gutter-x: 0.5rem; }
.row.g-1 { --bs-gutter-y: 0.15rem; --bs-gutter-x: 0.3rem; }
.mb-2 { margin-bottom: 0.35rem !important; }
.mb-3 { margin-bottom: 0.5rem !important; }
.mt-1 { margin-top: 0.2rem !important; }
.py-2 { padding-top: 0.35rem !important; padding-bottom: 0.35rem !important; }
.pt-3 { padding-top: 0.5rem !important; }
.pb-5 { padding-bottom: 2.5rem !important; }

/* ----- Radio Pill Groups ----- */
.btn-group-sm > .btn {
    font-size: 0.8rem;
    padding: 0.15rem 0.5rem;
    line-height: 1.4;
}

.btn-check:checked + .btn-outline-secondary {
    background-color: var(--s2s-brand);
    border-color: var(--s2s-brand);
    color: white;
}

/* ----- Product Groups ----- */
.product-group {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 0.3rem;
    padding: 0.3rem 0.4rem;
}

.product-group-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--s2s-indigo);
    letter-spacing: 0.04em;
    margin-bottom: 0.2rem;
    padding-bottom: 0.15rem;
    border-bottom: 1px solid #e2e8f0;
}

/* ----- Section Headers ----- */
h6.text-uppercase {
    font-size: 0.85rem;
    margin-bottom: 0.25rem !important;
    padding-bottom: 0.15rem !important;
}

/* ----- Action Buttons ----- */
#actionCard {
    border-left-color: var(--s2s-green) !important;
}

#actionCard .btn {
    font-size: 0.85rem;
    padding: 0.3rem 0.65rem;
}

/* ----- Sticky Action Bar ----- */
.sticky-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1e293b;
    color: white;
    padding: 0.35rem 0.75rem;
    box-shadow: 0 -2px 6px rgba(0,0,0,0.15);
    z-index: 1030;
}

.sticky-action-bar .btn {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    padding: 0.3rem 0.65rem;
}

/* ----- Finance Section ----- */
#financeSection .card-header { font-size: 0.95rem; }

/* Finance outline buttons — stronger border + text on pink background.
   (No -primary/-warning rules: Send Invoice / Send Overdue live in the action bar, not here.) */
#financeSection .btn-outline-info {
    border-width: 2px;
    color: #0277b5;
    background: rgba(255,255,255,0.85);
}
#financeSection .btn-outline-danger {
    border-width: 2px;
    color: #b91c1c;
    background: rgba(255,255,255,0.85);
}

.payment-row {
    padding: 0.15rem 0;
    border-top: 1px solid #e2e8f0;
}

.payment-row:first-child { border-top: none; }

/* ----- Co-list Invoice Status ----- */
.colist-leg-status.colist-leg-status-unpaid {
    color: #b91c1c;
    font-weight: 700;
}
.colist-leg-status.colist-leg-status-partial,
.colist-leg-status.colist-leg-status-inconsistent {
    color: #b45309;
    font-weight: 700;
}
.colist-leg-status.colist-leg-status-paid {
    color: #15803d;
    font-weight: 700;
}

/* ----- Booking Status Badge ----- */
.booking-status {
    font-weight: 700;
    text-transform: uppercase;
    min-width: 10rem;
    text-align: center;
}
.status-new       { background: #94a3b8; color: #fff; }
.status-booking   { background: #16a34a; color: #fff; }
.status-hold      { background: #d97706; color: #fff; }
.status-canceled  { background: #dc2626; color: #fff; }
.status-waitlist  { background: #7c3aed; color: #fff; }
.status-look      { background: #0284c7; color: #fff; }

/* ----- Overdue Balance ----- */
#oBalance.overdue {
    background-color: MistyRose;
    color: var(--s2s-brand);
    font-weight: 700;
}

/* ----- Readonly (general) ----- */
input[readonly] {
    background-color: #f1f5f9 !important;
    border-color: #e2e8f0;
}

.text-danger { color: var(--s2s-brand) !important; }

/* ----- Buttons ----- */
.btn-sm {
    font-size: 0.85rem;
    padding: 0.25rem 0.55rem;
}

/* Button depth & hover for all action buttons */
.btn {
    box-shadow: 0 2px 4px rgba(0,0,0,0.18), 0 1px 2px rgba(0,0,0,0.12);
    transition: all 0.18s ease;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 600;
}

.btn:hover {
    box-shadow: 0 5px 12px rgba(0,0,0,0.25), 0 3px 6px rgba(0,0,0,0.15);
    transform: translateY(-2px);
    filter: brightness(1.12);
}

.btn:active {
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    transform: translateY(0);
    filter: brightness(0.95);
}

/* Stronger hover for solid-colored buttons — darken + glow */
.btn-success:hover  { background-color: #0a7a2d; border-color: #086b26; box-shadow: 0 5px 14px rgba(15,140,54,0.4), 0 3px 6px rgba(0,0,0,0.15); }
.btn-primary:hover  { background-color: #0847a8; border-color: #073d94; box-shadow: 0 5px 14px rgba(13,110,253,0.4), 0 3px 6px rgba(0,0,0,0.15); }
.btn-danger:hover   { background-color: #a11818; border-color: #8e1515; box-shadow: 0 5px 14px rgba(220,53,69,0.4), 0 3px 6px rgba(0,0,0,0.15); }
.btn-warning:hover  { background-color: #c26a05; border-color: #a85c04; color: #fff; box-shadow: 0 5px 14px rgba(217,119,6,0.4), 0 3px 6px rgba(0,0,0,0.15); }
.btn-info:hover     { background-color: #02669d; border-color: #015a8a; color: #fff; box-shadow: 0 5px 14px rgba(13,202,240,0.35), 0 3px 6px rgba(0,0,0,0.15); }
.btn-secondary:hover { background-color: #3d4651; border-color: #353d47; box-shadow: 0 5px 14px rgba(108,117,125,0.35), 0 3px 6px rgba(0,0,0,0.15); }

/* Outline buttons — fill on hover with colored glow */
.btn-outline-primary:hover  { background-color: #0d6efd; color: #fff; box-shadow: 0 5px 14px rgba(13,110,253,0.4), 0 3px 6px rgba(0,0,0,0.12); }
.btn-outline-danger:hover   { background-color: #dc3545; color: #fff; box-shadow: 0 5px 14px rgba(220,53,69,0.4), 0 3px 6px rgba(0,0,0,0.12); }
.btn-outline-info:hover     { background-color: #0891b2; color: #fff; box-shadow: 0 5px 14px rgba(8,145,178,0.4), 0 3px 6px rgba(0,0,0,0.12); }
.btn-outline-warning:hover  { background-color: #d97706; color: #fff; box-shadow: 0 5px 14px rgba(217,119,6,0.4), 0 3px 6px rgba(0,0,0,0.12); }
.btn-outline-secondary:hover { background-color: #6c757d; color: #fff; box-shadow: 0 5px 14px rgba(108,117,125,0.35), 0 3px 6px rgba(0,0,0,0.12); }

/* Ensure text contrast on solid buttons */
.btn-warning { color: #212529; }
.btn-info    { color: #fff; }

/* ----- Responsive ----- */
@media (max-width: 1200px) {
    .product-group { margin-bottom: 0.3rem; }
}

/* ----- Print ----- */
@media print {
    .sticky-action-bar, .navbar, #actionCard, #financeSection { display: none !important; }
    .section-card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
    body { background: white; }
}
