/* =============================================================================
 * quote.css — Ops v4 · Phase 2 (Sales) · A4.
 *
 * Layout ONLY, for the three sales screens: enquiry (.opsv4e-*), quote
 * (.opsv4q-*) and templates (.opsv4t-*).
 *
 * ── WHAT THIS FILE DELIBERATELY DOES NOT DO ────────────────────────────────
 * It does not restyle the shared kit. The four status colours, the date tile,
 * the big green button, the sheet, the undo toast and the face all come from
 * web/js/ops-v4/kit/lres-ops-v4-kit.js with their styles inline, and A0 owns
 * them. A second definition of #009A42 here would be a second place to change
 * it, and SimpleKit.dc.html exists precisely to prevent that.
 *
 * The colours that DO appear below are structural greys and the two board
 * surfaces (#F4F5F7 page, #FFFFFF panel). Nothing here carries meaning: every
 * meaningful colour — green done, amber needs-you, red blocked, grey not-yet —
 * is applied inline by the JS from the kit's own palette, so a status can never
 * be styled into existence by a stylesheet.
 *
 * Every panel is a plain flex/grid container. On a narrow screen the two-column
 * layouts collapse to one, because these screens are used on a phone.
 * ========================================================================== */

/* ── Shared shell ────────────────────────────────────────────────────────── */

.opsv4e-wrap,
.opsv4q-wrap,
.opsv4t-wrap {
    font-family: Inter, Arial, sans-serif;
    color: #0F1419;
    background: #F4F5F7;
    padding: 18px 20px 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
}

.opsv4e-topbar,
.opsv4q-topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.opsv4e-spacer,
.opsv4q-spacer,
.opsv4t-spacer { flex-grow: 1; }

.opsv4e-back,
.opsv4q-back {
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    color: #006B2E;
}

.opsv4e-head,
.opsv4q-head,
.opsv4t-head {
    display: flex;
    align-items: flex-end;
    gap: 18px;
    flex-wrap: wrap;
}

.opsv4e-h1,
.opsv4q-h1,
.opsv4t-h1 {
    margin: 0;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.opsv4e-h2,
.opsv4q-h2,
.opsv4t-h2 { margin: 0; font-size: 17px; font-weight: 800; }

.opsv4e-sub,
.opsv4q-sub,
.opsv4t-sub { font-size: 13px; color: #6B7280; line-height: 1.5; }

.opsv4e-cap,
.opsv4q-cap {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.4px;
    color: #6B7280;
}

.opsv4e-strong { font-size: 15px; font-weight: 800; }

.opsv4e-err,
.opsv4q-err,
.opsv4t-err {
    padding: 10px 14px;
    border-radius: 12px;
    background: #FEE2E2;
    color: #991B1B;
    font-size: 14px;
    font-weight: 600;
}

.opsv4e-panel,
.opsv4q-panel {
    background: #FFFFFF;
    border-radius: 20px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.opsv4e-panel-head,
.opsv4q-panel-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.opsv4e-grow { flex-grow: 1; }

.opsv4e-empty,
.opsv4q-empty {
    padding: 16px;
    border-radius: 14px;
    border: 2px dashed #E5E7EB;
    text-align: center;
    font-size: 14px;
    color: #9CA3AF;
}

/* The one big button per screen. Height is the kit's floor, not a suggestion:
   these screens are used on a phone, outdoors, in gloves. */
.opsv4e-main,
.opsv4q-main {
    min-height: 56px;
    padding: 0 26px;
    border: none;
    border-radius: 18px;
    color: #FFFFFF;
    font-size: 18px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
}

.opsv4e-main.is-off {
    background: #E5E7EB;
    color: #6B7280;
    cursor: default;
}

/* ── Enquiry ─────────────────────────────────────────────────────────────── */

.opsv4e-modes {
    display: flex;
    background: #E9EBEE;
    border-radius: 14px;
    padding: 4px;
    gap: 2px;
}

.opsv4e-mode {
    min-height: 38px;
    padding: 0 14px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #6B7280;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.opsv4e-mode.is-on {
    background: #FFFFFF;
    color: #0F1419;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.opsv4e-cols {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.opsv4e-col-left {
    flex: 1 1 380px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.opsv4e-col-right { flex: 2 1 460px; min-width: 0; }

.opsv4e-source {
    width: 100%;
    box-sizing: border-box;
    border: 2px solid #E5E7EB;
    border-radius: 14px;
    padding: 12px 14px;
    font: inherit;
    font-size: 15px;
    line-height: 1.55;
    color: #1F2937;
    resize: vertical;
}

/* Black, not green: there is one big green button per screen and it is
   "Make quote". The board draws this one exactly this way. */
.opsv4e-read {
    min-height: 56px;
    border: none;
    border-radius: 14px;
    background: #0F1419;
    color: #FFFFFF;
    font: inherit;
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
}

.opsv4e-read[disabled] { background: #6B7280; cursor: wait; }

.opsv4e-q,
.opsv4e-gitem {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 12px;
}

.opsv4e-q { background: #FFFBEB; }
.opsv4e-gitem { background: #F4F5F7; }

.opsv4e-q-text { flex-grow: 1; font-size: 14px; }
.opsv4e-gitem span { flex-grow: 1; font-size: 13px; }

.opsv4e-qfoot {
    margin-top: auto;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.opsv4e-sendqs {
    min-height: 46px;
    padding: 0 16px;
    border: 2px solid #0F1419;
    border-radius: 14px;
    background: #FFFFFF;
    color: #0F1419;
    font: inherit;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    flex-shrink: 0;
}

.opsv4e-sendqs.is-sent,
.opsv4e-sendqs[disabled] {
    border: none;
    background: #E6F4EC;
    color: #064a23;
    cursor: default;
}

.opsv4e-facts { display: flex; gap: 8px; flex-wrap: wrap; }

.opsv4e-fact {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 8px 14px;
    border-radius: 14px;
    background: #F4F5F7;
}

.opsv4e-fact-v { font-size: 15px; font-weight: 800; }

.opsv4e-scope-head { display: flex; align-items: center; gap: 8px; }

.opsv4e-task {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 16px;
    background: #F4F5F7;
    flex-wrap: wrap;
}

.opsv4e-task-name { width: 210px; flex-shrink: 0; }
.opsv4e-task-title { font-size: 15px; font-weight: 800; }

.opsv4e-slots { display: flex; gap: 5px; flex-grow: 1; flex-wrap: wrap; }

.opsv4e-slot {
    min-height: 30px;
    padding: 0 8px;
    border-radius: 8px;
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.opsv4e-step {
    width: 34px;
    height: 34px;
    border: 2px solid #E5E7EB;
    border-radius: 10px;
    background: #FFFFFF;
    font: inherit;
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
}

.opsv4e-people {
    width: 70px;
    text-align: center;
    font-size: 13px;
    font-weight: 800;
}

.opsv4e-x,
.opsv4q-x {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 9px;
    background: #FFFFFF;
    color: #6B7280;
    font: inherit;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    flex-shrink: 0;
}

.opsv4e-groups { display: flex; gap: 12px; margin-top: 4px; flex-wrap: wrap; }

.opsv4e-group {
    flex: 1 1 220px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.opsv4e-group-title { font-size: 15px; font-weight: 800; }

/* ── Quote ───────────────────────────────────────────────────────────────── */

.opsv4q-stages { display: flex; gap: 6px; flex-wrap: wrap; }

.opsv4q-stage {
    font-size: 13px;
    font-weight: 800;
    padding: 7px 13px;
    border-radius: 12px;
}

.opsv4q-stage.is-now { background: #0F1419; color: #FFFFFF; }
.opsv4q-stage.is-done { background: #E6F4EC; color: #064a23; }
.opsv4q-stage.is-later { background: #E9EBEE; color: #9CA3AF; }

.opsv4q-totals {
    background: #FFFFFF;
    border-radius: 20px;
    padding: 16px 22px;
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
}

.opsv4q-sell { font-size: 30px; font-weight: 800; }
.opsv4q-cost { font-size: 21px; font-weight: 800; color: #374151; }

.opsv4q-bar-wrap {
    flex: 1 1 260px;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.opsv4q-bar-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.opsv4q-pct { font-size: 24px; font-weight: 800; }

.opsv4q-gate {
    font-size: 13px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 10px;
}

/* The bar. The 40% mark sits at 66.6% because the scale runs 0-60% — the
   board's own geometry, kept so the two read identically. */
.opsv4q-bar {
    position: relative;
    height: 14px;
    border-radius: 7px;
    background: #F1F3F5;
}

.opsv4q-bar-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    border-radius: 7px;
}

.opsv4q-bar-mark {
    position: absolute;
    left: 66.6%;
    top: -5px;
    bottom: -5px;
    width: 3px;
    border-radius: 2px;
    background: #0F1419;
}

.opsv4q-bar-mark-label {
    position: absolute;
    left: 66.6%;
    top: 18px;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: 800;
}

.opsv4q-next { max-width: 300px; font-size: 14px; color: #4B5563; }

.opsv4q-cols {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.opsv4q-col {
    flex: 1 1 380px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.opsv4q-col-right { flex: 1 1 440px; }

.opsv4q-line {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    background: #F4F5F7;
    flex-wrap: wrap;
}

.opsv4q-line-name { flex: 1 1 160px; font-size: 14px; font-weight: 700; }
.opsv4q-line-calc { font-size: 13px; color: #6B7280; }
.opsv4q-line-total { font-size: 14px; font-weight: 800; margin-left: auto; }

.opsv4q-tabs {
    display: flex;
    background: #F1F3F5;
    border-radius: 12px;
    padding: 3px;
    gap: 2px;
}

.opsv4q-tab {
    flex-grow: 1;
    min-height: 36px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #6B7280;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.opsv4q-tab.is-on {
    background: #FFFFFF;
    color: #0F1419;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.opsv4q-stmt {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    background: #F4F5F7;
}

.opsv4q-stmt-text { flex-grow: 1; font-size: 14px; }

/* The provenance chip. Its background is set inline by the JS so the
   enquiry-sourced ones tint green — the client's own words, told apart at a
   glance, which is the entire reason the source is stored. */
.opsv4q-stmt-src {
    font-size: 11px;
    font-weight: 800;
    padding: 3px 7px;
    border-radius: 8px;
    white-space: nowrap;
}

.opsv4q-flag {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    background: #F4F5F7;
    font-size: 13px;
    line-height: 1.5;
}

.opsv4q-flag-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 3px;
}

.opsv4q-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 12px;
}

.opsv4q-input,
.opsv4q-textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 44px;
    padding: 10px 12px;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    font: inherit;
    font-size: 15px;
}

.opsv4q-textarea { resize: vertical; margin-bottom: 12px; }

/* ── Templates ───────────────────────────────────────────────────────────── */

.opsv4t-search {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 11px;
    color: #6B7280;
}

.opsv4t-search input {
    width: 260px;
    max-width: 100%;
    box-sizing: border-box;
    min-height: 36px;
    padding: 0 10px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font: inherit;
    font-size: 13px;
}

.opsv4t-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.opsv4t-segs {
    display: flex;
    padding: 3px;
    background: #F1F3F5;
    border-radius: 8px;
    gap: 2px;
}

.opsv4t-seg {
    min-height: 30px;
    padding: 0 12px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #4B5563;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.opsv4t-seg.is-on {
    background: #FFFFFF;
    color: #064a23;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.opsv4t-cols {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.opsv4t-grid {
    flex: 2 1 480px;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    grid-auto-rows: min-content;
    gap: 12px;
}

.opsv4t-card {
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    font: inherit;
    cursor: pointer;
}

.opsv4t-card.is-on { border-color: #009A42; box-shadow: 0 0 0 2px #B7DFC6; }
.opsv4t-card.is-lost { opacity: 0.8; }

.opsv4t-card-top { display: flex; align-items: center; gap: 6px; width: 100%; }

.opsv4t-chip {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 8px;
}

.opsv4t-master {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 8px;
    background: #064a23;
    color: #FFFFFF;
}

.opsv4t-id { font-size: 11px; color: #6B7280; }

.opsv4t-name { font-size: 14px; font-weight: 600; line-height: 1.3; }
.opsv4t-site { font-size: 12px; color: #6B7280; }

.opsv4t-foot {
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
    font-size: 12px;
    color: #374151;
    margin-top: 2px;
}

.opsv4t-price { font-weight: 600; }

.opsv4t-detail {
    flex: 1 1 320px;
    min-width: 0;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.opsv4t-note {
    font-size: 13px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #F0F8F3;
    color: #064a23;
}

.opsv4t-spacer-v { flex-grow: 1; min-height: 8px; }

.opsv4t-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.opsv4t-btn {
    flex: 1 1 130px;
    min-height: 40px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    background: #FFFFFF;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

/* ── Narrow screens ──────────────────────────────────────────────────────── */

@media (max-width: 760px) {
    .opsv4e-wrap,
    .opsv4q-wrap,
    .opsv4t-wrap { padding: 14px 12px 24px; }

    .opsv4e-h1,
    .opsv4q-h1,
    .opsv4t-h1 { font-size: 24px; }

    .opsv4e-main,
    .opsv4q-main { width: 100%; }

    .opsv4e-task-name { width: 100%; }

    .opsv4t-search input { width: 100%; }

    .opsv4q-next { max-width: none; }
}

/* Focus is never removed, only restyled — these screens are keyboard-reachable
   and a gloved thumb is not the only input. */
.opsv4e-wrap button:focus-visible,
.opsv4e-wrap a:focus-visible,
.opsv4e-wrap textarea:focus-visible,
.opsv4q-wrap button:focus-visible,
.opsv4q-wrap a:focus-visible,
.opsv4q-wrap input:focus-visible,
.opsv4q-wrap textarea:focus-visible,
.opsv4t-wrap button:focus-visible,
.opsv4t-wrap a:focus-visible,
.opsv4t-wrap input:focus-visible {
    outline: 3px solid #009A42;
    outline-offset: 2px;
}
