/*
 * Offer show page — components not covered by generic Bootstrap utilities.
 * Reuses app.css's --mh-* tokens; adds no new colour identity.
 */

/* ── Calculation-state banner ─────────────────────────────────────────── */
.mh-state {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    padding: 0.65rem 0.9rem;
    border-radius: var(--mh-radius-md);
    border: 1px solid var(--mh-brand-line);
    background: var(--mh-brand-light);
}
.mh-state--warn {
    border-color: var(--bs-warning-border-subtle);
    background: var(--mh-status-warn-bg);
    color: var(--mh-status-warn-fg);
}
.mh-state__grow {
    margin-left: auto;
}

/* ── Lifecycle rail ────────────────────────────────────────────────────── */
.mh-rail {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
    margin: 0.75rem 0 0;
    padding: 0;
    list-style: none;
}
.mh-rail li {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8125rem;
    color: var(--bs-secondary-color);
}
.mh-rail li:not(:last-child)::after {
    content: "";
    width: 16px;
    height: 1px;
    background: var(--bs-border-color);
    margin: 0 0.25rem;
}
.mh-rail .mh-rail__step {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
}
.mh-rail .is-done .mh-rail__step { color: var(--mh-status-ok-fg); }
.mh-rail .is-now .mh-rail__step { background: var(--mh-brand); color: #fff; font-weight: 600; }
.mh-rail .mh-rail__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.7; }

/* ── Facts strip (replaces a narrow <dl> whose labels wrapped) ────────────── */
.mh-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1px;
    background: var(--bs-border-color);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--mh-radius-lg);
    overflow: hidden;
    margin-top: 1rem;
}
.mh-facts > div { background: var(--bs-body-bg); padding: 0.7rem 0.9rem; }
.mh-facts dt { font-size: 0.75rem; color: var(--bs-secondary-color); margin: 0 0 0.2rem; }
.mh-facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ── Money summary panel (aside) ───────────────────────────────────────── */
.mh-money-gross { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.mh-money-row { display: flex; justify-content: space-between; gap: 0.75rem; padding: 0.35rem 0; font-variant-numeric: tabular-nums; }
.mh-money-row + .mh-money-row { border-top: 1px dashed var(--bs-border-color); }
.mh-money-row span:first-child { color: var(--bs-secondary-color); }
.mh-money-per {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--bs-border-color);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    overflow: hidden;
    margin-top: 0.75rem;
}
.mh-money-per > div { background: var(--bs-tertiary-bg); padding: 0.55rem 0.7rem; }
.mh-money-per b { display: block; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.mh-money-per small { color: var(--bs-secondary-color); font-size: 0.75rem; }

/* ── Service-window grouping inside the lines card ────────────────────── */
.mh-win + .mh-win { margin-top: 0.875rem; }
.mh-win__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.625rem;
    padding: 0.75rem 1.25rem;
    background: var(--bs-tertiary-bg);
    border-bottom: 1px solid var(--bs-border-color);
}
.mh-win__name { font-weight: 600; }
.mh-win__time { font-size: 0.84rem; color: var(--bs-secondary-color); font-variant-numeric: tabular-nums; }
.mh-win__sum { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; }

/* Per-window guest-group price + subtotal rows appended below a window's
   line rows. */
.mh-win-foot td { background: var(--bs-tertiary-bg); border-top: 1px solid var(--bs-border-color); font-variant-numeric: tabular-nums; }
.mh-win-foot td div + div { margin-top: 0.15rem; }

/* Alternative-group rows within a window's line table. */
.mh-altrow > td { background: var(--mh-brand-surface); color: var(--mh-brand-surface-text); font-weight: 600; }
.mh-altchild > td:first-child { padding-left: 2.5rem; position: relative; }
.mh-altchild > td:first-child::before {
    content: "";
    position: absolute;
    left: 1.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--mh-brand-line);
}

/* ── Internal-only cost breakdown disclosure — never printed ──────────── */
details.mh-internal {
    margin-top: 1.1rem;
    border: 1px dashed var(--bs-border-color);
    border-radius: var(--mh-radius-lg);
    background: var(--bs-body-bg);
}
details.mh-internal > summary {
    cursor: pointer;
    padding: 0.875rem 1.25rem;
    font-weight: 600;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    list-style: none;
}
details.mh-internal > summary::-webkit-details-marker { display: none; }
details.mh-internal > summary::before { content: "▸"; color: var(--bs-secondary-color); transition: transform 0.15s; display: inline-block; }
details.mh-internal[open] > summary::before { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) {
    details.mh-internal > summary::before { transition: none; }
}

.mh-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.625rem;
    padding: 0 1.25rem 1.25rem;
}
.mh-tile { background: var(--bs-tertiary-bg); border-radius: var(--bs-border-radius); padding: 0.7rem 0.8rem; }
.mh-tile dt { font-size: 0.75rem; color: var(--bs-secondary-color); margin-bottom: 0.2rem; }
.mh-tile dd { margin: 0; font-size: 1.05rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.mh-tile small { color: var(--bs-secondary-color); font-weight: 400; font-size: 0.75rem; }

/* ── Labor breakdown: work-type rows collapse their per-source detail ──── */
.mh-labor-row { cursor: pointer; }
.mh-labor-toggle-icon { width: 14px; height: 14px; transition: transform 0.15s; color: var(--bs-secondary-color); }
.mh-labor-row[aria-expanded="true"] .mh-labor-toggle-icon { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) {
    .mh-labor-toggle-icon { transition: none; }
}
/* Bootstrap's .collapse/.collapsing default to display:block, which breaks
   <tr> layout — these rows must stay table-row (or none) throughout. */
.mh-labor-table tr.collapse:not(.show) { display: none; }
.mh-labor-table tr.collapse.show,
.mh-labor-table tr.collapsing { display: table-row; }
.mh-labor-table > tbody > tr > td:first-child { width: 2.5rem; }
/* Detail rows sit in the same table as their work-type row, so their time and
   cost line up column for column; the source name is indented one step. */
.mh-labor-detail > td { color: var(--bs-secondary-color); }
.mh-labor-detail__name { padding-left: 1rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; }
.mh-labor-detail__rate { font-size: 0.875rem; }

/* Blocks inside the breakdown share the card gutter (1.25rem) with its tables. */
.mh-internal__pad { padding-left: 1.25rem; padding-right: 1.25rem; }
