/* Performance & Workflow Hub — scoped additions only; everything else reuses portal classes. */
.hub-svg{width:20px;height:20px;flex:none}
.hub-sub{display:block;color:var(--muted);font-size:12px;margin-top:2px}
.hub-warn{color:var(--amber)}

/* module switch cards (same blue hero as the portal's first fx tile) */
.hub-modules{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:0 0 18px}
.hub-module{display:flex;align-items:center;gap:16px;text-align:left;padding:18px 20px;border:1px solid var(--border);border-radius:20px;background:var(--surface);color:var(--text);box-shadow:0 1px 2px rgba(33,70,160,.05),0 8px 24px rgba(33,70,160,.05);transition:transform .15s ease,box-shadow .15s ease}
.hub-module:hover{transform:translateY(-1px);box-shadow:0 12px 28px rgba(33,70,160,.12)}
.hub-module-icon{width:46px;height:46px;border-radius:14px;display:grid;place-items:center;background:var(--brand-soft);color:var(--blue);flex:none}
.hub-module-icon .hub-svg{width:24px;height:24px}
.hub-module-copy{flex:1;min-width:0}
.hub-module-copy strong{display:block;font-size:17px;letter-spacing:-.01em}
.hub-module-copy small{display:block;margin-top:4px;color:var(--muted);font-size:13px}
.hub-module-arrow{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;background:var(--surface-soft);color:var(--muted);font-size:20px;flex:none}
.hub-module.active{background:linear-gradient(135deg,#3b95f3 0%,#2146a0 100%);border-color:transparent;color:#fff;box-shadow:0 14px 30px rgba(33,70,160,.28)}
.hub-module.active .hub-module-icon{background:rgba(255,255,255,.18);color:#fff}
.hub-module.active small{color:rgba(255,255,255,.85)}
.hub-module.active .hub-module-arrow{background:rgba(255,255,255,.18);color:#fff}

/* layout */
.hub-ops-grid{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:18px;align-items:start;margin-top:18px}
.hub-ops-main{min-width:0;display:grid;grid-template-columns:minmax(0,1fr);gap:18px;align-content:start}
.hub-side{display:grid;grid-template-columns:minmax(0,1fr);gap:16px;align-content:start;min-width:0}
.hub-sticky{position:sticky;top:84px}
.hub-panel{padding:18px}
.hub-panel .fx-panel-title{font-size:16px;line-height:1.3}
.hub-panel .fx-panel-head{align-items:flex-start}
.hub-mini{min-height:34px!important;padding:0 12px!important;font-size:13px;display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
.hub-mini .hub-svg{width:16px;height:16px}
.hub-toolbar{margin:0}
.hub-toolbar input{flex:2 1 260px!important;min-width:0}
.hub-toolbar select{flex:1 1 160px;min-width:0}
.hub-table-card{border-radius:14px}
.hub-ops-table{min-width:960px}
.hub-ops-table th,.hub-ops-table td{padding-left:10px!important;padding-right:10px!important}
.hub-ops-table td.merchant-cell{max-width:220px}
.hub-badge{white-space:nowrap}
.badge.muted{background:var(--surface-muted);color:var(--muted);border-color:var(--border)}
.hub-pager{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:10px;font-size:13px;color:var(--muted)}
.hub-pager div{display:flex;gap:6px}
.hub-pager button{min-width:32px;height:32px;border:1px solid var(--border);border-radius:8px;background:var(--surface);color:var(--text);font-weight:700}
.hub-pager button.active{background:var(--cta);border-color:var(--cta);color:#fff}
.hub-menu{right:14px;top:auto;margin-top:6px}
.action-cell{position:relative}
.hub-danger{color:var(--red)!important}

/* workflow panel */
.hub-wf-meta{display:flex;align-items:center;gap:10px;flex-wrap:wrap;font-size:12px;color:var(--muted);margin:-4px 0 14px}
.hub-timeline{list-style:none;margin:0;padding:0;display:grid;gap:0}
.hub-step{position:relative;display:grid;grid-template-columns:22px 1fr auto;gap:10px;align-items:start;padding:0 0 16px}
.hub-step:last-child{padding-bottom:0}
.hub-step:not(:last-child)::after{content:"";position:absolute;left:10px;top:22px;bottom:2px;width:2px;background:var(--border)}
.hub-step i{width:22px;height:22px;border-radius:50%;border:5px solid var(--brand-soft);background:var(--cta);box-sizing:border-box}
.hub-step-amber i{background:var(--amber);border-color:#fff3df}
.hub-step-red i{background:var(--red);border-color:#fde8ea}
.hub-step-green i{background:var(--green);border-color:#e3f5ec}
.hub-step-blue i{background:var(--blue)}
.hub-step strong{display:block;font-size:14px}
.hub-step small{display:block;color:var(--muted);font-size:12px;margin-top:2px}
.hub-step b{min-width:26px;height:22px;padding:0 7px;border-radius:999px;background:var(--surface-soft);border:1px solid var(--border);font-size:12px;display:grid;place-items:center}
.hub-quick{display:grid;gap:8px;margin-top:12px}
.hub-quick .secondary{min-height:40px;display:flex;align-items:center;gap:8px;justify-content:flex-start;font-size:13px;white-space:nowrap}
.hub-quick .hub-danger{border-color:#f5c2c7}
.hub-note{margin:12px 0 0;font-size:12px;color:var(--muted)}

/* forms */
.hub-form-grid{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:18px;align-items:start}
.hub-form>section+section{border-top:1px solid var(--line)}
.hub-form .form-grid{gap:16px}
.hub-grid-3{grid-template-columns:repeat(3,minmax(0,1fr))!important}
.hub-form>section>label{margin-top:16px}
.hub-heading-row{display:flex;justify-content:space-between;align-items:flex-end;gap:12px}
.hub-unit{display:flex;align-items:stretch}
.hub-unit input{border-top-right-radius:0!important;border-bottom-right-radius:0!important}
.hub-unit em{display:grid;place-items:center;padding:0 14px;border:1.5px solid #c8d2e3;border-left:0;border-radius:0 9px 9px 0;background:var(--surface-soft);color:var(--muted);font-style:normal;font-weight:600;font-size:13px;white-space:nowrap}
.hub-chipbox{display:flex;flex-wrap:wrap;gap:6px;align-items:center;min-height:48px;padding:6px 10px;border:1.5px solid #c8d2e3;border-radius:9px;background:var(--surface)}
.hub-chip{display:inline-flex;align-items:center;height:28px;padding:0 10px;border-radius:999px;background:var(--brand-soft);color:var(--blue);font-size:12px;font-weight:700;border:1px solid #bfd7fb}
.hub-stages{display:grid;gap:12px}
.hub-stage{border:1px solid var(--border);border-radius:14px;background:var(--surface)}
.hub-stage[open]{box-shadow:var(--shadow-soft)}
.hub-stage summary{display:flex;align-items:center;gap:12px;padding:14px 16px;cursor:pointer;list-style:none}
.hub-stage summary::-webkit-details-marker{display:none}
.hub-stage-title{flex:1;min-width:0}
.hub-stage-title strong{display:block}
.hub-stage-title small{display:block;color:var(--muted);font-size:12px;margin-top:2px;font-weight:500}
.hub-stage[open]>summary{border-bottom:1px solid var(--line)}
.hub-stage>:not(summary){margin-left:16px;margin-right:16px}
.hub-stage .hub-stage-grid{margin-top:16px}
.hub-stage textarea{font-family:inherit;line-height:1.55;font-weight:450}
.hub-stage>label{margin-top:14px}
.hub-form footer button{white-space:nowrap}
.hub-stage-dot{width:12px;height:12px;border-radius:50%;flex:none;background:var(--cta)}
.hub-dot-amber{background:var(--amber)}.hub-dot-red{background:var(--red)}.hub-dot-blue{background:var(--blue)}
.hub-stage-foot{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:14px 0 16px;font-size:12px;color:var(--muted)}
.hub-stage-foot>div{display:flex;gap:8px;flex:none}
.hub-switch{position:relative;display:inline-block!important;width:42px;height:24px;flex:none}
.hub-switch input{position:absolute;opacity:0;width:0;height:0}
.hub-switch i{position:absolute;inset:0;border-radius:999px;background:var(--border-strong);transition:background .15s}
.hub-switch i::after{content:"";position:absolute;top:3px;left:3px;width:18px;height:18px;border-radius:50%;background:#fff;transition:transform .15s;box-shadow:0 1px 3px rgba(0,0,0,.2)}
.hub-switch input:checked+i{background:var(--cta)}
.hub-switch input:checked+i::after{transform:translateX(18px)}
.hub-placeholders{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-top:14px;font-size:12px;color:var(--muted)}
.hub-placeholders strong{color:var(--text);margin-right:4px}
.hub-placeholders code{padding:2px 6px;font-size:11px!important;border-radius:6px;background:var(--surface-soft);border:1px solid var(--border);font-size:12px;color:var(--text)}
.hub-checks{display:grid;grid-template-columns:1fr 1fr;gap:12px 20px}
.hub-checks .check,.hub-form label.check{flex-direction:row!important;justify-content:flex-start;text-align:left;gap:10px;font-size:14px}
.hub-checks .check input{width:18px!important;height:18px!important;flex:none}
.hub-advanced{margin-top:18px;border-top:1px dashed var(--border);padding-top:14px}
.hub-advanced summary{cursor:pointer;font-weight:750;color:var(--blue);font-size:14px}
.hub-advanced .form-grid{margin-top:14px}

/* summary list */
.hub-summary{margin:12px 0 0;display:grid}
.hub-summary div{display:grid;grid-template-columns:110px 1fr;gap:10px;padding:9px 0;border-bottom:1px solid var(--line);font-size:13px}
.hub-summary div:last-child{border-bottom:0}
.hub-summary dt{color:var(--muted)}
.hub-summary dd{margin:0;font-weight:600;min-width:0;overflow-wrap:anywhere}

/* email preview */
.hub-email-card{width:min(640px,calc(100% - 28px))}
.hub-email-card header{display:flex;justify-content:space-between;gap:12px}
.hub-email-card h2{margin:6px 0;font-size:18px}
.hub-email-card p{margin:0;color:var(--muted);font-size:13px}
.hub-email{margin-top:16px;padding:18px;border:1px solid var(--border);border-radius:12px;background:var(--surface-soft);line-height:1.6;font-size:14px}

/* staff performance */
.hub-period{height:44px;border:1px solid var(--border);border-radius:9px;background:var(--surface);color:var(--text);padding:0 12px;font-weight:600}
.hub-table-shell .fx-table-head{flex-wrap:wrap;gap:12px}
.hub-table-shell .fx-segmented{flex-wrap:wrap}
.hub-flat{border:0!important;border-radius:0!important}
.hub-staff-table{min-width:860px}
.hub-staff-table tbody tr{cursor:pointer}
.hub-staff-table tbody tr:hover td{background:var(--surface-soft)}
.hub-row-active td{background:var(--brand-soft)!important}
.hub-row-active td:first-child{box-shadow:inset 3px 0 0 var(--cta)}
.hub-pct-cell{min-width:120px}
.hub-pct-cell span{display:block;font-weight:800;margin-bottom:6px}
.hub-card-foot{padding:14px 20px;border-top:1px solid var(--line)}
.hub-emp{display:flex;align-items:center;gap:12px}
.hub-emp>div{flex:1;min-width:0}
.hub-emp strong{display:block}
.hub-emp small{color:var(--muted);font-size:12px}
.hub-av{background:var(--brand-soft);color:var(--blue)}
.hub-progress{margin:12px 0 4px}
.hub-chart-label{display:block;margin-top:16px}
.hub-chart{width:100%;height:auto;margin-top:8px;overflow:visible}
.hub-chart text{font-size:10px;fill:var(--muted)}
.hub-bar-target{fill:var(--border-strong)}
.hub-dot-target{background:var(--border-strong)}
.hub-legend{margin-top:6px}
.hub-mini-wide{width:100%;margin-top:14px;min-height:40px}
.hub-top{margin-top:18px}
.hub-top-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.hub-top-list>div{display:flex;align-items:center;gap:10px;padding:12px;border:1px solid var(--border);border-radius:14px;background:var(--surface-soft)}
.hub-top-list>div>b{font-size:13px;color:var(--muted)}
.hub-top-list>div>div{flex:1;min-width:0}
.hub-top-list strong{display:block;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hub-top-list small{display:block;color:var(--muted);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hub-top-pct{font-weight:800;color:var(--green)}
.hub-preview{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:12px 0}
.hub-preview>div{padding:12px;border:1px solid var(--border);border-radius:12px;background:var(--surface-soft)}
.hub-preview small{display:block;color:var(--muted);font-size:12px}
.hub-preview strong{display:block;font-size:20px;margin-top:4px;letter-spacing:-.02em}
.hub-preview-foot{display:flex;align-items:center;gap:10px;margin-top:10px;font-size:12px;color:var(--muted)}
.hub-pad{margin-top:10px}

/* sidebar: the hub sub-menu only opens while the hub is active; the sidebar scrolls instead of
   overflowing on short screens (no visual change when everything fits) */
.sidebar{overflow-y:auto;scrollbar-width:thin}
.hub-subnav:not(.open){display:none}
.nav-item[data-view="hub"]{line-height:1.25;white-space:normal;text-align:left;height:auto;min-height:48px;padding-top:8px;padding-bottom:8px}
.hub-subnav{margin-top:-2px}
.hub-subnav button{grid-template-columns:18px 1fr}

/* dark mode: only the few hard-coded light values above */
[data-theme="dark"] .hub-unit em,[data-theme="dark"] .hub-chipbox{border-color:var(--border)}
[data-theme="dark"] .hub-chip{background:rgba(77,148,243,.14);border-color:rgba(77,148,243,.35);color:#9cc4ff}
[data-theme="dark"] .hub-step i{border-color:var(--surface-soft)}
[data-theme="dark"] .hub-quick .hub-danger{border-color:rgba(255,107,129,.4)}
[data-theme="dark"] .hub-module-icon,[data-theme="dark"] .hub-av{background:rgba(77,148,243,.14);color:#9cc4ff}
[data-theme="dark"] .hub-row-active td{background:rgba(77,148,243,.10)!important}

/* staff page: details panel stays beside the table on wide screens, sits below it otherwise */
.hub-chart{max-height:200px}
@media(max-width:1599px){
  .hub-ops-grid.hub-staff-grid>.hub-side{order:0;grid-template-columns:minmax(0,1fr)}
  .hub-emp-panel{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);gap:28px;align-items:start}
  .hub-emp-chart .hub-chart-label{margin-top:0}
}
@media(max-width:900px){.hub-emp-panel{grid-template-columns:1fr;gap:8px}}
/* below 1600px the table needs the full width: the workflow panel moves above it and runs horizontally */
@media(max-width:1599px){
  .hub-ops-grid{grid-template-columns:minmax(0,1fr)}
  .hub-ops-grid>.hub-side{order:-1;grid-template-columns:minmax(0,1fr) 280px}
  .hub-ops-grid .hub-timeline{grid-template-columns:repeat(5,minmax(0,1fr));gap:12px}
  .hub-ops-grid .hub-step{grid-template-columns:22px auto 1fr;grid-template-rows:auto auto;gap:8px 8px;padding:0}
  .hub-ops-grid .hub-step i{grid-row:1}
  .hub-ops-grid .hub-step b{grid-row:1;grid-column:2;align-self:center;height:20px;font-size:11px}
  .hub-ops-grid .hub-step>div{grid-row:2;grid-column:1/-1}
  .hub-ops-grid .hub-step:not(:last-child)::after{left:30px;right:-6px;top:10px;bottom:auto;width:auto;height:2px}
  .hub-ops-grid .hub-step:has(b):not(:last-child)::after{left:62px}
  .hub-ops-grid .hub-quick{grid-template-columns:1fr 1fr}
  .hub-ops-grid .hub-quick .secondary{font-size:12px;padding:0 10px}
  .hub-ops-grid .hub-note{display:none}
}
@media(max-width:1280px){
  .hub-form-grid{grid-template-columns:1fr}
  .hub-sticky{position:static}
  .hub-form-grid .hub-side{grid-template-columns:repeat(auto-fit,minmax(280px,1fr))}
}
@media(max-width:1100px){
  .hub-ops-grid>.hub-side{grid-template-columns:minmax(0,1fr)}
  .hub-ops-grid .hub-timeline{grid-template-columns:1fr;gap:0}
  .hub-ops-grid .hub-step{grid-template-columns:22px 1fr auto;grid-template-rows:auto;gap:10px;padding:0 0 14px}
  .hub-ops-grid .hub-step i,.hub-ops-grid .hub-step>div{grid-row:auto;grid-column:auto}
  .hub-ops-grid .hub-step b{grid-row:1;grid-column:3}
  .hub-ops-grid .hub-step:has(b):not(:last-child)::after{left:10px}
  .hub-ops-grid .hub-step:not(:last-child)::after{left:10px;right:auto;top:22px;bottom:2px;width:2px;height:auto}
}
@media(max-width:760px){
  .hub-modules{grid-template-columns:1fr;gap:10px}
  .hub-module{padding:14px 16px;border-radius:16px}
  .hub-module-copy small{display:none}
  .hub-grid-3,.hub-checks,.hub-top-list{grid-template-columns:1fr!important}
  .hub-toolbar select{flex:1 1 45%}
  .hub-stage-foot{flex-direction:column;align-items:stretch}
  .hub-stage-foot>div{justify-content:stretch}
  .hub-stage-foot>div button{flex:1}
  .hub-heading-row{flex-direction:column;align-items:stretch}
  .hub-preview strong{font-size:17px}
  .hub-side{grid-template-columns:1fr}
  .hub-ops-grid>.hub-side{order:0}
}
[data-theme="dark"] .hub-ops-main .ll-user strong,[data-theme="dark"] .hub-top-list strong{color:var(--text)}
[data-theme="dark"] .hub-ops-main .ll-av,[data-theme="dark"] .hub-top-list .ll-av{background:rgba(77,148,243,.14);color:#9cc4ff}

/* live controls */
.hub-banner{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:0 0 16px;padding:12px 16px;border:1px solid #f5c2c7;border-radius:14px;background:#fdecee;color:#7a1020;font-size:13px}
.hub-banner strong{font-size:14px}
.hub-banner span{flex:1;min-width:200px}
.hub-link{font-size:12px;padding:0;margin-left:auto}
.hub-ask-card{width:min(480px,calc(100% - 28px))}
.hub-ask-card header{display:flex;justify-content:space-between;gap:12px;margin-bottom:12px}
.hub-ask-card h2{margin:0 0 6px;font-size:19px}
.hub-ask-card p{margin:0;color:var(--muted);font-size:14px;line-height:1.5}
.hub-ask-label{display:flex;flex-direction:column;gap:6px;font-size:13px;font-weight:700;margin-top:8px}
.hub-ask-label textarea,.hub-update textarea,.hub-update input{width:100%;border:1.5px solid #c8d2e3;border-radius:9px;padding:10px 12px;font:inherit;font-weight:450;background:var(--surface);color:var(--text)}
.hub-ask-card footer{display:flex;justify-content:flex-end;gap:10px;margin-top:18px}
.hub-primary-danger{background:var(--red)!important;box-shadow:none!important}
.hub-wf-card{width:min(760px,calc(100% - 28px))}
.hub-wf-card header{display:flex;justify-content:space-between;gap:12px}
.hub-wf-card h2{margin:6px 0 4px;font-size:20px}
.hub-wf-card header p{margin:0;color:var(--muted);font-size:13px}
.hub-wf-facts{display:grid;grid-template-columns:1fr 1fr;column-gap:24px;margin-top:14px}
.hub-wf-actions{display:flex;gap:8px;flex-wrap:wrap;margin:14px 0 4px}
.hub-update{margin-top:16px;padding:16px;border:1px solid var(--border);border-radius:14px;background:var(--surface-soft);display:grid;gap:10px}
.hub-update>strong{font-size:15px}
.hub-update>span{color:var(--muted);font-size:12px;margin-top:-6px}
.hub-update label{display:flex;flex-direction:column;gap:6px;font-size:13px;font-weight:700}
.hub-update input{height:42px}
.hub-update-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.hub-update-foot{display:flex;justify-content:flex-end}
.hub-events{margin-top:18px}
.hub-events>strong{display:block;margin-bottom:10px}
.hub-events ol{list-style:none;margin:0;padding:0}
.hub-ev{position:relative;display:grid;grid-template-columns:14px 1fr;gap:10px;padding:0 0 14px}
.hub-ev:not(:last-child)::after{content:"";position:absolute;left:6px;top:16px;bottom:0;width:2px;background:var(--border)}
.hub-ev i{width:14px;height:14px;border-radius:50%;background:var(--cta);margin-top:3px}
.hub-ev-green i{background:var(--green)}.hub-ev-amber i{background:var(--amber)}.hub-ev-red i{background:var(--red)}.hub-ev-muted i{background:var(--border-strong)}
.hub-ev b{display:block;font-size:14px}
.hub-ev small{color:var(--muted);font-size:12px}
.hub-ev p{margin:4px 0 0;font-size:13px;line-height:1.45}
.hub-chip button{border:0;background:transparent;color:inherit;margin-left:4px;padding:0 2px;font-size:15px;line-height:1;cursor:pointer}
.hub-add-rcpt{height:30px!important;width:auto!important;min-width:90px;border:1px dashed #bcd0ee!important;border-radius:999px!important;padding:0 10px!important;font-size:12px!important;color:var(--blue)!important;background:transparent!important}
.hub-range{margin:0 0 16px;align-items:flex-end}
.hub-range label{display:flex;flex-direction:column;gap:4px;font-size:12px;font-weight:700}
.hub-range input{flex:none!important;min-width:160px}
.hub-rules{margin-top:14px}
.hub-rules-list{margin:0;padding-left:18px;color:var(--text);font-size:14px;line-height:1.7}
.hub-loading{opacity:.55;pointer-events:none}
.hub-progress-strip{margin-top:12px}
[data-theme="dark"] .hub-banner{background:rgba(255,107,129,.12);border-color:rgba(255,107,129,.4);color:#ffc2cc}
[data-theme="dark"] .hub-ask-label textarea,[data-theme="dark"] .hub-update textarea,[data-theme="dark"] .hub-update input{border-color:var(--border)}
@media(max-width:760px){.hub-wf-facts,.hub-update-grid{grid-template-columns:1fr}}
