/* Shared commercial UI: compact actions, clear hierarchy, USD reporting. */
#app :is(.dossier-file-actions,.application-actions){display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:flex-start;width:auto}
#app :is(.dossier-file-actions,.application-actions)>.btn{flex:0 1 auto;width:auto;min-height:38px;padding:8px 13px;line-height:1.35;font-size:12px;border-radius:9px;white-space:normal;box-shadow:0 2px 6px #163b6310}
#app .dossier-file-actions>.btn:only-child{grid-column:auto}
#app .application-actions>.badge{width:auto;flex:0 0 auto}
#app .dossier-file{grid-template-columns:minmax(0,1fr) auto;gap:20px;padding:18px 0}
#app .dossier-file .dossier-file-actions{max-width:310px;justify-content:flex-end}
#app .dossier-file-actions .btn svg{width:16px;height:16px;flex-basis:16px}
#app .dossier-group{padding:20px 22px;border-radius:16px}
#app .dossier-group>.section-head{gap:14px;margin-bottom:12px;align-items:center}
#app .dossier-group>.section-head>.btn{min-height:38px;padding:8px 13px;max-width:none;width:auto;justify-self:end;font-size:12px;border-radius:9px}
#app .dossier-group h3 .badge{display:inline-flex;margin:0 0 0 8px;font-size:10px}
#app .dossier-group h3{font-size:15px}
#app .application-panel{padding:22px;border-radius:16px}
#app .application-actions{margin-top:18px;padding-top:14px}
#app .dossier-customers>.card{padding:22px;border-radius:16px}
#app .dossier-customers .dossier-file-actions{margin-top:16px;padding-top:14px}
#app .credit-overview{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1px;border:1px solid var(--line,#dce6ee);border-radius:18px;overflow:hidden;margin:0 0 24px;background:var(--line,#dce6ee)}
#app .credit-overview>div{background:var(--white,#fff);padding:21px 24px;display:grid;gap:7px}
#app .credit-overview span{font-size:10px;letter-spacing:.09em;font-weight:650;color:var(--muted,#728297)}
#app .credit-overview strong{font-size:28px;line-height:1.2;letter-spacing:-.04em;color:var(--ink,#19344f)}
#app .credit-overview small{font-size:12px;color:var(--muted,#728297)}
#app .credit-overview .credit-currency-note{background:linear-gradient(120deg,#edf7f9,#f6fafc)}
#app .credit-client-list{display:grid;gap:22px}
#app .credit-client-card{padding:0;overflow:hidden;border-radius:18px;box-shadow:0 4px 20px #1f496507}
#app .credit-client-heading{padding:20px 24px;border-bottom:1px solid var(--line,#e1e9f0);display:flex;align-items:center;justify-content:space-between;gap:16px;background:var(--white,#fff)}
.credit-client-identity{display:flex;gap:13px;align-items:center;min-width:0}
.credit-client-avatar{display:grid;place-items:center;background:#eaf3fa;color:#26699d;font-size:20px;font-weight:750;border:1px solid #dce8f3;border-radius:13px;width:46px;height:46px;flex:none}
#app .credit-client-heading small{display:block;font-size:10px;letter-spacing:.09em;color:var(--muted,#718296);margin-bottom:5px}
#app .credit-client-heading h2{font-size:18px;line-height:1.4;margin:0;overflow-wrap:anywhere}
#app .credit-client-body{display:grid;grid-template-columns:minmax(0,1fr) minmax(245px,.38fr)}
#app .credit-client-main{padding:24px;min-width:0}
#app .credit-client-main>.credit-workflow{margin:0;padding:0;border:0;box-shadow:none;background:transparent;border-radius:0}
#app .credit-client-main>.credit-workflow h2{font-size:18px;margin:8px 0 12px}
#app .credit-client-resources{padding:26px 22px;background:var(--surface-alt,#f8fafc);border-left:1px solid var(--line,#e1e9f0);min-width:0}
#app .credit-client-resources>p{font-size:12px;color:var(--muted,#728297);line-height:1.7;margin:12px 0 20px}
.credit-resource-actions{display:flex;flex-direction:column;align-items:flex-start;gap:10px;margin-top:18px}
#app .credit-client-list .btn{width:auto;min-height:38px;padding:9px 13px;font-size:12px;line-height:1.4;border-radius:9px;box-shadow:0 2px 7px #163b6310;white-space:normal}
#app .credit-client-list .credit-actions{gap:8px;margin-top:16px}
#app .credit-client-list .credit-documents{margin-top:20px;gap:12px}
#app .credit-client-list .credit-document{padding:17px;border-radius:13px}
#app .credit-client-list .credit-document h3{font-size:14px;line-height:1.5;margin-bottom:6px}
#app .credit-client-list .credit-document .section-sub{font-size:12px;line-height:1.7}
#app .credit-client-list .credit-doc-icon{width:34px;height:38px;flex-basis:34px;border-radius:10px}
#app .credit-process{display:flex;flex-wrap:wrap;gap:8px;list-style:none;counter-reset:stage;padding:0;margin:16px 0 18px}
#app .credit-process li{counter-increment:stage;display:flex;align-items:center;gap:7px;color:var(--muted,#657d91);font-size:11px;font-weight:550}
#app .credit-process li:before{content:counter(stage);display:grid;place-items:center;width:23px;height:23px;border:1px solid #d3e3ee;background:var(--white,#f7fbfd);border-radius:50%;color:#2c719a;font-size:10px}
#app .credit-process li+li:before{margin-left:5px}
/* Wide history and case dialogs; short buttons never stretch to a form row's height. */
#modalRoot .modal:has(:is(#creditApplicantHistoryPanel,.credit-case-panel,.quote-dossier-top)){width:min(1120px,calc(100vw - 48px));max-width:1120px;padding:28px;max-height:calc(100dvh - 48px);border-radius:20px;box-sizing:border-box}
#modalRoot .modal:has(#creditApplicantHistoryPanel)>h2{font-size:21px;margin:0 0 18px}
#modalRoot #creditApplicantHistoryPanel .credit-history-toolbar{display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap;padding:16px;margin:18px 0;background:var(--surface-alt,#f7fafc);border:1px solid var(--line,#e0e8ef);border-radius:13px}
#modalRoot .credit-history-toolbar .field{flex:1 1 320px;margin:0;min-width:0}
#modalRoot .credit-history-toolbar label{font-size:12px;line-height:1.6;margin-bottom:7px;display:block}
#modalRoot .credit-history-toolbar input{width:100%;min-height:40px;box-sizing:border-box;font-size:14px}
#modalRoot #creditApplicantHistoryPanel .btn{width:auto;min-height:38px;height:auto;align-self:auto;flex:0 0 auto;padding:9px 14px;font-size:12px;line-height:1.3;border-radius:9px;white-space:normal}
#modalRoot .credit-history-table{min-width:0;width:100%;table-layout:fixed}
#modalRoot .credit-history-table :is(th,td){white-space:normal;overflow-wrap:anywhere;padding:14px 12px;line-height:1.6;vertical-align:top}
#modalRoot .credit-history-table th:nth-child(1){width:26%}
#modalRoot .credit-history-table th:nth-child(2){width:24%}
#modalRoot .credit-history-table th:nth-child(3){width:17%}
#modalRoot .credit-history-table th:nth-child(4){width:23%}
#modalRoot .credit-history-table th:nth-child(5){width:10%}
#modalRoot .credit-history-table small{display:block;color:var(--muted,#6d8095);margin-top:3px}
#modalRoot .credit-history-pagination{display:flex;flex-wrap:wrap;gap:12px;align-items:center;justify-content:flex-end;margin-top:16px}
#modalRoot .credit-case-panel{padding:0}
#modalRoot .credit-case-panel>.case-documents,#modalRoot .credit-case-panel>.case-decision{margin-top:20px;border-radius:14px}
#modalRoot .credit-case-panel .btn{min-height:40px;line-height:1.5;padding:9px 14px;font-size:13px;width:auto}
#modalRoot .credit-case-panel .field{margin:14px 0}
#modalRoot .credit-case-panel input:not([type=checkbox]),#modalRoot .credit-case-panel select{min-height:44px;padding:10px 12px;box-sizing:border-box}
/* Quote builder */
#app .quote-workspace{display:grid;gap:20px}
#app .quote-workspace-overview{display:flex;align-items:center;gap:34px;flex-wrap:wrap;padding:20px 24px;background:linear-gradient(115deg,#edf5fc,#f5fafb);border:1px solid #dbe7ef;border-radius:17px}
#app .quote-workspace-overview>div{display:grid;gap:8px}
#app .quote-workspace-overview small{font-size:9px;letter-spacing:.1em;font-weight:650;color:#607b91}
#app .quote-workspace-overview strong{font-size:23px;color:#1b425f;letter-spacing:-.025em}
#app .quote-workspace-overview strong span{font-size:12px;letter-spacing:0;font-weight:500;color:#738a9a}
.quote-draft-label{margin-left:auto;border-radius:30px;border:1px solid #c5dbe6;background:#ffffffa6;padding:7px 12px;font-size:11px;color:#3d6a84}
#app .quote-workspace .container-tabs{display:flex;gap:9px;flex-wrap:wrap;margin:0;padding:0}
#app .quote-workspace .container-tabs>button{width:auto;display:flex;align-items:center;gap:12px;min-height:42px;padding:10px 14px;border-radius:10px;font-size:12px;line-height:1.3;background:var(--white,#fff);color:var(--ink,#27465e);border:1px solid var(--line,#d7e4ed);box-shadow:none}
#app .quote-workspace .container-tabs>button.active{color:#176b8a;background:#eaf6fa;border-color:#8fc1d2;box-shadow:inset 0 -2px #2786a3}
#app .quote-workspace .container-tabs small{font-size:10px;opacity:.8}
#app .quote-builder-layout{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:20px;align-items:start}
#app .quote-builder-aside{display:grid;gap:15px;min-width:0}
#app .quote-workspace .card{border-radius:17px;padding:23px;box-shadow:0 4px 18px #163b6305}
#app .quote-workspace h2{font-size:17px;margin:7px 0}
#app .quote-workspace .quote-muted{font-size:13px;font-weight:500;color:#7d92a2}
#app .quote-workspace .section-head{margin-bottom:16px;gap:14px;align-items:center;flex-wrap:wrap}
#app .quote-workspace .progress{height:6px;border-radius:20px;margin:0;background:#edf3f8}
#app .quote-workspace .progress i{background:linear-gradient(90deg,#3488af,#2caaa0);border-radius:20px}
.quote-capacity-note{font-size:11px;color:var(--muted,#7b8c9f);margin:12px 0 5px;line-height:1.7}
#app .quote-empty{display:flex;align-items:center;flex-direction:column;justify-content:center;text-align:center;padding:38px 14px 25px;min-height:225px;box-sizing:border-box}
.quote-empty-icon{display:grid;place-items:center;width:56px;height:56px;background:#eef6fa;color:#398ca8;border:1px solid #d8eaf0;border-radius:17px;margin-bottom:18px}
.quote-empty-icon svg{width:26px;height:26px}
#app .quote-empty h3{font-size:17px;margin:0 0 9px;letter-spacing:-.025em}
#app .quote-empty p{font-size:12px;max-width:320px;line-height:1.8;color:var(--muted,#72869b);margin:0 0 20px}
#app .quote-workspace .btn{width:auto;min-height:38px;padding:9px 14px;font-size:12px;line-height:1.4;border-radius:9px;box-shadow:0 2px 7px #163b6310}
#app .quote-workspace .quote-submit{width:100%;min-height:44px;white-space:normal}
#app .quote-workspace .quote-lines{width:100%;min-width:620px;margin-top:24px}
#app .quote-lines :is(th,td){padding:13px 10px;font-size:12px}
#app .quote-lines td:first-child{min-width:150px;white-space:normal}
#app .quote-lines td small{display:block;font-size:10px;color:var(--muted,#7b8c9f);margin-top:6px}
#app .quote-lines .cart-qty{width:62px;min-height:36px;border-radius:8px;padding:8px;font-size:13px;box-sizing:border-box}
#app .quote-lines .quote-remove{padding:4px;min-height:32px;width:32px;font-size:20px}
.quote-summary-facts{margin:22px 0 0;display:grid;gap:14px}
.quote-summary-facts>div{display:flex;justify-content:space-between;gap:10px;font-size:12px}
.quote-summary-facts dt{color:var(--muted,#72869b)}
.quote-summary-facts dd{margin:0;font-weight:650}
#app .quote-summary-card .quote-total{padding:20px 0;margin:22px 0 0;border-top:1px solid var(--line,#dce6ee);background:none}
#app .quote-summary-card .quote-total small{font-size:12px;color:var(--muted,#72869b)}
#app .quote-summary-card .quote-total strong{display:block;font-size:28px;letter-spacing:-.04em;color:#226f88;margin:9px 0}
#app .quote-summary-card .quote-total>span{font-size:10px;color:var(--muted,#72869b)}
.quote-summary-note{font-size:11px;color:var(--muted,#72869b);line-height:1.8;margin:14px 0 0}
.quote-guidelines{border:1px solid var(--line,#dce6ee);padding:16px 18px;border-radius:14px;background:var(--white,#fff);font-size:12px;line-height:1.8}
.quote-guidelines summary{cursor:pointer;font-weight:650;color:var(--ink,#27465e)}
.quote-guidelines .notice{margin:14px 0;padding:12px;font-size:11px}
.quote-guidelines p{font-size:11px;color:var(--muted,#72869b)}
#app .accounting-layout{grid-template-columns:minmax(0,1fr) minmax(290px,.48fr);gap:20px}
#app .accounting-metrics{gap:14px}
#app .accounting-metrics .stat{padding:20px;border-radius:15px}
#app .accounting-layout>.card{padding:24px;border-radius:17px}
#app .accounting-layout .field input,#app .accounting-layout .field select{min-height:42px;box-sizing:border-box}
#app .quote-flow-filters{gap:12px;margin-bottom:22px}
#app .quote-flow-card{padding:22px;border-radius:17px;gap:12px}
#app .quote-flow-card .quote-flow-amount{font-size:25px;color:#236f91}
#app .quote-flow-card>.btn{align-self:flex-start;min-height:38px;padding:9px 14px;font-size:12px;border-radius:9px}
html[data-theme=dark] #app :is(.credit-overview>div,.credit-client-heading,.credit-client-resources,.quote-workspace-overview){background:#152c40;border-color:#354c60}
html[data-theme=dark] #app :is(.credit-overview strong,.quote-workspace-overview strong,.quote-summary-card .quote-total strong,.quote-empty h3){color:#d1e6f3}
html[data-theme=dark] :is(.quote-draft-label,.credit-client-avatar,.quote-empty-icon){background:#203f53;color:#a6d1e4;border-color:#36566b}
html[data-theme=dark] #app .quote-workspace .container-tabs>button.active{background:#1b4053;color:#b4e1ed;border-color:#40778b}
@media(min-width:1100px){#app .quote-summary-card{position:sticky;top:90px}}
@media(max-width:1050px){#app .credit-client-body{grid-template-columns:minmax(0,1fr)}#app .credit-client-resources{border-left:0;border-top:1px solid var(--line,#e1e9f0)}.credit-resource-actions{flex-direction:row;flex-wrap:wrap}#app .quote-builder-layout{grid-template-columns:minmax(0,1fr) 290px}#app .dossier-file{grid-template-columns:minmax(0,1fr)}#app .dossier-file .dossier-file-actions{max-width:none;justify-content:flex-start}}
@media(max-width:800px){#app .quote-builder-layout,#app .accounting-layout{grid-template-columns:1fr}#app .credit-overview{grid-template-columns:repeat(2,minmax(0,1fr))}#app .quote-workspace-overview{gap:22px}.quote-draft-label{margin-left:0}#modalRoot .modal:has(:is(#creditApplicantHistoryPanel,.credit-case-panel,.quote-dossier-top)){width:calc(100vw - 24px);max-height:calc(100dvh - 24px);padding:22px 18px}#modalRoot .credit-history-table{table-layout:auto}#modalRoot .credit-history-table thead{display:none}#modalRoot .credit-history-table tbody{display:grid;gap:14px}#modalRoot .credit-history-table tr{display:grid;border:1px solid var(--line,#dde7ef);border-radius:13px;padding:8px 14px}#modalRoot .credit-history-table td{display:grid;gap:5px;padding:10px 0;border:0;min-width:0}#modalRoot .credit-history-table td:before{content:attr(data-label);font-size:9px;font-weight:700;letter-spacing:.08em;color:var(--muted,#718599);text-transform:uppercase}#modalRoot .credit-history-table td .btn{justify-self:start}#modalRoot #creditApplicantHistoryPanel .tablewrap{border:0;overflow:visible}#modalRoot .credit-history-toolbar .field{flex-basis:100%}}
@media(max-width:600px){#app .dossier-group>.section-head{grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:10px}#app .dossier-group>.section-head>.btn{min-height:42px;font-size:11px;padding:8px 10px;max-width:120px}#app .dossier-group h3 .badge{display:table;margin:8px 0 0}#app .dossier-group{padding:18px 16px}#app :is(.dossier-file-actions,.application-actions)>.btn{min-height:42px;flex:0 1 auto;padding:10px 12px}#app .credit-client-heading{padding:18px 16px;align-items:flex-start;flex-wrap:wrap}#app .credit-client-heading h2{font-size:16px}#app .credit-client-main{padding:20px 16px}#app .credit-client-resources{padding:20px 16px}#app .credit-overview>div{padding:18px 16px}#app .credit-overview strong{font-size:24px}#app .credit-process{gap:10px 7px}#app .credit-client-list .btn{min-height:42px}#app .quote-workspace-overview{padding:18px;gap:20px;display:grid;grid-template-columns:1fr 1fr}#app .quote-workspace-overview>div:nth-child(3){grid-column:1 / -1}#app .quote-workspace-overview strong{font-size:22px}.quote-draft-label{justify-self:start;font-size:10px;grid-column:1 / -1}#app .quote-workspace .container-tabs{flex-wrap:nowrap;overflow-x:auto;max-width:100%;padding-bottom:5px}#app .quote-workspace .container-tabs>button{flex:none;min-height:44px}#app .quote-workspace .card{padding:20px 16px}#app .quote-empty{padding:30px 10px 20px}#app .quote-workspace .btn{min-height:42px}#app .quote-empty h3{font-size:16px}#modalRoot #creditApplicantHistoryPanel .credit-history-toolbar{padding:12px;gap:10px}#modalRoot #creditApplicantHistoryPanel .btn{min-height:42px}#modalRoot .credit-history-pagination{justify-content:center}#app .quote-flow-card>.btn{min-height:42px}#app .quote-flow-summary{gap:10px}#app .quote-flow-summary div{padding:14px 10px;border-radius:12px}#app .quote-flow-summary strong{font-size:23px}}
@media(prefers-reduced-motion:reduce){.quote-workspace *{scroll-behavior:auto}}
#app .dossier-management-toolbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:14px;margin:24px 0 0;padding:17px 20px;border:1px solid var(--line,#dce6ee);border-radius:13px;background:var(--surface-alt,#f8fafc)}
#app .dossier-management-toolbar>span{font-size:13px;font-weight:650;color:var(--ink,#29485f)}
#app .dossier-management-toolbar .btn{min-height:38px;padding:9px 13px;font-size:12px;border-radius:9px;box-shadow:none}
#app .credit-workflow .btn{width:auto;min-height:38px;padding:9px 13px;font-size:12px;line-height:1.45;border-radius:9px;white-space:normal;box-shadow:0 2px 7px #163b6310}
#app .credit-workflow .credit-document h3{font-size:15px;line-height:1.55}
#app .import-cost-panel{margin-top:22px;border-radius:17px;padding:24px}
#app .import-cost-panel .manual-cost-container{border-radius:13px;margin-top:18px;padding:18px;border:1px solid var(--line,#dce6ee)}
#app .import-cost-panel .manual-cost-container>.row{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
#app .import-cost-panel .field input{min-height:42px;font-size:14px;padding:10px 12px;box-sizing:border-box}
#app .import-cost-panel h2{font-size:17px}
@media(max-width:600px){#app .credit-workflow .btn,#app .dossier-management-toolbar .btn{min-height:42px}#app .dossier-management-toolbar{padding:16px}#app .import-cost-panel{padding:20px 16px}#app .import-cost-panel .manual-cost-container>.row{grid-template-columns:1fr}}

/* Support files occupy their own rows inside the narrow credit resource column. */
#app .credit-supporting-files{min-width:0;width:100%;margin:18px 0;box-sizing:border-box}
#app .credit-supporting-files>summary{cursor:pointer;font-size:12px;font-weight:600;line-height:1.6;color:var(--text,#27465e);overflow-wrap:normal;word-break:normal;padding:0 0 10px}
#app .credit-support-count{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 5px;margin-left:4px;border-radius:6px;background:var(--white,#fff);border:1px solid var(--line,#dbe6ec);font-size:10px}
#app .credit-support-list{display:grid;gap:12px;min-width:0}
#app .credit-supporting-files .credit-support-file{display:grid;grid-template-columns:minmax(0,1fr);align-items:start;gap:12px;min-width:0;width:100%;padding:14px;background:var(--card,#fff);border:1px solid var(--line,#dce7ef);border-radius:11px;box-sizing:border-box}
#app .credit-support-file .dossier-file-info{width:100%;min-width:0;max-width:100%}
#app .credit-support-file-heading{display:grid;grid-template-columns:26px minmax(0,1fr);gap:9px;align-items:start;margin-bottom:10px;min-width:0}
#app .credit-support-file-heading>span{display:grid;place-items:center;width:26px;height:30px;background:#edf5f9;color:#387e9d;border-radius:6px}
#app .credit-support-file-heading svg{width:16px;height:16px}
#app .credit-support-file-heading strong{display:block;width:100%;min-width:0;margin:0;font-size:12px;line-height:1.6;overflow-wrap:anywhere;word-break:normal;white-space:normal}
#app .credit-support-file .badge{display:table;max-width:100%;margin:0;font-size:10px;white-space:normal;line-height:1.5}
#app .credit-supporting-files .credit-support-file .dossier-file-actions{display:flex;flex-wrap:wrap;justify-content:flex-start;gap:7px;width:100%;max-width:100%;min-width:0;padding-top:11px;border-top:1px solid var(--line,#e3ebf0)}
#app .credit-support-file .dossier-file-actions>.btn{flex:0 1 auto;max-width:100%;min-width:0;min-height:34px;padding:7px 10px;line-height:1.4;font-size:11px;border-radius:7px;white-space:normal}
#app .credit-support-file :is(p,small,.dossier-review-note){overflow-wrap:anywhere;max-width:100%;min-width:0}
html[data-theme=dark] #app .credit-support-file{background:#142b3e;border-color:#354c60}
html[data-theme=dark] #app .credit-support-file-heading>span{background:#203e52;color:#a5cddd}
@media(max-width:600px){#app .credit-support-file .dossier-file-actions>.btn{min-height:40px;font-size:12px}#app .credit-supporting-files .credit-support-file{padding:14px}}
