/* Clients, Subscriptions and Sales (js/modules/clients.js,
   subscriptions.js, sales.js; loaded with ui.stylesheet). Builds on
   app.css: same tokens, same rows and groups. */

/* Detail screens read better a little narrower than lists. */
.page.cs-detail { max-width: 900px; }

.cs-one-line { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-inline { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cs-web { display: inline-flex; color: var(--ink); }

/* List filters (the app's menu pickers): a label and a select. */
.cs-filter { display: inline-flex; align-items: center; gap: 10px; max-width: 100%; }
.cs-filter-label { font-size: 0.88rem; font-weight: 600; color: var(--text-dim); white-space: nowrap; }
.cs-filter .select { min-width: 170px; max-width: 100%; }

/* Buttons at the end of a profile section ("Log Interaction", …). */
.cs-section-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px; }

/* A section with only its footer (a won deal the role can't change). */
.group.cs-no-body .group-body { display: none; }

.cs-caption { font-size: 0.78rem; font-weight: 650; color: var(--text-dim); margin-bottom: 2px; }
.cs-form-note { line-height: 1.45; }

/* Communication history */
.cs-interaction { padding: 12px 16px; display: flex; flex-direction: column; gap: 3px; }
.cs-interaction-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 0.82rem; font-weight: 650; color: var(--ink); }
.cs-interaction-date { font-weight: 500; color: var(--text-dim); white-space: nowrap; }
.cs-interaction-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.95rem; }
.cs-interaction-by { font-size: 0.78rem; color: var(--text-faint); }

/* Lead editor: probability slider */
.cs-range-row { display: flex; align-items: center; gap: 12px; }
.cs-range { flex: 1; min-width: 0; height: 28px; accent-color: var(--ink); }
.cs-range-value { width: 48px; flex-shrink: 0; text-align: right; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }

/* POS Agreement: equipment provided */
.cs-equip { padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.cs-equip-top { display: flex; align-items: center; gap: 12px; }
.cs-equip-main { flex: 1; min-width: 0; }
.cs-equip-name { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.cs-equip-sub { font-size: 0.82rem; color: var(--text-dim); }
.cs-stepper { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
.cs-qty { min-width: 26px; text-align: center; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.cs-qty.muted { color: var(--text-faint); font-weight: 500; }

/* POS Agreement: the document (always English, like the app's PDF) */
.cs-paper {
  background: #fff; border: 1px solid var(--line-strong); border-radius: 12px;
  padding: 30px 32px; box-shadow: var(--shadow-card);
}
.cs-agreement { font-family: Georgia, "Times New Roman", serif; color: #111; font-size: 0.95rem; line-height: 1.5; }
.cs-agreement h1 { font-size: 1.5rem; font-weight: 700; line-height: 1.25; color: #111; }
.cs-ag-sub { color: #444; margin: 2px 0 16px; }
.cs-ag-section { margin-top: 14px; }
.cs-agreement h2 { font-size: 1.02rem; font-weight: 700; margin-bottom: 4px; color: #111; }
.cs-agreement p { margin-bottom: 6px; overflow-wrap: anywhere; }
.cs-ag-signers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; margin-top: 12px; }
.cs-ag-signer { font-size: 0.85rem; min-width: 0; overflow-wrap: anywhere; }
.cs-ag-signer-label { font-weight: 700; min-height: 2.8em; }
.cs-ag-sign-box { height: 64px; border-bottom: 1px solid #111; }
.cs-ag-sign-caption { color: #777; font-size: 0.78rem; margin: 3px 0 4px; }
.cs-ag-table { width: 100%; min-width: 460px; border-collapse: collapse; font-size: 0.85rem; margin: 6px 0 10px; }
.cs-ag-table th, .cs-ag-table td { padding: 5px 6px; border-bottom: 1px solid #bbb; text-align: left; vertical-align: top; }
.cs-ag-table th { font-weight: 700; }
.cs-ag-table .cs-center { text-align: center; }
.cs-ag-table .cs-right { text-align: right; white-space: nowrap; }
.cs-ag-footer { margin-top: 22px; padding-top: 8px; border-top: 1px solid #ddd; color: #777; font-size: 0.78rem; text-align: center; }

@media (max-width: 760px) {
  .cs-paper { padding: 18px 16px; }
  .cs-filter { flex: 1 1 100%; }
  .cs-filter .select { flex: 1; min-width: 0; }
}

@media (max-width: 560px) {
  .cs-ag-signers { grid-template-columns: minmax(0, 1fr); gap: 18px; }
}

/* Printing an agreement: only the agreement prints. */
.cs-print-root { display: none; }

@media print {
  body.cs-printing { background: #fff !important; overflow: visible !important; }
  body.cs-printing > *:not(.cs-print-root) { display: none !important; }
  body.cs-printing > .cs-print-root { display: block !important; }
  .cs-print-root .cs-agreement { font-size: 10.5pt; }
  .cs-print-root .table-wrap { overflow: visible; }
  .cs-print-root .cs-ag-table { min-width: 0; }
  .cs-print-root .cs-ag-signers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-print-root .cs-ag-keep, .cs-print-root .cs-ag-table tr { break-inside: avoid; page-break-inside: avoid; }
  .cs-print-root .cs-agreement h2 { break-after: avoid; page-break-after: avoid; }
}
