:root {
  --es-navy: #16325c;
  --es-accent: #0d6efd;
  --es-ok: #198754;
  --es-bad: #dc3545;
  --es-wait: #adb5bd;
  --es-ap: #f0ad00;
}
/* ---------- base: calm, light, few borders ---------- */
body { background: #f6f7f9; font-size: .9rem; color: #1f2933; }
h3, h4, .h3, .h4 { font-weight: 600; letter-spacing: -.01em; }
.es-nav { background: var(--es-navy); padding-top: .35rem; padding-bottom: .35rem; }
.es-nav .nav-link { color: rgba(255,255,255,.72); font-size: .88rem; padding-left: .7rem !important; padding-right: .7rem !important; }
.es-nav .nav-link:hover, .es-nav .nav-link.active { color: #fff; }
.es-nav .nav-link.active { box-shadow: inset 0 -2px 0 rgba(255,255,255,.85); }
.es-logo { display: inline-block; background: #fff; color: var(--es-navy); border-radius: 6px; padding: 0 .35rem; font-weight: 800; margin-right: .25rem; }
.es-brand-img { height: 28px; max-width: 150px; object-fit: contain; background: #fff; border-radius: 4px; padding: 2px 4px; margin-right: .4rem; }
.es-switch { max-width: 320px; }
.es-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; margin-right: .4rem; flex: none; }
.es-company-select { background-color: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.25); max-width: 260px; }
.es-company-select option { color: #000; }
.es-user { color: #fff; border: 1px solid rgba(255,255,255,.25); display: inline-flex; align-items: center; gap: .45rem; }
.es-user:hover, .es-user:focus { color: #fff; background: rgba(255,255,255,.1); }
.es-avatar { width: 1.6rem; height: 1.6rem; border-radius: 50%; background: #fff; color: var(--es-navy); font-size: .7rem; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center; }
.es-bc-dot { display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; background: #adb5bd; }
.es-bc-dot.on { background: #3ccf7a; }
.es-user-menu { min-width: 260px; }
.card { border: 1px solid #e6e8ec; border-radius: .6rem; box-shadow: none; }
.card-header { background: #fff; font-weight: 600; border-bottom: 1px solid #eef0f3; padding: .7rem 1rem; }
.card-header:first-child { border-radius: .6rem .6rem 0 0; }
.alert { border-radius: .5rem; font-size: .88rem; }
.table td, .table th { vertical-align: middle; }
.es-table { font-size: .88rem; }
.es-table thead th, .table thead.table-light th { background: #fafbfc; color: #6b7280; font-weight: 600; font-size: .72rem; text-transform: uppercase;
    letter-spacing: .04em; border-bottom: 1px solid #e6e8ec; }
.es-table td { padding-top: .55rem; padding-bottom: .55rem; border-color: #f0f1f4; }
.es-kpi .card-body { padding: .6rem .9rem; }
.es-kpi-label { font-size: .72rem; color: #6b7280; text-transform: uppercase; letter-spacing: .04em; }
.es-kpi-value { font-size: 1.35rem; font-weight: 600; color: #1f2933; }
.queue-tile { text-decoration: none; color: inherit; display: flex; justify-content: space-between; align-items: center;
    padding: .35rem .6rem; border-radius: .4rem; border-left: 3px solid transparent; }
.queue-tile:hover { background: #f1f4f9; }
.queue-tile .count { font-weight: 600; font-size: .85rem; background: #eef1f6; border-radius: 999px; padding: 0 .55rem; min-width: 1.8rem; text-align: center; }
.queue-tile .count.zero { color: #9aa1ab; background: transparent; }
.queue-tile.ap { border-left-color: var(--es-ap); }
.queue-tile.bad { border-left-color: var(--es-bad); }
.queue-tile.ok { border-left-color: var(--es-ok); }
.queue-nav .list-group-item { border: 0; border-radius: .4rem !important; padding: .3rem .6rem; margin-bottom: 1px; background: transparent; }
.queue-nav .list-group-item:hover { background: #eef1f6; }
.queue-nav .list-group-item.active { background: var(--es-navy); border-color: var(--es-navy); }
.queue-nav .badge { font-weight: 600; }
.queue-group { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: #8a929c; margin: .8rem 0 .2rem .1rem; }

/* ---------- approval stepper ---------- */
.stepper { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0; }
.step { position: relative; flex: 1 1 150px; min-width: 150px; max-width: 240px; padding: 0 .5rem 0 0; }
.step .box { border: 1px solid #d5d9df; border-radius: 10px; background: #fff; padding: .55rem .7rem; height: 100%; }
.step .role { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: #6c757d; }
.step .who { font-weight: 600; }
.step .meta { font-size: .75rem; color: #6c757d; }
.step .icon { float: right; font-weight: 700; }
.step:not(:last-child)::after { content: "\2192"; position: absolute; right: -.35rem; top: 40%; color: #6c757d; z-index: 1; font-weight: 700; }
.step.done .box { border-color: var(--es-ok); background: #f1faf4; }
.step.done .icon { color: var(--es-ok); }
.step.rejected .box { border-color: var(--es-bad); background: #fdf1f2; }
.step.rejected .icon { color: var(--es-bad); }
.step.current .box { border-color: var(--es-accent); background: #f3f7ff; box-shadow: 0 0 0 3px rgba(13,110,253,.12); }
.step.current.ap .box { border-color: var(--es-ap); background: #fffaeb; box-shadow: 0 0 0 3px rgba(240,173,0,.15); }
.step.waiting .box { border-style: dashed; color: #6c757d; }
.step.cancelled .box { opacity: .45; text-decoration: line-through; }
.step.forwarded .box { border-color: #6f42c1; background: #f5f0fc; }
.step.forwarded .icon { color: #6f42c1; }
.here { display: inline-block; background: var(--es-accent); color: #fff; font-size: .65rem; border-radius: 4px; padding: 0 .35rem; margin-top: .2rem; }
.step.ap .here { background: var(--es-ap); color: #000; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 4px rgba(13,110,253,.18);} 50% { box-shadow: 0 0 0 7px rgba(13,110,253,.08);} }

/* ---------- rule map (simulator) ---------- */
.rulemap { display: grid; grid-template-columns: minmax(200px, 1fr) 58px minmax(180px, 1fr); gap: .45rem 0; align-items: center; }
.rulemap .node { border: 2px solid #ced4da; border-radius: 8px; padding: .4rem .6rem; background: #fff; font-size: .85rem; color: #6c757d; }
.rulemap .node.decision { border-radius: 20px; font-style: italic; }
.rulemap .node.on { border-color: var(--es-accent); color: #000; background: #eef4ff; font-weight: 600; }
.rulemap .node.end.on { border-color: var(--es-ok); background: #f1faf4; }
.rulemap .node.warn.on { border-color: var(--es-ap); background: #fff8e1; }
.rulemap .node.bad.on { border-color: var(--es-bad); background: #fdf1f2; }
.rulemap .arrow { text-align: center; color: #adb5bd; font-weight: 700; }
.rulemap .arrow.on { color: var(--es-accent); }
.rulemap .down { grid-column: 1; text-align: center; color: #adb5bd; line-height: .6; }
.trace li { margin-bottom: .2rem; }
.pass { color: var(--es-ok); font-weight: 700; }
.fail { color: var(--es-bad); font-weight: 700; }
.pdf-frame { width: 100%; height: 78vh; border: 1px solid #dee2e6; border-radius: 6px; background: #fff; }
.missing { background: #fff3cd; }
.timeline { list-style: none; padding-left: 0; }
.timeline li { border-left: 2px solid #dee2e6; padding: 0 0 .6rem .8rem; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; background: var(--es-navy); border-radius: 50%; }

/* Bootstrap 5.1 has no text-bg-* helpers */
/* soft tints: readable, not shouting */
.text-bg-primary { color: #1d4ed8 !important; background-color: #e6efff !important; }
.text-bg-secondary { color: #4b5563 !important; background-color: #eceef1 !important; }
.text-bg-success { color: #146c43 !important; background-color: #e3f4ea !important; }
.text-bg-danger { color: #b02a37 !important; background-color: #fbe7e9 !important; }
.text-bg-warning { color: #8a5a00 !important; background-color: #fff1cc !important; }
.text-bg-info { color: #0b6e83 !important; background-color: #e0f5fa !important; }
.text-bg-light { color: #374151 !important; background-color: #f1f3f5 !important; }
.badge { font-weight: 600; letter-spacing: .01em; }

/* ---------- simulator PDF drop zone ---------- */
.dropzone { border: 2px dashed #9fb3d1; background: #f8fbff; cursor: pointer; text-align: center; padding: 1.1rem; transition: all .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--es-accent); background: #eaf2ff; }
.dropzone .dz-icon { font-size: 1.8rem; line-height: 1; margin-bottom: .25rem; }
.dropzone .dz-busy { display: none; }
.dropzone.busy .dz-idle { display: none; }
.dropzone.busy .dz-busy { display: block; }

/* ---------- queue list + preview ---------- */
.queue-list { max-height: calc(100vh - 230px); overflow-y: auto; }
.queue-list .sel-row { cursor: pointer; }
.queue-list .sel-row.table-active > td { --bs-table-accent-bg: transparent; background: #e3ecff !important; box-shadow: none; }
.queue-list .sel-row.table-active > td:first-child { box-shadow: inset 4px 0 0 var(--es-accent); }
.preview-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: #6c757d; font-weight: 600; margin: .5rem 0 .35rem; }
.queue-list .sel-row:focus { outline: none; }
.preview-sticky { position: sticky; top: 1rem; transition: opacity .15s; }
.preview-pdf { width: 100%; height: calc(100vh - 430px); min-height: 420px; border-top: 1px solid #dee2e6; }
.stepper-compact .step { flex: 1 1 110px; min-width: 110px; }
.stepper-compact .step .box { padding: .35rem .5rem; font-size: .8rem; }
.stepper-compact .step .meta { display: none; }
.stepper-compact .step.current .meta:last-child, .stepper-compact .here { display: inline-block; }
.preview-meta > div { padding-bottom: .35rem; }

/* ---------- PDF.js viewer ---------- */
.es-pdf { display: flex; flex-direction: column; overflow: hidden; background: #e9ecef; }
.es-pdf-bar { display: flex; align-items: center; gap: .5rem; padding: .3rem .5rem; background: #f8f9fa; border-bottom: 1px solid #dee2e6; font-size: .8rem; }
.es-pdf-bar .btn { padding: .05rem .5rem; border: 1px solid #dee2e6; }
.es-pdf-pages { flex: 1; overflow: auto; padding: 8px; text-align: center; }
.es-pdf-page { display: block; margin: 0 auto 8px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25); }

/* ---------- bulk actions ---------- */
.bulk-bar { background: #fff8e1; border-bottom: 1px solid #ffe08a; padding: .5rem .75rem; }
.queue-list td.pick { width: 2rem; }

/* ---------- company logos ---------- */
.es-logo-preview { width: 180px; height: 60px; border: 1px dashed #d5d9df; border-radius: .4rem; display: flex; align-items: center; justify-content: center; background: #fff; }
.es-logo-preview img { max-width: 170px; max-height: 52px; object-fit: contain; }
.es-login-logo img { max-height: 48px; max-width: 220px; object-fit: contain; }

/* ---------- validation panel (AP exceptions) ---------- */
.es-validation { font-size: .85rem; }
.es-exception { background: #fffaeb; border: 1px solid #f5e3a8; border-radius: .45rem; padding: .5rem .65rem; }
.es-dl { display: grid; grid-template-columns: max-content 1fr; gap: .1rem .75rem; margin: .35rem 0; }
.es-dl dt { font-weight: 500; color: #6b7280; }
.es-dl dd { margin: 0; }
.es-checks li { padding: .15rem 0; border-bottom: 1px solid #f1f3f5; }
.es-checks li:last-child { border-bottom: 0; }
.es-check-icon { display: inline-block; width: 1.1rem; font-weight: 700; }
.es-checks li.ok .es-check-icon { color: var(--es-ok); }
.es-checks li.bad .es-check-icon { color: var(--es-bad); }
.es-checks li.bad { background: #fff5f5; }
.es-reason { color: #8a5a00; }

/* ---------- queues directory ---------- */
.q-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .15rem .75rem; }
.q-item[hidden] { display: none !important; }
.q-item span:first-child { min-width: 0; }
.es-queue-menu { width: 340px; padding-top: .5rem; }
.es-queue-scroll { max-height: min(60vh, 520px); overflow-y: auto; }
.es-queue-menu .dropdown-header { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; padding-top: .5rem; }
.es-queue-menu .dropdown-item { font-size: .88rem; padding-top: .3rem; padding-bottom: .3rem; }
.es-queue-count { font-size: .75rem; font-weight: 600; background: #eef1f6; border-radius: 999px; padding: 0 .5rem; color: #1f2933; }
.es-queue-count.zero { background: transparent; color: #9aa1ab; }
.dropdown-item.active .es-queue-count { background: rgba(255,255,255,.25); color: #fff; }

/* ---------- department queue list (left of the queue page) ---------- */
.es-dept .card-header { position: sticky; top: 0; z-index: 1; }
.es-dept-list { max-height: calc(100vh - 210px); overflow-y: auto; padding: .35rem .4rem; }
.es-dept-list .queue-tile { font-size: .86rem; }
.es-dept-list .queue-tile.current { background: var(--es-navy); color: #fff; }
.es-dept-list .queue-tile.current .count { background: rgba(255,255,255,.2); color: #fff; }

/* =====================================================================
   Modern theme (v1.10): soft surfaces, rounded controls, clear focus.
   Overrides the base rules above; Inter falls back to the system font.
   ===================================================================== */
:root {
  --es-navy: #0f2747;
  --es-navy-2: #1b3b6b;
  --es-accent: #2563eb;
  --es-accent-soft: #eaf1ff;
  --es-bg: #f4f6fa;
  --es-surface: #ffffff;
  --es-line: #e5e8ef;
  --es-line-soft: #eef1f5;
  --es-text: #172033;
  --es-muted: #667085;
  --es-radius: 14px;
  --es-radius-sm: 9px;
  --es-shadow: 0 1px 2px rgba(16,24,40,.04), 0 2px 8px rgba(16,24,40,.05);
  --es-shadow-lg: 0 10px 30px rgba(16,24,40,.10);
}
body { background: var(--es-bg); color: var(--es-text); font-size: .9rem;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, .h3, .h4 { font-weight: 650; letter-spacing: -.02em; color: var(--es-text); }
h3 { font-size: 1.45rem; }
a { color: var(--es-accent); }
.text-muted { color: var(--es-muted) !important; }

/* navigation: deep gradient, pill links */
.es-nav { background: linear-gradient(90deg, var(--es-navy) 0%, var(--es-navy-2) 100%); padding-top: .45rem; padding-bottom: .45rem;
  box-shadow: 0 2px 10px rgba(15,39,71,.18); }
.es-nav .nav-link { border-radius: 8px; margin: 0 .1rem; transition: background .15s, color .15s; }
.es-nav .nav-link:hover { background: rgba(255,255,255,.08); }
.es-nav .nav-link.active { box-shadow: none; background: rgba(255,255,255,.14); color: #fff; }
.es-logo { border-radius: 8px; padding: .05rem .4rem; }
.dropdown-menu { border: 1px solid var(--es-line); border-radius: 12px; box-shadow: var(--es-shadow-lg); padding: .35rem; }
.dropdown-item { border-radius: 8px; }
.dropdown-item.active, .dropdown-item:active { background: var(--es-accent); }

/* surfaces */
.card { border: 1px solid var(--es-line); border-radius: var(--es-radius); box-shadow: var(--es-shadow); background: var(--es-surface); }
.card-header { background: transparent; border-bottom: 1px solid var(--es-line-soft); padding: .85rem 1.1rem; font-weight: 600; font-size: .95rem; }
.card-header:first-child { border-radius: var(--es-radius) var(--es-radius) 0 0; }
.card-body { padding: 1rem 1.1rem; }
.card-footer { background: #fafbfd; border-top: 1px solid var(--es-line-soft); }
.alert { border: 0; border-radius: 12px; box-shadow: var(--es-shadow); border-left: 4px solid currentColor; }
.alert-success { background: #ecfdf3; color: #067647; }
.alert-danger { background: #fef3f2; color: #b42318; }
.alert-warning { background: #fffaeb; color: #b54708; }
.alert-info { background: #eff8ff; color: #175cd3; }

/* controls */
.btn { border-radius: var(--es-radius-sm); font-weight: 500; padding: .42rem .9rem; transition: background .15s, box-shadow .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn-sm { border-radius: 8px; padding: .25rem .65rem; }
.btn-primary { background: var(--es-accent); border-color: var(--es-accent); box-shadow: 0 1px 2px rgba(37,99,235,.25); }
.btn-primary:hover, .btn-primary:focus { background: #1d4ed8; border-color: #1d4ed8; }
.btn-outline-primary { color: var(--es-accent); border-color: #bcd0fb; }
.btn-outline-primary:hover { background: var(--es-accent-soft); color: #1d4ed8; border-color: #9db9f7; }
.btn-outline-secondary { color: #344054; border-color: #d0d5dd; background: #fff; }
.btn-outline-secondary:hover { background: #f5f7fa; color: #172033; border-color: #c2c8d2; }
.form-control, .form-select { border-radius: var(--es-radius-sm); border-color: #d0d5dd; }
.form-control:focus, .form-select:focus, .btn:focus, .form-check-input:focus { border-color: #84a9f5; box-shadow: 0 0 0 4px rgba(37,99,235,.13); }
.form-control::placeholder { color: #98a2b3; }
.form-label { font-weight: 500; color: #344054; margin-bottom: .3rem; }
.form-text { color: var(--es-muted); }
.input-group > .btn { border-radius: 0 var(--es-radius-sm) var(--es-radius-sm) 0; }
.input-group-text { background: #f8f9fb; border-color: #d0d5dd; color: var(--es-muted); }
.form-check-input:checked { background-color: var(--es-accent); border-color: var(--es-accent); }
.form-switch .form-check-input { width: 2.3em; cursor: pointer; }

/* tables */
.table { --bs-table-hover-bg: #f6f8fc; }
.table > :not(caption) > * > * { border-color: var(--es-line-soft); }
.table-hover tbody tr { transition: background .1s; }
.es-table thead th, .table thead.table-light th { background: #f9fafc; color: var(--es-muted); }
.badge { border-radius: 999px; padding: .32em .65em; }

/* page header used by redesigned pages */
.es-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem; margin-bottom: 1.1rem; }
.es-page-head h3 { margin: 0; }
.es-eyebrow { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--es-muted); margin-bottom: .15rem; }
.es-section-title { display: flex; align-items: center; gap: .6rem; }
.es-section-icon { width: 2rem; height: 2rem; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--es-accent-soft); color: var(--es-accent); font-size: 1rem; flex: none; }
.es-section-sub { font-weight: 400; font-size: .8rem; color: var(--es-muted); }

/* settings layout: sticky section nav + content */
.es-settings { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.es-settings-nav { position: sticky; top: 1rem; display: flex; flex-direction: column; gap: .1rem; }
.es-settings-nav a { color: #475467; text-decoration: none; padding: .45rem .7rem; border-radius: 9px; font-weight: 500; font-size: .86rem; }
.es-settings-nav a:hover { background: #e9eef7; color: var(--es-text); }
.es-settings-nav a.active { background: var(--es-surface); color: var(--es-accent); box-shadow: var(--es-shadow); }
.es-settings section { scroll-margin-top: 1rem; }
@media (max-width: 991.98px) {
  .es-settings { grid-template-columns: 1fr; }
  .es-settings-nav { position: static; flex-direction: row; flex-wrap: wrap; }
}
.es-savebar { position: sticky; bottom: 0; z-index: 5; margin-top: 1rem; padding: .75rem 1rem; background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px); border: 1px solid var(--es-line); border-radius: var(--es-radius); box-shadow: var(--es-shadow-lg);
  display: flex; align-items: center; gap: .75rem; }
.es-savebar .es-dirty { display: none; color: #b54708; font-size: .82rem; }
.es-savebar.dirty .es-dirty { display: inline; }

/* approval ladder (company thresholds) */
.es-ladder { display: flex; flex-wrap: wrap; align-items: stretch; gap: .5rem; margin-bottom: 1rem; }
.es-rung { position: relative; flex: 1 1 140px; min-width: 140px; border: 1px solid var(--es-line); border-radius: 12px; padding: .65rem .8rem;
  background: #fff; transition: border-color .15s, background .15s; }
.es-rung.on { border-color: #b7cdfa; background: linear-gradient(180deg, #f6f9ff, #fff); }
.es-rung.off { background: #fafbfc; color: #98a2b3; border-style: dashed; }
.es-rung .es-rung-role { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--es-muted); }
.es-rung .es-rung-amount { font-size: 1.1rem; font-weight: 650; margin-top: .1rem; }
.es-rung.off .es-rung-amount { font-size: .9rem; font-weight: 500; }
.es-rung .es-rung-note { font-size: .74rem; color: var(--es-muted); }
.es-rung .es-rung-off { position: absolute; top: .45rem; right: .5rem; border: 0; background: transparent; color: #98a2b3; font-size: .95rem; line-height: 1;
  padding: .1rem .3rem; border-radius: 6px; }
.es-rung .es-rung-off:hover { background: #fee4e2; color: #b42318; }
.es-rung:not(:last-child)::after { content: "\203A"; position: absolute; right: -.45rem; top: 50%; transform: translateY(-50%); color: #98a2b3;
  font-size: 1.2rem; z-index: 1; }
.es-composer { background: #f8fafd; border: 1px solid var(--es-line-soft); border-radius: 12px; padding: .75rem; }
.form-switch .form-check-label { margin-left: .4rem; }

/* ---------- invoice lock ---------- */
fieldset.es-lockable { min-width: 0; }
fieldset.es-lockable:disabled { opacity: .55; filter: grayscale(.6); cursor: not-allowed; }
fieldset.es-lockable:disabled .btn { pointer-events: none; }
.es-lock-banner { border-left-color: #f79009; }
.es-lock-icon { font-size: 1.1rem; }

/* ---------- bulk upload ---------- */
.es-route-preview { border-radius: 10px; padding: .55rem .7rem; border: 1px solid; }
.es-route-preview.ok { background: #ecfdf3; border-color: #abefc6; }
.es-route-preview.bad { background: #fffaeb; border-color: #fedf89; }
.es-route-title { font-weight: 600; font-size: .85rem; }
.es-route-steps { margin: .3rem 0 0; padding-left: 1.2rem; font-size: .85rem; }
.es-route-steps li { padding: .05rem 0; }
.es-upload-drop { border: 2px dashed #9fb3d1; border-radius: var(--es-radius); background: #f8fbff; padding: 2rem 1rem; text-align: center; cursor: pointer; transition: all .15s; }
.es-upload-drop:hover, .es-upload-drop.over { border-color: var(--es-accent); background: var(--es-accent-soft); }
.es-upload-drop .dz-icon { font-size: 2.2rem; line-height: 1; }
.es-upload-list td { vertical-align: middle; }
.es-upload-list .st-wait { color: #98a2b3; }
.es-upload-list .st-busy { color: var(--es-accent); }
.es-upload-list .st-ok { color: #067647; }
.es-upload-list .st-warn { color: #b54708; }
.es-upload-list .st-bad { color: #b42318; }
.es-pred-ok { color: #067647; }
.es-pred-bad { color: #b54708; }

/* ---------- AI usage chart ---------- */
.es-cost-chart { width: 100%; height: 150px; display: block; }
.es-chart-axis { stroke: #d0d5dd; stroke-width: 1; vector-effect: non-scaling-stroke; }
.es-chart-label { font-size: 9px; fill: #667085; }
.es-bar-fill { fill: #2563eb; }
.es-bar-hit { fill: transparent; }
.es-bar:hover .es-bar-fill { fill: #1d4ed8; }
.es-bar:hover .es-bar-hit { fill: rgba(37,99,235,.06); }
.es-chart-x { position: relative; height: 1.1rem; font-size: .72rem; color: #667085; }
.es-chart-x span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.es-chart-x span.first { transform: none; left: 0 !important; }
.es-chart-x span.last { transform: none; left: auto !important; right: 0; }

/* ---------- company settings (overrides) ---------- */
.es-co-setting.own { background: #f6f9ff; box-shadow: inset 3px 0 0 var(--es-accent); }
.es-co-setting .es-val:disabled { background: #f8f9fb; color: #98a2b3; }
.es-nav .nav-link { white-space: nowrap; }
.es-company-select { min-width: 11rem; }

/* ---------- queue PO column ---------- */
.es-po-cell { font-size: .8rem; }
.es-po-cell .font-monospace { font-size: .78rem; letter-spacing: -.01em; }
.queue-list .table td:nth-child(2) { max-width: 320px; }

/* ---------- queue page: one screen, frames scroll inside (large screens) ---------- */
@media (min-width: 992px) {
  .es-queue-page { overflow: hidden; }
  .es-queue-page > [class*="col-"] { height: 100%; display: flex; flex-direction: column; min-height: 0; }
  .es-queue-page .es-dept { max-height: 100%; display: flex; flex-direction: column; }
  .es-queue-page .es-dept-list { max-height: none; flex: 1 1 auto; min-height: 0; }
  .es-queue-mid { gap: 1rem; }
  .es-queue-listcard { flex: 1 1 55%; min-height: 0; display: flex; flex-direction: column; }
  .es-queue-listcard > .card-header, .es-queue-listcard > form, .es-queue-listcard > .es-queue-hint { flex: none; }
  .es-queue-listcard .queue-list { flex: 1 1 auto; min-height: 0; max-height: none; }
  .es-queue-details { flex: 0 1 45%; min-height: 120px; overflow-y: auto; }
  .es-preview-pane { height: 100%; display: flex; flex-direction: column; min-height: 0; }
  .es-preview-pane > * { flex: none; }
  .es-preview-pane > .preview-card { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  .es-preview-pane .preview-card > * { flex: none; }
  .es-preview-pane .preview-pdf { flex: 1 1 auto; height: auto; min-height: 0; }
}
.es-queue-details .card-body { padding: .75rem 1rem; }
.es-details-head { margin-bottom: .4rem; }
.queue-list thead th { position: sticky; top: 0; z-index: 1; }
@media (min-width: 992px) {
  .es-wide-preview > .es-queue-dept { display: none !important; }
  .es-wide-preview > .es-queue-mid { flex: 0 0 34%; max-width: 34%; }
  .es-wide-preview > .es-queue-right { flex: 1 1 0; max-width: none; }
}
.preview-meta > div { overflow-wrap: anywhere; }
.preview-meta .text-muted + br + * { word-break: normal; }

/* a PO found in Business Craft: greyed out until AP presses Edit PO */
.es-po-locked { background-color: var(--bs-secondary-bg); color: var(--bs-secondary-color); cursor: not-allowed; }
