/* ===================================================================
   RENTALS HUB — BOOKINGS SCREEN (bookings.css)
   Pixel truth: scratchpad/rental-design-zip/rental-hub/Bookings.dc.html
   Page-scoped styles only — shared shell/tokens/sheet live in app.css
   (frozen). Owner "Requests" view is a design-gap fill in the same
   design language (segmented toggle + grouped status sections).
   =================================================================== */

body { background: #f4f6f7; }
.bk-page {
    background: #f4f6f7;
    padding-bottom: 96px;
}

/* ---- Header: title + segmented toggle + tabs --------------------- */
.bk-header {
    background: #fff;
    padding: 18px 20px 0;
    border-bottom: 1px solid var(--vm-border-2);
}
.bk-header h1 {
    margin: 0 0 14px;
    font-family: var(--vm-font-display);
    font-weight: 700;
    font-size: 24px;
    color: var(--vm-text);
}

/* Segmented renter/owner toggle (design language, gap fill) */
.bk-seg {
    display: flex;
    background: #eef1f3;
    border-radius: 999px;
    padding: 3px;
    margin-bottom: 14px;
}
.bk-seg button {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--vm-muted);
    border-radius: 999px;
    padding: 8px 12px;
}
.bk-seg button.is-active {
    background: #fff;
    color: var(--vm-text);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .1);
}
.bk-seg .bk-seg-badge {
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: var(--vm-primary);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

/* Status tabs */
.bk-tabs { display: flex; gap: 24px; }
.bk-tabs button {
    padding: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--vm-muted-2);
    border-bottom: 2.5px solid transparent;
}
.bk-tabs button.is-active {
    font-weight: 700;
    color: var(--vm-primary);
    border-bottom-color: var(--vm-primary);
}
.bk-tabs button span {
    font-size: 11px;
    font-weight: 600;
    color: var(--vm-muted-2);
}

/* ---- List + group headings ---------------------------------------- */
.bk-list {
    padding: 16px 16px 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.bk-group-h {
    margin: 6px 2px -4px;
    font-family: var(--vm-font-display);
    font-weight: 700;
    font-size: 14px;
    color: var(--vm-text-2);
}
.bk-group-h:first-child { margin-top: 0; }

/* ---- Booking card --------------------------------------------------- */
.bk-card {
    background: #fff;
    border: 1px solid var(--vm-border-2);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
}
.bk-card--done { opacity: .92; }
.bk-card--done .bk-thumb img,
.bk-card--done .bk-thumb-ph { filter: grayscale(.15); }

/* Status band */
.bk-band {
    padding: 9px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
}
.bk-band i { font-size: 12px; }
.bk-band--active {
    background: var(--vm-tint);
    border-bottom: 1px solid #dcecdb;
    color: var(--vm-primary-dark);
}
.bk-band--active .bk-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--vm-primary);
    box-shadow: 0 0 0 3px rgba(26, 137, 23, .18);
    flex-shrink: 0;
}
.bk-band--confirmed {
    background: var(--vm-canvas);
    border-bottom: 1px solid #eef1f3;
    color: var(--vm-text-2);
}
.bk-band--confirmed i { color: var(--vm-primary); }
.bk-band--pending {
    background: var(--vm-amber-bg);
    border-bottom: 1px solid #f6e6bf;
    color: #8a6516;
}
.bk-band--pending i { color: var(--vm-amber); }

/* Body */
.bk-body {
    padding: 14px 15px;
    display: flex;
    gap: 13px;
}
.bk-thumb,
.bk-thumb img {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
}
.bk-thumb { position: relative; overflow: hidden; }
.bk-thumb-ph {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    flex-shrink: 0;
    background: var(--vm-border-2);
    color: var(--vm-muted-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}
.bk-info { flex: 1; min-width: 0; }
.bk-info h3 {
    margin: 0 0 3px;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--vm-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bk-info .bk-sub {
    font-size: 12px;
    color: var(--vm-muted);
    margin-bottom: 2px;
}
.bk-info .bk-price {
    font-size: 12.5px;
    color: var(--vm-text);
    font-weight: 600;
}
.bk-chip {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 700;
    color: #4b5563;
    background: #f1f3f5;
    border-radius: 999px;
    padding: 3px 9px;
    margin-top: 3px;
}

/* Actions */
.bk-actions {
    display: flex;
    gap: 9px;
    padding: 0 15px 14px;
}
.bk-actions > * {
    flex: 1;
    text-align: center;
    font-size: 13px;
    padding: 10px;
    border-radius: 11px;
    white-space: nowrap;
}
.bk-btn-solid { font-weight: 700; color: #fff; background: var(--vm-primary); }
.bk-btn-outline { font-weight: 600; color: var(--vm-primary); border: 1px solid var(--vm-primary); background: #fff; }
a.bk-btn-outline { color: var(--vm-primary); }
a.bk-btn-solid { color: #fff; }
.bk-btn-muted { font-weight: 600; color: var(--vm-muted); border: 1px solid var(--vm-chip-border); background: #fff; }
.bk-btn-dark { font-weight: 600; color: var(--vm-text-2); border: 1px solid var(--vm-chip-border); background: #fff; }
a.bk-btn-dark { color: var(--vm-text-2); }
.bk-btn-star { font-weight: 700; color: #fff; background: var(--vm-star); }
.bk-btn-star i { font-size: 11px; }
.bk-btn-solid:disabled,
button[disabled].bk-btn-solid {
    background: #c7d8c6;
    cursor: not-allowed;
    box-shadow: none;
}

/* ---- Empty states ---------------------------------------------------- */
.bk-empty {
    text-align: center;
    padding: 38px 20px;
    background: #fff;
    border: 1px dashed var(--vm-chip-border);
    border-radius: 16px;
}
.bk-empty i {
    font-size: 26px;
    color: var(--vm-muted-2);
    margin-bottom: 10px;
    display: block;
}
.bk-empty h3 { margin: 0 0 5px; font-size: 14.5px; font-weight: 700; color: var(--vm-text); }
.bk-empty p { margin: 0 0 14px; font-size: 12.5px; color: var(--vm-muted); line-height: 1.5; }
.bk-empty a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--vm-primary);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 10px 18px;
    border-radius: 999px;
}
.bk-loading {
    text-align: center;
    padding: 30px 0;
    font-size: 13px;
    color: var(--vm-muted-2);
}

/* ---- Review bottom sheet (reuses app.css .vm-sheet chrome) ----------- */
.bk-review-listing {
    margin: 2px 0 0;
    font-size: 12.5px;
    color: var(--vm-muted);
}
.bk-stars {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 10px 0 16px;
}
.bk-stars button {
    font-size: 31px;
    color: #d1d5db;
    transition: color .12s, transform .12s;
}
.bk-stars button.is-on { color: var(--vm-star); }
.bk-stars button:active { transform: scale(1.15); }
.bk-review-text {
    width: 100%;
    border: 1.5px solid var(--vm-border);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    color: var(--vm-text);
    outline: none;
    resize: none;
    line-height: 1.5;
    font-family: var(--vm-font-body);
}

/* ---- Toasts (same page-local block as wizard.css — candidate for
   a shared app.css section once it unfreezes) ------------------------- */
.vm-toast {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 92px;
    z-index: 120;
    max-width: min(420px, calc(100vw - 40px));
    background: #111827;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 11px 18px;
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
    opacity: 0;
    transition: opacity .2s ease;
    pointer-events: none;
    text-align: center;
}
.vm-toast.is-visible { opacity: 1; }
.vm-toast--success { background: var(--vm-primary-dark); }
.vm-toast--error { background: var(--vm-red); }
.vm-toast--info { background: #374151; }


/* ===================================================================
   DESKTOP LAYER — bookings (>= 901px)
   ===================================================================
   Per the css/rentals/desktop.css contract: per-PAGE desktop rules live
   at the end of that page's own stylesheet, using the page's own class
   prefix. desktop.css still loads AFTER this file, so anything it owns
   (.vm-dt-*, .vm-app.vm-dt-shell, the header, .vm-dt-footslim) keeps
   winning ties.

   Everything below is either inside a min-width media query or is a
   base-state rule whose only job is to make the new desktop-only markup
   invisible on a phone. <= 900px must not move by one pixel.

   DELIBERATE OMISSIONS from the design (RENTALS_HUB.md 2.7):
     - the sidebar's "Deposits held by owners ₣20,000" row. We know the
       AGREED deposit; "held" asserts money actually changed hands, and
       Veranda has no in-app payments and cannot know that. Dropped, not
       replaced.
     - the design's 4th "All" tab. The shipped tab model (Upcoming /
       Active / Past + the renter/owner segment) is bound to real
       statuses; a 4th tab adds no information and would churn the
       filter logic.
   =================================================================== */

/* --- base state for the new desktop-only markup ------------------ */

/* Layout wrappers only. display:contents drops their boxes on a phone so
   .bk-header / .bk-list keep the exact flow position they shipped with. */
.bk-shell,
.bk-main { display: contents; }

/* Class gating, never the hidden attribute (app.css guards [hidden] with
   !important and this page uses `hidden` for STATE). */
.bk-side,
.bk-foot,
.bk-dep { display: none; }

/* --- sidebar chrome (inert until .bk-side is revealed) ------------ */
.bk-side-card {
    background: #fff;
    border: 1px solid var(--vm-border-2);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
    padding: 18px;
}
.bk-side-eyebrow {
    margin: 0 0 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--vm-muted-2);
}
.bk-next {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 12px;
}
.bk-next-tile {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border-radius: 12px;
    background: var(--vm-tint);
    color: var(--vm-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.bk-next-day { font-family: var(--vm-font-display); font-weight: 700; font-size: 16px; }
.bk-next-mon { font-size: 9.5px; font-weight: 600; margin-top: 2px; }
.bk-next-txt { min-width: 0; }
.bk-next-title { display: block; font-size: 13.5px; font-weight: 700; color: var(--vm-text); }
.bk-next-sub { display: block; margin-top: 2px; font-size: 12px; color: var(--vm-muted); }
.bk-next-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    font-weight: 600;
}
.bk-next-link i { font-size: 10px; }
.bk-next-none { margin: 0; font-size: 12.5px; color: var(--vm-muted); }
.bk-side-rule { height: 1px; background: #f0f2f4; margin: 14px 0; }
.bk-side-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 8px;
    font-size: 13px;
    color: var(--vm-muted);
}
.bk-side-row:last-child { margin-bottom: 0; }
.bk-side-row strong { color: var(--vm-text); }
.bk-side-h {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 9px;
    font-size: 13px;
    color: var(--vm-text);
}
.bk-side-h i { color: var(--vm-primary); font-size: 14px; }
.bk-side-copy { margin: 0 0 12px; font-size: 12.5px; line-height: 1.6; color: var(--vm-muted); }
.bk-side-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    font-weight: 600;
}
.bk-side-link i { font-size: 10px; }


@media (min-width: 901px) {

/* --- frame -------------------------------------------------------- */
/* The bottom nav is gone at this width, so give the clearance back.
   Column flex + `margin-top:auto` on the footer keeps the slim footer at
   the bottom of a short page instead of stranding it mid-canvas. The
   sheet/backdrop/bottom-nav are all position:fixed, so they stay out of
   this flow. */
.bk-page {
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
}
.vm-toast { bottom: 32px; }

.bk-shell {
    display: block;
    /* width:100% is load-bearing: .bk-page is a column flex container here,
       and a flex item with auto side margins loses `stretch` and would
       shrink to fit-content. */
    width: 100%;
    max-width: var(--vm-dt-wrap);
    margin: 0 auto;
    padding: 0 var(--vm-dt-pad) 8px;
}
.bk-main { display: block; min-width: 0; }

/* --- title + segment + tab row ------------------------------------ */
/* The mobile white header card dissolves into the page: an H1 over an
   underlined tab row, with the renter/owner segment on the title line. */
.bk-header {
    background: none;
    border-bottom: 1px solid var(--vm-border);
    padding: 32px 0 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}
.bk-header h1 {
    grid-column: 1;
    grid-row: 1;
    margin: 0 0 20px;
    font-size: clamp(22px, 2.6vw, 34px);
    letter-spacing: -.8px;
    line-height: 1.14;
}
.bk-seg {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    width: max-content;
    margin: 0 0 20px;
}
.bk-seg button { flex: 0 0 auto; padding: 8px 16px; }

.bk-tabs {
    grid-column: 1 / -1;
    grid-row: 2;
    gap: 26px;
    /* pull the 2.5px active underline on top of the header's 1px rule */
    margin-bottom: -1px;
    overflow-x: auto;
}
.bk-tabs button { padding: 0 0 13px; font-size: 14.5px; white-space: nowrap; }
.bk-tabs button span { font-size: 11.5px; }

/* --- list --------------------------------------------------------- */
.bk-list { padding: 20px 0 0; gap: 16px; }
.bk-group-h { margin: 10px 0 -4px; font-size: 15px; }

/* --- booking rows become horizontal cards ------------------------- */
/* .bk-band spans; .bk-body and .bk-actions sit side by side. The `auto`
   action track collapses to zero on rows that render no actions (the
   owner's past rows), so no dead column is reserved. */
.bk-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}
.bk-band {
    grid-column: 1 / -1;
    padding: 10px 20px;
    font-size: 12.5px;
}
.bk-band i { font-size: 12.5px; }

.bk-body {
    padding: 18px 22px 18px 20px;
    align-items: center;
    gap: 16px;
}
.bk-thumb,
.bk-thumb img,
.bk-thumb-ph {
    width: 88px;
    height: 88px;
    border-radius: 14px;
}
.bk-thumb-ph { font-size: 28px; }
.bk-info h3 { margin: 0 0 5px; font-size: 16px; }
.bk-info .bk-sub { margin-bottom: 7px; font-size: 13px; }
.bk-info .bk-price { font-size: 13px; font-weight: 700; }
/* The design separates price and deposit with a thin vertical rule. */
.bk-dep {
    display: inline;
    margin-left: 14px;
    padding-left: 14px;
    border-left: 1px solid var(--vm-chip-border);
    font-weight: 500;
    color: var(--vm-muted);
}
.bk-chip { margin-top: 0; }

/* column-reverse puts the primary action on top without touching the
   JS templates (every card renders secondary-then-primary). */
.bk-actions {
    flex-direction: column-reverse;
    justify-content: center;
    gap: 9px;
    width: 180px;
    padding: 18px 20px 18px 0;
}
.bk-actions > * {
    flex: 0 0 auto;
    font-size: 13.5px;
    padding: 11px 16px;
    border-radius: 12px;
}
/* ...but a permanently disabled action must never OWN that primary slot.
   Today the only one is "Extend rental" on an Active rental row: it has no
   backend and ships disabled, yet it is the second child, so column-reverse
   floated it to the top over the real action ("Message owner"). order:-1
   places it first in the reversed flow, i.e. at the BOTTOM. Mobile is a row,
   not a column, and this rule is inside the desktop query, so <= 900px keeps
   the order it shipped with. */
.bk-actions > button[disabled] { order: -1; }

/* --- empty / loading ---------------------------------------------- */
.bk-empty { padding: 44px 24px; }
.bk-empty i { font-size: 30px; margin-bottom: 12px; }
.bk-empty h3 { font-size: 15px; }
.bk-empty p { font-size: 13.5px; }
.bk-loading { padding: 40px 0; }

/* --- sidebar: a 2-up row until the rail tier ---------------------- */
.bk-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 16px;
    margin-top: 24px;
}

/* --- slim footer -------------------------------------------------- */
/* Two classes so it outranks desktop.css's `.vm-dt-footslim{margin-top:40px}`,
   which loads later. */
.bk-foot { display: block; }
.bk-page > .bk-foot { margin-top: auto; }

} /* end >= 901px */


/* ================================================================
   RAIL TIER — >= 1120px: the summary sidebar takes its own column.
   ================================================================ */
@media (min-width: 1120px) {

.bk-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    column-gap: 32px;
    align-items: start;
}
.bk-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 0;
    position: sticky;
    top: calc(var(--vm-dt-header-h) + 24px);
}

}
