/* Quotes and invoices. Uses the shared design tokens, so light and dark both work. */
.dx-pills { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.dx-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dx-actions .btn.danger-soft { margin-inline-start: auto; }
.dx-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; }
.dx-grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 16px; }
.dx-grid3 .list .li { border-radius: 0; }
.dx-top { display: grid; gap: 16px; }
.dx-top-r { display: flex; align-items: flex-start; gap: 12px; }
.dx-top-r .row b { font-size: 14px; }
.dx-credit { display: grid; gap: 4px; min-width: 150px; }
.bar.hot i { background: var(--bad); }
.dx-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line2); background: var(--surface); font-size: 13px; font-weight: 600; transition: all .15s; }
.dx-chip .icon { color: var(--orange); }
.dx-chip:hover { border-color: rgba(244, 122, 32, .45); background: var(--grad-soft); }
.dx-rel { display: flex; flex-wrap: wrap; gap: 8px; }
.dx-sw { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink2); cursor: pointer; }
.dx-offscreen { position: absolute; inset-inline-start: -9999px; top: 0; width: 780px; pointer-events: none; }
.dx-tot-s { display: grid; }
.dx-tot-s b { font: 800 22px var(--head); letter-spacing: -.02em; }

/* line editor */
.dx-lines { position: relative; }
.dx-add { padding: 12px 12px 8px; }
.dx-add .searchbox { max-width: none; flex: 1 1 100%; }
.dx-pick { position: relative; }
.dx-pick-list { position: absolute; z-index: 20; inset-inline: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line2); border-radius: 14px; box-shadow: var(--sh-pop); padding: 6px; display: grid; gap: 2px; max-height: 340px; overflow-y: auto; }
.dx-pick-i { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; border-radius: 10px; text-align: start; }
.dx-pick-i.on { background: var(--grad-soft); box-shadow: 0 0 0 1px rgba(244, 122, 32, .25) inset; }
.dx-pick-i .grow { display: grid; }
.dx-pick-i b { font-weight: 600; font-size: 14px; }
.dx-pick-i small { font-size: 12px; }
.dx-pick-em { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--surface3); font-size: 17px; color: var(--ink3); }
.dx-pick-r { display: grid; text-align: end; font-weight: 650; font-size: 13.5px; }
.dx-pick-none { padding: 14px; text-align: center; color: var(--ink3); font-size: 13.5px; }
.dx-lh, .dx-l { display: grid; grid-template-columns: minmax(0, 1fr) 82px 104px 76px 74px 112px 32px; gap: 8px; align-items: center; padding: 8px 12px; }
.dx-lh { font-size: 11.5px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--ink3); padding-top: 4px; border-bottom: 1px solid var(--line); }
.dx-lh .r { text-align: end; }
.dx-l { border-bottom: 1px solid var(--line); }
.dx-l:last-of-type { border-bottom: 0; }
.dx-n { display: grid; min-width: 0; }
.dx-n b { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dx-n small { font-size: 12px; }
.dx-src { color: var(--good); font-weight: 600; }
input.dx-in, select.dx-in { height: 36px; padding: 0 8px; border-radius: 10px; font-size: 14px; text-align: end; }
select.dx-in { text-align: start; padding-inline-end: 26px; background-position: right 6px center; }
.dx-lt { text-align: end; font-weight: 650; font-size: 14px; }
.dx-none { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 26px 16px; color: var(--ink3); font-size: 13.5px; }
.dx-two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.dx-cust { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 10px 14px; border-radius: 12px; background: var(--surface2); border: 1px solid var(--line); font-size: 13px; color: var(--ink2); font-weight: 550; }
.dx-cust span { display: inline-flex; align-items: center; gap: 6px; }
.dx-cust .icon { color: var(--ink3); }
.dx-qrow { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.dx-qrow:last-child { border-bottom: 0; }
.dx-qrow .grow { display: grid; }
.dx-qrow b { font-weight: 600; font-size: 14px; }
.dx-qrow small { font-size: 12px; }
.dx-qrow input { width: 96px; flex: none; }
.dx-pl { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line); }
.dx-pl .grow { display: grid; min-width: 0; }
.dx-pl b { font-weight: 600; font-size: 14px; }
.dx-pl select.dx-in { width: 130px; flex: none; }
.dx-pl input.dx-in { width: 100px; flex: none; }
.dx-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dx-m { display: flex; align-items: center; justify-content: center; gap: 8px; height: 44px; border-radius: 12px; border: 1px solid var(--line2); background: var(--surface); font-weight: 600; color: var(--ink2); transition: all .15s; }
.dx-m:hover { border-color: var(--line-strong); }
.dx-m.on { border-color: var(--orange); background: var(--grad-soft); color: var(--ink); box-shadow: var(--ring); }
.dx-m.on .icon { color: var(--orange); }

/* price lists */
.dx-pl-card { text-align: start; display: grid; gap: 8px; align-content: start; transition: transform .15s, box-shadow .15s, border-color .15s; }
.dx-pl-card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--sh-3); }
.dx-pl-ic { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--grad-soft); color: var(--accent-t); }
.dx-pl-m { display: flex; gap: 22px; padding: 10px 0 8px; }
.dx-pl-m div { display: grid; }
.dx-pl-m b { font: 750 22px var(--head); letter-spacing: -.02em; }
.dx-pl-m small { color: var(--ink3); font-size: 12px; }

/* printable document: always a white sheet, in both themes */
.tx-wrap { background: var(--surface3); border-radius: 14px; padding: 16px; overflow-x: auto; }
.tx-doc { --tx-ink: #14141a; --tx-mute: #5b5b68; --tx-line: #dcdce3; --tx-soft: #f4f4f7; background: #fff; color: var(--tx-ink); border-radius: 6px; padding: 34px 36px; width: 100%; min-width: 640px; max-width: 760px; margin: 0 auto; font-size: 12.5px; line-height: 1.5; box-shadow: var(--sh-2); }
.tx-doc h1, .tx-doc h2 { color: var(--tx-ink); }
.tx-head { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 18px; border-bottom: 3px solid #E3242B; }
.tx-co h2 { font-size: 19px; margin-bottom: 4px; }
.tx-sm { display: grid; color: var(--tx-mute); font-size: 12px; }
.tx-title { text-align: end; }
.tx-title h1 { font-size: 24px; letter-spacing: -.02em; text-transform: uppercase; }
.tx-no { color: var(--tx-mute); margin-top: 2px; font-size: 13px; }
.tx-meta { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; padding: 18px 0; }
.tx-meta b { font-size: 14.5px; }
.tx-k { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--tx-mute); margin-bottom: 4px; }
.tx-kv { display: grid; grid-template-columns: max-content 1fr; gap: 3px 16px; margin: 0; }
.tx-kv dt { color: var(--tx-mute); } .tx-kv dd { margin: 0; font-weight: 600; text-align: end; }
.tx-tbl { width: 100%; border-collapse: collapse; margin-top: 4px; }
.tx-tbl th { background: var(--tx-soft); text-align: start; font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--tx-mute); padding: 8px 8px; border-bottom: 1px solid var(--tx-line); }
.tx-tbl td { padding: 8px; border-bottom: 1px solid var(--tx-line); vertical-align: top; }
.tx-tbl .num, .tx-vat .num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tx-tbl small { color: var(--tx-mute); }
.tx-bottom { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; padding-top: 18px; align-items: start; }
.tx-notes p { margin: 0; color: var(--tx-mute); font-size: 12px; }
.tx-vat { border-collapse: collapse; width: 100%; font-size: 12px; }
.tx-vat th { text-align: start; color: var(--tx-mute); font-weight: 600; padding: 4px 0; border-bottom: 1px solid var(--tx-line); }
.tx-vat th.num { text-align: end; }
.tx-vat td { padding: 4px 0; }
.tx-tot { display: grid; gap: 4px; }
.tx-tot > div { display: flex; justify-content: space-between; gap: 16px; }
.tx-tot > div span:first-child { color: var(--tx-mute); }
.tx-tot .tx-grand { border-top: 2px solid var(--tx-ink); margin-top: 4px; padding-top: 8px; font-size: 15px; font-weight: 800; }
.tx-tot .tx-grand span:first-child { color: var(--tx-ink); }
.tx-tot .tx-due { background: var(--tx-soft); border-radius: 6px; padding: 8px 10px; font-weight: 800; font-size: 14px; }
.tx-tot .tx-due span:first-child { color: var(--tx-ink); }
.tx-foot { margin-top: 26px; padding-top: 12px; border-top: 1px solid var(--tx-line); color: var(--tx-mute); font-size: 11px; text-align: center; }
body.tx-print { background: #fff; margin: 0; }
body.tx-print .tx-doc { box-shadow: none; max-width: none; padding: 0; min-width: 0; border-radius: 0; }
@media print { @page { size: A4; margin: 14mm; } body.tx-print { font-size: 12px; } }

@media (max-width: 1024px) { .dx-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) {
  .dx-two { grid-template-columns: 1fr; }
  .dx-lh { display: none; }
  .dx-l { grid-template-columns: 1fr 1fr 1fr 32px; grid-template-areas: 'n n n x' 'q p d d' 'v v t t'; row-gap: 8px; padding: 12px; }
  .dx-l .dx-n { grid-area: n; } .dx-l > button { grid-area: x; } .dx-l .dx-lt { grid-area: t; }
  .dx-l > input:nth-of-type(1) { grid-area: q; } .dx-l > input:nth-of-type(2) { grid-area: p; } .dx-l > input:nth-of-type(3) { grid-area: d; }
  .dx-l > select { grid-area: v; text-align: start; }
  .tx-doc { padding: 22px 18px; }
  .dx-pl { flex-wrap: wrap; }
  .dx-pl .grow { flex: 1 1 100%; }
}
.list .li .tnum { white-space: nowrap; }

/* right-to-left: the money select arrow sits on the start side of the text */
[dir=rtl] select.dx-in { background-position: left 6px center; }
[dir=rtl] .tx-doc, [dir=rtl] .tx-wrap { direction: rtl; }
[dir=rtl] .tx-title h1, [dir=rtl] .tx-k, [dir=rtl] .tx-tbl th, [dir=rtl] .dx-lh { letter-spacing: 0; text-transform: none; }
