/* Approved B: one invoice per row; horizontal scroll retains legible type. */
.cmzb-view { max-width:1080px;margin-inline:auto;padding:18px!important; }
.cmzb-view h2,.cmzb-view h3 { margin:8px 0 14px;line-height:1.3; }
.cmzb-heading { display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:16px; }
.cmzb-heading h2,.cmzb-heading h3 { margin:0; }
.cmzb-button { display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;text-decoration:none;min-height:44px;border:1px solid var(--border,#384460);border-radius:10px;background:var(--card,#202a43);color:var(--text,#eef0f7);padding:10px 16px;font:inherit;font-weight:650;cursor:pointer; }
.cmzb-button:hover,.cmzb-button:focus-visible { border-color:#f5da65;outline:2px solid #f5da65;outline-offset:2px; }
.cmzb-button:disabled { opacity:.55;cursor:wait; }
.cmzb-primary { background:#8ecf9a;color:#132f20;border-color:transparent; }
.cmzb-muted,.cmzb-hint { color:var(--text-secondary,#b8c1d5);font-size:.9rem;line-height:1.5; }
.cmzb-stats { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:16px 0 24px; }
.cmzb-stat { display:flex;flex-direction:column;gap:7px;border:1px solid var(--border,#384460);border-radius:10px;padding:14px;min-width:0; }
.cmzb-stat span { font-size:.9rem;line-height:1.35; }
.cmzb-stat strong { font-size:1.2rem;font-variant-numeric:tabular-nums; }
.cmzb-danger,.cmzb-overdue { color:#f7ad97; }
.cmzb-stat.cmzb-danger { border-color:#89635c;background:#ec8d7910; }
.cmzb-good { color:#9cdaaa; }
.cmzb-status { display:inline-block;margin-top:16px;padding:6px 10px;border-radius:6px;background:#ffffff0b;font-weight:700; }
.cmzb-table-wrap { max-width:100%;overflow:auto;border:1px solid var(--border,#384460);border-radius:12px;overscroll-behavior-x:contain; }
.cmzb-table { border-collapse:separate;border-spacing:0;width:100%;min-width:850px;font-size:14px;font-variant-numeric:tabular-nums; }
.cmzb-table td,.cmzb-table th { padding:15px 12px;text-align:right;border-right:1px solid var(--border,#384460);border-bottom:1px solid var(--border,#384460);white-space:nowrap; }
.cmzb-table th { font-size:13px;color:var(--text-secondary,#b8c1d5);font-weight:650; }
.cmzb-table td:first-child,.cmzb-table th:first-child { text-align:left;position:sticky;left:0;z-index:1;background:var(--card,#1a243d);min-width:215px;box-shadow:2px 0 2px #0002; }
.cmzb-table tfoot td,.cmzb-table tfoot th { font-weight:750;background:var(--card,#1a243d); }
.cmzb-invoice-link,.cmzb-sort { padding:4px 0;min-height:36px;background:none;color:inherit;border:0;font:inherit;font-weight:650;cursor:pointer;text-align:inherit; }
.cmzb-invoice-link:focus-visible,.cmzb-sort:focus-visible { outline:2px solid #f5da65;outline-offset:3px; }
.cmzb-table tbody tr { cursor:pointer; }
.cmzb-table tbody tr:hover td { background:var(--bg,#26334e); }
.cmzb-rest { font-weight:750; }
.cmzb-balance { border-top:1px solid var(--border,#384460);padding-top:18px;margin-bottom:8px; }
.cmzb-balance .cmzb-stat { border:0;padding:0; }
.cmzb-balance .cmzb-stat:last-child:nth-child(3) { grid-column:1/-1;margin-top:10px; }
.cmzb-actions { display:flex;gap:10px;flex-wrap:wrap;margin-top:22px; }
.cmzb-actions button { flex:1; }
.cmzb-invoice-totals { display:grid;gap:12px;margin:20px 0; }
.cmzb-discount { background:#8ecf9a10;border-color:#8ecf9a66; }
.cmzb-discount strong { color:#9cdaaa; }
.cmzb-products { min-width:740px; }
.cmzb-products td:first-child { white-space:normal;min-width:185px;max-width:260px;line-height:1.5; }
.cmzb-view label { display:block;margin:20px 0 10px;font-weight:650; }
.cmzb-view textarea { box-sizing:border-box;width:100%;min-height:125px;background:var(--card,#202a43);color:var(--text,#eef0f7);border:1px solid var(--border,#384460);border-radius:10px;padding:14px;font:inherit;resize:vertical;margin-bottom:12px; }
.cmzb-view [role=alert] { margin-bottom:12px; }
.cmz-card .cmzb-button { width:100%;margin-top:12px; }
[hidden].cmzb-view { display:none!important; }
@media(max-width:480px) {
  .cmzb-view { padding:12px!important; }
  .cmzb-heading h2 { font-size:1.1rem; }
  .cmzb-table td,.cmzb-table th { padding:12px 10px; }
  .cmzb-table td:first-child,.cmzb-table th:first-child { min-width:195px; }
  .cmzb-stats { gap:8px; }
  .cmzb-stat { padding:10px; }
  .cmzb-stat strong { font-size:1.05rem; }
  .cmzb-actions { flex-direction:column; }
}

/* Client details use the available app viewport; only invoices scroll. */
.sidebar:has(#panel-comenzi.active .cmzb-client-page:not([hidden])) { padding-bottom:0;overflow:hidden; }
#panel-comenzi:has(.cmzb-client-page:not([hidden])) { height:100%;padding:6px!important; }
#comenziContent:has(.cmzb-client-page:not([hidden])) { height:100%;min-height:0; }
.cmzb-client-page:not([hidden]) ~ .cmz-selector { display:none; }
#panel-comenzi .cmzb-client-page { display:flex;flex-direction:column;gap:4px;height:100%;min-height:0;margin-bottom:0;padding:6px!important; }
.cmzb-client-page > * { flex-shrink:0; }
.cmzb-client-page .cmzb-heading { gap:8px;margin:0; }
#panel-comenzi .cmzb-client-page h2 { font-size:16px;line-height:1.2;margin:0; }
.cmzb-client-page .cmzb-identity h3 { font-size:16px;line-height:1.25;margin:0 0 3px;overflow-wrap:anywhere; }
.cmzb-client-page .cmzb-muted,.cmzb-client-page .cmzb-hint { font-size:13px;line-height:1.3; }
.cmzb-client-page .cmzb-status { margin:0;padding:3px 8px;font-size:14px;line-height:1.25; }
.cmzb-client-page .cmzb-stats { gap:6px;margin:0; }
.cmzb-client-page .cmzb-reasons:empty { display:none; }
.cmzb-client-page .cmzb-reasons .cmzb-stat { flex-direction:row;flex-wrap:wrap;align-items:baseline;gap:2px 6px;padding:4px 6px; }
.cmzb-client-page .cmzb-stat { padding:6px 8px;gap:2px;border-radius:7px; }
.cmzb-client-page .cmzb-stat span { font-size:13px;line-height:1.2; }
.cmzb-client-page .cmzb-stat strong { font-size:16px;line-height:1.25; }
.cmzb-client-page .cmzb-invoices-heading h3 { margin:0;font-size:15px;line-height:1.3; }
.cmzb-client-page .cmzb-table-wrap { flex:1 1 0;min-height:0;overscroll-behavior:contain;scroll-padding:44px 0 30px; }
.cmzb-client-page .cmzb-table { min-width:780px; }
#panel-comenzi .cmzb-client-page .cmzb-table td,#panel-comenzi .cmzb-client-page .cmzb-table th { padding:0 8px; }
#panel-comenzi .cmzb-client-page .cmzb-table td:first-child,#panel-comenzi .cmzb-client-page .cmzb-table th:first-child { min-width:190px; }
.cmzb-client-page .cmzb-table thead th { position:sticky;top:0;z-index:2;background:var(--card,#1a243d);box-shadow:0 1px 0 var(--border,#384460); }
.cmzb-client-page .cmzb-table thead th:first-child { z-index:3; }
.cmzb-client-page .cmzb-table tfoot td,.cmzb-client-page .cmzb-table tfoot th { position:sticky;bottom:0;z-index:2;height:30px;box-shadow:0 -1px 0 var(--border,#384460); }
.cmzb-client-page .cmzb-table tfoot th:first-child { z-index:3; }
#panel-comenzi .cmzb-client-page .cmzb-invoice-link,#panel-comenzi .cmzb-client-page .cmzb-sort { min-height:44px!important;padding:4px 0!important;font-size:14px!important;line-height:1.2; }
.cmzb-client-page .cmzb-balance { padding-top:6px;grid-template-columns:repeat(2,minmax(0,1fr)); }
.cmzb-client-page .cmzb-balance .cmzb-stat { padding:0; }
.cmzb-client-page .cmzb-balance .cmzb-stat:last-child:nth-child(3) { display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:8px;margin-top:0; }
.cmzb-client-page .cmzb-footnote { margin:0;font-size:13px;line-height:1.25; }
.cmzb-client-page .cmzb-actions { flex-direction:row;flex-wrap:nowrap;align-items:center;gap:6px;margin:0; }
.cmzb-client-page .cmzb-actions:empty { display:none; }
#panel-comenzi .cmzb-client-page .cmzb-button { min-height:44px;padding:6px 10px;font-size:15px!important;line-height:1.2; }
.cmzb-client-page .cmzb-actions p { margin:0; }
