/* ==========================================================================
   estimator-shell.css — Beta estimator shell additions (Lane 6):
   editable client card + lead picker, estimate notes, payment-scope toggle,
   ft/m unit toggle, shell modals (unit confirm + pre-generate validation),
   post-generate share bar.

   Lives NEXT TO css/estimator.css (owned by the configurator lane) — only
   NEW class names here, nothing overriding .est- rules defined there.
   Brand tokens from style.css: --cc-navy #1A365D, --cc-gold #D4A012.
   ========================================================================== */

/* -- Client card: pencil toggle + edit form ------------------------------- */
.est-client-card { position: relative; }
.est-client-card__edit {
  position: absolute; top: 8px; right: 8px;
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid #D7DEE8; background: #fff; color: var(--cc-navy, #1A365D);
  font-size: 13px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.est-client-card__edit:hover { background: #F1F5F9; }
.est-client-card__org { font-size: 12.5px; color: #334155; margin-top: 2px; font-weight: 600; }
.est-client-card--editing { padding-top: 8px; }

.est-client-form { display: flex; flex-direction: column; gap: 8px; margin-right: 28px; }
.est-client-form__row { display: flex; gap: 8px; }
.est-client-form__field { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.est-client-form__field--sm { flex: 0 0 84px; }
.est-client-form__label {
  font-size: 10.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .4px; color: #64748B;
}
.est-client-form input,
.est-client-form select {
  width: 100%; padding: 6px 8px; border: 1px solid #CBD5E1; border-radius: 6px;
  font: inherit; font-size: 13px; color: #0F172A; background: #fff;
}
.est-client-form input:focus,
.est-client-form select:focus {
  outline: 2px solid var(--cc-gold, #D4A012); outline-offset: 0; border-color: var(--cc-gold, #D4A012);
}
#est-lead-picker-mount { margin-top: 4px; }

/* -- Create-lead button (client edit form, unlinked clients only) ---------- */
.est-client-form__createlead { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; }
.est-create-lead {
  align-self: flex-start; padding: 7px 12px;
  border: 1px solid var(--cc-navy, #1A365D); border-radius: 7px;
  background: #fff; color: var(--cc-navy, #1A365D);
  font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.est-create-lead:hover { background: #F1F5F9; }
.est-create-lead:disabled { opacity: .5; cursor: not-allowed; }

/* -- Estimate-level notes -------------------------------------------------- */
.est-notes {
  width: 100%; padding: 8px; border: 1px solid #CBD5E1; border-radius: 8px;
  font: inherit; font-size: 13px; color: #0F172A; background: #fff;
  resize: vertical; min-height: 56px;
}
.est-notes:focus { outline: 2px solid var(--cc-gold, #D4A012); outline-offset: 0; border-color: var(--cc-gold, #D4A012); }

/* -- Payment-scope toggle (left rail) -------------------------------------- */
.est-scope-toggle { display: flex; gap: 0; border: 1px solid #CBD5E1; border-radius: 8px; overflow: hidden; }
.est-scope-toggle__btn {
  flex: 1; padding: 7px 4px; border: none; background: #fff; color: #475569;
  font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.est-scope-toggle__btn + .est-scope-toggle__btn { border-left: 1px solid #CBD5E1; }
.est-scope-toggle__btn--active { background: var(--cc-navy, #1A365D); color: #fff; }

/* -- Unit toggle (top rail, navy background) ------------------------------- */
.est-unit-toggle {
  display: flex; border: 1px solid rgba(255,255,255,.25); border-radius: 7px;
  overflow: hidden; flex-shrink: 0;
}
.est-unit-toggle__btn {
  padding: 4px 12px; border: none; background: transparent; color: #C9D6E5;
  font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.est-unit-toggle__btn + .est-unit-toggle__btn { border-left: 1px solid rgba(255,255,255,.25); }
.est-unit-toggle__btn--active { background: var(--cc-gold, #D4A012); color: #1A365D; }

/* -- Shell modals (unit confirm + validation gate) ------------------------- */
.est-shell-modal {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15, 23, 42, .45);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.est-shell-modal__box {
  background: #fff; border-radius: 12px; padding: 20px;
  width: 100%; max-width: 440px; max-height: 80vh; overflow-y: auto;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .3);
}
.est-shell-modal__title { font-weight: 700; font-size: 16px; color: var(--cc-navy, #1A365D); margin-bottom: 8px; }
.est-shell-modal__body { margin: 0 0 16px; font-size: 13.5px; color: #334155; line-height: 1.5; }
.est-shell-modal__actions { display: flex; gap: 8px; justify-content: flex-end; }
.est-shell-modal__btn {
  padding: 8px 16px; border-radius: 7px; border: 1px solid #CBD5E1;
  background: #fff; color: #334155; font-size: 13px; font-weight: 600; cursor: pointer;
}
.est-shell-modal__btn--primary {
  background: var(--cc-navy, #1A365D); border-color: var(--cc-navy, #1A365D); color: #fff;
}
.est-shell-modal__btn:disabled { opacity: .5; cursor: not-allowed; }

.est-shell-modal__issues { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.est-shell-modal__issue {
  display: flex; gap: 8px; align-items: baseline;
  font-size: 13px; color: #334155; line-height: 1.45;
  padding: 8px 10px; border-radius: 8px; background: #F8FAFC;
}
.est-shell-modal__issue--error { background: #FEF2F2; }
.est-shell-modal__issue--warn { background: #FFFBEB; }
.est-shell-modal__issue-tag {
  flex-shrink: 0; font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .4px; padding: 1px 7px; border-radius: 10px;
}
.est-shell-modal__issue--error .est-shell-modal__issue-tag { background: #DC2626; color: #fff; }
.est-shell-modal__issue--warn .est-shell-modal__issue-tag { background: #D4A012; color: #1A365D; }

/* -- Post-generate share bar ----------------------------------------------- */
.est-share-bar {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  z-index: 150; display: flex; align-items: center; gap: 10px;
  background: var(--cc-navy, #1A365D); color: #fff;
  padding: 10px 14px; border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .35);
  max-width: calc(100vw - 32px);
}
.est-share-bar__label { font-size: 13px; font-weight: 600; white-space: nowrap; }
.est-share-bar__btn {
  padding: 6px 12px; border: none; border-radius: 7px;
  background: var(--cc-gold, #D4A012); color: #1A365D;
  font-size: 12.5px; font-weight: 700; cursor: pointer;
  text-decoration: none; white-space: nowrap; display: inline-block;
}
.est-share-bar__btn:hover { filter: brightness(1.08); }
.est-share-bar__close {
  border: none; background: transparent; color: #C9D6E5;
  font-size: 18px; line-height: 1; cursor: pointer; padding: 2px 4px;
}
.est-share-bar__close:hover { color: #fff; }
