/* Sales, purchasing and customer-facing pages (estimates, invoices, price book, suppliers, POs, public links). */

/* ---- Line items editor ---- */
.li-table-wrap { background: #fff; border: 1px solid #e3e6ea; border-radius: 6px; }
.li-table th { font-size: 0.78rem; font-weight: 600; color: #6c757d; text-transform: uppercase; letter-spacing: .02em; background: #f8f9fb; white-space: nowrap; }
.li-table td { vertical-align: middle; }
.li-table .form-control-sm, .li-table .form-select-sm { min-width: 0; }
.li-desc { min-height: 31px; resize: vertical; }
.li-section td { background: #eef3fd; border-top: 2px solid #c9d8f8; }
.li-section-input { max-width: 280px; font-weight: 600; background: transparent; }
.li-optional-off td { color: #9aa1a9; }
.li-optional-off td.fw-semibold { text-decoration: line-through; }
.li-btn { padding: 0.05rem 0.35rem; font-size: 0.75rem; line-height: 1.2; }
.li-totals { background: #fff; border: 1px solid #e3e6ea; border-radius: 6px; padding: 0.75rem 1rem; }
.li-totals > div { padding: 0.1rem 0; }
.li-grand { font-weight: 700; font-size: 1.1rem; color: var(--tp-navy, #0B1A3A); border-top: 1px solid #dee2e6; margin-top: 0.3rem; padding-top: 0.35rem !important; }
.li-picker-list { max-height: 55vh; overflow-y: auto; }

/* ---- Lightweight modal (Bootstrap look, Blazor-controlled) ---- */
.tp-modal-backdrop { position: fixed; inset: 0; background: rgba(11, 26, 58, 0.45); z-index: 1050; }
.tp-modal { position: fixed; inset: 0; z-index: 1055; display: flex; align-items: flex-start; justify-content: center; padding: 3vh 0.75rem; pointer-events: none; overflow-y: auto; }
.tp-modal-dialog { pointer-events: auto; background: #fff; border-radius: 10px; width: 100%; max-width: 520px; box-shadow: 0 20px 50px rgba(0,0,0,0.25); display: flex; flex-direction: column; max-height: 94vh; }
.tp-modal-lg { max-width: 820px; }
.tp-modal-xl { max-width: 1100px; }
.tp-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 0.85rem 1.1rem; border-bottom: 1px solid #e9ecef; }
.tp-modal-body { padding: 1rem 1.1rem; overflow-y: auto; }
.tp-modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 0.5rem; padding: 0.75rem 1.1rem; border-top: 1px solid #e9ecef; }

/* ---- Editors / toolbars ---- */
.doc-toolbar { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.doc-card { background: #fff; border: 1px solid #e3e6ea; border-radius: 8px; padding: 1rem 1.25rem; }
.doc-card h2, .doc-card h3 { font-size: 1rem; font-weight: 600; color: var(--tp-navy, #0B1A3A); }
.picker-results { max-height: 260px; overflow-y: auto; }
.status-timeline { list-style: none; padding: 0; margin: 0; }
.status-timeline li { position: relative; padding: 0 0 0.6rem 1.3rem; font-size: 0.9rem; }
.status-timeline li::before { content: ""; position: absolute; left: 0.25rem; top: 0.4rem; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: #ced4da; }
.status-timeline li.done::before { background: var(--tp-blue, #1A5CE6); }
.status-timeline li.ok::before { background: #198754; }
.status-timeline li.bad::before { background: #dc3545; }
.sales-grid { background: #fff; }
.text-overdue { color: #dc3545; font-weight: 600; }
.row-highlight td { background: #fff8eb !important; }
.cheapest-row td { background: #e9f7ef !important; }
.price-up { color: #dc3545; }
.price-down { color: #198754; }
.ar-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0.75rem; }
.ar-tiles .tile-value { font-size: 1.35rem; }
.calc-card { height: 100%; }
.calc-result { background: #eef3fd; border-radius: 6px; padding: 0.6rem 0.8rem; }
.calc-result .value { font-size: 1.4rem; font-weight: 700; color: var(--tp-navy, #0B1A3A); }
.filter-pills .btn { border-radius: 999px; }
.sales-table { background: #fff; }
.sales-table th { font-size: 0.8rem; color: #6c757d; font-weight: 600; white-space: nowrap; }

/* ---- Customer-facing public pages ---- */
.pub-doc { background: #fff; border-radius: 10px; box-shadow: 0 4px 20px rgba(11, 26, 58, 0.08); padding: 1.5rem; max-width: 900px; margin: 0 auto 1.25rem; }
.pub-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; border-bottom: 3px solid var(--tp-blue, #1A5CE6); padding-bottom: 1rem; margin-bottom: 1rem; }
.pub-logo { max-height: 70px; max-width: 220px; object-fit: contain; }
.pub-company { color: var(--tp-navy, #0B1A3A); font-weight: 700; font-size: 1.25rem; }
.pub-doc-title { color: var(--tp-navy, #0B1A3A); font-weight: 700; }
.pub-lines th { font-size: 0.78rem; color: #6c757d; text-transform: uppercase; }
.pub-lines .pub-section td { background: #eef3fd; font-weight: 600; color: var(--tp-navy, #0B1A3A); }
.pub-optional td { background: #fffbea; }
.pub-totals { max-width: 360px; margin-left: auto; }
.pub-totals > div { display: flex; justify-content: space-between; padding: 0.15rem 0; }
.pub-totals .grand { font-weight: 700; font-size: 1.2rem; color: var(--tp-navy, #0B1A3A); border-top: 1px solid #dee2e6; margin-top: 0.3rem; padding-top: 0.4rem; }
.pub-panel { background: #f7f9fd; border: 1px solid #dbe4f6; border-radius: 8px; padding: 1rem; }
.pub-approved { background: #e9f7ef; border: 1px solid #b7e1c7; border-radius: 8px; padding: 1rem; color: #14532d; }
.star-rating { display: flex; gap: 0.35rem; justify-content: center; }
.star-rating button { background: none; border: none; font-size: 2.4rem; line-height: 1; color: #ced4da; padding: 0 0.1rem; cursor: pointer; }
.star-rating button.on { color: #f5b301; }

@media (max-width: 576px) {
    .pub-doc { padding: 1rem; border-radius: 0; }
    .pub-lines .hide-xs { display: none; }
    .doc-toolbar .btn, .doc-toolbar .dxbl-btn { flex: 1 1 auto; }
}

@media print {
    .no-print, nav, .sidebar, .top-row, .doc-toolbar { display: none !important; }
    .print-only { display: block !important; }
    .pub-doc { box-shadow: none; }
}
.print-only { display: none; }
