/* CRM & Accounts. Builds on app.css tokens; nothing here changes core components. */

/* ---------- small helpers ---------- */
.crm-sub{display:block;font-size:.8rem;color:var(--muted)}
.crm-mono{font-family:var(--f-mono);font-size:.88em}
.crm-pre{white-space:pre-line}
.crm-right{float:right}
.crm-inline,form.inline{display:inline}
.crm-grow{flex:1 1 auto;min-width:0}
.crm-nowrap{white-space:nowrap}
.crm-meta{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-top:6px}
.crm-link{word-break:break-all}
.crm-in{color:var(--ok)}.crm-out{color:var(--bad)}
.crm-muted{opacity:.62}
.crm-pad{padding:10px 16px}
.crm-w3{width:4.2em!important}.crm-w4{width:5.5em!important}.crm-w5{width:6.5em!important}.crm-w6{width:7.5em!important}.crm-w8{width:10em!important}
.crm-fs{border:0;padding:0;margin:0;min-width:0;display:contents}
.crm-fs[disabled] input,.crm-fs[disabled] select,.crm-fs[disabled] textarea{background:var(--surface-2)}
.crm-count{display:inline-block;min-width:1.5em;padding:0 6px;border-radius:999px;background:var(--surface-3);color:var(--ink-2);font-size:.72rem;font-weight:600;text-align:center;line-height:1.6}
.crm-section-title{display:flex;align-items:center;gap:8px;font-size:.82rem;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);margin:22px 0 10px}
.crm-section-title:first-child{margin-top:0}
.crm-warn-box{background:var(--warn-bg);padding:10px;border-radius:8px;align-items:flex-start}
.crm-tips{margin:0;padding-left:1.1em;display:grid;gap:6px;color:var(--ink-2)}
.crm-steps{padding-left:1.2em;display:grid;gap:8px;margin:8px 0 0}
.crm-inline-field{display:inline-flex;align-items:center;gap:6px;font-size:.84rem;color:var(--muted);white-space:nowrap}
.crm-inline-field input,.crm-inline-field select{width:auto}
.crm-hide-sm{}
.crm-sticky{margin:0;position:sticky;bottom:0;z-index:5;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:10px 14px;display:flex;gap:10px;align-items:center;justify-content:flex-end;flex-wrap:wrap;box-shadow:var(--shadow)}
.crm-activity-form{display:flex;flex-direction:column;gap:8px}
.crm-rowform{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.crm-rowform input:not([type=checkbox]):not([type=radio]),.crm-rowform select{max-width:22em}

/* keep wide tables and long links inside the screen on phones */
.split>*,.grid-2>*,.grid-3>*,.stack-lg>*{min-width:0}
.content .seg{max-width:100%;overflow-x:auto;scrollbar-width:none;flex-wrap:nowrap}
.content .seg::-webkit-scrollbar{display:none}
.content .seg>*{flex:none}
.crm-tabs-row{min-width:0}
.crm-tabs-row .tabs,.content .tabs{max-width:100%;overflow-x:auto;scrollbar-width:none}

/* ---------- lists: tabs, toolbar extras, saved views, bulk bar ---------- */
.crm-tabs-row{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:12px}
.crm-tabs-row .tabs{margin-bottom:0}
.crm-search{flex:1 1 280px;max-width:560px}
.crm-search input{width:100%}
.crm-viewbar{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin:-4px 0 12px}
.crm-chips{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.crm-chips .chip.on,.crm-chips .chip[aria-current]{background:var(--brand);color:#fff;border-color:var(--brand)}
.crm-x{border:0;background:none;color:var(--muted);cursor:pointer;padding:0 2px;font-size:1rem;line-height:1}
.crm-filter-pop{min-width:260px;padding:12px}
.crm-bulk{position:sticky;top:calc(var(--top) + 6px);z-index:6;display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:8px 12px;margin-bottom:10px;background:var(--info-bg);border:1px solid var(--line-2);border-radius:var(--radius-sm)}
.crm-bulk select,.crm-bulk input{width:auto;max-width:16em}
.crm-check{width:34px}
.crm-sort{color:inherit;text-decoration:none}
.crm-sort:hover{color:var(--brand)}
.crm-thumbcell{width:52px}
img.crm-mini,span.crm-mini{display:grid;place-items:center;width:40px;height:40px;border-radius:8px;object-fit:cover;background:var(--surface-2);color:var(--faint)}
ul.crm-mini,ol.crm-mini{list-style:none;margin:0;padding:0;display:grid}
ul.crm-mini>li,ol.crm-mini>li{display:flex;justify-content:space-between;align-items:baseline;gap:10px;padding:7px 0;border-bottom:1px solid var(--line)}
ul.crm-mini>li:last-child,ol.crm-mini>li:last-child{border-bottom:0}
ol.crm-mini{counter-reset:n}
.crm-new summary{list-style:none}
.crm-new summary::-webkit-details-marker{display:none}
.crm-decide{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.crm-decide input[type=text],.crm-decide input:not([type]){max-width:14em}
.crm-stage-form{display:flex;gap:6px;flex-wrap:wrap}
.crm-more summary{cursor:pointer;color:var(--brand);font-weight:550}

/* ---------- tiles, cards, money accounts ---------- */
.crm-tile{display:flex;flex-direction:column;gap:6px;text-decoration:none;color:var(--ink);transition:border-color .15s,box-shadow .15s}
.crm-tile .ico{color:var(--brand)}
.crm-tile:hover{border-color:var(--brand);box-shadow:var(--shadow)}
.crm-tile p{margin:0}
.crm-pcards{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:14px;margin-bottom:16px}
.crm-money{display:flex;flex-direction:column;gap:4px;text-decoration:none;color:var(--ink)}
a.crm-money:hover{border-color:var(--brand);box-shadow:var(--shadow)}
.crm-money-bal{font-size:1.45rem;font-weight:700;letter-spacing:-.01em;margin:6px 0 0}
.between{justify-content:space-between}
.crm-kinds{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:8px}
.crm-kinds>label:not(.check-card){display:flex;align-items:center;gap:8px;padding:10px 12px;border:1px solid var(--line-2);border-radius:var(--radius-sm);cursor:pointer;background:var(--surface)}
.crm-kinds>label:has(input:checked){border-color:var(--brand);box-shadow:0 0 0 1px var(--brand) inset;background:var(--info-bg)}
.crm-kinds .check-card span{display:flex;flex-direction:column}

/* ---------- home ---------- */
.mb{margin-bottom:16px}
.crm-setup{border-left:4px solid var(--brand)}
.crm-checklist{list-style:none;margin:8px 0 0;padding:0;display:grid;gap:4px}
.crm-checklist>li{display:flex;align-items:center;gap:10px;padding:8px 0;border-bottom:1px solid var(--line)}
.crm-checklist>li:last-child{border-bottom:0}
.crm-checklist>li.done{color:var(--muted)}
.crm-checklist>li.done a{color:var(--muted)}
.crm-tick{display:grid;place-items:center;width:22px;height:22px;border-radius:50%;border:1.5px solid var(--line-2);flex:none;color:#fff}
.done .crm-tick{background:var(--ok);border-color:var(--ok)}
.crm-now{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:14px}
.crm-now-card h2{display:flex;align-items:center;gap:8px}
tr.crm-now td{background:var(--info-bg)}

/* ---------- forms: line editors, grids, photos ---------- */
.crm-lines td{vertical-align:top;padding:4px}
.crm-lines input,.crm-lines select{min-width:0}
.crm-lines td:first-child select{min-width:10em}
.crm-lines [data-desc]{min-width:12em}
.crm-live{display:inline-flex;flex-wrap:wrap;gap:4px;align-items:baseline;color:var(--muted)}
.crm-live b{color:var(--ink)}
.crm-grid td{vertical-align:middle;padding:4px 6px}
.crm-grid input,.crm-grid select{min-width:0}
.crm-photos{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:10px}
.crm-photos figure{margin:0;border:1px solid var(--line);border-radius:var(--radius-sm);overflow:hidden;background:var(--surface-2)}
.crm-photos img{display:block;width:100%;aspect-ratio:1;object-fit:cover}
.crm-photo-acts{display:flex;gap:4px;justify-content:center;padding:4px;flex-wrap:wrap}
.crm-create summary{cursor:pointer;color:var(--brand)}
.crm-create form{margin-top:8px}
.crm-thumb{display:block;max-width:120px;max-height:80px;object-fit:contain;margin-bottom:4px}
.crm-due.late b{color:var(--bad)}

/* ---------- reports ---------- */
.crm-statement td,.crm-statement th{padding-top:7px;padding-bottom:7px}
.crm-statement tr.crm-group th{background:var(--surface-2);font-size:.78rem;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);text-align:left}
.crm-statement tr.crm-subtotal td{font-weight:600;border-top:1px solid var(--line-2)}
tr.crm-total td,tr.crm-total th{font-weight:700;font-size:1rem;border-top:2px solid var(--ink-2)}
tr.crm-entry-start td{border-top:2px solid var(--line-2)}
.crm-bars{display:flex;align-items:flex-end;gap:6px;height:170px;padding-top:18px}
.crm-bar{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;height:100%;position:relative;min-width:0}
.crm-bar i{display:block;width:100%;max-width:34px;background:var(--brand);border-radius:5px 5px 0 0;opacity:.85}
.crm-bar:hover i{opacity:1}
.crm-bar span{font-size:.72rem;color:var(--muted);margin-top:4px;white-space:nowrap}
.crm-bar b{position:absolute;top:0;font-size:.62rem;font-weight:600;color:var(--muted);white-space:nowrap;display:none}
.crm-bar:hover b{display:block}

/* ---------- bank statement lines ---------- */
.crm-stmt{list-style:none;margin:0;padding:0}
.crm-stmt>li{padding:10px 16px;border-top:1px solid var(--line)}
.crm-stmt-row{display:grid;grid-template-columns:6.5em 1fr auto auto;gap:10px;align-items:center}
.crm-stmt-desc{min-width:0;overflow-wrap:anywhere}
.crm-stmt-act{margin-top:6px;display:flex;flex-wrap:wrap;gap:8px;align-items:center;padding-left:7em}
.crm-stmt-act select{max-width:24em}
.crm-stmt-reconciled{opacity:.7}
.crm-stmt-ignored{opacity:.5}

/* ---------- deal board ---------- */
[data-deal-board] .board-col.drop{outline:2px dashed var(--brand);outline-offset:-4px}
[data-deal-board] .ticket-card.dragging{opacity:.5}
[data-deal-board] .ticket-card{cursor:grab}

/* ---------- public store, product, checkout, order pages ---------- */
.crm-store{max-width:1080px;margin:0 auto;display:flex;flex-direction:column;gap:18px;padding:8px 0 40px}
.crm-store.crm-narrow{max-width:680px}
.crm-testband{background:#f59e0b;color:#1f1300;font-weight:700;font-size:.85rem;padding:8px 14px;border-radius:10px}
.crm-pub-brand{display:flex;align-items:center;gap:12px;text-decoration:none;color:var(--ink);font-weight:700;font-size:1.1rem}
.crm-pub-brand img{height:44px;width:auto;max-width:170px;object-fit:contain}
.crm-pub-head{display:flex;align-items:center;gap:12px}
.crm-pub-foot{text-align:center;color:var(--muted);font-size:.8rem;margin-top:12px}
.crm-store-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.crm-pcard{display:flex;flex-direction:column;gap:6px;padding:12px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);text-decoration:none;color:var(--ink);box-shadow:var(--shadow-sm);transition:box-shadow .15s,border-color .15s}
.crm-pcard:hover{box-shadow:var(--shadow);border-color:var(--line-2)}
.crm-pcard-img{display:grid;place-items:center;aspect-ratio:4/3;border-radius:var(--radius-sm);background:var(--surface-2);color:var(--faint);overflow:hidden;margin-bottom:4px}
.crm-pcard-img img{width:100%;height:100%;object-fit:cover}
.crm-price-line{display:flex;flex-wrap:wrap;gap:6px;align-items:baseline;margin-top:auto}
.crm-price-line b{font-size:1.1rem}
.crm-product{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:28px;align-items:start}
.crm-gallery{display:flex;flex-direction:column;gap:10px}
.crm-gallery-main{width:100%;aspect-ratio:1;object-fit:cover;border-radius:var(--radius);background:var(--surface-2);border:1px solid var(--line)}
.crm-gallery-empty{display:grid;place-items:center;aspect-ratio:4/3;border-radius:var(--radius);background:var(--surface-2);color:var(--faint)}
.crm-gallery-thumbs{display:flex;gap:8px;flex-wrap:wrap}
.crm-gallery-thumbs button{padding:0;border:2px solid transparent;border-radius:8px;background:none;cursor:pointer;width:64px;height:64px;overflow:hidden}
.crm-gallery-thumbs button[aria-current]{border-color:var(--brand)}
.crm-gallery-thumbs img{width:100%;height:100%;object-fit:cover}
.crm-buy{display:flex;flex-direction:column;gap:12px}
.crm-buy h1{font-size:1.7rem}
.crm-price-big{display:flex;flex-wrap:wrap;gap:8px;align-items:baseline}
.crm-price-big>b{font-size:1.9rem;letter-spacing:-.01em;color:var(--ink)}
.crm-price-big .crm-sub{flex-basis:100%}
.crm-price{font-size:1.15rem}
.crm-price b{font-size:1.5rem;color:var(--brand)}
.crm-variants{border:0;padding:0;margin:0;display:grid;gap:8px}
.crm-variants legend{font-weight:600;font-size:.86rem;margin-bottom:6px}
.crm-variants .check-card span{display:flex;flex-direction:column}
.crm-qty input{max-width:7em}
.crm-get{list-style:none;padding:0;margin:0;display:grid;gap:6px}
.crm-get li{display:flex;gap:8px;align-items:flex-start}
.crm-get .ico{color:var(--ok);margin-top:2px}
.crm-desc{max-width:780px}
.crm-checkout{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);gap:20px;align-items:start}
.crm-summary{position:sticky;top:16px}
.crm-sum-item{display:flex;gap:10px;align-items:center}
.crm-sum{width:100%;border-collapse:collapse}
.crm-sum td{padding:5px 0;border-bottom:1px solid var(--line)}
.crm-sum .num{text-align:right}
.crm-sum-total td{font-weight:700;font-size:1.1rem;border-bottom:0;border-top:2px solid var(--ink-2)}
.crm-hp{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}
.crm-has-error input,.crm-has-error select,.crm-has-error textarea{border-color:var(--bad)}
.crm-test{border:2px dashed var(--warn);background:var(--warn-bg)}

/* ---------- invoice document on the letterhead ---------- */
.crm-doc{position:relative;font-family:var(--f);font-size:9.5pt}
.crm-doc-title{text-align:center;text-transform:uppercase;letter-spacing:.12em;font-size:13pt;margin:0 0 10px}
.crm-doc-label{font-size:8pt;text-transform:uppercase;letter-spacing:.06em;color:#555;margin-bottom:2px}
.lh-body table.crm-doc-head,.lh-body table.crm-doc-head td{border:0;padding:0 0 10px;vertical-align:top}
.crm-doc-head{width:100%}
.crm-doc-meta div{display:flex;justify-content:space-between;gap:12px}
.crm-doc-meta span{color:#555}
table.crm-doc-lines{width:100%;border-collapse:collapse;margin:8px 0}
.crm-doc-lines th,.crm-doc-lines td{border:1px solid #bbb;padding:4px 5px;font-size:8.5pt}
.crm-doc-lines th{background:#f1f1f4}
.crm-doc .num{text-align:right;white-space:nowrap}
table.crm-doc-totals{margin-left:auto;min-width:50%;border-collapse:collapse}
.crm-doc-totals td{border:0;padding:2px 5px}
.crm-grand td{border-top:1px solid #333;font-weight:700}
.crm-words{margin-top:8px}
.crm-watermark{position:absolute;top:35%;left:0;right:0;text-align:center;font-size:64pt;font-weight:800;color:rgba(180,35,44,.12);transform:rotate(-20deg);pointer-events:none}

/* ---------- phones ---------- */
@media (max-width:900px){
  .crm-product,.crm-checkout{grid-template-columns:1fr}
  .crm-summary{position:static}
}
@media (max-width:760px){
  .crm-hide-sm{display:none!important}
  .crm-stmt>li{padding:10px 12px}
  .crm-stmt-row{grid-template-columns:1fr auto}
  .crm-stmt-date{grid-column:1/-1;font-size:.8rem;color:var(--muted)}
  .crm-stmt-row>span:last-child{grid-column:1/-1}
  .crm-stmt-act{padding-left:0}
  .crm-bars{gap:3px;height:140px}
  .crm-right{float:none;display:block}
  .crm-pcards{grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px}
  .crm-money-bal{font-size:1.2rem}
  .crm-sticky{justify-content:stretch}
  .crm-sticky .btn{flex:1 1 auto}
  .crm-inline-field{white-space:normal}
  .crm-bulk{top:calc(var(--top) + 4px)}
  .crm-buy h1{font-size:1.35rem}
  .crm-price-big>b{font-size:1.5rem}
}
@media print{
  .no-print,.crm-sticky,.page-head .actions,.toolbar,.crm-viewbar,.sidebar,.topbar{display:none!important}
  .card{box-shadow:none;border-color:#ccc}
}
.crm-money-bal.num{text-align:left}
@media (max-width:760px){ .crm-pcards:has(.crm-money){grid-template-columns:1fr} }

/* pammigroups.com/shop: the group page, same look as the careers page */
.crm-store{width:100%}
body.crm-group{background:#f6f4ee}
body.crm-group .plain-wrap{justify-content:flex-start;padding-top:40px}
.pg-bar{display:flex;justify-content:space-between;align-items:center;gap:12px;background:#1d2341;color:#fff;padding:12px 18px;border-radius:10px;border-bottom:3px solid #c99a2e}
.pg-mark{display:flex;align-items:center;gap:10px;color:#fff;text-decoration:none}
.pg-mark small{display:block;color:#c99a2e;font-size:.72rem;letter-spacing:.08em;text-transform:uppercase}
.pg-logo{display:grid;place-items:center;width:34px;height:34px;border-radius:8px;background:#c99a2e;color:#1d2341;font-weight:800}
.pg-site{color:#e9dcc0;font-size:.85rem}
.pg-hero h1{color:#1d2341;margin-bottom:.3rem}
.pg-hero p{color:var(--muted);margin:0}
body.crm-group .btn-primary{background:#1d2341;border-color:#1d2341}
@media (max-width:600px){.pg-site{display:none}}
.crm-pcards{justify-content:start}

/* v3: statements, settlements, management P&L, reconciliation, petty cash */
.crm-mgmt tr.crm-detail{display:none}
.crm-mgmt tr.crm-detail.open{display:table-row}
.crm-mgmt tr.crm-detail td:first-child{padding-left:28px}
.crm-mgmt tr.crm-estimate td{font-style:italic;color:var(--muted)}
.crm-span{flex-wrap:wrap}
.crm-span-nav b{min-width:150px;text-align:center}
.crm-suggest{flex-wrap:wrap;background:var(--surface-2);border-radius:8px;padding:6px 8px}
.crm-quick{display:flex;flex-wrap:wrap;gap:6px;align-items:flex-start;margin-top:4px}
.crm-paste-preview{max-height:220px;overflow:auto;font-size:.8rem}
.crm-import-go .btn-lg{white-space:normal}
.crm-tie{display:grid;grid-template-columns:1fr auto;gap:4px 16px;align-items:baseline}
.crm-tie .num{text-align:right}
.crm-tie .crm-diff{font-weight:700;border-top:1px solid var(--line-2);padding-top:4px}
.crm-ok-tick{color:var(--ok, #15803d);font-weight:700}
.crm-bad-amt{color:var(--bad, #b91c1c);font-weight:700}
.crm-recon-head{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.crm-cashbook .crm-cash-actions{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.crm-cashbook .crm-cash-actions .btn{justify-content:center;white-space:normal;min-width:0;padding-left:6px;padding-right:6px;text-align:center}
.crm-denoms{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
.crm-denoms label{display:flex;flex-direction:column;font-size:.8rem}
.crm-denoms input{width:100%}
.crm-warn-line{color:var(--warn-ink, #92400e);font-size:.8rem}
@media (max-width:600px){
  .crm-cashbook .crm-cash-actions{grid-template-columns:1fr 1fr 1fr}
  .crm-denoms{grid-template-columns:repeat(2,1fr)}
  .crm-span .seg{overflow-x:auto;max-width:100%}
  .crm-tie{grid-template-columns:1fr auto}
}
