/* Four semantic labels, shared between compact list and detail. */
.grade-panel { padding: 14px 16px; display:grid; gap:10px; min-width:0; }
.grade-panel-head { display:flex; align-items:center; justify-content:space-between; gap:8px; flex-wrap:wrap; }
.grade-panel-head h2 { font-size:1rem; margin:0; }
.grade-chips { display:flex; flex-wrap:wrap; align-items:center; gap:5px; margin-block:4px; min-width:0; }
.grade-chip { display:inline-flex; gap:5px; align-items:baseline; font-size:11px; line-height:1.55; padding:3px 8px; border-radius:6px; background:#f0f0ee; color:#42413d; border:1px solid #dcdad4; max-width:100%; }
.grade-chip span { font-weight:400; }
.grade-chip b { font-weight:650; }
.grade-type-A,.grade-type-B,.grade-type-C,.grade-type-D { background:#e9edf8; color:#27456b; border-color:#cdd8ea; }
.grade-supplier { background:#eee8f8; color:#513b75; border-color:#d8cde9; }
.grade-buy-A,.grade-trend-A,.grade-credit-A,.grade-credit-B { background:#e5f4eb; color:#175b37; border-color:#bddfc8; }
.grade-buy-B,.grade-trend-B { background:#e9edf8; color:#27456b; border-color:#cdd8ea; }
.grade-buy-C,.grade-trend-C,.grade-credit-C { background:#fff4d8; color:#674907; border-color:#ead6a1; }
.grade-trend-D,.grade-credit-D { background:#fae8e5; color:#8d2620; border-color:#efc9c4; }
.grade-details { display:grid; gap:12px; }
.grade-detail { border:1px solid var(--ln,#dedbd4); padding:12px; border-radius:8px; display:grid; gap:8px; min-width:0; }
.grade-meta { font-size:12px; color:var(--mu,#5e5c57); }
.grade-pending { display:grid; gap:3px; background:#fff4d8; color:#674907; padding:8px 10px; border-radius:6px; }
.grade-pending small { overflow-wrap:anywhere; }
.grade-actions { display:flex; flex-wrap:wrap; gap:6px; }
.grade-history { margin-block:16px 4px; }
.grade-history summary { cursor:pointer; font-weight:600; }
.grade-hist-row { display:grid; gap:4px; padding:9px 0; border-bottom:1px solid var(--ln,#dedbd4); font-size:12px; overflow-wrap:anywhere; }
@media(max-width:600px) { .grade-panel {padding:12px;} .grade-panel .grade-chips {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));} .grade-panel .grade-chip {white-space:normal;} .grade-detail .grade-actions .btn {min-height:44px;} }
.grade-filter { border:1px solid var(--ln,#dedbd4); background:var(--card,#fff); border-radius:8px; padding:9px 12px; }
.grade-filter summary { font-weight:600; cursor:pointer; padding:4px 0; }
.grade-filter-fields { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; margin-block:8px 0; }
.grade-filter-fields .input { min-width:0; width:100%; }
@media(max-width:700px) { .grade-filter-fields {grid-template-columns:repeat(2,minmax(0,1fr));} }

/* Commercial tier: distinct icon, explicit label, subdued surface. No financial values. */
.customer-name-line {display:flex;align-items:center;gap:6px;flex-wrap:wrap;min-width:0}
.customer-name-line .nm {min-width:0;max-width:100%;overflow-wrap:anywhere}
.customer-name-line > span:not(.importance-badge) {min-width:0;overflow-wrap:anywhere}
.importance-badge {display:inline-flex;align-items:center;gap:4px;flex:0 0 auto;vertical-align:middle;border:1px solid;line-height:1.4;border-radius:6px;font-size:11px;font-weight:650;padding:2px 6px;white-space:nowrap;letter-spacing:normal}
.importance-badge svg {width:17px;height:17px;flex:none}
.importance-badge.importance-prominent {font-size:13px;padding:4px 8px;gap:5px}
.importance-badge.importance-prominent svg {width:21px;height:21px}
.importance-a {color:#18566a;background:#e6f4f7;border-color:#aad4dd}
.importance-b {color:#805b09;background:#fff2c9;border-color:#e4c66d}
.importance-c {color:#4d5663;background:#eef0f4;border-color:#cdd3dc}
.importance-d {color:#794b2c;background:#f8e9dc;border-color:#dec0a5}
/* a bad payer has no medal: a red label in its place (owner, 3 Dec 2026) */
.importance-x {color:#8f1d14;background:#fdecea;border-color:#f1b5ad;font-weight:800}
@media(max-width:600px){.importance-badge{font-size:10px;padding:2px 5px}.importance-badge svg{width:15px;height:15px}.importance-badge.importance-prominent{font-size:12px;padding:3px 6px}}

.importance-provisional{border-style:dashed}.importance-badge small{font-size:9px;font-weight:400;opacity:.9}.grade-score{border:1px solid var(--ln,#dedbd4);border-radius:8px;padding:10px;margin-bottom:12px}.grade-score p{margin:5px 0 0}.grade-filter-fields{grid-template-columns:repeat(6,minmax(0,1fr))}@media(max-width:900px){.grade-filter-fields{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:600px){.grade-filter-fields{grid-template-columns:repeat(2,minmax(0,1fr))}}
