/* =====================================================================
   Quotations (عروض الأسعار) — on top of inventory.css (.iv); everything here is qt-* scoped.
   Full-height window like the fire doors register.
   ===================================================================== */

.qt-root { position: fixed; inset: 0; z-index: 48; background: rgba(15, 23, 42, .55); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; padding: 16px; }
.qt-root[hidden] { display: none; }
.qt-win {
    width: 100%; max-width: 1320px; height: min(94vh, 1000px);
    background: var(--iv-sub); border-radius: 18px; box-shadow: 0 25px 60px rgba(15, 23, 42, .3);
    display: flex; flex-direction: column; overflow: hidden; animation: iv-pop .18s ease-out;
}
.qt-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 20px; background: var(--iv-panel); border-bottom: 1px solid var(--iv-border-strong); }
.qt-title { display: flex; align-items: center; gap: 12px; margin-inline-end: auto; min-width: 0; }
.qt-ico { width: 42px; height: 42px; border-radius: 12px; background: var(--iv-accent-bg); color: var(--iv-accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qt-ico .ti { font-size: 22px; }
.qt-title h3 { margin: 0; font-size: 19px; font-weight: 800; line-height: 1.3; }
.qt-title .sub { font-size: 12.5px; color: var(--iv-text-2); }
.qt-head .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.qt-main { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px 24px; }
.qt-main .iv-kpis { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.qt-main .iv-kpi { padding: 10px 14px; cursor: pointer; }
.qt-main .iv-kpi .value { font-size: 22px; }
.qt-main .iv-toolbar .iv-input { flex: 1; min-width: 200px; max-width: 360px; height: 38px; font-size: 13.5px; }

/* sent switch */
.qt-switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12.5px; font-weight: 700; user-select: none; }
.qt-switch input { position: absolute; opacity: 0; pointer-events: none; }
.qt-switch .track { width: 38px; height: 22px; border-radius: 999px; background: #cbd5e1; position: relative; transition: background .15s; flex-shrink: 0; }
.qt-switch .track::after { content: ''; position: absolute; top: 3px; right: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.qt-switch input:checked + .track { background: var(--iv-ok); }
.qt-switch input:checked + .track::after { transform: translateX(-16px); }
.qt-switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--iv-accent-soft); }
.qt-switch .txt { color: var(--iv-text-2); }
.qt-switch input:checked ~ .txt { color: var(--iv-ok); }

.qt-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.qt-money { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }

/* editor */
.qt-edit { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.qt-edit .iv-card { padding: 16px 18px; }
.qt-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.qt-form .iv-input, .qt-form .iv-select { height: 38px; font-size: 13.5px; }
.qt-aside { position: sticky; top: 0; display: flex; flex-direction: column; gap: 12px; }
.qt-tot > div { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 0; font-size: 13.5px; border-bottom: 1px dashed var(--iv-border-strong); }
.qt-tot > div:last-child { border-bottom: 0; }
.qt-tot .grand { font-size: 17px; font-weight: 800; color: var(--iv-text); }
.qt-tot .iv-input, .qt-tot .iv-select { height: 32px; font-size: 13px; width: 86px; padding: 0 8px; }
.qt-tot .iv-select { width: 74px; }
.qt-inline { display: flex; gap: 6px; align-items: center; }

/* lines */
.qt-lines td { padding: 8px 10px; }
.qt-lines th { padding: 10px; }
.qt-lines .iv-input { height: 34px; font-size: 13px; border-radius: 9px; padding: 0 8px; }
.qt-lines .desc { min-width: 220px; }
.qt-lines .qty { width: 70px; text-align: center; }
.qt-lines .price { width: 100px; text-align: center; }
.qt-lines tr.qt-over td { background: #fffbeb; }
.qt-lines tr.qt-x > td { background: var(--iv-sub); padding: 14px 16px 16px; }
.qt-lines .tag { font-size: 11px; color: var(--iv-muted); display: flex; gap: 6px; align-items: center; margin-top: 3px; }
.qt-x-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 16px; }
.qt-bd { background: var(--iv-panel); border: 1px solid var(--iv-border-strong); border-radius: 12px; padding: 10px 12px; font-size: 13px; }
.qt-bd > div { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; }
.qt-bd .sum { border-top: 1px solid var(--iv-border-strong); margin-top: 4px; padding-top: 7px; font-weight: 800; }
.qt-bd h5, .qt-specs h5 { margin: 0 0 8px; font-size: 12.5px; font-weight: 800; color: var(--iv-text-2); }
.qt-specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; }
.qt-specs label.iv-field > span { font-size: 11.5px; margin-bottom: 3px; }
.qt-specs .iv-input, .qt-specs .iv-select { height: 32px; font-size: 12.5px; padding: 0 8px; border-radius: 8px; }
.qt-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; grid-column: 1 / -1; font-size: 12.5px; }
.qt-checks label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.qt-checks input { width: 15px; height: 15px; accent-color: var(--iv-accent); }
.qt-box { background: var(--iv-panel); border: 1px solid var(--iv-border-strong); border-radius: 12px; padding: 10px 12px; margin-top: 10px; }
.qt-addbar { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--iv-border-strong); }

/* pricing profiles */
.qt-prof { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.qt-plist { display: flex; flex-direction: column; gap: 6px; }
.qt-plist button { text-align: right; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--iv-border-strong) !important; background: var(--iv-panel) !important; }
.qt-plist button.on { border-color: var(--iv-accent) !important; box-shadow: 0 0 0 1px var(--iv-accent); }
.qt-plist .n { font-weight: 700; font-size: 13.5px; display: flex; gap: 6px; align-items: center; }
.qt-plist .m { font-size: 11.5px; color: var(--iv-text-2); }
.qt-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.qt-method { border: 1px solid var(--iv-border-strong) !important; border-radius: 12px; padding: 12px; text-align: right; background: var(--iv-panel) !important; }
.qt-method.on { border-color: var(--iv-accent) !important; background: var(--iv-accent-bg) !important; }
.qt-method .ti { font-size: 20px; color: var(--iv-accent); }
.qt-method b { display: block; font-size: 13.5px; margin-top: 4px; }
.qt-method small { color: var(--iv-text-2); font-size: 11.5px; }
.qt-sec { margin-top: 18px; }
.qt-sec > h4 { margin: 0 0 4px; font-size: 14px; font-weight: 800; }
.qt-sec > p { margin: 0 0 10px; font-size: 12.5px; color: var(--iv-text-2); }
.qt-rules td { padding: 6px 6px; }
.qt-rules .iv-input, .qt-rules .iv-select { height: 34px; font-size: 12.5px; padding: 0 8px; border-radius: 8px; }
.qt-test { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }

@media (max-width: 1000px) {
    .qt-edit, .qt-prof, .qt-x-grid { grid-template-columns: 1fr; }
    .qt-aside { position: static; }
}
@media (max-width: 767px) {
    .qt-root { padding: 0; }
    .qt-win { height: 100%; border-radius: 0; }
    .qt-head { padding: 12px 14px; }
    .qt-main { padding: 12px 12px 20px; }
}
