#bessRtoeAdvisorPanel {
  width: 100%;
  margin: 0 0 14px;
  padding: 14px;
  border: 1px solid var(--border, #dbe3ef);
  border-radius: 16px;
  background: var(--panel, #fff);
  color: var(--text, #0f172a);
  box-shadow: var(--shadow, 0 10px 26px rgba(15,23,42,.07));
}
#bessRtoeAdvisorPanel * { box-sizing: border-box; }
#bessRtoeAdvisorPanel .advisor-header { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:12px; }
#bessRtoeAdvisorPanel .advisor-title { margin:0; font-size:18px; font-weight:900; }
#bessRtoeAdvisorPanel .advisor-subtitle { margin-top:4px; color:var(--muted,#475569); font-size:13px; line-height:1.4; }
#bessRtoeAdvisorPanel .advisor-toolbar { display:flex; align-items:end; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
#bessRtoeAdvisorPanel .advisor-toolbar label { display:flex; flex-direction:column; gap:4px; font-size:10px; font-weight:800; color:var(--muted,#475569); text-transform:uppercase; letter-spacing:.04em; }
#bessRtoeAdvisorPanel .advisor-toolbar input { width:82px; }
#bessRtoeAdvisorPanel select,
#bessRtoeAdvisorPanel input,
#bessRtoeAdvisorPanel button { height:34px; border-radius:10px; border:1px solid var(--border,#dbe3ef); background:var(--panel2,#f1f5f9); color:var(--text,#0f172a); padding:0 10px; font-size:12px; font-weight:700; }
#bessRtoeAdvisorPanel button { cursor:pointer; }
#bessRtoeAdvisorPanel button.primary { background:var(--accent,#2563eb); border-color:var(--accent,#2563eb); color:#fff; }
#bessRtoeAdvisorPanel button.danger { background:#fee2e2; border-color:#fecaca; color:#991b1b; }
#bessRtoeAdvisorPanel button:disabled { opacity:.38; cursor:not-allowed; filter:grayscale(.25); }
body.dark #bessRtoeAdvisorPanel select,
body.dark #bessRtoeAdvisorPanel input,
body.dark #bessRtoeAdvisorPanel button { background:var(--panel,#111827); color:var(--text,#e5e7eb); }
body.dark #bessRtoeAdvisorPanel button.danger { background:#3f1d1d; border-color:#7f1d1d; color:#fecaca; }
#bessRtoeAdvisorPanel .advisor-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; align-items:start; }
#bessRtoeAdvisorPanel .advisor-card { border:1px solid var(--border,#dbe3ef); border-radius:14px; background:var(--panel2,#f1f5f9); padding:12px; min-height:210px; }
#bessRtoeAdvisorPanel .advisor-card.rtoe { border-color:rgba(37,99,235,.32); }
#bessRtoeAdvisorPanel .advisor-card.schedule { border-color:rgba(22,163,74,.32); }
#bessRtoeAdvisorPanel .advisor-card.stale { border-color:rgba(220,38,38,.55); }
#bessRtoeAdvisorPanel .card-head { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; margin-bottom:10px; }
#bessRtoeAdvisorPanel .card-title { font-size:15px; font-weight:900; margin:0; }
#bessRtoeAdvisorPanel .pill { display:inline-flex; align-items:center; border:1px solid var(--border,#dbe3ef); border-radius:999px; padding:4px 8px; font-size:11px; font-weight:900; text-transform:uppercase; letter-spacing:.04em; background:var(--panel,#fff); color:var(--muted,#475569); white-space:nowrap; }
#bessRtoeAdvisorPanel .pill.proposed { color:#92400e; border-color:rgba(245,158,11,.45); }
#bessRtoeAdvisorPanel .pill.pending { color:#1d4ed8; border-color:rgba(37,99,235,.45); }
#bessRtoeAdvisorPanel .pill.submitted,
#bessRtoeAdvisorPanel .pill.active,
#bessRtoeAdvisorPanel .pill.ok { color:#166534; border-color:rgba(22,101,52,.45); }
#bessRtoeAdvisorPanel .pill.stale,
#bessRtoeAdvisorPanel .pill.expiring { color:#b91c1c; border-color:rgba(220,38,38,.5); }
body.dark #bessRtoeAdvisorPanel .pill.proposed { color:#fcd34d; }
body.dark #bessRtoeAdvisorPanel .pill.pending { color:#93c5fd; }
body.dark #bessRtoeAdvisorPanel .pill.submitted,
body.dark #bessRtoeAdvisorPanel .pill.active,
body.dark #bessRtoeAdvisorPanel .pill.ok { color:#86efac; }
body.dark #bessRtoeAdvisorPanel .pill.stale,
body.dark #bessRtoeAdvisorPanel .pill.expiring { color:#fca5a5; }
#bessRtoeAdvisorPanel .kpis { display:grid; grid-template-columns:repeat(4,minmax(90px,1fr)); gap:8px; margin:10px 0; }
#bessRtoeAdvisorPanel .kpi { border:1px solid var(--border,#dbe3ef); border-radius:12px; padding:8px; background:var(--panel,#fff); }
#bessRtoeAdvisorPanel .kpi .k { font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:.04em; color:var(--muted,#475569); margin-bottom:4px; }
#bessRtoeAdvisorPanel .kpi .v { font-size:16px; font-weight:900; }
#bessRtoeAdvisorPanel .reason { color:var(--muted,#475569); font-size:13px; line-height:1.45; margin-top:8px; min-height:38px; }
#bessRtoeAdvisorPanel .actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
#bessRtoeAdvisorChart { width:100%; height:var(--chart-height,420px); min-height:340px; margin-top:14px; }
#bessRtoeAdvisorPanel .handoff { margin-top:12px; border:1px solid var(--border,#dbe3ef); border-radius:12px; padding:10px; background:var(--panel2,#f1f5f9); color:var(--muted,#475569); font-size:13px; line-height:1.4; }
#bessRtoeAdvisorPanel .advisor-table-wrap { margin-top:12px; overflow:auto; max-height:300px; border:1px solid var(--border,#dbe3ef); border-radius:12px; }
#bessRtoeAdvisorPanel table { width:100%; border-collapse:collapse; table-layout:fixed; font-size:12px; }
#bessRtoeAdvisorPanel th,
#bessRtoeAdvisorPanel td { padding:7px 9px; border-bottom:1px solid var(--border,#dbe3ef); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-align:right; }
#bessRtoeAdvisorPanel th:first-child,
#bessRtoeAdvisorPanel td:first-child { text-align:left; }
#bessRtoeAdvisorPanel th { position:sticky; top:0; z-index:1; background:var(--panel2,#f1f5f9); }
body.dark #bessRtoeAdvisorPanel th { background:var(--panel2,#1f2937); }
#bessRtoeAdvisorPanel .zone-rtoe td { background:rgba(37,99,235,.07); }
#bessRtoeAdvisorPanel .zone-schedule td { background:rgba(22,163,74,.07); }
#bessRtoeAdvisorPanel .zone-closed td { opacity:.72; }
body.dark #bessRtoeAdvisorPanel .zone-rtoe td { background:rgba(96,165,250,.13); }
body.dark #bessRtoeAdvisorPanel .zone-schedule td { background:rgba(74,222,128,.11); }
@media(max-width:1150px) {
  #bessRtoeAdvisorPanel .advisor-grid { grid-template-columns:1fr; }
  #bessRtoeAdvisorPanel .kpis { grid-template-columns:repeat(2,minmax(90px,1fr)); }
}
@media(max-width:700px) {
  #bessRtoeAdvisorPanel .advisor-header { flex-direction:column; }
  #bessRtoeAdvisorPanel .advisor-toolbar { justify-content:flex-start; }
  #bessRtoeAdvisorPanel .kpis { grid-template-columns:1fr; }
}
#bessRtoeAdvisorPanel .sim-tools {
  border: 1px dashed var(--border,#dbe3ef);
  border-radius: 14px;
  padding: 10px;
  margin: 0 0 14px;
  background: color-mix(in srgb, var(--panel2,#f1f5f9) 72%, transparent);
}
#bessRtoeAdvisorPanel .sim-title {
  color: var(--muted,#475569);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
#bessRtoeAdvisorPanel .sim-controls {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 8px;
}
#bessRtoeAdvisorPanel .sim-controls label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted,#475569);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}
#bessRtoeAdvisorPanel .sim-controls input,
#bessRtoeAdvisorPanel .sim-controls select {
  min-width: 118px;
  height: 32px;
}
#bessRtoeAdvisorPanel .sim-status {
  color: var(--muted,#475569);
  font-size: 12px;
  margin-top: 7px;
  line-height: 1.35;
}
body.dark #bessRtoeAdvisorPanel .sim-tools {
  background: color-mix(in srgb, var(--panel2,#1f2937) 80%, transparent);
}
#bessRtoeAdvisorPanel .advisor-toolbar label.auto-check {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--border,#dbe3ef);
  border-radius: 10px;
  background: var(--panel2,#f1f5f9);
}
#bessRtoeAdvisorPanel .advisor-toolbar label.auto-check input[type="checkbox"] {
  width: 14px;
  height: 14px;
  min-width: 14px;
  padding: 0;
  margin: 0;
}
body.dark #bessRtoeAdvisorPanel .advisor-toolbar label.auto-check {
  background: var(--panel,#111827);
}
#bessRtoeAdvisorPanel .pill.queued { color:#7c3aed; border-color:rgba(124,58,237,.45); }
body.dark #bessRtoeAdvisorPanel .pill.queued { color:#c4b5fd; }


#bessRtoeAdvisorPanel .auto-usage {
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--border,#dbe3ef);
  border-radius: 12px;
  background: var(--panel,#fff);
  color: var(--text,#0f172a);
  font-size: 12px;
}
#bessRtoeAdvisorPanel .auto-usage-title {
  color: var(--muted,#475569);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .03em;
  font-size: 11px;
  margin-bottom: 6px;
}
#bessRtoeAdvisorPanel .auto-usage-row {
  display: grid;
  grid-template-columns: minmax(96px, 1fr) auto auto minmax(230px, 2fr);
  gap: 8px;
  align-items: center;
  padding: 5px 0;
  border-top: 1px solid var(--border,#dbe3ef);
}
#bessRtoeAdvisorPanel .auto-usage-row:first-of-type { border-top: 0; }
#bessRtoeAdvisorPanel .auto-usage-row b { font-weight: 900; }
#bessRtoeAdvisorPanel .auto-usage-row em {
  font-style: normal;
  font-weight: 900;
  font-size: 11px;
  border-radius: 999px;
  padding: 3px 7px;
  justify-self: start;
}
#bessRtoeAdvisorPanel .auto-usage-row.available em {
  color: #166534;
  border: 1px solid rgba(22,101,52,.35);
  background: rgba(22,101,52,.08);
}
#bessRtoeAdvisorPanel .auto-usage-row.limit-reached em {
  color: #991b1b;
  border: 1px solid rgba(153,27,27,.38);
  background: rgba(153,27,27,.08);
}
#bessRtoeAdvisorPanel .auto-usage-row small { color: var(--muted,#475569); }
#bessRtoeAdvisorPanel .auto-usage-blocked {
  grid-column: 1 / -1;
  color: #991b1b;
  font-weight: 700;
  line-height: 1.3;
}
body.dark #bessRtoeAdvisorPanel .auto-usage { background: var(--panel,#111827); }
body.dark #bessRtoeAdvisorPanel .auto-usage-row.available em { color:#86efac; background: rgba(34,197,94,.12); }
body.dark #bessRtoeAdvisorPanel .auto-usage-row.limit-reached em { color:#fecaca; background: rgba(239,68,68,.12); }
body.dark #bessRtoeAdvisorPanel .auto-usage-blocked { color:#fecaca; }
@media(max-width: 760px) {
  #bessRtoeAdvisorPanel .auto-usage-row { grid-template-columns: 1fr auto; }
  #bessRtoeAdvisorPanel .auto-usage-row small,
  #bessRtoeAdvisorPanel .auto-usage-row em { grid-column: 1 / -1; }
}

#bessRtoeAdvisorPanel .auto-submit-usage {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 8px;
  margin: 8px 0 12px;
}
#bessRtoeAdvisorPanel .auto-usage-card {
  border: 1px solid var(--border,#dbe3ef);
  border-radius: 12px;
  padding: 8px 10px;
  background: var(--panel2,#f1f5f9);
  color: var(--muted,#475569);
  font-size: 12px;
  line-height: 1.35;
}
#bessRtoeAdvisorPanel .auto-usage-card .usage-title {
  color: var(--text,#0f172a);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 4px;
}
#bessRtoeAdvisorPanel .auto-usage-card .usage-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  border-radius: 999px;
  padding: 2px 7px;
  margin-left: 5px;
  background: var(--panel,#fff);
  border: 1px solid var(--border,#dbe3ef);
  color: var(--text,#0f172a);
  font-weight: 900;
}
#bessRtoeAdvisorPanel .auto-usage-card.limit-reached {
  border-color: rgba(220,38,38,.55);
  background: rgba(220,38,38,.07);
}
#bessRtoeAdvisorPanel .auto-usage-card.limit-reached .usage-count {
  color: #b91c1c;
  border-color: rgba(220,38,38,.55);
}
#bessRtoeAdvisorPanel .auto-usage-card.available {
  border-color: rgba(22,163,74,.35);
}
#bessRtoeAdvisorPanel .auto-blocked-reason {
  margin-top: 6px;
  color: #b91c1c;
  font-weight: 800;
}
body.dark #bessRtoeAdvisorPanel .auto-usage-card {
  background: var(--panel,#111827);
}
body.dark #bessRtoeAdvisorPanel .auto-usage-card .usage-title,
body.dark #bessRtoeAdvisorPanel .auto-usage-card .usage-count {
  color: var(--text,#e5e7eb);
}
body.dark #bessRtoeAdvisorPanel .auto-usage-card.limit-reached {
  background: rgba(220,38,38,.14);
}
body.dark #bessRtoeAdvisorPanel .auto-usage-card.limit-reached .usage-count,
body.dark #bessRtoeAdvisorPanel .auto-blocked-reason {
  color: #fca5a5;
}
@media(max-width:800px) {
  #bessRtoeAdvisorPanel .auto-submit-usage { grid-template-columns: 1fr; }
}
#bessRtoeAdvisorPanel .auto-countdown {
  display: inline-flex;
  min-width: 48px;
  justify-content: center;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(37,99,235,.35);
  background: rgba(37,99,235,.08);
  color: #1d4ed8;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
body.dark #bessRtoeAdvisorPanel .auto-countdown {
  border-color: rgba(147,197,253,.38);
  background: rgba(96,165,250,.14);
  color: #93c5fd;
}

/* AUI-053 submitted RTOE / Schedule Offer audit table */
#bessRtoeAdvisorPanel .submitted-audit-panel {
  margin-top: 14px;
  border: 1px solid var(--border,#dbe3ef);
  border-radius: 14px;
  background: var(--panel,#fff);
  overflow: hidden;
}
#bessRtoeAdvisorPanel .submitted-audit-panel > summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--panel2,#f1f5f9);
  color: var(--text,#0f172a);
  font-size: 13px;
  font-weight: 900;
  list-style: none;
}
#bessRtoeAdvisorPanel .submitted-audit-panel > summary::-webkit-details-marker { display: none; }
#bessRtoeAdvisorPanel .submitted-audit-panel > summary::before {
  content: '▾';
  display: inline-flex;
  width: 16px;
  color: var(--muted,#475569);
}
#bessRtoeAdvisorPanel .submitted-audit-panel:not([open]) > summary::before { content: '▸'; }
#bessRtoeAdvisorPanel .submitted-audit-panel > summary span { margin-right: auto; }
#bessRtoeAdvisorPanel .submitted-audit-panel > summary small {
  color: var(--muted,#475569);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
#bessRtoeAdvisorPanel .submitted-audit-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 12px 0;
}
#bessRtoeAdvisorPanel .audit-note {
  padding: 8px 12px 0;
  color: var(--muted,#475569);
  font-size: 12px;
  line-height: 1.35;
}
#bessRtoeAdvisorPanel .submitted-audit-wrap {
  max-height: 520px;
  margin: 10px 12px 12px;
}
#bessRtoeAdvisorPanel #submittedAuditTable,
#bessRtoeAdvisorPanel #submittedAuditTable .audit-detail-table {
  table-layout: auto;
  min-width: 1500px;
}
#bessRtoeAdvisorPanel #submittedAuditTable th,
#bessRtoeAdvisorPanel #submittedAuditTable td {
  text-align: left;
  vertical-align: top;
}
#bessRtoeAdvisorPanel #submittedAuditTable .audit-parent {
  cursor: pointer;
  font-weight: 800;
}
#bessRtoeAdvisorPanel #submittedAuditTable .audit-parent td {
  background: color-mix(in srgb, var(--panel2,#f1f5f9) 75%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--border,#dbe3ef) 75%, #94a3b8);
}
#bessRtoeAdvisorPanel #submittedAuditTable .audit-parent:hover td {
  background: rgba(37,99,235,.08);
}
#bessRtoeAdvisorPanel #submittedAuditTable .audit-chevron {
  width: 32px;
  text-align: center;
  font-size: 15px;
  color: var(--muted,#475569);
}
#bessRtoeAdvisorPanel #submittedAuditTable .audit-reason {
  min-width: 260px;
  max-width: 520px;
  white-space: normal;
  line-height: 1.3;
}
#bessRtoeAdvisorPanel #submittedAuditTable .audit-detail-shell td {
  padding: 10px;
  background: var(--panel,#fff);
}
#bessRtoeAdvisorPanel #submittedAuditTable .audit-detail-title {
  margin: 0 0 8px;
  color: var(--muted,#475569);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}
#bessRtoeAdvisorPanel #submittedAuditTable .audit-detail-table {
  border: 1px solid var(--border,#dbe3ef);
  border-radius: 10px;
  overflow: hidden;
}
#bessRtoeAdvisorPanel #submittedAuditTable .audit-detail-row.changed td {
  background: rgba(22,163,74,.08);
  font-weight: 800;
}
#bessRtoeAdvisorPanel #submittedAuditTable .audit-empty {
  text-align: left;
  color: var(--muted,#475569);
  padding: 14px;
}
body.dark #bessRtoeAdvisorPanel .submitted-audit-panel { background: var(--panel,#111827); }
body.dark #bessRtoeAdvisorPanel .submitted-audit-panel > summary,
body.dark #bessRtoeAdvisorPanel #submittedAuditTable .audit-parent td { background: var(--panel2,#1f2937); }
body.dark #bessRtoeAdvisorPanel #submittedAuditTable .audit-parent:hover td { background: rgba(96,165,250,.13); }
body.dark #bessRtoeAdvisorPanel #submittedAuditTable .audit-detail-shell td { background: var(--panel,#111827); }
body.dark #bessRtoeAdvisorPanel #submittedAuditTable .audit-detail-row.changed td { background: rgba(34,197,94,.12); }
