/* Quotations and Recurring pages and their pop-ups, in the Sales page family (qt4 / rq4, 13 Nov 2026). */
/* ==========================================================================
   Quotations (.qt4, assets/js/app/quotations.js) and Recurring (.rq4, the
   Recurring part of assets/js/app/batches-recurring.js)
   --------------------------------------------------------------------------
   Both pages wear the Sales page kit (ord2 / sl4 in pages-business.css): one
   money card, a strip that names the next thing to do (green when nothing
   waits), status tabs and the .lt table with a Next step column. This file
   adds the strip of three tabs at the top of Invoices, Quotations and
   Recurring (App.docTabs, .qt4-tabs), the four facts on each money card, the
   status chips, and the read-first pop-ups. The pop-ups are not inside the
   page wrapper, so their rules are not scoped to it.
   Primary text #000; secondary text no lighter than #4b5563.
   ========================================================================== */

/* ---- The Invoices | Quotations | Recurring strip (App.docTabs) -----------
   One white track with three tabs; each tab keeps its own colour (cyan,
   indigo, teal) and the open one is filled with it, so it reads the same on
   all three pages. The old .doc-tabs rules are not used here. */
#page-content .qt4-tabs { margin: 0 0 14px; max-width: 100%; }
#page-content .qt4-tabs-in {
    display: inline-flex; gap: 4px; max-width: 100%; box-sizing: border-box; padding: 4px;
    border-radius: 16px; background: #fff; border: 1px solid #e3e7ef; box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
    overflow-x: auto; scrollbar-width: none;
}
#page-content .qt4-tabs-in::-webkit-scrollbar { display: none; }
#page-content .qt4-tabs .qt4-tab {
    flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 44px; min-height: 44px; margin: 0; padding: 0 16px 0 6px; border: 0; border-radius: 12px;
    background: transparent; color: #000; font: inherit; font-size: .9rem; font-weight: 800; line-height: 1.1;
    white-space: nowrap; cursor: pointer; box-shadow: none;
    transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
#page-content .qt4-tabs .qt4-tab-ic {
    flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
    background: color-mix(in srgb, var(--c, #4338ca) 13%, #fff); color: var(--c, #4338ca); font-size: 1rem;
}
#page-content .qt4-tabs .qt4-tab-ic i { opacity: 1; }
#page-content .qt4-tabs .qt4-tab:hover:not(.is-on) { background: #f4f6fa; }
#page-content .qt4-tabs .qt4-tab.is-on {
    background: var(--c, #4338ca); color: #fff; cursor: default;
    box-shadow: 0 10px 20px -12px var(--c, #4338ca);
}
#page-content .qt4-tabs .qt4-tab.is-on .qt4-tab-ic { background: rgba(255, 255, 255, .2); color: #fff; }
#page-content .qt4-tabs .qt4-tab:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }
/* A phone: the three share the width, the icon over its name. */
@media (max-width: 560px) {
    #page-content .qt4-tabs-in { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
    #page-content .qt4-tabs .qt4-tab { flex-direction: column; gap: 3px; height: 58px; min-height: 58px; padding: 0 4px; font-size: .8rem; }
    #page-content .qt4-tabs .qt4-tab-ic { width: 26px; height: 26px; border-radius: 8px; font-size: .88rem; }
    #page-content .qt4-tabs .qt4-tab-t { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
}
@media (prefers-reduced-motion: reduce) { #page-content .qt4-tabs .qt4-tab { transition: none; } }

/* ---- The money card's four facts (each opens its tab) --------------------- */
:is(.qt4, .rq4) .qt4-hero { container: qt4hero / inline-size; }
:is(.qt4, .rq4) .qt4-stats {
    position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px; margin-top: 12px;
}
@container qt4hero (min-width: 620px) {
    :is(.qt4, .rq4) .qt4-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
:is(.qt4, .rq4) .qt4-stat {
    display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; margin: 0; padding: 9px 12px;
    border-radius: 14px; border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .12); color: #fff;
    font: inherit; text-align: left; cursor: pointer; transition: background-color .15s ease;
}
:is(.qt4, .rq4) .qt4-stat:hover { background: rgba(255, 255, 255, .2); }
:is(.qt4, .rq4) .qt4-stat:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
:is(.qt4, .rq4) .qt4-stat-l { max-width: 100%; font-size: .74rem; font-weight: 750; line-height: 1.25; color: rgba(255, 255, 255, .92); }
:is(.qt4, .rq4) .qt4-stat .qt4-fig {
    display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: 1.1rem; font-weight: 900; line-height: 1.3; color: #fff; font-variant-numeric: tabular-nums;
}
:is(.qt4, .rq4) .qt4-stat .qt4-fig.sx-masked { letter-spacing: .1em; }
:is(.qt4, .rq4) .qt4-stat small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .72rem; font-weight: 700; color: rgba(255, 255, 255, .88); }
/* the fact whose tab is open */
:is(.qt4, .rq4) .qt4-stat.is-on { background: #fff; border-color: #fff; }
:is(.qt4, .rq4) .qt4-stat.is-on .qt4-stat-l, :is(.qt4, .rq4) .qt4-stat.is-on small { color: #374151; }
:is(.qt4, .rq4) .qt4-stat.is-on .qt4-fig { color: #000; }
@media (prefers-reduced-motion: reduce) { :is(.qt4, .rq4) .qt4-stat { transition: none; } }

/* ---- The strip: amber while something waits, green when nothing does, red for a missed bill */
:is(.qt4, .rq4) .ord2-strip.qt4-strip.is-ok { background: #ecfdf5; border-color: #a7f3d0; }
:is(.qt4, .rq4) .ord2-strip.qt4-strip.is-ok .ord2-strip-ic { background: #d1fae5; color: #065f46; }
:is(.qt4, .rq4) .ord2-strip.qt4-strip.is-ok b { color: #064e3b; }
:is(.qt4, .rq4) .ord2-strip.qt4-strip.is-ok > div > span { color: #065f46; }
:is(.qt4, .rq4) .ord2-strip.qt4-strip.is-ok button { background: #065f46; }
:is(.qt4, .rq4) .ord2-strip.qt4-strip.is-ok button:focus-visible { outline-color: #6ee7b7; }
:is(.qt4, .rq4) .ord2-strip.qt4-strip.is-late { background: #fef2f2; border-color: #fecaca; }
:is(.qt4, .rq4) .ord2-strip.qt4-strip.is-late .ord2-strip-ic { background: #fee2e2; color: #991b1b; }
:is(.qt4, .rq4) .ord2-strip.qt4-strip.is-late b { color: #7f1d1d; }
:is(.qt4, .rq4) .ord2-strip.qt4-strip.is-late > div > span { color: #991b1b; }
:is(.qt4, .rq4) .ord2-strip.qt4-strip.is-late button { background: #991b1b; }
:is(.qt4, .rq4) .ord2-strip.qt4-strip.is-late button:focus-visible { outline-color: #fca5a5; }
:is(.qt4, .rq4) .ord2-strip.qt4-strip b { overflow-wrap: anywhere; }
/* Beside the card the strip is narrow: the button goes under the words. */
:is(.qt4, .rq4) .sl4-stripw { container: qt4strip / inline-size; }
@container qt4strip (max-width: 480px) {
    :is(.qt4, .rq4) .ord2-strip.qt4-strip { flex-wrap: wrap; align-content: center; }
    :is(.qt4, .rq4) .ord2-strip.qt4-strip > div { flex: 1 1 160px; }
    :is(.qt4, .rq4) .ord2-strip.qt4-strip > button { flex: 1 1 100%; }
}

/* ---- Status chips (table and pop-ups) ------------------------------------ */
.qt4-chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 900; white-space: nowrap; background: #f3f4f6; color: #374151; }
.qt4-chip.is-sent { background: #dbeafe; color: #1e3a8a; }
.qt4-chip.is-accepted { background: #d1fae5; color: #064e3b; }
.qt4-chip.is-converted { background: #ede9fe; color: #4c1d95; }
.qt4-chip.is-declined { background: #fee2e2; color: #991b1b; }
.qt4-chip.is-expired { background: #fef3c7; color: #78350f; }
.qt4-chip.is-rq-active { background: #ccfbf1; color: #134e4a; }
.qt4-chip.is-rq-paused { background: #fef3c7; color: #78350f; }

/* ---- The table ------------------------------------------------------------ */
:is(.qt4, .rq4) .qt4-valid { display: block; white-space: nowrap; }
:is(.qt4, .rq4) .qt4-valid b { display: block; font-weight: 800; color: #000; }
:is(.qt4, .rq4) .qt4-valid small { display: block; margin-top: 1px; font-size: .72rem; font-weight: 700; color: #4b5563; }
:is(.qt4, .rq4) .qt4-valid.is-soon b { color: #b45309; }
:is(.qt4, .rq4) .qt4-valid.is-gone b { color: #4b5563; }
:is(.qt4, .rq4) .qt4-valid.is-none { font-size: .8rem; font-weight: 700; color: #4b5563; }
:is(.qt4, .rq4) .qt4-line { display: block; margin-top: 3px; font-size: .72rem; font-weight: 800; color: #4b5563; white-space: nowrap; }
:is(.qt4, .rq4) .qt4-line.is-soon { color: #b45309; }
:is(.qt4, .rq4) .qt4-line.is-late { color: #b91c1c; }
:is(.qt4, .rq4) .qt4-of { font-size: .72rem; font-weight: 700; color: #4b5563; }
#page-content :is(.qt4, .rq4) .lt-table tr.lt-dim .qt4-valid b { color: #4b5563; }

/* ---- One quote, one schedule (read first) ---------------------------------- */
.qt4-box { gap: 10px; }
.qt4-box-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.qt4-box-top > div:first-child { min-width: 0; }
.qt4-box-top > div:first-child span { display: block; font-size: .7rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: #3730a3; }
.qt4-box-top > div:first-child b { display: block; font-size: 1.6rem; font-weight: 900; line-height: 1.2; color: #000; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.qt4-box-left { flex: none; text-align: right; }
.qt4-box-left b { display: block; font-size: .95rem; font-weight: 900; color: #000; }
.qt4-box-left span { font-size: .78rem; font-weight: 700; color: #4b5563; }
.qt4-box-left.is-soon b { color: #b45309; }
.qt4-box-left.is-late b { color: #b91c1c; }
.qt4-box-line { display: flex; align-items: flex-start; gap: 8px; padding: 9px 12px; border-radius: 12px; background: #f3f4f6; color: #1f2937; font-size: .84rem; font-weight: 750; line-height: 1.4; }
.qt4-box-line > i { margin-top: 1px; }
.qt4-box.is-draft, .qt4-box.is-sent { border-color: #c7d2fe; }
.qt4-box.is-draft .qt4-box-line, .qt4-box.is-sent .qt4-box-line { background: #eef2ff; color: #312e81; }
.qt4-box.is-accepted { border-color: #a7f3d0; }
.qt4-box.is-accepted .qt4-box-line { background: #ecfdf5; color: #065f46; }
.qt4-box.is-converted { border-color: #ddd6fe; }
.qt4-box.is-converted .qt4-box-line { background: #f5f3ff; color: #4c1d95; }
.qt4-box.is-declined .qt4-box-line { background: #fef2f2; color: #7f1d1d; }
.qt4-box.is-expired { border-color: #fde68a; }
.qt4-box.is-expired .qt4-box-line { background: #fffbeb; color: #78350f; }
.qt4-box[class*="is-rq-"] .qt4-box-top > div:first-child span { color: #0f766e; }
.qt4-box.is-rq-active { border-color: #99f6e4; }
.qt4-box.is-rq-active .qt4-box-line { background: #f0fdfa; color: #134e4a; }
.qt4-box.is-rq-paused { border-color: #fde68a; }
.qt4-box.is-rq-paused .qt4-box-line { background: #fffbeb; color: #78350f; }
.qt4-box.is-late { border-color: #fecaca; }
.qt4-box.is-late .qt4-box-line { background: #fef2f2; color: #7f1d1d; }
.qt4-words > div + div { padding-top: 10px; border-top: 1px solid #eef0f5; }
.qt4-words p { margin: 4px 0 0; font-size: .86rem; font-weight: 700; line-height: 1.45; color: #1f2937; white-space: pre-line; overflow-wrap: anywhere; }
.qt4-facts { gap: 0; }
.qt4-facts h3 { margin-bottom: 4px; }
.qt4-fact { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 9px 0; border-top: 1px solid #eef0f5; }
.qt4-facts h3 + .qt4-fact { border-top: 0; }
.qt4-fact > span { flex: none; font-size: .84rem; font-weight: 700; color: #4b5563; }
.qt4-fact > b { min-width: 0; font-size: .88rem; font-weight: 900; color: #000; text-align: right; overflow-wrap: anywhere; }
.qt4-fact > b small { display: block; font-size: .74rem; font-weight: 700; color: #4b5563; }
.qt4-det .rec-by { margin: 0; }
/* The next step on its own, the rest two by two (an odd last one spans the row). */
body .modal-overlay .modal-actions.qt4-acts > .ord2-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body .modal-overlay .modal-actions.qt4-acts > .ord2-two > :last-child:nth-child(odd) { grid-column: 1 / -1; }

/* ---- The quote and schedule pop-ups (.fm4) ---------------------------------- */
.qt4-form .qt4-opt { font-size: .76rem; font-weight: 700; color: #4b5563; }
.qt4-form .fm4-rows:empty { display: none; }
.qt4-form .fm4-line .fm4-two { align-items: end; }
.qt4-form .fm4-head { margin-top: 2px; }
.ord2-two.qt4-send { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.ord2-two.qt4-send > :last-child:nth-child(3) { grid-column: 1 / -1; }
