/* The offer side panel (Sami 2026-11-09, DECISIONS #145; prototype docs/prototypes/offer-panel/). A modal <dialog> on the right, over
   the screen you are on. Fixed width (pop-ups never resize with data, #74): the middle scrolls, head and buttons stay. Tablet first;
   on a phone it rises from the bottom. Sections use the shared folding box .sbox (#124). Closes on ✕, Esc or a click outside. */
dialog.opn { position: fixed; inset: 12px 12px 12px auto; width: min(460px, calc(100vw - 24px)); height: auto; max-width: none; max-height: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; border: 0; border-radius: 20px; background: var(--c-page, #F4F6FA); color: var(--c-ink);
  box-shadow: 0 20px 50px -12px rgba(27, 34, 51, .35), 0 0 0 1px var(--c-line); transform: translateX(calc(100% + 24px)); transition: transform .22s ease; }
dialog.opn:not([open]) { display: none; }
dialog.opn.on { transform: none; }
dialog.opn::backdrop { background: rgba(27, 34, 51, .28); }
.opn-h { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 16px 16px 14px; border-bottom: 1px solid var(--c-line); background: var(--c-card); border-radius: 20px 20px 0 0; }
.opn-t { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.opn-t h2 { margin: 0; font-size: 19px; letter-spacing: -.01em; }
.opn-tools { display: flex; gap: 6px; align-items: start; }
.opn-x { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--c-line-strong); border-radius: 11px; background: var(--c-card); color: var(--c-text); cursor: pointer; }
.opn-x:hover { background: var(--c-neutral-soft); }
.opn-x .ico { width: 18px; height: 18px; }
.opn-s { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--fs-table); color: var(--c-muted); min-width: 0; }
.opn-b { flex: 1; min-height: 0; overflow-y: auto; padding: 14px; display: grid; gap: 12px; align-content: start; }
.opn-b .sbox + .sbox { margin-top: 0; }
.opn-b .sbox-h { min-height: 54px; }
.opn-b .sbox-b { padding: 14px 16px; }
.opn-b .sbox-fold .ico { width: 16px; height: 16px; }
.opn-late { display: flex; gap: 10px; align-items: center; padding: 11px 14px; border-radius: 14px; background: var(--c-danger-soft); color: var(--c-danger); font-size: var(--fs-table); font-weight: var(--fw-semibold, 600); }
.opn-late .ico { width: 18px; height: 18px; flex: none; }
.opn-price { display: grid; gap: 2px; margin-bottom: 10px; }
.opn-price small { color: var(--c-muted); font-size: var(--fs-hint); }
.opn-price b { font-size: 26px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.opn-kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: var(--fs-body); }
.opn-kv dt { color: var(--c-muted); }
.opn-kv dt small { color: var(--c-faint); font-size: var(--fs-hint); } /* "before discount" next to Total price, like New offer */
.opn-kv dd { margin: 0; text-align: right; font-weight: var(--fw-medium, 500); font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }
.opn-kv .opn-total { padding-top: 8px; border-top: 1px solid var(--c-line); color: var(--c-text); font-weight: var(--fw-semibold); } /* the plan + extra discount summed, under its two parts */
.opn-kv dt.opn-total { margin-inline-end: -16px; padding-inline-end: 16px; } /* the line runs through the gap between label and value */
.opn-terms { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--c-line-strong); }
.opn-more { margin-top: 4px; }
.opn-more > summary { cursor: pointer; color: var(--c-accent-text); font-weight: var(--fw-medium, 500); font-size: var(--fs-table); }
.opn-more > summary:hover { text-decoration: underline; }
.opn-more table { width: 100%; margin-top: 8px; font-size: var(--fs-table); }
.opn-life { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.opn-life li { --k: var(--tint-blue); display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 12px; border-radius: 12px; background: var(--c-tile, var(--c-neutral-soft)); }
.opn-life li.green { --k: var(--tint-green); } .opn-life li.orange { --k: var(--tint-orange); } .opn-life li.red { --k: var(--c-danger); }
.opn-dot { width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--k); box-shadow: 0 0 0 3px color-mix(in srgb, var(--k) 18%, transparent); }
.opn-life b { font-size: var(--fs-table); }
.opn-life small { display: block; color: var(--c-muted); font-size: var(--fs-hint); }
/* Footer (Sami 2026-11-21): "Open lead ↗" at the start (it leaves for the lead page, same look as My day's),
   the offer's decisions at the end, words only, the one blue main button last. 44px high for the tablet. */
.opn-f { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--c-line); background: var(--c-card); border-radius: 0 0 20px 20px; }
.opn-f .btn { min-height: 44px; padding-inline: 18px; }
.opn-acts { display: flex; gap: 8px; margin-inline-start: auto; }
.opn-f .opn-lead { background: var(--c-card); border-color: var(--c-line-strong); color: var(--c-ink); }
.opn-f .opn-lead:hover { background: var(--c-select); border-color: var(--c-ink); }
.opn-f .opn-lead .ico { width: 14px; height: 14px; color: var(--c-muted); transition: transform .2s, color .15s; }
.opn-f .opn-lead:hover .ico { color: var(--c-ink); transform: translate(1px, -1px); }
@media (max-width: 560px) {
  dialog.opn { inset: auto 0 0 0; width: 100%; height: 92vh; border-radius: 20px 20px 0 0; transform: translateY(105%); }
  .opn-f { border-radius: 0; padding-bottom: max(12px, env(safe-area-inset-bottom, 0px)); }
}
.opn-kv dd .opn-area { margin-inline-start: 6px; color: var(--c-muted); font-weight: 400; font-size: var(--fs-hint); white-space: nowrap; } /* T-70: area next to the price per m² */

/* Salespeople of an offer (T-111): the names in the panel header (DECISIONS #500) and the edit pop-up. */
.opn-sps { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-width: 0; }
.opn-sp { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.opn-sp .ico { width: 14px; height: 14px; color: var(--c-faint); }
.opn-sp > span { color: var(--c-text); font-weight: var(--fw-medium); }
.opn-sp i { font-style: normal; color: var(--c-faint); font-size: var(--fs-hint); }
.sp-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.sp-rows { display: grid; gap: 10px; align-content: start; min-height: 202px; } /* room for four rows, so the pop-up never grows when one is added (said-once #1) */
.sp-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px 40px; gap: 8px; align-items: center; }
.sp-main { color: var(--c-muted); font-size: var(--fs-hint); text-align: center; }
.sp-total { margin: 12px 0 0; font-weight: var(--fw-medium); font-variant-numeric: tabular-nums; }
.sp-total.bad { color: var(--c-danger); }

/* Payments on the offer (slice 6, DECISIONS #496): read live from Odoo; one row per payment, amount and its state at the end, like the life list. */
/* Down payment (Sami 2026-11-21): the total, then one bar holding the amounts: green part = paid, grey part = left */
.opn-dp { display: grid; gap: 8px; margin-bottom: 12px; }
.opn-dp-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: var(--fs-table); color: var(--c-muted); }
.opn-dp-h b { color: var(--c-text); font-size: var(--fs-body); font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.opn-dp-bar { display: flex; gap: 3px; min-height: 52px; border-radius: 12px; overflow: hidden; }
.opn-dp-s { flex: 1 0 auto; flex-basis: 0; min-width: max-content; display: grid; align-content: center; gap: 1px; padding: 8px 12px; }
.opn-dp-s small { font-size: var(--fs-hint); }
.opn-dp-s b { font-size: 17px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.opn-dp-s.is-paid { background: var(--c-success-soft); color: var(--c-success); }
.opn-dp-s.is-left { background: var(--c-neutral-soft); color: var(--c-muted); text-align: right; }
.opn-dp-s.is-left b { color: var(--c-muted); }
.opn-dp-s.is-full.is-left { text-align: left; }
.opn-pay { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.opn-pay li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--c-tile, var(--c-neutral-soft)); }
.opn-pay li > div { min-width: 0; }
.opn-pay b { font-size: var(--fs-table); font-variant-numeric: tabular-nums; }
.opn-pay small { display: block; color: var(--c-muted); font-size: var(--fs-hint); }
.opn-pay-a { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.opn-pay-msg { margin: 8px 0 0; color: var(--c-muted); font-size: var(--fs-table); }
.opn-pay-msg:first-child { margin-top: 0; }
.opn-pay-f { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; }
.opn-pay-f small { color: var(--c-muted); font-size: var(--fs-hint); }
