/* Financials > Invoices (FIN-2, screens/invoices.js). Scope every rule under .screen[data-screen="fin-invoices"] and use --rt-* tokens only. */
/* The drawer (.ui-drawer.inv-drawer) sits on <body>, outside the screen's box; its rules use the inv- class names only
   this screen makes. The Ironworks windows reuse the Loads screen's dialog.ld-window rules (loads.css). */
.screen[data-screen="fin-invoices"] .inv-alert{display:flex;gap:10px;align-items:flex-start;margin-bottom:14px;padding:12px 14px;border:1px solid var(--rt-stop-edge);border-left-width:4px;border-radius:var(--rt-r);background:var(--rt-stop-bg);color:var(--rt-ink)}
.screen[data-screen="fin-invoices"] .inv-alert .ui-icon{flex:none;width:20px;height:20px;color:var(--rt-stop);stroke:currentColor;fill:none;stroke-width:2}
.screen[data-screen="fin-invoices"] .ui-toolbar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-bottom:10px}
.screen[data-screen="fin-invoices"] .ui-search{flex:1 1 300px;max-width:460px}
.screen[data-screen="fin-invoices"] .inv-pick select,.screen[data-screen="fin-invoices"] .inv-dates input{min-height:36px;max-width:240px;padding:4px 8px;border:1px solid var(--rt-line);border-radius:var(--rt-r-sm);background:var(--rt-panel);color:var(--rt-ink);font:inherit}
.screen[data-screen="fin-invoices"] .inv-dates{display:inline-flex;flex-wrap:wrap;gap:8px;align-items:center}
.screen[data-screen="fin-invoices"] .inv-dates label{display:inline-flex;gap:6px;align-items:center;color:var(--rt-muted)}
.screen[data-screen="fin-invoices"] .inv-spacer{flex:1}
.screen[data-screen="fin-invoices"] .inv-group{display:inline-flex;flex-wrap:wrap;gap:8px;align-items:center}
.screen[data-screen="fin-invoices"] .inv-group+.inv-group{margin-left:10px}
.screen[data-screen="fin-invoices"] .inv-label{color:var(--rt-muted);font-size:calc(var(--v2-size,16px)*.8125);font-weight:600}
.screen[data-screen="fin-invoices"] .inv-count{color:var(--rt-ink);font-weight:600;font-size:calc(var(--v2-size,16px)*.875)}
.screen[data-screen="fin-invoices"] .inv-note{margin:4px 0 10px;color:var(--rt-muted)}
.screen[data-screen="fin-invoices"] .inv-table-wrap{overflow-x:auto;background:var(--rt-panel);border:1px solid var(--rt-line);border-radius:var(--rt-r-lg)}
.screen[data-screen="fin-invoices"] .inv-table{width:100%;border-collapse:collapse}
.screen[data-screen="fin-invoices"] .inv-table th{text-align:left;font-size:calc(var(--v2-size,16px)*.78125);font-weight:600;color:var(--rt-muted);padding:8px 12px;border-bottom:1px solid var(--rt-line);white-space:nowrap}
.screen[data-screen="fin-invoices"] .inv-table td{padding:10px 12px;border-bottom:1px solid var(--rt-line-soft);vertical-align:middle}
.screen[data-screen="fin-invoices"] .inv-table tr:last-child td{border-bottom:0}
.screen[data-screen="fin-invoices"] .inv-table .num{text-align:right;white-space:nowrap}
.screen[data-screen="fin-invoices"] .inv-num,.screen[data-screen="fin-invoices"] .inv-load{white-space:nowrap}
.screen[data-screen="fin-invoices"] .inv-sub{display:block;font-size:calc(var(--v2-size,16px)*.78125);color:var(--rt-muted)}
.screen[data-screen="fin-invoices"] .inv-muted{color:var(--rt-muted)}
.screen[data-screen="fin-invoices"] .inv-tag{display:inline-block;margin-left:6px;padding:0 6px;border:1px solid var(--rt-line);border-radius:4px;font-size:calc(var(--v2-size,16px)*.71875);color:var(--rt-muted);white-space:nowrap}
.screen[data-screen="fin-invoices"] .inv-acts{text-align:right;white-space:nowrap}
.screen[data-screen="fin-invoices"] .inv-more{display:flex;gap:12px;align-items:center;justify-content:center;margin:14px 0 4px}
@media (max-width:760px){
 /* A phone: each invoice row becomes a card and every cell says which column it is (data-label in invoices.js), so the
    total, the Sage status and Open stay on screen and the page never scrolls sideways. */
 .screen[data-screen="fin-invoices"] .ui-search{flex:1 1 100%;max-width:none;min-width:0}
 .screen[data-screen="fin-invoices"] .inv-pick{flex:1 1 140px}
 .screen[data-screen="fin-invoices"] .inv-pick select{width:100%;max-width:none}
 .screen[data-screen="fin-invoices"] .inv-table-wrap{overflow:visible;background:none;border:0;border-radius:0}
 .screen[data-screen="fin-invoices"] .inv-table,.screen[data-screen="fin-invoices"] .inv-table tbody,.screen[data-screen="fin-invoices"] .inv-table tr,.screen[data-screen="fin-invoices"] .inv-table td{display:block;width:100%;box-sizing:border-box}
 .screen[data-screen="fin-invoices"] .inv-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
 .screen[data-screen="fin-invoices"] .inv-table tr.inv-row{margin:0 0 10px;padding:4px 0;border:1px solid var(--rt-line);border-radius:var(--rt-r);background:var(--rt-panel)}
 .screen[data-screen="fin-invoices"] .inv-table td{padding:6px 12px;border-bottom:0;overflow-wrap:anywhere}
 .screen[data-screen="fin-invoices"] .inv-table td[data-label]::before{content:attr(data-label);display:block;font-size:calc(var(--v2-size,16px)*.75);font-weight:600;color:var(--rt-muted);margin-bottom:2px}
 .screen[data-screen="fin-invoices"] .inv-table .num{text-align:left;white-space:normal}
 .screen[data-screen="fin-invoices"] .inv-acts{text-align:left}
}
/* The drawer. It sits on <body>, outside #app, so it gets the app's normal letters and weights here (style.css makes
   everything outside #app and dialogs upper case and bold). */
.inv-drawer,.inv-drawer *{text-transform:none;font-weight:400!important}
.inv-drawer :is(h2,h3,b,strong){font-weight:650!important}
.inv-drawer button,.inv-drawer .inv-fact dd{font-weight:600!important}
.inv-drawer .inv-drawer-sub{margin:-8px 0 10px}
.inv-drawer .inv-muted{color:var(--rt-muted)}
.inv-drawer h3{margin:18px 0 6px;font-size:var(--rt-text,1rem)}
.inv-drawer .inv-facts{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:12px 0 12px}
.inv-drawer .inv-fact dt{font-size:calc(var(--v2-size,16px)*.75);color:var(--rt-muted)}
.inv-drawer .inv-fact dd{margin:0;overflow-wrap:anywhere}
.inv-drawer .inv-sage{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:8px 0}
.inv-drawer .inv-paid{margin:8px 0;padding:8px 10px;border:1px solid var(--rt-line);border-radius:var(--rt-r-sm);background:var(--rt-bg)}
.inv-drawer .inv-money{width:100%;border-collapse:collapse}
.inv-drawer .inv-money th{text-align:left;padding:4px 0;color:var(--rt-muted)}
.inv-drawer .inv-money td{padding:4px 0}
.inv-drawer .inv-money .num{text-align:right;white-space:nowrap}
.inv-drawer .inv-money-total th,.inv-drawer .inv-money-total td{border-top:1px solid var(--rt-line);padding-top:8px;color:var(--rt-ink);font-weight:650!important}
/* A statement invoice's loads (drawerHtml): the lines of the one invoice. */
.inv-drawer .inv-statement-lines{width:100%;border-collapse:collapse;margin-top:6px}
.inv-drawer .inv-statement-lines th{text-align:left;padding:4px 8px 4px 0;color:var(--rt-muted);font-size:calc(var(--v2-size,16px)*.75)}
.inv-drawer .inv-statement-lines td{padding:6px 8px 6px 0;border-top:1px solid var(--rt-line-soft,var(--rt-line));vertical-align:top}
.inv-drawer .inv-statement-lines .num{text-align:right;white-space:nowrap}
.inv-drawer .inv-statement-lines .inv-sub{display:block;color:var(--rt-muted)}
.inv-drawer .inv-statement-lines td:last-child{padding-right:0;text-align:right}
.inv-drawer .inv-bol img{display:block;max-width:100%;max-height:360px;border:1px solid var(--rt-line);border-radius:var(--rt-r-sm)}
.inv-drawer .inv-drawer-acts{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 6px}
@media (max-width:520px){.inv-drawer .inv-facts{grid-template-columns:1fr}}
