/* ==========================================================================
   S16 Estimate approval + send - lifecycle flow styling.
   Reuses the DataRipple tokens from chrome.css. The estimate shown is the
   same approved (Format D) estimate, read-only here. Review-only mockup.
   ========================================================================== */

.appr-layout { display: grid; grid-template-columns: 1fr 300px; gap: 22px; align-items: start; }

/* ---- lifecycle stepper ------------------------------------------------ */
.steps { display: flex; align-items: flex-start; margin: 2px 2px 20px; }
.step { flex: 1; display: flex; flex-direction: column; align-items: center; position: relative; }
.step .dot { width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 2px solid var(--border-default);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--fg-3); z-index: 2; }
.step .lab { font-size: 11.5px; color: var(--fg-3); margin-top: 7px; text-align: center; line-height: 1.25; max-width: 92px; }
.step::before, .step::after { content: ""; position: absolute; top: 12px; height: 2px; background: var(--border-default); z-index: 1; }
.step::before { left: 0; right: 50%; }
.step::after { left: 50%; right: 0; }
.step:first-child::before, .step:last-child::after { display: none; }
/* done */
.step.done .dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.step.done .lab { color: var(--fg-2); }
.step.done::before, .step.done::after { background: var(--brand); }
.step.current .dot { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 4px var(--brand-subtle); }
.step.current .lab { color: var(--brand); font-weight: 600; }
.step.current::before { background: var(--brand); }
.step.declined .dot { background: var(--danger); border-color: var(--danger); color: #fff; }
.step.declined .lab { color: var(--danger); font-weight: 600; }

/* ---- status / action bar --------------------------------------------- */
.statusbar { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: var(--r-lg);
  border: 1px solid var(--border-default); background: var(--card); box-shadow: var(--shadow-sm); margin-bottom: 18px; }
.statusbar .sicon { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0; background: var(--brand-subtle); color: var(--brand); }
.statusbar.ok .sicon { background: var(--success-soft); color: var(--success); }
.statusbar.warn .sicon { background: var(--danger-soft); color: var(--danger); }
.statusbar .stxt { flex: 1; }
.statusbar .stxt .t { display: block; font-size: 15px; font-weight: 600; color: var(--fg-1); }
.statusbar .stxt .s { display: block; font-size: 12.5px; color: var(--fg-3); margin-top: 2px; }
.statusbar .sact { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

/* ---- estimate summary card ------------------------------------------- */
.esum { border: 1px solid var(--border-default); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.esum .ehead { padding: 14px 18px; border-bottom: 1px solid var(--border-default); }
.esum .ehead .eno { font-size: 12px; color: var(--fg-3); }
.esum .ehead .etitle { font-size: 16px; font-weight: 600; color: var(--fg-1); margin-top: 2px; }
/* live snapshot reused look */
.esnap { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; padding: 12px 18px; border-bottom: 1px solid var(--border-subtle); background: #fbfcfe; }
.esnap .eb { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--brand); display: inline-flex; align-items: center; gap: 6px; }
.esnap .eb .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px var(--brand-subtle); }
.esnap .st { font-size: 13px; color: var(--fg-3); display: inline-flex; align-items: baseline; gap: 6px; }
.esnap .st b { font-size: 18px; font-weight: 700; color: var(--fg-1); font-variant-numeric: tabular-nums; }
.esnap .st.mgn.below b { color: var(--danger); }
.esnap .sep { color: var(--border-default); }
.esec-rows { padding: 6px 0; }
.esec-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 18px; font-size: 13.5px; }
.esec-row:not(:last-child) { border-bottom: 1px solid var(--border-subtle); }
.esec-row .nm { color: var(--fg-2); display: flex; align-items: center; gap: 9px; }
.esec-row .nm .ct { font-size: 11px; color: var(--fg-3); }
.esec-row .amt { font-weight: 600; color: var(--fg-1); font-variant-numeric: tabular-nums; }
.esec-row.total { border-top: 2px solid var(--border-default); padding-top: 13px; padding-bottom: 13px; }
.esec-row.total .nm { font-size: 15px; font-weight: 700; color: var(--fg-1); }
.esec-row.total .amt { font-size: 18px; }
.esum .efoot { padding: 12px 18px; border-top: 1px solid var(--border-default); display: flex; justify-content: space-between; align-items: center; }
.esum .efoot .lnk { font-size: 13px; color: var(--brand); font-weight: 500; cursor: pointer; }
.esum .efoot .cust { font-size: 12px; color: var(--fg-3); }

/* ---- activity trail (right rail) ------------------------------------- */
.rail h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--fg-3); margin: 0 0 12px; }
.trail { position: relative; padding-left: 22px; }
.trail::before { content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--border-default); }
.tevent { position: relative; padding-bottom: 16px; }
.tevent::before { content: ""; position: absolute; left: -22px; top: 3px; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 2px solid var(--border-default); }
.tevent.on::before { background: var(--brand); border-color: var(--brand); }
.tevent .te-t { font-size: 13px; color: var(--fg-1); font-weight: 500; }
.tevent .te-s { font-size: 11.5px; color: var(--fg-3); margin-top: 1px; }
.tevent.pending .te-t { color: var(--fg-3); font-weight: 400; }
.rail .qbcard { margin-top: 8px; padding: 13px 15px; border: 1px dashed var(--border-default); border-radius: var(--r-md); background: var(--surface-secondary); }
.rail .qbcard .t { font-size: 12.5px; font-weight: 600; color: var(--fg-2); display: flex; align-items: center; gap: 6px; }
.rail .qbcard .s { font-size: 11.5px; color: var(--fg-3); margin-top: 4px; line-height: 1.4; }
.rail .lock { font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--fg-3);
  background: #fff; border: 1px solid var(--border-default); border-radius: 999px; padding: 2px 7px; }

/* ---- modals ----------------------------------------------------------- */
.backdrop { position: fixed; inset: 0; background: rgba(11,18,32,0.45); display: none; align-items: center; justify-content: center; z-index: 200; padding: 24px; }
.backdrop.show { display: flex; }
.modal { background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 520px; max-height: 88vh; overflow: auto; }
.modal.wide { max-width: 620px; }
.modal .mhead { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border-default); }
.modal .mhead h3 { font-size: 16px; }
.modal .mhead .x { font-size: 20px; color: var(--fg-3); cursor: pointer; background: none; border: none; }
.modal .mbody { padding: 18px 20px; }
.modal .mfoot { padding: 14px 20px; border-top: 1px solid var(--border-default); display: flex; justify-content: flex-end; gap: 9px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--fg-2); margin-bottom: 5px; }
.field input, .field textarea { width: 100%; font-family: inherit; font-size: 13.5px; color: var(--fg-2);
  border: 1px solid var(--border-default); border-radius: var(--r-md); padding: 9px 11px; background: #fff; }
.field textarea { min-height: 80px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-subtle); }
.sendnote { font-size: 12.5px; color: var(--fg-3); background: var(--surface-secondary); border-radius: var(--r-md); padding: 11px 13px; line-height: 1.5; }
.sendnote b { color: var(--fg-2); }

/* ---- client view (inside a modal) ------------------------------------ */
.client { border: 1px solid var(--border-default); border-radius: var(--r-md); overflow: hidden; }
.client .chead { padding: 16px 18px; background: var(--shell); color: #fff; }
.client .chead .co { font-size: 12px; color: rgba(255,255,255,0.7); }
.client .chead .cttl { font-size: 17px; font-weight: 600; margin-top: 2px; }
.client .cbody { padding: 6px 0; }
.client .cband { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--fg-3); padding: 10px 18px 4px; }
.client .crow { display: flex; justify-content: space-between; padding: 7px 18px; font-size: 13.5px; color: var(--fg-2); }
.client .crow .amt { font-variant-numeric: tabular-nums; }
.client .ctotal { display: flex; justify-content: space-between; padding: 14px 18px; border-top: 2px solid var(--border-default); margin-top: 6px; }
.client .ctotal .l { font-size: 15px; font-weight: 700; color: var(--fg-1); }
.client .ctotal .v { font-size: 19px; font-weight: 700; color: var(--fg-1); font-variant-numeric: tabular-nums; }
.client-hint { font-size: 11.5px; color: var(--fg-3); text-align: center; margin: 10px 0 0; }

.badge-you { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--sky);
  background: rgba(81,137,173,0.12); border-radius: 999px; padding: 2px 8px; }

/* ---- pricing review vs history (ready-for-review) --------------------- */
.pricing-review { margin-top: 18px; border: 1px solid var(--border-default); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.pr-head { display: flex; align-items: center; gap: 10px; padding: 13px 18px; border-bottom: 1px solid var(--border-default); }
.pr-head .pr-title { font-size: 14.5px; font-weight: 600; color: var(--fg-1); }
.pr-head .grow { flex: 1; }
.pr-head .lock { font-size: 9.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--warning);
  background: var(--warning-soft); border: 1px solid rgba(133,77,14,0.22); border-radius: 999px; padding: 3px 9px; }
.pr-head .pr-conf { font-size: 12px; color: var(--fg-3); }
.pr-explain { font-size: 12.5px; color: var(--fg-3); padding: 11px 18px; background: #fbfcfe; border-bottom: 1px solid var(--border-subtle); line-height: 1.5; }
.pr-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pr-table th { text-align: left; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--fg-3); padding: 8px 14px; border-bottom: 1px solid var(--border-default); white-space: nowrap; }
.pr-table th.num { text-align: right; } .pr-table th.ctr { text-align: center; }
.pr-table th.soon { color: #b3bccb; }
.pr-table td { padding: 8px 14px; border-bottom: 1px solid var(--border-subtle); }
.pr-table tr:last-child td { border-bottom: none; }
.pr-table td.num { text-align: right; font-variant-numeric: tabular-nums; } .pr-table td.ctr { text-align: center; }
.pr-table .pl { color: var(--fg-1); }
.pr-table .pl .sc { display: block; font-size: 11px; color: var(--fg-3); margin-top: 1px; }
.pr-table .rate { color: var(--fg-1); font-weight: 600; }
.pr-table .rate .per { color: var(--fg-3); font-weight: 400; font-size: 11px; }
.pr-table .hist { color: #b3bccb; font-weight: 600; }
.vchip { display: inline-block; font-size: 11px; font-weight: 600; border-radius: 999px; padding: 2px 9px; }
.vchip.ph { color: #b3bccb; border: 1px dashed var(--border-default); }
.vchip.up { color: var(--danger); background: var(--danger-soft); }
.vchip.ok { color: var(--success); background: var(--success-soft); }
.pr-preview { font-size: 12.5px; color: var(--fg-2); padding: 12px 18px; border-top: 1px solid var(--border-default);
  background: var(--surface-secondary); line-height: 1.55; }
.pr-preview b { color: var(--fg-1); }

/* ---- v2: pop-out drawer ---------------------------------------------- */
.pr-trigger { display: inline-flex; align-items: center; gap: 9px; font-family: inherit; font-size: 13px; font-weight: 500;
  color: var(--brand); background: var(--brand-subtle); border: 1px solid rgba(204,12,31,0.22); border-radius: var(--r-md);
  padding: 9px 15px; cursor: pointer; margin-bottom: 16px; }
.pr-trigger:hover { background: rgba(204,12,31,0.12); }
.pr-trigger .lock { font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--warning);
  background: #fff; border: 1px solid rgba(133,77,14,0.25); border-radius: 999px; padding: 2px 7px; }
.drawer-back { position: fixed; inset: 0; background: rgba(11,18,32,0.42); opacity: 0; visibility: hidden;
  transition: opacity .2s ease; z-index: 200; }
.drawer-back.show { opacity: 1; visibility: visible; }
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: 580px; max-width: 94vw; background: #fff;
  box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform .22s ease; z-index: 201;
  display: flex; flex-direction: column; }
.drawer-back.show .drawer { transform: translateX(0); }
.drawer .dhead { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border-default); flex-shrink: 0; }
.drawer .dhead h3 { font-size: 16px; }
.drawer .dhead .x { font-size: 20px; color: var(--fg-3); cursor: pointer; background: none; border: none; }
.drawer .dbody { overflow: auto; }
.drawer .pricing-review { border: none; border-radius: 0; box-shadow: none; margin-top: 0; }

/* ---- v3: side matrix (compact) --------------------------------------- */
.appr-layout.side { grid-template-columns: 1fr 400px; }
.pricing-review.compact { position: sticky; top: 16px; }
.pricing-review.compact .pr-explain { font-size: 11.5px; padding: 10px 15px; }
.pc-list { }
.pc-row { padding: 10px 15px; border-bottom: 1px solid var(--border-subtle); }
.pc-row:last-child { border-bottom: none; }
.pc-row .d { font-size: 13px; color: var(--fg-1); line-height: 1.3; }
.pc-row .d .sc { display: block; font-size: 11px; color: var(--fg-3); margin-top: 1px; }
.pc-row .m { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.pc-row .est { font-size: 13.5px; font-weight: 600; color: var(--fg-1); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pc-row .est .per { font-size: 11px; color: var(--fg-3); font-weight: 400; }
.pc-row .cmp { display: inline-flex; align-items: center; gap: 8px; }
.pc-row .cmp .hist { font-size: 12px; color: #b3bccb; font-weight: 600; white-space: nowrap; }
.pricing-review.compact .pr-preview { font-size: 11.5px; padding: 11px 15px; }
@media (max-width: 1080px) { .appr-layout.side { grid-template-columns: 1fr; } }

@media (max-width: 940px) { .appr-layout { grid-template-columns: 1fr; } }
