/* EGNIN application chrome only. Never restyle or print branded documents. */
@media screen {
  html.refined-ui body.egnin-ui { --eg-space:16px; --eg-radius:12px; }
  html.refined-ui body.egnin-ui .content :is(.page-head,.card-heading) { align-items:center; gap:16px; flex-wrap:wrap; }
  html.refined-ui body.egnin-ui .content .page-head h1 { line-height:1.2!important; letter-spacing:-.035em!important; }
  html.refined-ui body.egnin-ui .content :is(.panel-card,.card,.fin-panel):not(.proforma *) {
    border:1px solid var(--ref-border)!important; border-radius:var(--eg-radius)!important;
    background:var(--ref-card)!important; color:var(--ref-text); box-shadow:none!important;
    margin-bottom:16px; padding:20px;
  }
  html.refined-ui body.egnin-ui .content :is(.panel-card,.card,.fin-panel)>h2 { margin:0 0 16px; font-size:17px; line-height:1.4; }
  html.refined-ui body.egnin-ui .content :is(.grid,.grid3,.grid4,.sales-filters,.fin-filters) { gap:16px; }
  html.refined-ui body.egnin-ui .content :is(.sales-filters,.fin-filters,.filters-card form) { align-items:end; }
  html.refined-ui body.egnin-ui .content :is(.grid,.grid3,.grid4,.sales-filters,.fin-filters)>* { min-width:0; }
  html.refined-ui body.egnin-ui .content :is(input,select,textarea):not(.proforma *) { max-width:100%; }
  html.refined-ui body.egnin-ui .content input[type=file] { padding:10px; border:1px solid var(--ref-border); background:var(--ref-card); color:var(--ref-text); border-radius:10px; }
  html.refined-ui body.egnin-ui .content input[type=file]::file-selector-button { border:1px solid var(--ref-border); border-radius:6px; padding:6px 10px; margin-right:10px; color:var(--ref-text); background:var(--ref-soft); font:inherit; }
  html.refined-ui body.egnin-ui .content :is(input[type=checkbox],input[type=radio]) { accent-color:var(--ref-accent); flex:0 0 auto; width:18px; height:18px; }
  html.refined-ui body.egnin-ui .content :is(.checkline,.permission-grid label) { display:flex; align-items:flex-start; gap:10px; line-height:1.6!important; }
  html.refined-ui body.egnin-ui .content :is(input,select,textarea,button):disabled { opacity:.6; cursor:not-allowed; }
  html.refined-ui body.egnin-ui .content input[readonly] { background-color:var(--ref-soft)!important; }
  html.refined-ui body.egnin-ui .content :is(.field-help,.muted) { color:var(--ref-muted); line-height:1.6; }
  html.refined-ui body.egnin-ui :is(.sales-tabs,.fin-tabs) { display:flex; flex-wrap:wrap; gap:8px; margin:16px 0; }
  html.refined-ui body.egnin-ui :is(.sales-tabs,.fin-tabs)>a { display:inline-flex; align-items:center; justify-content:center; min-height:44px; padding:10px 16px; border:1px solid var(--ref-border); border-radius:10px; background:var(--ref-card); color:var(--ref-text); font-weight:650; text-decoration:none; }
  html.refined-ui body.egnin-ui :is(.sales-tabs,.fin-tabs)>a:is([aria-current=page],.active) { background:var(--ref-soft); color:var(--ref-accent); border-color:var(--ref-accent); }
  html.refined-ui body.egnin-ui .sales-stage { border-color:var(--ref-border); border-top-color:var(--ref-accent); background:linear-gradient(135deg,var(--ref-card),var(--ref-soft)); color:var(--ref-text); border-radius:var(--eg-radius); padding:18px; min-width:0; }
  html.refined-ui body.egnin-ui .sales-stage span { color:var(--ref-muted); line-height:1.5; overflow-wrap:anywhere; }
  html.refined-ui body.egnin-ui .sales-stage strong { font-variant-numeric:tabular-nums; font-size:28px; line-height:1.2; }
  html.refined-ui body.egnin-ui .sales-stage[aria-current=page] { outline:2px solid var(--ref-accent); outline-offset:2px; }
  html.refined-ui body.egnin-ui .sales-flow-note { background:var(--ref-soft); color:var(--ref-text); border-left-color:var(--ref-accent); border-radius:0 10px 10px 0; line-height:1.65; }
  html.refined-ui body.egnin-ui .content .clean-table { width:100%; font-variant-numeric:tabular-nums; }
  html.refined-ui body.egnin-ui .content .clean-table th { background:var(--ref-soft)!important; color:var(--ref-muted)!important; padding:12px; line-height:1.4; }
  html.refined-ui body.egnin-ui .content .clean-table td { padding:14px 12px; border-color:var(--ref-border); vertical-align:middle; }
  html.refined-ui body.egnin-ui .content .clean-table tbody tr:hover { background:var(--ref-soft); }
  html.refined-ui body.egnin-ui .content .clean-table td.num { white-space:nowrap; }
  html.refined-ui body.egnin-ui #payments { scroll-margin-top:90px; }
  html.refined-ui body.egnin-ui #payments article { margin-top:20px; background:var(--ref-bg)!important; }
  html.refined-ui body.egnin-ui #payments :is(p,h3) { overflow-wrap:anywhere; }
  html.refined-ui body.egnin-ui #payments form>.checkline { margin:16px 0!important; }
  @media(max-width:800px) {
    html.refined-ui body.egnin-ui .content :is(.panel-card,.card,.fin-panel):not(.proforma *) { padding:16px; }
    html.refined-ui body.egnin-ui .sales-pipeline { grid-template-columns:repeat(2,minmax(0,1fr)); }
    html.refined-ui body.egnin-ui .content .page-head { align-items:flex-start; }
  }
  @media(max-width:480px) {
    html.refined-ui body.egnin-ui .content :is(.sales-filters,.fin-filters) { display:grid; grid-template-columns:minmax(0,1fr)!important; }
    html.refined-ui body.egnin-ui .sales-tabs>a { flex:1 1 auto; }
    html.refined-ui body.egnin-ui .content .actions { align-items:stretch; }
    html.refined-ui body.egnin-ui .content .actions>button { white-space:normal; }
  }
}
