/* BETA — pro forma: consistent document action area across create, edit and detail. */
.tev-proforma-toolbar{
  box-sizing:border-box;min-width:0;
  display:flex;flex-direction:column;gap:7px;
  margin-top:9px;padding:9px;
  border:1px solid var(--tev-border,#ddd6cb);
  border-radius:12px;background:#f8f6f5;
}
.tev-pf-toolbar-heading{
  display:flex;align-items:baseline;justify-content:space-between;
  gap:8px;min-width:0;padding:0 2px;
}
.tev-pf-toolbar-heading>span{font-size:10px;line-height:1.3;font-weight:800;letter-spacing:.075em;color:#4a123f}
.tev-pf-toolbar-heading>small{font-size:10px;line-height:1.3;color:#746975;text-align:right}
.tev-pf-action-group{
  display:grid;grid-template-columns:minmax(0,1fr) minmax(0,.56fr) minmax(0,1.4fr);
  align-items:stretch;gap:1px;min-width:0;width:100%;
}
.tev-proforma-toolbar .tev-pf-action-group>.btn{
  box-sizing:border-box;display:inline-flex;justify-content:center;align-items:center;
  min-width:0;min-height:35px;height:auto;padding:7px 5px!important;
  border:1px solid #d9cdd6!important;border-radius:9px!important;
  white-space:normal;text-align:center;line-height:1.2;
  font-size:10px!important;font-weight:700;letter-spacing:0;
  box-shadow:none!important;transform:none!important;cursor:pointer;
  transition:background-color .15s ease,border-color .15s ease!important;
}
.tev-proforma-toolbar .tev-pf-action-group>.tev-pf-action-open{
  color:#fff!important;background:#4a123f!important;border-color:#4a123f!important;
}
.tev-proforma-toolbar .tev-pf-action-group>.tev-pf-action-open:hover{
  color:#fff!important;background:#622653!important;border-color:#622653!important;
}
.tev-proforma-toolbar .tev-pf-action-group>.tev-pf-action-download{
  color:#4a123f!important;background:#fff!important;
}
.tev-proforma-toolbar .tev-pf-action-group>.tev-pf-action-download:hover{
  background:#f0e9ee!important;border-color:#bda6b7!important;
}
.tev-proforma-toolbar .tev-pf-action-group>.tev-pf-action-send{
  color:#4a123f!important;background:#f0e8ee!important;border-color:#dfcdd9!important;
}
.tev-proforma-toolbar .tev-pf-action-group>.tev-pf-action-send:hover{
  background:#e9d9e4!important;border-color:#bda6b7!important;
}
.tev-proforma-toolbar .tev-pf-action-group>.btn:focus-visible{
  outline:2px solid #8e6384!important;outline-offset:2px;
}
/* Detail view: an identifiable, compact group alongside BC/BL/invoice actions. */
.tev-proforma-toolbar-detail{
  flex:0 0 auto;display:inline-flex;flex-direction:row;align-items:center;
  gap:0;width:auto;padding:0 0 0 9px;margin:0 2px 0 0;
  border:0;border-left:1px solid #d9cdd6;border-radius:0;background:transparent;
}
.tev-proforma-toolbar-detail .tev-pf-action-group{
  display:inline-flex;flex-wrap:nowrap;gap:1px;width:auto;
}
.tev-proforma-toolbar-detail .tev-pf-action-group>.btn{
  width:auto;white-space:nowrap;padding:7px 10px!important;min-height:33px;
}
body #app .shell .main .tev-order-actions-all:has(.tev-proforma-toolbar-detail){
  display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-start;
  gap:6px;white-space:normal;min-width:0;margin-left:0;
}
body #app .shell .main .tev-order-actions-main:has(.tev-proforma-toolbar-detail){
  overflow-x:visible;
}
body #app .shell .main .tev-order-composer-actions .btn,
body #app .shell .main .tev-ap-submit{
  border-radius:10px!important;min-height:35px;
}
.tev-proforma-layer{position:fixed;inset:0;z-index:19000;background:rgba(26,18,27,.48);display:grid;place-items:center;padding:15px}
.tev-proforma-dialog{box-sizing:border-box;width:min(1170px,100%);max-height:calc(100dvh - 30px);overflow:auto;background:var(--tev-bg,#f3f0e9);border:1px solid var(--tev-border,#ddd6cb);border-radius:17px;box-shadow:0 24px 64px rgba(22,15,22,.26);padding:14px;color:var(--tev-text,#392932)}
.tev-proforma-head{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--tev-border,#ddd6cb);padding:0 0 10px;margin-bottom:10px}
.tev-proforma-head>div{display:flex;align-items:baseline;gap:12px;min-width:0}
.tev-proforma-head strong{font-size:16px;letter-spacing:.04em;color:#58253c}
.tev-proforma-head small{color:var(--muted,#77736f);font-size:11px}
.tev-pf-close{display:grid;place-items:center;width:30px;height:30px;min-width:30px;border:0;background:transparent;font-size:24px;cursor:pointer;color:#58253c}
.tev-proforma-actions{display:flex;align-items:center;flex-wrap:wrap;gap:4px;padding:0 0 10px}
.tev-proforma-actions .btn{border-radius:10px!important;font-size:11px!important}
.tev-proforma-actions .tev-pf-number{margin-left:auto;font-size:11px;font-weight:600;color:#58253c}
.tev-proforma-main{display:grid;grid-template-columns:minmax(0,1fr) minmax(275px,310px);gap:12px;align-items:stretch}
.tev-proforma-preview{background:#fff;border:1px solid var(--tev-border,#ddd6cb);border-radius:12px;min-height:62vh;overflow:hidden}
.tev-proforma-preview iframe{display:block;border:0;width:100%;height:min(72vh,790px);background:#fff}
.tev-proforma-side{background:#fff;border:1px solid var(--tev-border,#ddd6cb);border-radius:12px;padding:12px;display:flex;flex-direction:column;gap:7px;min-width:0}
.tev-proforma-side h3{margin:0 0 4px;font-size:12px;font-weight:700;letter-spacing:.03em;color:#58253c}
.tev-proforma-side label{display:flex;flex-direction:column;gap:4px;font-size:11px;color:#5e5960}
.tev-proforma-side input,.tev-proforma-side textarea{box-sizing:border-box;width:100%;max-width:100%;min-height:32px;padding:7px 9px;border:1px solid #d8d2d7;border-radius:9px;font:12px/1.4 Inter,Arial,sans-serif;color:#302630;background:#fff;resize:vertical}
.tev-proforma-side textarea{min-height:105px}
.tev-proforma-side input:focus-visible,.tev-proforma-side textarea:focus-visible{outline:2px solid #bda9b5;outline-offset:1px}
.tev-pf-notice{margin:4px 0;font-size:10px;line-height:1.45;color:#777078}
.tev-pf-send{border-radius:10px!important;font-size:11px!important;min-height:34px}
.tev-pf-message{min-height:15px;font-size:11px;line-height:1.4;color:#58253c;margin:0}
.tev-pf-message.error{color:#9a3030}
.tev-pf-history{margin-top:9px;padding-top:9px;border-top:1px solid #e3dde1}
.tev-pf-history h4{font-size:11px;margin:0 0 6px;color:#58253c}
.tev-pf-history-row{display:flex;align-items:center;justify-content:space-between;gap:6px;margin:3px 0;border-bottom:1px solid #f0edf0;padding-bottom:5px;font-size:11px}
.tev-pf-history-row span{min-width:0;overflow:hidden;text-overflow:ellipsis}
.tev-pf-history-row small{display:block;color:#726a73;word-break:break-word;font-size:9px}
.tev-pf-history-row .btn{border-radius:9px!important}
@media(max-width:800px){.tev-proforma-dialog{padding:10px}.tev-proforma-main{grid-template-columns:minmax(0,1fr)}.tev-proforma-preview{min-height:40vh}.tev-proforma-preview iframe{height:45vh}.tev-proforma-head>div{display:block}.tev-proforma-actions .tev-pf-number{margin-left:0;width:100%}.tev-proforma-side textarea{min-height:74px}}

/* BETA — pro forma modal action refinements */
.tev-pf-modal-buttons{display:inline-flex;flex-wrap:wrap;gap:1px;align-items:center}
.tev-pf-modal-buttons .btn{min-height:32px!important;padding:7px 12px!important;font-size:10.5px!important;font-weight:700!important;border-radius:9px!important}
.tev-pf-modal-buttons .tev-pf-download{background:#4a123f!important;color:#fff!important;border-color:#4a123f!important}
.tev-pf-modal-buttons .tev-pf-download:hover{background:#622653!important}
.tev-proforma-actions{gap:8px;border-bottom:1px solid #e6dee4;margin-bottom:10px}
.tev-proforma-actions .tev-pf-number{min-width:0;white-space:normal;text-align:right}
.tev-proforma-side .tev-pf-send{
  width:100%;background:#4a123f!important;border:1px solid #4a123f!important;
  color:#fff!important;font-weight:700!important;border-radius:10px!important;
}
.tev-proforma-side .tev-pf-send:hover{background:#622653!important}
@media(max-width:1100px){
 .tev-proforma-toolbar-create .tev-pf-toolbar-heading>small,
 .tev-proforma-toolbar-edit .tev-pf-toolbar-heading>small{display:none}
}
@media(max-width:700px){
 .tev-proforma-toolbar{padding:8px;margin-top:8px}
 .tev-proforma-toolbar-detail{padding:0;margin:0;border-left:0;max-width:100%}
 .tev-proforma-toolbar-detail .tev-pf-action-group{display:flex;flex-wrap:wrap}
 .tev-proforma-toolbar-detail .tev-pf-action-group>.btn{white-space:normal;min-height:32px}
 .tev-pf-toolbar-heading>small{display:none}
 .tev-pf-modal-buttons{width:100%}
 .tev-pf-modal-buttons>.btn{flex:1}
 .tev-proforma-actions .tev-pf-number{text-align:left}
}
