/* Stone Surgeons CRM — Quoting tab (admin only). Scoped to .qt. */
.qt { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.qt-main { min-width: 0; }
.qt-side { display: grid; gap: 12px; }
.qt-side h3 { margin: 0 0 10px; font-size: 17px; color: var(--ink); }

.qt-search { position: relative; }
.qt-results { position: absolute; left: 0; right: 64px; top: 46px; z-index: 1500; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; }
.qt-results:empty { display: none; }
.qt-result { padding: 9px 12px; border: 0; background: none; text-align: left; font: inherit; font-size: 14px; color: var(--text); cursor: pointer; }
.qt-result:hover, .qt-result.on { background: var(--off); }
.qt-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 8px; }
.qt-tools .chk { margin-left: 4px; }
.qt-tools .qt-primary { background: var(--blue); color: #fff; border: 0; }
.qt-tools .qt-primary:hover { background: var(--blue-d); }
.qt-status { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 30px; margin: 0 0 8px; font-size: 14px; color: var(--navy); font-weight: 600; }
.qt-status:empty { min-height: 0; margin: 0; }

.qt-mapwrap { position: relative; }
.qt-map { height: 72vh; min-height: 420px; border-radius: var(--radius); border: 1px solid var(--line); background: #1b2430; z-index: 0; }
.qt-map.is-drawing, .qt-map.is-drawing .leaflet-interactive { cursor: crosshair; }
.qt-map.is-drawing { outline: 3px solid #7b4fd0; }
.qt-hint { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); z-index: 500; max-width: 90%; padding: 6px 12px;
  border-radius: 8px; background: rgba(11, 42, 74, .92); color: #fff; font-weight: 600; font-size: 14px; pointer-events: none; }

.qt-v { width: 14px; height: 14px; border: 2px solid #fff; border-radius: 50%; background: var(--navy); box-shadow: 0 0 0 1px rgba(0, 0, 0, .5); }
.qt-v.qt-v-first { background: #f4a300; cursor: pointer; }
.qt-v.qt-v-hole { background: #e76f51; width: 12px; height: 12px; }
.qt-road { background: none; border: 0; }
.qt-road span { display: inline-block; color: #fff; font: 700 14px/1.2 system-ui, sans-serif; white-space: nowrap; pointer-events: none;
  text-shadow: 0 0 3px #000, 0 0 3px #000, 0 1px 2px #000, 1px 0 2px #000, -1px 0 2px #000, 0 -1px 2px #000; }
.qt-hn { background: none; border: 0; }
.qt-hn span { display: inline-block; transform: translate(-50%, -50%); padding: 1px 5px; border-radius: 4px; background: rgba(255, 255, 255, .92);
  color: #071a2e; font: 700 12px/1.3 system-ui, sans-serif; white-space: nowrap; box-shadow: 0 1px 3px rgba(0, 0, 0, .45); pointer-events: none; }
.leaflet-tooltip.qt-label {padding: 2px 6px; border: 0; border-radius: 4px; background: rgba(11, 42, 74, .88); color: #fff; font-weight: 600; box-shadow: none; }
.leaflet-tooltip.qt-label::before { display: none; }

.qt-areas { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.qt-card { border: 1px solid var(--line); border-left: 5px solid var(--c, var(--blue)); border-radius: 8px; padding: 10px; margin-top: 10px; display: grid; gap: 6px; }
.qt-card.on { box-shadow: 0 0 0 2px rgba(31, 111, 208, .25); }
.qt-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.qt-row .grow { flex: 1 1 140px; min-width: 0; }
.qt-row .in-sm[type="number"] { width: 84px; text-align: right; }
.qt-nums { justify-content: space-between; }
.qt-nums b { font-size: 16px; }
.qt-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.qt-warn { color: #9a5b00; font-weight: 600; }

.qt-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 3px 0; font-size: 14px; }
.qt-line b { white-space: nowrap; }
.qt-total { margin-top: 6px; padding-top: 8px; border-top: 2px solid var(--navy); font-size: 18px; }
.qt-jobsvc select { max-width: 200px; }
.qt-ask-back { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(7, 26, 46, .45); }
.qt-ask { width: 100%; max-width: 380px; display: grid; gap: 8px; padding: 18px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); outline: 0; }
.qt-ask h3 { margin: 0; font-size: 18px; color: var(--ink); }
.qt-ask p { margin: 0; }
.qt-ask .btn { justify-content: flex-start; text-align: left; }
.qt-ask kbd { font: 700 12px/1 system-ui, sans-serif; padding: 3px 6px; border-radius: 4px; border: 1px solid currentColor; opacity: .7; }
.qt-tax {text-align: right; font-size: 13px; color: var(--muted); margin-top: 2px; }
.qt-num {width: 96px !important; text-align: right; }
.qt-addon { display: flex; gap: 8px; align-items: center; padding: 3px 0; font-size: 14px; }
.qt-addon span { flex: 1; }

.qt-margin.is-ok { border-color: #bfe3cf; }
.qt-margin.is-low { border-color: #f1c9c6; background: #fff8f7; }
.qt-badge { margin: 8px 0 4px; font: 800 22px/1.2 var(--display); }
.qt-margin.is-ok .qt-badge { color: var(--ok); }
.qt-margin.is-low .qt-badge { color: var(--err); }
.qt-badge small { font: 600 13px/1.4 var(--body, inherit); color: var(--muted); }

.qt-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.qt-log summary, .qt-settings summary { cursor: pointer; font-weight: 700; color: var(--ink); }
.qt-log[open] summary, .qt-settings[open] summary { margin-bottom: 10px; }
.qt-entry { border-top: 1px solid var(--line); padding: 8px 0; }
.qt-entry pre { margin: 0 0 4px; white-space: pre-wrap; font: 13px/1.45 ui-monospace, Consolas, monospace; color: var(--text); }
.qt-settings fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 0 0 10px; padding: 8px 10px; }
.qt-settings legend { font-weight: 700; font-size: 14px; color: var(--navy); padding: 0 4px; }
.qt-flags { display: grid; gap: 4px; margin: 0 0 10px; }

@media (max-width: 980px) {
  .qt { grid-template-columns: 1fr; }
  .qt-map { height: 60vh; min-height: 340px; }
}
