/* Styles for the shared dashboard interface (dashboard-ui.js) and the analyst dashboards
   (dashboard-analyst.js): popovers, toast, drawer, persona menu, and the analyst panels. */

/* ---------- Persona switcher in the sidebar footer ---------- */
.nav-user { cursor: pointer; border-radius: 10px; }
.nav-user:hover { background: rgba(255, 255, 255, 0.05); }
.nav-user:focus-visible { outline: 2px solid var(--blue-accent); outline-offset: 2px; }
.nav-user__chev { margin-left: auto; flex: none; color: var(--nav-text); }
.sidebar.collapsed .nav-user__chev { display: none; }

/* ---------- Popover ---------- */
.dash-pop {
  position: fixed; z-index: 200; min-width: 240px; max-width: 320px; padding: 8px;
  background: #fff; color: var(--ink); border: 1px solid var(--surface-border); border-radius: 12px;
  box-shadow: 0 16px 40px -12px rgba(16, 27, 48, 0.35);
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  animation: pop-in .16s ease-out;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.pop-title { padding: 6px 8px 8px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.pop-body { margin: 0; padding: 0 8px 10px; font-size: 13.5px; line-height: 1.5; }
.pop-actions { display: flex; gap: 8px; padding: 0 8px 6px; }
.pop-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px; border: 0; border-radius: 8px; background: none; cursor: pointer;
  font-family: inherit; font-size: 13.5px; color: var(--ink);
}
.pop-item:hover, .pop-item:focus-visible { background: #F2F7FE; outline: none; }
.pop-item img { width: 30px; height: 30px; border-radius: 50%; flex: none; }
.pop-item span { display: flex; flex-direction: column; min-width: 0; }
.pop-item b { font-weight: 600; }
.pop-item small { font-size: 12px; color: var(--muted); }
.pop-item em { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 600; color: var(--blue-dark); background: var(--blue-tint); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.dash-pop--form label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 8px 4px; }
.dash-pop--form select, .dash-pop--form textarea {
  display: block; width: calc(100% - 16px); margin: 0 8px 10px; font: inherit; font-size: 13.5px; color: var(--ink);
  border: 1px solid var(--surface-border); border-radius: 8px; padding: 7px 10px; background: #fff;
}
.dash-pop--form textarea { min-height: 72px; resize: vertical; }
.dash-pop--form select:focus, .dash-pop--form textarea:focus { outline: 2px solid var(--blue-accent); outline-offset: 0; border-color: transparent; }

/* ---------- Toast ---------- */
.dash-toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 300; transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  max-width: min(520px, calc(100vw - 32px)); padding: 11px 18px; border-radius: 12px; background: var(--ink); color: #fff;
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 13.5px; line-height: 1.45;
  box-shadow: 0 16px 40px -12px rgba(16, 27, 48, 0.5); transition: opacity .2s ease, transform .25s ease;
}
.dash-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.dash-toast b { font-weight: 600; }

/* ---------- Drawer ---------- */
.dash-drawer {
  position: fixed; inset: 0 0 0 auto; margin: 0; width: min(480px, 100vw); height: 100vh; max-width: none; max-height: none; padding: 0;
  border: 0; border-left: 1px solid var(--surface-border); background: var(--surface); color: var(--ink);
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; box-shadow: -24px 0 60px -20px rgba(16, 27, 48, 0.4);
}
.dash-drawer[open] { animation: drawer-in .3s cubic-bezier(0.22, 1, 0.36, 1); }
.dash-drawer::backdrop { background: rgba(19, 25, 41, 0.4); }
@keyframes drawer-in { from { transform: translateX(32px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-shell { position: relative; height: 100%; overflow-y: auto; padding: 28px 28px 32px; }
.drawer-close { position: absolute; top: 16px; right: 16px; }
.drawer-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.dash-drawer h2 { margin: 6px 40px 4px 0; font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
.dash-drawer h3 { margin: 22px 0 8px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.dash-drawer p { margin: 0 0 8px; font-size: 14px; line-height: 1.55; }
.dash-drawer ul { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.55; }
.drawer-issue { color: var(--ink); font-size: 15px !important; }
.drawer-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.drawer-tier { font-size: 12px; color: var(--muted); }
.drawer-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 0; }
.drawer-facts div { background: var(--canvas); border-radius: 10px; padding: 10px 12px; }
.drawer-facts dt { font-size: 11px; color: var(--muted); }
.drawer-facts dd { margin: 2px 0 0; font-size: 15px; font-weight: 600; }
.drawer-facts dd.bad { color: var(--status-critical-text); }
.drawer-note { color: var(--muted); font-size: 13px !important; }
.drawer-timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
.drawer-timeline li { position: relative; display: flex; flex-direction: column; padding: 0 0 12px 18px; font-size: 13.5px; border-left: 2px solid var(--surface-border); }
.drawer-timeline li::before { content: ""; position: absolute; left: -6px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--blue-primary); border: 2px solid #fff; }
.drawer-timeline li.is-open::before { background: var(--status-critical); }
.drawer-timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.drawer-timeline b { font-weight: 600; }
.drawer-timeline span { color: var(--muted); font-size: 12.5px; }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--surface-border); }
.drawer-ask { display: inline-flex; align-items: center; gap: 6px; }
.drawer-exceptions { list-style: none; padding: 0 !important; display: flex; flex-direction: column; gap: 8px; }
.drawer-exceptions li { display: flex; gap: 10px; align-items: baseline; background: var(--canvas); border-radius: 10px; padding: 10px 12px; }
.pg { flex: none; font-size: 11px; font-weight: 600; color: var(--blue-dark); background: var(--blue-tint); border-radius: 4px; padding: 1px 7px; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .dash-pop, .dash-drawer[open], .dash-toast { animation: none; transition: none; } }

/* ---------- Analyst dashboards ---------- */
.dash > .panel.plain-head .panel__head { padding-bottom: var(--space-3); }
.count-pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--blue-tint); color: var(--blue-dark); vertical-align: 1px; }
.count-pill.bad { background: rgba(196, 63, 63, 0.1); color: var(--status-critical-text); }

.row-list { list-style: none; margin: 0; padding: 0 var(--space-5); }
.row-list li { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-3) 0; border-top: 1px solid var(--surface-border); }
.row-list li:first-child { border-top: 0; }
.row-list li.is-changed { animation: row-changed 2.6s ease-out; }
.row-list .grow { flex: 1; min-width: 0; }
.row-list .kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.row-list .quote { font-size: 13px; color: var(--ink); margin-top: 3px; }
.doc-badge { font-size: 11px; font-weight: 600; color: var(--muted); border: 1px solid var(--surface-border); border-radius: 4px; padding: 0 6px; }
.fw-badge { font-size: 11px; font-weight: 600; color: #fff; background: var(--blue-dark); border-radius: 4px; padding: 1px 7px; }
.done-note { font-size: 12.5px; font-weight: 600; color: #2C7D54; white-space: nowrap; }
.over-note { font-size: 12.5px; font-weight: 600; color: var(--status-warn-text); white-space: nowrap; }
.muted { color: var(--muted); }

/* Marcus: intake queue */
.sla-cell b { font-variant-numeric: tabular-nums; }
.sla-cell.bad b { color: var(--status-critical-text); }
.sla-cell.warn b { color: var(--status-warn-text); }
.qbar { height: 6px; width: 120px; background: var(--surface-border); border-radius: 3px; overflow: hidden; margin-bottom: 4px; }
.qbar span { display: block; height: 100%; background: var(--blue-primary); border-radius: 3px; }
.qbar.done span { background: var(--status-low); }
table.vendor-table.intake th, table.vendor-table.intake td { padding-left: 10px; padding-right: 10px; }
table.vendor-table.intake th:first-child, table.vendor-table.intake td:first-child { padding-left: var(--space-5); }
table.vendor-table.intake th:last-child, table.vendor-table.intake td:last-child { padding-right: var(--space-5); }
table.vendor-table.intake th { white-space: nowrap; }
.t-routine { background: #EAF1FA; color: var(--blue-dark); }
.due-bars { display: flex; align-items: flex-end; gap: 10px; height: 132px; padding-top: 8px; }
.due-bars .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.due-bars .bar { width: 100%; max-width: 44px; min-height: 4px; border-radius: 4px 4px 0 0; background: var(--blue-primary); transition: height .4s ease; }
.due-bars .bar.past { background: var(--status-critical); }
.due-bars .bar.today { background: var(--status-high); }
.due-bars .n { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.due-bars .d { font-size: 11px; color: var(--muted); white-space: nowrap; }
.header-note { margin: 0; text-align: right; }
@media (max-width: 1180px) { .header-note { text-align: left; } }

.btn-row { white-space: nowrap; }
