/* ============================================================
   Polaris Platform — UI kit styles
   Layered on top of /colors_and_type.css
   ============================================================ */

* { box-sizing: border-box; }
html, body, #root { height: 100%; }
body { background: var(--bg); color: var(--fg1); margin: 0; }

button { font-family: inherit; cursor: pointer; }
a { color: var(--accent); text-decoration: none; }

/* ----- App shell ----- */
.app {
  display: grid;
  grid-template-columns: 250px 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ----- Sidebar ----- */
.sb {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 18px 14px 12px;
  gap: 2px;
}
.sb-brand { position: relative; display: flex; align-items: center; padding: 4px 8px 18px; cursor: pointer; }
.sb-brand img { width: 150px; height: auto; display: block; }
.sb-brand .sb-logo-dark { display: none; }
[data-theme="dark"] .sb-brand .sb-logo-light { display: none; }
[data-theme="dark"] .sb-brand .sb-logo-dark { display: block; }
.sb-brand-tip {
  position: absolute; left: 30px; top: 30px;
  background: var(--slate-800); color: #fff; font-size: 11px; font-weight: 500;
  padding: 3px 8px; border-radius: 5px; opacity: 0; pointer-events: none;
  transition: opacity var(--t-fast) var(--ease-out); white-space: nowrap;
}
.sb-brand:hover .sb-brand-tip { opacity: 1; }

.sb-nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.sb-section { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg3); font-weight: 700; padding: 16px 10px 8px; }
.sb-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 14px; color: var(--fg1); font-weight: 500;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease-out);
}
.sb-item > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-item:hover { background: var(--surface-muted); }
.sb-item.is-active { background: var(--accent-tint); color: var(--accent-pressed); font-weight: 600; }
.sb-item.is-active svg { color: var(--accent-pressed); }
.sb-item svg { color: var(--fg2); flex-shrink: 0; }
.sb-item-count { margin-left: auto; font-size: 12px; color: var(--fg3); font-variant-numeric: tabular-nums; font-weight: 500; }
.sb-item.is-active .sb-item-count { color: var(--accent-pressed); }

.sb-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.sb-foot-user { display: flex; align-items: center; gap: 11px; padding: 9px 8px; border-radius: 8px; cursor: pointer; transition: background var(--t-fast) var(--ease-out); }
.sb-foot-user:hover { background: var(--surface-muted); }
.sb-foot-user.is-active { background: var(--accent-tint); }
.sb-foot-user .av { width: 32px; height: 32px; border-radius: 999px; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.sb-foot-text { min-width: 0; overflow: hidden; }
.sb-foot-text .name { font-size: 13.5px; font-weight: 600; color: var(--fg1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-foot-text .sub  { font-size: 11.5px; color: var(--fg2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-foot-logout { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--danger); cursor: pointer; transition: background var(--t-fast) var(--ease-out); }
.sb-foot-logout:hover { background: var(--danger-tint); }
.sb-foot-powered { padding: 12px 10px 4px; font-size: 11px; color: var(--fg3); font-weight: 500; }
.sb-foot-powered .xdi { color: var(--accent); font-weight: 700; }

/* ----- Top bar ----- */
.main { display: flex; flex-direction: column; overflow: hidden; }
.tb {
  height: 64px; flex-shrink: 0;
  display: flex; align-items: center; gap: 14px;
  padding: 0 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  /* Positioned + z-index so the topbar's stacking context floats above
     .content. Without this the ws-menu dropdown (z-index 70 inside .tb)
     was being painted UNDER .content — view-transition-name on .tb
     creates an isolated stacking context, so we must explicitly elevate it. */
  position: relative;
  z-index: var(--z-topbar);
}
.tb-title { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; color: var(--fg1); }
.tb-status { display: flex; align-items: center; gap: 8px; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 999px; white-space: nowrap; }
.status-badge.mock { background: var(--surface-muted); color: var(--fg1); }
.status-badge.prod { background: var(--success-tint); color: var(--success-fg); }
.status-badge.locked { background: var(--warning-tint); color: var(--warning-fg); }
.tb-spacer { flex: 1; }
.tb-search {
  width: 100%; max-width: 560px;
  position: relative; cursor: text;
}
.tb-search input {
  width: 100%; padding: 9px 12px 9px 36px;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-muted);
  font-size: 13.5px; color: var(--fg1); outline: none;
  font-family: inherit; cursor: text;
}
.tb-search input:focus { background: var(--surface); border-color: var(--accent); box-shadow: var(--shadow-focus); }
.tb-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--fg3); }
.tb-search .kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-family: var(--font-mono); font-size: 11px; color: var(--fg2); background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 2px 6px; white-space: nowrap; }

.tb-icon-btn { width: 36px; height: 36px; border-radius: 8px; border: 1px solid transparent; background: transparent; display: grid; place-items: center; color: var(--fg2); position: relative; flex-shrink: 0; text-decoration: none; }
.tb-icon-btn:hover { background: var(--surface-muted); color: var(--fg1); }
.tb-icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; background: var(--danger); border-radius: 50%; border: 2px solid var(--surface); }

/* ----- Language toggle ----- */
.lang-toggle { display: inline-flex; align-items: center; gap: 2px; height: 32px; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-muted); flex-shrink: 0; }
.lang-toggle span { font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em; color: var(--fg2); padding: 4px 8px; border-radius: 6px; line-height: 1; transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out); }
.lang-toggle span.is-on { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }
.lang-toggle:hover span:not(.is-on) { color: var(--fg1); }

/* ----- Content area ----- */
.content { flex: 1; overflow: auto; padding: 28px 36px 56px; }
.row-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

/* ----- Card ----- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-xs);
}
.card-pad { padding: 16px 18px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.card-head .sub { font-size: 12px; color: var(--fg2); }
.card-head .spacer { flex: 1; }

/* ----- Buttons ----- */
.btn { font-size: 13px; font-weight: 500; padding: 7px 12px; border-radius: 4px; border: 1px solid transparent; display: inline-flex; align-items: center; gap: 6px; line-height: 1; white-space: nowrap; transition: background var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out), transform 100ms var(--ease-snap); }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--fg1); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-muted); }
.btn-ghost { background: transparent; color: var(--fg1); }
.btn-ghost:hover { background: var(--surface-muted); }
.btn-sm { font-size: 12px; padding: 5px 9px; }
/* Disabled buttons (e.g. Approve/Reject for operators) — clearly inactive, not-allowed cursor. */
.btn:disabled, .btn[disabled] { background: var(--surface-muted); color: var(--fg3); border-color: var(--border); cursor: not-allowed; opacity: 0.7; box-shadow: none; pointer-events: auto; }
.btn:disabled:hover, .btn[disabled]:hover { background: var(--surface-muted); color: var(--fg3); border-color: var(--border); }

/* ----- Pills ----- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; line-height: 1.4; }
.pill .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill-review   { background: var(--accent-tint); color: var(--accent-pressed); }
.pill-active   { background: var(--success-tint); color: var(--success-fg); }
.pill-pending  { background: var(--warning-tint); color: var(--warning-fg); }
.pill-escalated{ background: var(--danger-tint);  color: var(--danger-fg); }
.pill-warning  { background: var(--warning-tint); color: var(--warning-fg); }
.pill-danger   { background: var(--danger-tint);  color: var(--danger-fg); }
.pill-neutral  { background: var(--surface-muted); color: var(--fg1); }
.pill-info     { background: var(--info-tint); color: var(--info-fg); }
.pill-violet   { background: var(--violet-tint); color: var(--violet-fg); }

/* ----- Avatar ----- */
.av { display: inline-flex; align-items: center; justify-content: center; background: var(--surface-muted); color: var(--fg1); font-weight: 600; border-radius: 999px; flex-shrink: 0; }
.av-blue  { background: var(--accent-tint);  color: var(--accent-pressed); }
.av-green { background: var(--success-tint); color: var(--success-fg); }
.av-amber { background: var(--warning-tint); color: var(--warning-fg); }
.av-red   { background: var(--danger-tint);  color: var(--danger-fg); }
.av-slate { background: var(--surface-muted); color: var(--fg1); }

/* ----- Metric tile ----- */
.tile { padding: 16px 18px; }
.tile .eyebrow { font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg2); font-weight: 600; }
.tile .val {
  font-size: 28px; font-weight: 700; color: var(--fg1);
  margin-top: 10px; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums; line-height: 1;
  /* `.is-bump` is toggled briefly via JS when the displayed value changes,
     creating a subtle "confirmed update" affordance. */
  transition: transform 200ms var(--ease-snap), color 200ms var(--ease-out);
  display: inline-block; transform-origin: left center;
}
.tile .val.is-bump { transform: scale(1.06); color: var(--accent); }
.tile .val small { font-size: 14px; font-weight: 500; color: var(--fg2); margin-left: 4px; }
.tile .delta { margin-top: 10px; font-size: 11.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.tile .delta.up   { color: var(--success-fg); }
.tile .delta.down { color: var(--danger-fg); }
.tile .delta.flat { color: var(--fg2); }
.tile .note { font-size: 11.5px; color: var(--fg2); margin-left: 6px; font-weight: 500; }

/* ----- Agent card ----- */
.agent { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.agent-head { display: flex; align-items: center; gap: 10px; }
.agent-icon { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.agent-name { font-size: 13.5px; font-weight: 600; }
.agent-meta { font-size: 11.5px; color: var(--fg2); }
.agent-status { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; }
.agent-status .dot { width: 7px; height: 7px; border-radius: 50%; }
.agent-status .dot.online { background: var(--success); box-shadow: 0 0 0 0 rgba(16,185,129,0.6); animation: pulse 1.8s infinite; }
.agent-status .dot.degraded { background: var(--warning); }
.agent-status .dot.offline  { background: var(--fg3); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(16,185,129,0.5); } 70% { box-shadow: 0 0 0 8px rgba(16,185,129,0); } 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); } }
.agent-load { display: flex; flex-direction: column; gap: 4px; }
.agent-load-track { height: 4px; background: var(--surface-muted); border-radius: 999px; overflow: hidden; }
.agent-load-fill  { height: 100%; border-radius: 999px; }
.agent-load-meta  { display: flex; justify-content: space-between; font-size: 11px; color: var(--fg2); }
.agent-row { display: flex; align-items: center; gap: 10px; }
.agent-row .stat { display: flex; flex-direction: column; }
.agent-actions .btn { flex: 1; justify-content: center; }

/* ----- Live system-health strip ----- */
.live-strip { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 18px; flex-wrap: wrap; }
.live-strip-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.live-strip-main > svg { color: var(--success-fg); flex-shrink: 0; }
.live-strip-text { font-size: 14px; font-weight: 600; color: var(--fg1); }
.live-strip-meta { font-size: 12.5px; color: var(--fg2); }
.live-strip-sep { width: 1px; height: 18px; background: var(--border); }
.live-strip-right { display: flex; align-items: center; gap: 12px; }
.live-strip-sync { font-size: 12px; color: var(--fg3); font-variant-numeric: tabular-nums; }

/* WebSocket live badge */
.ws-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; letter-spacing: 0.02em; }
.ws-badge .ws-dot { width: 7px; height: 7px; border-radius: 50%; }
.ws-badge.on  { background: var(--success-tint); color: var(--success-fg); }
.ws-badge.on .ws-dot  { background: var(--success); animation: pulse 1.8s infinite; }
.ws-badge.off { background: var(--warning-tint); color: var(--warning-fg); }
.ws-badge.off .ws-dot { background: var(--warning); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.3; } }

/* Top-bar live pill */
.tb-live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: var(--success-tint); color: var(--success-fg); flex-shrink: 0; }
.tb-live .ws-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); animation: pulse 1.8s infinite; }
.tb-live.off { background: var(--warning-tint); color: var(--warning-fg); }
.tb-live.off .ws-dot { background: var(--warning); animation: blink 1s steps(2) infinite; }

/* ============================================================
   HEALTH PAGE
   ============================================================ */
.hl-summary { display: grid; grid-template-columns: repeat(4, 1fr); padding: 0; }
.hl-sum-item { display: flex; align-items: center; gap: 14px; padding: 18px 22px; border-left: 1px solid var(--border); }
.hl-sum-item:first-child { border-left: 0; }
.hl-sum-ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.hl-sum-val { font-size: 15.5px; font-weight: 700; color: var(--fg1); line-height: 1.2; white-space: nowrap; }
.hl-sum-label { font-size: 12px; color: var(--fg2); margin-top: 3px; }

.hl-svc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.hl-svc { border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.hl-svc-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.hl-svc-ico { width: 38px; height: 38px; border-radius: 10px; background: var(--surface-muted); color: var(--fg2); display: grid; place-items: center; }
.hl-svc-name { font-size: 15px; font-weight: 700; color: var(--fg1); }
.hl-svc-meta { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; font-size: 12.5px; color: var(--fg2); }
.hl-svc-meta b { color: var(--fg1); font-variant-numeric: tabular-nums; }

.hl-row { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start; }
.hl-machines { display: flex; flex-direction: column; }
.hl-machine { display: grid; grid-template-columns: 12px 1fr 160px auto; gap: 16px; align-items: center; padding: 16px 4px; border-top: 1px solid var(--surface-muted); }
.hl-machine:first-child { border-top: 0; }
/* Operator conclusion — lightweight floating sticky card. Subtle, clear, intentional:
   restrained layered shadow + almost-imperceptible blue ambient ring (no visible blue border,
   no big glow, no modal feel). Pins below the drawer header while the email scrolls under it. */
.rv-conclusion {
  position: sticky; top: 0; z-index: 20;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(15,23,42,0.06), 0 8px 24px rgba(15,23,42,0.10), 0 0 0 1px rgba(59,130,246,0.04);
}
[data-theme="dark"] .rv-conclusion { box-shadow: 0 1px 2px rgba(0,0,0,0.4), 0 8px 24px rgba(0,0,0,0.45), 0 0 0 1px rgba(59,130,246,0.06); }
.rv-conclusion > label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 600; color: var(--fg2); margin: 0 0 10px; }
.rv-concl-title { display: inline-flex; align-items: center; gap: 7px; }
.rv-concl-title svg { width: 14px; height: 14px; color: var(--fg3); }
.rv-conclusion-status { font-size: 11.5px; font-weight: 500; color: var(--fg3); }
.rv-conclusion textarea {
  width: 100%; box-sizing: border-box; min-height: 84px; resize: vertical;
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
  font: 13px/1.55 inherit; color: var(--fg1); background: var(--surface); display: block;
}
.rv-conclusion textarea::placeholder { color: var(--fg3); }
.rv-conclusion textarea:focus { outline: none; border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(59,130,246,0.12); }
.rv-conclusion-foot { display: flex; justify-content: flex-end; margin-top: 12px; }

/* Live email preview (full Gmail thread, rendered in sandboxed iframes) */
.rv-mail { display: flex; flex-direction: column; gap: 14px; }
.rv-mailload { color: var(--fg2); font-size: 13px; padding: 16px; text-align: center; }
.rv-msg { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.rv-msg-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 12px; background: var(--surface-muted); border-bottom: 1px solid var(--border); }
.rv-msg-from { font-size: 13px; font-weight: 600; color: var(--fg1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-msg-date { font-size: 11.5px; color: var(--fg3); white-space: nowrap; }
.rv-msg-frame { width: 100%; border: 0; display: block; background: #fff; min-height: 80px; }
.rv-atts { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); }
.rv-att { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: 12px; color: var(--fg1); text-decoration: none; background: var(--surface-muted); }
.rv-att:hover { border-color: var(--accent); color: var(--accent); }
.rv-att svg { width: 12px; height: 12px; }
.rv-att-size { color: var(--fg3); font-size: 11px; }

.dot-lg { width: 10px; height: 10px; border-radius: 50%; background: var(--fg3); }
.hl-machine-conn { font-size: 12px; color: var(--fg2); min-width: 0; }
.hl-conn { display: inline-block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.dot-lg.online { background: var(--success); box-shadow: 0 0 0 0 rgba(16,185,129,0.5); animation: pulse 1.8s infinite; }
.dot-lg.degraded { background: var(--warning); }
.dot-lg.offline { background: var(--fg3); }
.hl-machine-name { font-size: 14px; font-weight: 600; color: var(--fg1); font-family: var(--font-mono); }
.hl-machine-sub { font-size: 12.5px; color: var(--fg2); margin-top: 3px; }
.hl-cpu-label { font-size: 11.5px; color: var(--fg2); margin-bottom: 5px; }
.hl-cpu-track { height: 5px; border-radius: 999px; background: var(--surface-muted); overflow: hidden; }
.hl-cpu-fill { height: 100%; border-radius: 999px; }
.hl-machine-hb { font-size: 11px; color: var(--fg3); text-align: right; line-height: 1.5; }
.hl-queue { align-self: start; }
.hl-q-stat { display: flex; align-items: center; justify-content: space-between; padding: 14px 2px; border-top: 1px solid var(--surface-muted); font-size: 14px; color: var(--fg2); }
.hl-q-stat:first-of-type { border-top: 0; }
.hl-q-stat b { font-size: 18px; color: var(--fg1); font-variant-numeric: tabular-nums; }

.hl-incident { display: grid; grid-template-columns: 24px 1fr auto; gap: 14px; align-items: start; padding: 15px 20px; border-top: 1px solid var(--surface-muted); }
.hl-incident:first-of-type { border-top: 0; }
.hl-inc-on { color: var(--warning-fg); }
.hl-inc-ok { color: var(--success-fg); }
.hl-inc-title { font-size: 14px; font-weight: 600; color: var(--fg1); display: flex; align-items: center; gap: 10px; }
.hl-inc-detail { font-size: 13px; color: var(--fg2); margin-top: 4px; }
.hl-inc-time { font-size: 12.5px; white-space: nowrap; }

@media (max-width: 1100px) {
  .hl-summary { grid-template-columns: 1fr 1fr; }
  .hl-svc-grid { grid-template-columns: 1fr 1fr; }
  .hl-row { grid-template-columns: 1fr; }
}

/* ============================================================
   AVATAR UPLOADER + 2FA PANEL
   ============================================================ */
.avu { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.avu-preview { border-radius: 999px; overflow: hidden; flex-shrink: 0; }
.avu-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avu-initials { border-radius: 999px; font-weight: 700; }
.avu-drop { flex: 1; min-width: 200px; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1.5px dashed var(--border-strong); border-radius: 12px; cursor: pointer; transition: border-color var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out); }
.avu-drop:hover, .avu-drop.is-drag { border-color: var(--accent); background: var(--accent-tint); }
.avu-drop > svg { color: var(--accent-fg); flex-shrink: 0; }
.avu-drop-title { font-size: 13.5px; font-weight: 600; color: var(--fg1); line-height: 1.35; }
.avu-drop-sub { font-size: 12px; color: var(--fg2); margin-top: 2px; }
.avu-remove { color: var(--danger); flex-shrink: 0; }

.tfa { display: flex; flex-direction: column; gap: 16px; }
.tfa-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.tfa-title { font-size: 14.5px; font-weight: 600; color: var(--fg1); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tfa-sub { font-size: 13px; color: var(--fg2); margin-top: 4px; }
.tfa-enforce { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--fg1); padding: 12px 14px; background: var(--surface-muted); border-radius: 10px; cursor: pointer; }
.tfa-enforce input { width: 16px; height: 16px; accent-color: var(--accent); }
.tfa-setup { display: flex; flex-direction: column; gap: 16px; padding-top: 16px; border-top: 1px solid var(--surface-muted); }
.tfa-methods { display: flex; gap: 10px; }
.tfa-method { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); font-size: 13.5px; font-weight: 600; color: var(--fg2); }
.tfa-method.is-on { border-color: var(--accent); background: var(--accent-tint); color: var(--accent-fg); }
.tfa-app { display: flex; gap: 18px; align-items: center; }
.tfa-app-side { min-width: 0; }
.tfa-app-label { font-size: 13.5px; font-weight: 600; color: var(--fg1); margin-bottom: 10px; }
.tfa-key { font-size: 12px; color: var(--fg2); display: flex; flex-direction: column; gap: 6px; }
.tfa-key code { font-family: var(--font-mono); font-size: 13px; color: var(--fg1); letter-spacing: 0.08em; background: var(--surface-muted); padding: 8px 10px; border-radius: 8px; }
.tfa-tg { padding: 4px 0; }
.tfa-verify { display: flex; align-items: flex-end; gap: 12px; }
.tfa-verify .field { width: 100%; letter-spacing: 0.3em; font-family: var(--font-mono); }

/* ----- Department connection health ----- */
.conn-health { display: flex; align-items: center; gap: 12px; padding: 13px 15px; border-radius: 12px; margin-bottom: 18px; border: 1px solid var(--border); background: var(--surface-muted); }
.conn-health > svg { flex-shrink: 0; color: var(--fg2); }
.conn-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.conn-health.online  .conn-dot { background: var(--success); box-shadow: 0 0 0 0 rgba(16,185,129,0.5); animation: pulse 1.8s infinite; }
.conn-health.degraded .conn-dot { background: var(--warning); animation: blink 1.2s steps(2) infinite; }
.conn-health.offline  .conn-dot { background: var(--danger); }
.conn-health.online  > svg { color: var(--success-fg); }
.conn-health.degraded > svg { color: var(--warning-fg); }
.conn-health.offline  > svg { color: var(--danger-fg); }
.conn-title { font-size: 14px; font-weight: 600; color: var(--fg1); }
.conn-title b { font-weight: 700; }
.conn-health.online  .conn-title b { color: var(--success-fg); }
.conn-health.degraded .conn-title b { color: var(--warning-fg); }
.conn-health.offline  .conn-title b { color: var(--danger-fg); }
.conn-sub { font-size: 12.5px; color: var(--fg2); margin-top: 3px; }

/* ----- Editable template rows ----- */
.tpl-row { cursor: pointer; }
.tpl-row:hover { background: var(--surface-muted); }
.drawer-body textarea.tpl-body-input { width: 100% !important; max-width: 100%; box-sizing: border-box; resize: vertical; min-height: 340px; line-height: 1.55; font-family: var(--font-mono); font-size: 13px; }
/* any field inside a drawer form-section fills the drawer width (matches the inputs in the grid above) */
.drawer-body .form-section .field { width: 100%; box-sizing: border-box; }
/* Hide the Ani floating widgets while a drawer is open so they never cover the Save/Cancel buttons.
   Toggled via body.drawer-open (cheap class selector) — NOT body:has(), which forces a style
   recalc on every DOM mutation and freezes heavy pages like /coi. */
body.drawer-open .ani-fab,
body.drawer-open .ani-peek,
body.drawer-open .ani-float { display: none !important; }

/* ----- Compact date/time (never wrap) ----- */
.audit-time, .tl-time, .hl-inc-time, .qrow-time { white-space: nowrap; }

/* ----- Telegram alerts card ----- */
.tg-body { display: flex; flex-direction: column; gap: 18px; padding-top: 18px; margin-top: 4px; border-top: 1px solid var(--surface-muted); }
.tg-target { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px; background: var(--surface-muted); }
.tg-target-ic { width: 40px; height: 40px; border-radius: 11px; background: #e0f2fe; color: #0369a1; display: grid; place-items: center; flex-shrink: 0; }
.tg-target-main { flex: 1; min-width: 0; }
.tg-target-name { font-size: 14.5px; font-weight: 700; color: var(--fg1); }
.tg-target-sub { font-size: 12.5px; color: var(--fg2); margin-top: 3px; }
.tg-test.sent { color: var(--success-fg); border-color: var(--success); }
.tg-test svg { transition: transform var(--t-base) var(--ease-out); }
.tg-test.sending svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* Global rule: every lucide loading spinner animates. Buttons swap in a loader icon while working,
   so any of these icons spins automatically wherever they appear. */
svg.lucide-loader, svg.lucide-loader-2, svg.lucide-loader-circle, .spin svg, i.is-loading { animation: spin 0.8s linear infinite; transform-origin: center; }

.tg-creds { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 14px; }
.tg-creds .field { width: 100%; font-family: var(--font-mono); font-size: 12.5px; }
.tg-creds select.field { font-family: var(--font-sans); }

.tg-events-head { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--fg2); }
.tg-events { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tg-event { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; transition: border-color var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out); }
.tg-event:hover { border-color: var(--border-strong); }
.tg-event.on { border-color: var(--accent); background: var(--accent-tint); }
.tg-event input { width: 16px; height: 16px; accent-color: var(--accent); flex-shrink: 0; }
.tg-event-label { flex: 1; font-size: 13px; color: var(--fg1); line-height: 1.35; }

.tg-recent { display: flex; flex-direction: column; }
.tg-recent-row { display: grid; grid-template-columns: 12px 1fr auto auto auto; gap: 12px; align-items: center; padding: 11px 2px; border-top: 1px solid var(--surface-muted); }
.tg-recent-row:first-child { border-top: 0; }
.tg-recent-event { font-size: 13.5px; color: var(--fg1); }
.tg-recent-time { font-size: 12px; color: var(--fg2); white-space: nowrap; }
.tg-recent-ok { color: var(--success-fg); display: inline-flex; }

@media (max-width: 1100px) {
  .tg-creds { grid-template-columns: 1fr; }
  .tg-events { grid-template-columns: 1fr; }
}

/* ============================================================
   MULTI-TENANT  —  company mark, xdi console, switcher
   ============================================================ */
.cmark-logo { display: inline-flex; align-items: center; }
.cmark-logo img { width: auto; display: block; }
.cmark-logo .sb-logo-dark { display: none; }
[data-theme="dark"] .cmark-logo .sb-logo-light { display: none; }
[data-theme="dark"] .cmark-logo .sb-logo-dark { display: block; }
/* company-mark partial: light theme shows the light-variant logo, dark theme the dark-variant */
.cmark-logo .cmark-img-dark { display: none; }
[data-theme="dark"] .cmark-logo .cmark-img-light { display: none; }
[data-theme="dark"] .cmark-logo .cmark-img-dark { display: block; }
.sb-company .cmark-logo img { max-width: 150px; }
.cmark-chip { border-radius: 9px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; letter-spacing: -0.02em; flex-shrink: 0; }

/* company sidebar brand */
.sb-company { display: flex; align-items: center; gap: 11px; }
.sb-company-name { font-size: 16px; font-weight: 700; color: var(--fg1); letter-spacing: -0.01em; }

/* role badge in sidebar footer */
.sb-role { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.02em; padding: 5px 10px; border-radius: 999px; margin-bottom: 10px; width: fit-content; white-space: nowrap; }
.sb-role.platform { background: var(--violet-tint); color: var(--violet-fg); }
.sb-role.company  { background: var(--accent-tint); color: var(--accent-fg); }

/* xdi sidebar */
.sb-xdi-brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; }
.xdi-mark { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--fg1); color: var(--bg); font-weight: 800; font-size: 15px; letter-spacing: -0.03em; }
.xdi-mark.sm { width: 24px; height: 24px; font-size: 11px; border-radius: 7px; }
.xdi-brand-name { font-size: 16px; font-weight: 800; color: var(--fg1); letter-spacing: -0.01em; line-height: 1.1; }
.xdi-brand-sub { font-size: 11px; color: var(--fg2); letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; }

/* workspace switcher */
.ws { position: relative; flex-shrink: 0; }
.ws-btn { display: inline-flex; align-items: center; gap: 9px; height: 38px; padding: 0 11px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--fg1); font-family: inherit; cursor: pointer; }
.ws-btn:hover { border-color: var(--border-strong); background: var(--surface-muted); }
.ws-btn-static { cursor: default; }
.ws-name { font-size: 14px; font-weight: 700; letter-spacing: -0.005em; }
.ws-btn > svg { color: var(--fg3); }
.ws-locked .ws-btn { background: var(--surface-muted); }

/* Drop down anchored to the RIGHT edge of the .ws button — the switcher now
   sits on the right side of the topbar (between lang-toggle and theme-toggle),
   so a left-anchored 320px menu would clip past the viewport. */
.ws-menu {
  position: absolute; top: 46px; right: 0; left: auto;
  width: 320px; max-width: calc(100vw - 24px); max-height: calc(100vh - 80px);
  overflow-y: auto; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow-lg); padding: 8px; z-index: var(--z-dropdown);
  /* Origin-aware scale from top-right (where the trigger button lives).
     Snappy 140ms — Emil: 150-250ms for dropdowns, leaning snappy because
     super-admin clicks this often. */
  transform-origin: top right;
  transform: scale(1); opacity: 1;
  transition: transform 140ms var(--ease-snap), opacity 140ms var(--ease-snap);
  @starting-style { transform: scale(0.95); opacity: 0; }
}
.ws-menu-sec { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg3); font-weight: 700; padding: 10px 10px 6px; }
.ws-item { width: 100%; display: flex; align-items: center; gap: 11px; padding: 10px; border: 0; background: transparent; border-radius: 9px; font-family: inherit; font-size: 14px; color: var(--fg1); text-align: left; cursor: pointer; }
.ws-item > span:nth-child(2), .ws-item > span:not(.xdi-mark):not(.cmark-chip):not(.cmark-logo):not(.pill) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ws-item:hover { background: var(--surface-muted); }
.ws-item.is-on { background: var(--accent-tint); }
.ws-item > svg { color: var(--accent-fg); margin-left: auto; }
.ws-menu-foot { border-top: 1px solid var(--surface-muted); margin-top: 6px; padding-top: 6px; }
.ws-demo { width: 100%; display: flex; align-items: center; gap: 9px; padding: 10px; border: 0; background: transparent; border-radius: 9px; font-family: inherit; font-size: 13.5px; color: var(--fg2); cursor: pointer; }
.ws-demo:hover { background: var(--surface-muted); color: var(--fg1); }

.demo-exit { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 8px; border: 1px solid var(--violet); background: var(--violet-tint); color: var(--violet-fg); font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; flex-shrink: 0; }

/* xdi console cards */
.xc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.xc-card { border: 1px solid var(--border); border-radius: 14px; padding: 20px; cursor: pointer; transition: border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out); position: relative; }
.xc-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.xc-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.xc-card-name { font-size: 17px; font-weight: 700; color: var(--fg1); letter-spacing: -0.01em; }
.xc-card-domain { font-size: 12.5px; margin-top: 3px; }
.xc-card-stats { display: flex; align-items: center; gap: 16px; margin-top: 16px; font-size: 13px; color: var(--fg2); }
.xc-card-stats b { color: var(--fg1); font-variant-numeric: tabular-nums; }
.health-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.health-dot.online { background: var(--success); }
.health-dot.degraded { background: var(--warning); }
.health-dot.offline { background: var(--danger); }
.xc-card-stats .health-dot { margin-left: auto; }
.xc-enter { margin-top: 16px; width: 100%; justify-content: center; }

.xc-identity { display: flex; align-items: center; gap: 18px; }
.xc-colors { display: flex; gap: 8px; }
.xc-color { width: 26px; height: 26px; border-radius: 7px; border: 2px solid transparent; cursor: pointer; }
.xc-color.on { border-color: var(--fg1); box-shadow: 0 0 0 2px var(--surface) inset; }

.company-tag { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--fg1); }
.users-scope { display: inline-flex; align-items: center; gap: 5px; }
.platform-only { font-size: 10.5px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; color: var(--violet-fg); background: var(--violet-tint); padding: 2px 8px; border-radius: 999px; margin-left: 8px; }

/* mini modal (migrate) */
.mini-modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 420px; max-width: calc(100vw - 32px); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 22px; z-index: var(--z-modal); }
.mini-head { display: flex; align-items: center; justify-content: space-between; }
.mini-head h3 { margin: 0; font-size: 18px; font-weight: 700; }
.mini-sub { font-size: 13.5px; color: var(--fg2); margin: 8px 0 16px; line-height: 1.5; }
.mini-list { display: flex; flex-direction: column; gap: 8px; }
.mini-row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); font-family: inherit; font-size: 14px; font-weight: 600; color: var(--fg1); cursor: pointer; text-align: left; }
.mini-row:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-tint); }
.mini-row:disabled { opacity: 0.6; cursor: default; }
.mini-row > span:nth-child(2) { flex: 1; }
.mini-row > svg { color: var(--accent-fg); }

@media (max-width: 1100px) {
  .xc-grid { grid-template-columns: 1fr; }
  .ws-menu { width: 280px; }
}

/* ----- Compliance audit table ----- */
.audit-search { position: relative; display: flex; align-items: center; }
.audit-search svg { position: absolute; left: 10px; color: var(--fg3); }
.audit-search input { padding: 7px 12px 7px 32px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-muted); font-size: 13px; color: var(--fg1); outline: none; font-family: inherit; width: 220px; }
.audit-search input:focus { background: var(--surface); border-color: var(--accent); box-shadow: var(--shadow-focus); }
.audit-filter { width: auto; padding: 7px 10px; font-size: 13px; }
.audit-tbl td { vertical-align: middle; }
.audit-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 9px; vertical-align: middle; }
.audit-dot.accent  { background: var(--accent); }
.audit-dot.info    { background: var(--info); }
.audit-dot.success { background: var(--success); }
.audit-dot.warning { background: var(--warning); }
.audit-dot.danger  { background: var(--danger); }
.audit-dot.violet  { background: var(--violet); }
.audit-dot.neutral { background: var(--fg3); }
.agent-row .stat .k { font-size: 10.5px; color: var(--fg2); letter-spacing: 0.04em; text-transform: uppercase; font-weight: 600; }
.agent-row .stat .v { font-size: 15px; font-weight: 700; color: var(--fg1); font-variant-numeric: tabular-nums; white-space: nowrap; margin-top: 3px; }
.agent-row .stat .v small { font-size: 11.5px; font-weight: 500; color: var(--fg2); }
.agent-actions { display: flex; gap: 6px; margin-top: 2px; } /* consolidat: unica definiție .agent-actions */

/* ----- Activity feed ----- */
.feed-row { display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; padding: 10px 16px; align-items: center; border-top: 1px solid var(--surface-muted); }
.feed-row:first-child { border-top: 0; }
.feed-row:hover { background: var(--surface-muted); }
.feed-ico { width: 28px; height: 28px; border-radius: 999px; display:flex; align-items:center; justify-content:center; }
.feed-ico.success { background: var(--success-tint); color: var(--success-fg); }
.feed-ico.warning { background: var(--warning-tint); color: var(--warning-fg); }
.feed-ico.danger  { background: var(--danger-tint);  color: var(--danger-fg); }
.feed-ico.info    { background: var(--info-tint);    color: var(--info-fg); }
.feed-ico.accent  { background: var(--accent-tint);  color: var(--accent-pressed); }
.feed-ico.neutral { background: var(--surface-muted); color: var(--fg1); }
.feed-title { font-size: 13px; font-weight: 500; color: var(--fg1); }
.feed-title .mono { font-family: var(--font-mono); font-size: 12px; }
.feed-sub { font-size: 11.5px; color: var(--fg2); margin-top: 2px; }
.feed-time { font-size: 11px; color: var(--fg3); font-variant-numeric: tabular-nums; }

/* ----- Data table ----- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg2); font-weight: 600; padding: 12px 18px; background: var(--surface-muted); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1; }
.tbl td { padding: 14px 18px; border-bottom: 1px solid var(--surface-muted); font-size: 14px; color: var(--fg1); line-height: 1.4; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover { background: var(--surface-muted); }
.tbl tbody tr.is-selected { background: var(--accent-tint); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .id { font-family: var(--font-mono); font-size: 12px; color: var(--fg2); }
.tbl .num { font-variant-numeric: tabular-nums; text-align: right; }
.holder { display:flex; align-items:center; gap:8px; }

/* ----- Filter bar ----- */
.filter-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.chip { font-size: 12px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--fg1); display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.chip:hover { border-color: var(--border-strong); }
.chip.is-active { background: var(--accent-tint); border-color: var(--accent-tint-strong); color: var(--accent-pressed); font-weight: 600; }

/* ----- Detail drawer ----- */
/* Z-INDEX HIERARCHY (top-down):
   90  mini-modal
   80  drawer / drawer-scrim / cmdk-scrim — overlay layer
   70  ws-menu, dropdowns inside topbar
   50  topbar (.tb) — own stacking context (view-transition-name)
   0   page content
   These must be >= 80 to render above the topbar's stacking context. */
/* Drawer/scrim: definiția UNICĂ e mai jos (.drawer-scrim > .drawer, @starting-style).
   Blocul legacy (.scrim, al doilea set .drawer/.drawer-head/.drawer-body/.drawer-foot,
   @keyframes slide-in + fade-in) a fost ELIMINAT — cauza conflictelor de drawer.
   Toate drawerele folosesc .drawer-scrim; niciun view nu mai referă .scrim. */
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--surface-muted); font-size: 13px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--fg2); }
.kv .v { color: var(--fg1); }

/* ----- Command palette -----
   No animation: keyboard-initiated, used 50+ times/day (Cmd+K). Emil:
   "never animate keyboard-initiated actions." Raycast precedent. */
.cmdk-scrim { position: fixed; inset: 0; background: var(--scrim); z-index: var(--z-scrim); display: grid; place-items: start center; padding-top: 12vh; }
.cmdk {
  width: 560px; max-width: 90vw;
  background: var(--glass-bg-strong);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}
.cmdk-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--glass-border); }
.cmdk-input input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 14px; font-family: inherit; color: var(--fg1); }
.cmdk-list { padding: 6px; max-height: 320px; overflow: auto; }
.cmdk-section { padding: 6px; max-height: 280px; overflow: auto; }
.cmdk-section + .cmdk-section { border-top: 1px solid var(--border); }
.cmdk-section-title { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg3); font-weight: 700; padding: 10px 10px 6px; }
.cmdk-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.cmdk-item:hover, .cmdk-item.is-active { background: var(--accent-tint); }
.cmdk-item .meta { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; color: var(--fg2); }
.cmdk-item svg { color: var(--fg2); flex-shrink: 0; }
.cmdk-item .cmdk-label { display: block; color: var(--fg1); font-weight: 500; }
.cmdk-item .cmdk-sub { display: block; font-size: 11.5px; color: var(--fg2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 380px; }

/* ----- Heatmap ----- */
.heatmap { display: grid; grid-template-columns: 36px repeat(24, 1fr); gap: 3px; }
.heatmap .hr-label { font-size: 9.5px; color: var(--fg2); text-align: center; }
.heatmap .day-label { font-size: 10.5px; color: var(--fg2); text-align: right; padding-right: 8px; line-height: 18px; font-weight: 500; }
.heatmap .cell { height: 18px; border-radius: 3px; background: var(--accent); }

/* ----- AI insight panel ----- */
.insight {
  border: 1px solid var(--accent-tint-strong);
  background: linear-gradient(180deg, rgba(59,130,246,0.06), rgba(59,130,246,0.02));
  border-radius: 12px;
  padding: 16px 18px;
}
.insight .eyebrow { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-pressed); font-weight: 700; display: flex; align-items: center; gap: 6px; }
.insight h4 { margin: 8px 0 4px; font-size: 14px; font-weight: 600; }
.insight p  { margin: 0; font-size: 13px; color: var(--fg2); line-height: 1.5; }
.insight-actions { margin-top: 12px; display:flex; gap: 8px; }

/* ----- Empty state ----- */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 56px 24px; text-align: center; color: var(--fg2); }
.empty .icon { width: 44px; height: 44px; border-radius: 999px; background: var(--surface-muted); display: grid; place-items: center; margin-bottom: 14px; }
.empty h3 { margin: 0 0 6px; font-size: 15px; color: var(--fg1); font-weight: 600; }
.empty p { margin: 0; max-width: 320px; font-size: 13px; }

/* ============================================================
   ADMIN SURFACE — pages, headers, shared
   ============================================================ */
.stack-16 { display: flex; flex-direction: column; gap: 16px; }
.page { display: flex; flex-direction: column; gap: 20px; }
.page-head.row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.page-title { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; color: var(--fg1); margin: 0; }
.page-title.with-ico { display: inline-flex; align-items: center; gap: 12px; }
.page-title.with-ico svg { color: var(--accent); }
.page-sub { font-size: 14.5px; color: var(--fg2); margin: 6px 0 0; }
.section-title { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 14px; display: inline-block; padding-bottom: 8px; }
.section-title.accent-rule { border-bottom: 3px solid var(--accent); }
.section-title.gold-rule   { border-bottom: 3px solid var(--polaris-gold); }
.muted { color: var(--fg3); }
.mono-cell { font-family: var(--font-mono); font-size: 12.5px; color: var(--fg2); font-variant-numeric: tabular-nums; }

/* ----- Audit / activity rows ----- */
.audit-day { padding: 12px 20px; font-size: 12px; font-weight: 600; color: var(--fg2); background: var(--surface-muted); border-bottom: 1px solid var(--border); }
.audit-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 14px; align-items: center; padding: 13px 20px; border-top: 1px solid var(--surface-muted); }
.audit-row:first-of-type { border-top: 0; }
.audit-row:hover { background: var(--surface-muted); }
.audit-ico { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; }
.audit-ico.accent  { background: var(--accent-tint);  color: var(--accent-pressed); }
.audit-ico.info    { background: var(--info-tint);    color: var(--info-fg); }
.audit-ico.warning { background: var(--warning-tint); color: var(--warning-fg); }
.audit-ico.success { background: var(--success-tint); color: var(--success-fg); }
.audit-ico.neutral { background: var(--surface-muted); color: var(--fg2); }
.audit-title { font-size: 14.5px; font-weight: 600; color: var(--fg1); }
.audit-tag { font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--accent); margin-left: 6px; }
.audit-sub { font-size: 13px; color: var(--fg2); margin-top: 2px; }
.audit-time { font-family: var(--font-mono); font-size: 13px; color: var(--fg3); font-variant-numeric: tabular-nums; }

/* ----- Dashboard queue ----- */
.queue-card { align-self: start; display: flex; flex-direction: column; gap: 2px; }
.queue-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 4px; border-top: 1px solid var(--surface-muted); }
.queue-row:first-child { border-top: 0; }
.queue-label { font-size: 14.5px; color: var(--fg1); }
.queue-val { font-size: 17px; font-weight: 700; color: var(--fg1); font-variant-numeric: tabular-nums; }

/* ----- Knowledge base ----- */
.kb-head { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.kb-head h3 { margin: 0; font-size: 17px; font-weight: 600; }
.kb-head .spacer { flex: 1; }
.kb-meta { font-size: 13px; color: var(--fg2); }
.kb-manage { font-size: 14px; font-weight: 600; color: var(--accent); display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.kb-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kb-tile { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px; transition: border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out); }
.kb-tile:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kb-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 16px; }
.kb-tile-val { font-size: 30px; font-weight: 700; color: var(--fg1); line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kb-tile-label { font-size: 13px; color: var(--fg2); font-weight: 500; margin-top: 6px; }
.kb-tile.is-primary { background: linear-gradient(135deg, var(--accent), var(--accent-hover)); border-color: transparent; }
.kb-tile.is-primary:hover { box-shadow: var(--shadow-lg); }
.kb-tile.is-primary .kb-ico { background: rgba(255,255,255,0.18); color: #fff; }
.kb-tile.is-primary .kb-tile-val { color: #fff; }
.kb-tile.is-primary .kb-tile-label { color: rgba(255,255,255,0.88); }

/* ----- Shared icon tones ----- */
.tone-blue   { background: var(--accent-tint);  color: var(--accent-pressed); }
.tone-violet { background: var(--violet-tint);              color: var(--violet-fg); }
.tone-cyan   { background: var(--info-tint);     color: var(--info-fg); }
.tone-green  { background: var(--success-tint);  color: var(--success-fg); }
.tone-amber  { background: var(--warning-tint);  color: var(--warning-fg); }
.tone-slate  { background: var(--surface-muted); color: var(--fg2); }
.tone-accent { background: var(--accent);        color: #fff; }

/* ----- Department cards ----- */
.dept-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.dept-grid.wide { gap: 20px; }
.dept-card { position: relative; border: 1px solid var(--border); border-radius: 12px; padding: 22px 24px; background: var(--surface); cursor: pointer; transition: border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out); }
.dept-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
/* Layout cerut: icon mic LÂNGĂ titlu, badge în COLȚ, descriere DEDESUBT, fără suprapunere */
.dept-card-badge { position: absolute; top: 16px; right: 16px; }
.dept-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; padding-right: 84px; }
.dept-ico { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.dept-card-name { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; color: var(--fg1); min-width: 0; }
.dept-card-desc { font-size: 14px; color: var(--fg2); margin: 0 0 8px; line-height: 1.5; }
/* compat: vechiul .dept-card-top dacă mai apare undeva */
.dept-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.dept-card-slug { font-family: var(--font-mono); font-size: 12.5px; color: var(--fg3); margin-top: 18px; }
.dept-card-slug span { color: var(--fg2); }

/* ----- Detail header + tabs ----- */
.detail-head { display: flex; align-items: center; gap: 14px; }
.back-btn { width: 36px; height: 36px; border-radius: 8px; border: 1px solid transparent; background: transparent; display: grid; place-items: center; color: var(--fg2); margin-left: -6px; }
.back-btn:hover { background: var(--surface-muted); color: var(--fg1); }
.detail-sub { margin-top: 0; }

/* ----- Department detail banner ----- */
.dept-detail-top { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--fg2); }
.dept-detail-top .back-btn { margin-left: -6px; }
.dept-detail-top svg { color: var(--fg3); }
.dept-detail-crumb { cursor: pointer; font-weight: 500; }
.dept-detail-crumb:hover { color: var(--accent); }
.dept-detail-crumb-active { color: var(--fg1); font-weight: 600; }
.dept-banner { display: flex; align-items: center; gap: 20px; padding: 22px 26px; }
.dept-banner-ico { width: 60px; height: 60px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; }
.dept-banner-id { flex: 1; min-width: 0; }
.dept-banner-name { font-size: 24px; font-weight: 700; letter-spacing: -0.015em; color: var(--fg1); display: flex; align-items: center; gap: 12px; }
.dept-banner-desc { font-size: 14px; color: var(--fg2); margin-top: 5px; }
.dept-banner-meta { display: flex; align-items: center; gap: 18px; margin-top: 12px; font-size: 13px; color: var(--fg2); flex-wrap: wrap; }
.dept-banner-meta > span { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 12.5px; }
.dept-banner-meta svg { color: var(--fg3); }
.dept-banner-stats { display: flex; gap: 10px; flex-shrink: 0; }
.dept-bstat { border: 1px solid var(--border); border-radius: 10px; padding: 14px 20px; min-width: 84px; text-align: center; }
.dept-bstat-val { font-size: 26px; font-weight: 700; color: var(--fg1); line-height: 1; font-variant-numeric: tabular-nums; }
.dept-bstat-label { font-size: 11.5px; color: var(--fg2); margin-top: 5px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px; background: transparent; border: 0; border-bottom: 2px solid transparent; font-size: 14.5px; font-weight: 500; color: var(--fg2); margin-bottom: -1px; }
.tab svg { color: var(--fg3); }
.tab:hover { color: var(--fg1); }
.tab.is-active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tab.is-active svg { color: var(--accent); }
.tab-count { color: var(--fg3); font-weight: 500; }
.tab.is-active .tab-count { color: var(--accent); }
.tab-body { margin-top: 8px; display: flex; flex-direction: column; gap: 20px; }

/* ----- Toggle switch ----- */
.toggle { width: 46px; height: 26px; border-radius: 999px; background: var(--slate-300); border: 0; padding: 0; position: relative; transition: background 200ms var(--ease-snap); flex-shrink: 0; cursor: pointer; }
.toggle .knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform 220ms var(--ease-spring); }
.toggle.on { background: var(--success); }
.toggle.on .knob { transform: translateX(20px); }
.toggle:disabled { opacity: 0.5; cursor: not-allowed; }

/* ----- Form field ----- */
.field {
  width: 280px; max-width: 100%;
  padding: 9px 12px; border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 14px; font-family: inherit; color: var(--fg1);
  outline: none;
  transition: border-color 140ms var(--ease-snap),
              box-shadow 140ms var(--ease-snap),
              background 140ms var(--ease-out);
}
.field:focus { border-color: var(--accent); box-shadow: var(--shadow-focus); }
.field:focus-visible { border-color: var(--accent); box-shadow: var(--shadow-focus); }
.field:hover:not(:focus):not(:disabled) { border-color: var(--fg3); }
select.field { cursor: pointer; }

/* ----- Department settings tab ----- */
.setting-list { display: flex; flex-direction: column; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 18px 4px; border-top: 1px solid var(--surface-muted); }
.setting-row:first-child { border-top: 0; }
.setting-label { font-size: 15px; font-weight: 600; color: var(--fg1); }
.setting-desc { font-size: 13px; color: var(--fg2); margin-top: 4px; line-height: 1.45; max-width: 460px; }
.setting-key { font-family: var(--font-mono); font-size: 12px; color: var(--fg3); margin-top: 6px; }
.setting-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* ----- Instructions tab ----- */
.instr { display: flex; flex-direction: column; gap: 14px; }
.instr-bar { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; font-size: 13.5px; color: var(--fg2); }
.instr-bar strong { color: var(--fg1); }
.instr-updated { color: var(--fg3); font-size: 12.5px; white-space: nowrap; }
.instr-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.instr-pane { display: flex; flex-direction: column; overflow: hidden; height: 620px; }
.instr-pane-head { display: flex; align-items: center; justify-content: space-between; height: 48px; padding: 0 16px; box-sizing: border-box; border-bottom: 1px solid var(--border); font-size: 13.5px; font-weight: 600; }
/* Injected expand button must not grow the header beyond the editor's — keep it compact. */
.instr-pane-head .pane-expand { width: 28px; height: 28px; }
.instr-pane-head span { display: inline-flex; align-items: center; gap: 7px; }
.instr-chars { color: var(--fg3); font-weight: 500; font-family: var(--font-mono); font-size: 12px; }
.instr-editor { flex: 1; border: 0; outline: 0; resize: none; padding: 16px; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.65; color: var(--fg1); background: var(--surface); }
.instr-preview { flex: 1; overflow: auto; padding: 8px 22px 22px; }

/* ----- Markdown renderer (.md-*) — Instructions preview + AI body text ----- */
.md { font-size: 14px; color: var(--fg1); line-height: 1.6; }
.md-h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; margin: 24px 0 12px; }
.md-h3 { font-size: 18px; font-weight: 700; color: var(--accent); margin: 22px 0 10px; }
.md-h4 { font-size: 15px; font-weight: 700; margin: 18px 0 8px; }
.md-quote { border-left: 3px solid var(--accent); padding: 4px 0 4px 14px; color: var(--fg2); margin: 12px 0; font-size: 13.5px; }
.md-hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
.md-p { margin: 10px 0; }
.md-ul { margin: 10px 0; padding-left: 20px; }
.md-ul li { margin: 5px 0; }
.md-code { font-family: var(--font-mono); font-size: 12px; background: var(--surface-muted); padding: 2px 5px; border-radius: 4px; color: var(--danger-fg); }
.md-table { width: 100%; border-collapse: collapse; margin: 14px 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.md-table th { text-align: left; font-size: 13px; font-weight: 700; padding: 10px 12px; background: var(--surface-muted); border-bottom: 1px solid var(--border); }
.md-table td { font-size: 13px; padding: 10px 12px; border-bottom: 1px solid var(--surface-muted); border-left: 1px solid var(--surface-muted); vertical-align: top; }
.md-table td:first-child { border-left: 0; }
.md-table tr:last-child td { border-bottom: 0; }

/* ----- Agents tab ----- */
.agents-legend { font-size: 13.5px; color: var(--fg2); line-height: 2; margin: 0; }
.agents-legend .pill { margin: 0 3px; }
.agent2 { padding: 0; overflow: hidden; }
.agent2-head { display: grid; grid-template-columns: 44px 1fr auto; gap: 16px; align-items: start; padding: 20px 22px; }
.agent2-ico { width: 44px; height: 44px; border-radius: 10px; background: var(--surface-muted); color: var(--fg2); display: grid; place-items: center; }
.agent2-name { font-size: 17px; font-weight: 700; color: var(--fg1); display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.agent2-name .pill { text-transform: lowercase; }
.agent2-desc { font-size: 14px; color: var(--fg2); margin-top: 6px; line-height: 1.5; }
.agent2-path { font-family: var(--font-mono); font-size: 12px; color: var(--fg3); margin-top: 8px; word-break: break-all; }
.agent2-body { border-top: 1px solid var(--border); background: var(--surface-muted); padding: 18px 22px 22px; }
.agent2-body-title { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; color: var(--fg2); margin-bottom: 14px; }
.agent2-group { margin-bottom: 18px; }
.agent2-group:last-child { margin-bottom: 0; }
.agent2-group-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--fg1); margin-bottom: 8px; }
.agent2-group-title svg { color: var(--success); flex-shrink: 0; }
.agent2-list { list-style: none; margin: 0; padding: 0 0 0 4px; }
.agent2-list li { display: flex; align-items: flex-start; gap: 9px; padding: 4px 0; font-size: 13.5px; color: var(--fg2); }
.agent2-list li svg { color: var(--success); flex-shrink: 0; margin-top: 2px; opacity: 0.85; }

/* ----- Email templates ----- */
.stat-row { gap: 16px; }
.stat-card { display: flex; align-items: center; gap: 16px; padding: 20px 22px; }
.stat-ico { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; }
.stat-ico.blue   { background: var(--accent-tint);  color: var(--accent-pressed); }
.stat-ico.green  { background: var(--success-tint); color: var(--success-fg); }
.stat-ico.amber  { background: var(--warning-tint); color: var(--warning-fg); }
.stat-ico.purple { background: var(--violet-tint); color: var(--violet-fg); }
.stat-label { font-size: 14px; color: var(--fg2); }
.stat-value { font-size: 28px; font-weight: 700; color: var(--fg1); line-height: 1.1; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 11.5px; color: var(--fg2); margin-top: 3px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tpl-name { font-size: 14.5px; font-weight: 600; color: var(--fg1); }
.tpl-subject { font-size: 13px; color: var(--fg2); margin-top: 3px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-type { font-size: 12px; color: var(--fg3); margin-top: 5px; }
.sla { font-weight: 700; color: var(--warning); font-variant-numeric: tabular-nums; }
.auto-flag { font-size: 13.5px; font-weight: 600; color: var(--fg3); }
.auto-flag.on { color: var(--fg1); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.icon-act { width: 32px; height: 32px; border-radius: 7px; border: 0; background: transparent; display: grid; place-items: center; color: var(--accent); }
.icon-act:hover { background: var(--accent-tint); }
.icon-act.danger { color: var(--danger); }
.icon-act.danger:hover { background: var(--danger-tint); }

/* ----- Global settings ----- */
.live-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; padding: 7px 13px; border-radius: 999px; background: var(--success-tint); color: var(--success-fg); white-space: nowrap; }
.gs-group { display: inline-flex; align-items: center; gap: 11px; font-size: 21px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 18px; padding-bottom: 10px; border-bottom: 2px solid var(--accent); }
.gs-group-ico { width: 30px; height: 30px; border-radius: 8px; background: var(--accent-tint); color: var(--accent-pressed); display: grid; place-items: center; }
.gs-group-count { font-size: 13px; color: var(--fg2); font-weight: 600; background: var(--surface-muted); border-radius: 999px; padding: 2px 10px; }
.gs-list { display: flex; flex-direction: column; }
.gs-row { display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: start; padding: 22px 4px; border-top: 1px solid var(--surface-muted); }
.gs-row:first-child { border-top: 0; }
.gs-label { font-size: 15px; font-weight: 600; color: var(--fg1); }
.gs-desc { font-size: 13.5px; color: var(--fg2); margin-top: 5px; line-height: 1.5; }
.gs-key { font-family: var(--font-mono); font-size: 12px; color: var(--fg3); margin-top: 8px; }
.gs-control { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.gs-updated { font-size: 11.5px; color: var(--fg3); }

/* ----- Users ----- */
.user-cell { display: flex; align-items: center; gap: 12px; }
.user-cell .av { width: 38px; height: 38px; border-radius: 999px; font-size: 14px; font-weight: 700; }
.user-name { font-size: 14.5px; font-weight: 600; color: var(--fg1); }
.user-role { font-size: 12.5px; color: var(--fg2); margin-top: 1px; }

/* ----- Profile ----- */
.prof-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: stretch; }
/* columns dissolve into the grid so the 4 cards form a real 2×2 with equal-height rows */
.prof-grid > .prof-col { display: contents; }
.prof-grid > .prof-col > .card { height: 100%; }
.prof-list { display: flex; flex-direction: column; }
.prof-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--surface-muted); }
.prof-row:first-child { border-top: 0; }
.prof-k { font-size: 14.5px; color: var(--fg2); }
.prof-v { font-size: 14.5px; font-weight: 600; color: var(--fg1); }
.prof-note { font-size: 14px; color: var(--fg2); line-height: 1.6; margin: 0 0 20px; }

/* (Was: "bigger rows for admin" — removed. Density per Emil's review:
    8px vertical wins. The override here was global, not admin-only. */

@media (max-width: 1100px) {
  .kb-grid { grid-template-columns: repeat(2, 1fr); }
  .dept-grid, .prof-grid, .instr-split, .row-2, .row-4, .stat-row { grid-template-columns: 1fr; }
}

/* ----- Global settings summary ----- */
.gs-summary { display: grid; grid-template-columns: repeat(3, 1fr); padding: 0; margin-bottom: 16px; }

/* Company logo upload (System → Configuration) */
.logo-grid { display: flex; gap: 18px; flex-wrap: wrap; }
.logo-card { width: 250px; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--surface); transition: box-shadow var(--t-fast) var(--ease-out); }
.logo-card:hover { box-shadow: 0 4px 16px rgba(15,23,42,0.08); }
.logo-card-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; font-size: 12.5px; font-weight: 600; color: var(--fg1); border-bottom: 1px solid var(--border); }
.logo-card-head svg { color: var(--fg3); }
.logo-prev { height: 110px; display: grid; place-items: center; padding: 16px; background-image: linear-gradient(45deg,#0000 25%,#00000008 0,#00000008 50%,#0000 0,#0000 75%,#00000008 0); background-size: 16px 16px; }
.logo-prev.light { background-color: #ffffff; }
.logo-prev.dark { background-color: #0f172a; }
.logo-prev img { max-height: 66px; max-width: 200px; object-fit: contain; }
.logo-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 500; }
.logo-prev.light .logo-empty { color: #94a3b8; }
.logo-prev.dark .logo-empty { color: #64748b; }
.logo-drop { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 11px; font-size: 12.5px; font-weight: 600; color: var(--accent-fg); cursor: pointer; border-top: 1px dashed var(--border-strong); transition: background var(--t-fast) var(--ease-out); }
.logo-drop:hover { background: var(--accent-tint); }
.logo-drop.is-busy { color: var(--fg3); pointer-events: none; }
.logo-hint { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--fg2); margin-top: 14px; line-height: 1.45; }
.logo-hint svg { color: var(--accent-fg); flex-shrink: 0; }
.gs-sum-item { display: flex; align-items: center; gap: 14px; padding: 20px 24px; border-left: 1px solid var(--border); }
.gs-sum-item:first-child { border-left: 0; }
.gs-sum-ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.gs-sum-val { font-size: 22px; font-weight: 700; color: var(--fg1); line-height: 1.15; letter-spacing: -0.01em; white-space: nowrap; }
.gs-sum-tag { text-transform: capitalize; }
.gs-sum-label { font-size: 12.5px; color: var(--fg2); margin-top: 2px; }

/* ----- Profile banner + sections ----- */
.prof-banner { display: flex; align-items: center; gap: 22px; padding: 22px 26px; }
.prof-avatar { width: 64px; height: 64px; border-radius: 999px; background: var(--accent-tint); color: var(--accent-pressed); display: grid; place-items: center; font-size: 26px; font-weight: 700; flex-shrink: 0; overflow: hidden; }
.prof-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* 2FA chip in users table */
.tfa-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.tfa-chip.on  { background: var(--success-tint); color: var(--success-fg); }
.tfa-chip.req { background: var(--warning-tint); color: var(--warning-fg); }
.tfa-chip.off { background: var(--surface-muted); color: var(--fg2); }
.prof-id { flex: 1; min-width: 0; }
.prof-id-name { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; color: var(--fg1); display: flex; align-items: center; gap: 10px; }
.prof-id-sub { font-size: 14px; color: var(--fg2); margin-top: 4px; }
.prof-id-meta { display: flex; align-items: center; gap: 18px; margin-top: 12px; font-size: 13px; color: var(--fg2); flex-wrap: wrap; }
.prof-id-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.prof-id-meta svg { color: var(--fg3); }
.prof-stats { display: flex; gap: 10px; flex-shrink: 0; }
.prof-stat { border: 1px solid var(--border); border-radius: 10px; padding: 14px 18px; min-width: 98px; text-align: center; }
.prof-stat svg { color: var(--accent); }
.prof-stat-val { font-size: 24px; font-weight: 700; color: var(--fg1); margin-top: 7px; line-height: 1; font-variant-numeric: tabular-nums; }
.prof-stat-label { font-size: 11.5px; color: var(--fg2); margin-top: 4px; }
.prof-col { display: flex; flex-direction: column; gap: 20px; }

.sec-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-top: 1px solid var(--surface-muted); }
.sec-row:first-of-type { border-top: 0; }
.sec-label { font-size: 14.5px; font-weight: 600; color: var(--fg1); }
.sec-sub { font-size: 13px; color: var(--fg2); margin-top: 3px; }

.pref-list { display: flex; flex-direction: column; }
.pref-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--surface-muted); }
.pref-row:first-child { border-top: 0; }
.pref-label { font-size: 14.5px; font-weight: 600; color: var(--fg1); }
.pref-desc { font-size: 13px; color: var(--fg2); margin-top: 3px; }

.sess-cell { display: flex; align-items: center; gap: 10px; }
.sess-cell svg { color: var(--fg3); }

/* ----- User edit drawer -----
   Switched from @keyframes → transitions + @starting-style so rapid
   open/close cycles can interrupt and retarget smoothly (keyframes
   restart from zero on each toggle). iOS-style ease + asymmetric
   enter/exit timings (slower in, snappier out). */
.drawer-scrim {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex; justify-content: flex-end;
  z-index: var(--z-scrim);   /* must be above .tb (50) which has its own stacking context */
  opacity: 1;
  transition: opacity var(--t-drawer-in) var(--ease-out);
  @starting-style { opacity: 0; }
}
.drawer {
  width: 480px; max-width: 92vw; height: 100%;
  background: var(--surface);
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateX(0) scale(1);
  opacity: 1;
  transition:
    transform var(--t-drawer-in) var(--ease-drawer),
    opacity   var(--t-drawer-in) var(--ease-drawer);
  @starting-style {
    transform: translateX(40px) scale(0.985);
    opacity: 0.55;
  }
}
.drawer > form { flex: 1; display: flex; flex-direction: column; min-height: 0; }
/* Lățimi canonice: 480 default (detalii simple) / 640 wide (review flows) */
.drawer--wide { width: 640px; }
/* Exit animation — singura jumătate care lipsea (--t-drawer-out era nefolosit) */
.drawer-scrim.is-closing { opacity: 0; transition: opacity var(--t-drawer-out) var(--ease-out); }
.drawer-scrim.is-closing .drawer { transform: translateX(40px) scale(0.985); opacity: 0;
  transition: transform var(--t-drawer-out) var(--ease-drawer), opacity var(--t-drawer-out) var(--ease-drawer); }
@media (max-width: 700px) { .drawer, .drawer--wide { width: 100vw; max-width: 100vw; } }

/* ── Extend-to-sidebar (full page) toggle ───────────────────────────────────
   Injected button (xdi-shell.js). Drawers widen up to the 250px sidebar; the
   department-instructions/skills preview grows IN PLACE to the full container. */
.drawer.is-full, .drawer--wide.is-full {
  width: calc(100vw - 250px) !important;
  max-width: calc(100vw - 250px) !important;
}
/* Smooth width animation for the drawer extend (keeps the open/close transition too). */
.drawer {
  transition:
    transform var(--t-drawer-in) var(--ease-drawer),
    opacity   var(--t-drawer-in) var(--ease-drawer),
    width     280ms var(--ease-drawer),
    max-width 280ms var(--ease-drawer);
}

/* Instructions/skills preview — expand in place: editor column collapses, preview fills
   the full container width and full height. Smooth, no fixed overlay, no corner jump. */
.instr-split { transition: grid-template-columns 300ms var(--ease-out, cubic-bezier(0.23,1,0.32,1)), gap 300ms var(--ease-out, cubic-bezier(0.23,1,0.32,1)); }
.instr-split.preview-full { grid-template-columns: 0fr 1fr; gap: 0; }
.instr-split.preview-full > .instr-pane:first-child { opacity: 0; border-width: 0; pointer-events: none; }
.instr-split.preview-full > .instr-pane { height: calc(100vh - 168px); transition: height 300ms var(--ease-out, cubic-bezier(0.23,1,0.32,1)); }
.instr-pane { transition: height 300ms var(--ease-out, cubic-bezier(0.23,1,0.32,1)); }

/* Expand button: identical footprint to the close (X) — sized SVG like the other tb-icon-btn. */
.dr-expand svg, .pane-expand svg { width: 16px; height: 16px; }

@media (max-width: 700px) {
  .drawer.is-full, .drawer--wide.is-full { width: 100vw !important; max-width: 100vw !important; }
  .instr-split.preview-full { grid-template-columns: 1fr; }
  .instr-split.preview-full > .instr-pane:first-child { display: none; }
}
/* Backwards-compat: legacy callers that still rely on the keyframes get
   the same visual treatment without re-trigger issues. */
@keyframes drawer-in { from { transform: translateX(40px) scale(0.985); opacity: 0.55; } to { transform: translateX(0) scale(1); opacity: 1; } }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px; border-bottom: 1px solid var(--border); }
.drawer-title { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; color: var(--fg1); margin: 0; }
.drawer-sub { font-size: 13px; color: var(--fg2); margin: 4px 0 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: 22px 24px; display: flex; flex-direction: column; gap: 24px; }
.drawer-identity { display: flex; align-items: center; gap: 14px; padding-bottom: 22px; border-bottom: 1px solid var(--surface-muted); }
.drawer-identity-name { font-size: 16px; font-weight: 700; color: var(--fg1); margin-bottom: 6px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-field { display: flex; flex-direction: column; gap: 7px; }
.form-field-full { grid-column: 1 / -1; }
.form-field .field { width: 100%; }
.form-label { font-size: 12.5px; font-weight: 600; color: var(--fg2); }

.form-section { display: flex; flex-direction: column; gap: 10px; }
.form-section-title { font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; font-weight: 700; color: var(--fg2); }
.seg { display: inline-flex; background: var(--surface-muted); border: 1px solid var(--border); border-radius: 9px; padding: 3px; gap: 3px; }
.seg-btn { border: 0; background: transparent; font-size: 13.5px; font-weight: 600; color: var(--fg2); padding: 7px 18px; border-radius: 6px; }
.seg-btn.is-on { background: var(--surface); color: var(--fg1); box-shadow: var(--shadow-sm); }

.danger-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-muted); }

.drawer-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px; border-top: 1px solid var(--border); }
.drawer-foot-right { display: flex; gap: 10px; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-tint); }

@media (max-width: 1100px) {
  .gs-summary { grid-template-columns: 1fr; }
  .gs-sum-item { border-left: 0; border-top: 1px solid var(--border); }
  .gs-sum-item:first-child { border-top: 0; }
  .prof-banner { flex-direction: column; align-items: flex-start; }
  .prof-stats { width: 100%; }
  .prof-stat { flex: 1; }
}

/* ============================================================
   ACTIVITY — header, queue, timeline, workflow
   ============================================================ */
.act-head { display: flex; flex-direction: column; gap: 18px; }
.act-dept { display: flex; align-items: center; gap: 10px; }
.act-dept-label { font-size: 13px; font-weight: 600; color: var(--fg2); }
.act-dept .field { width: 200px; }

/* ----- Queue ----- */
.queue-list { display: flex; flex-direction: column; }
.qrow { display: grid; grid-template-columns: 40px 1fr 120px 130px 56px; gap: 16px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--surface-muted); }
.qrow:first-child { border-top: 0; }
.qrow:hover { background: var(--surface-muted); }
.qrow-ico { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-muted); color: var(--fg2); }
/* Faster spinner = perceived faster app. Same load time, different perception. */
.qrow-ico.spin svg { animation: spin 700ms linear infinite; }
/* @keyframes spin — definit o singură dată la :356 */
.qrow-subject { font-size: 14px; font-weight: 600; color: var(--fg1); }
.qrow-meta { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.qrow-meta .mono-cell { font-size: 12px; }
.qrow-type { font-size: 11.5px; font-weight: 700; color: var(--accent-fg); background: var(--accent-tint); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.qrow-conf { display: flex; align-items: center; gap: 8px; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--fg2); }
.qrow-conf-track { width: 60px; height: 5px; border-radius: 999px; background: var(--surface-muted); overflow: hidden; }
.qrow-conf-fill { height: 100%; border-radius: 999px; }
.qrow-time { font-size: 12.5px; text-align: right; }

/* ----- Timeline ----- */
.tl { display: flex; flex-direction: column; margin-top: 6px; }
.tl-row { display: grid; grid-template-columns: 32px 1fr auto; gap: 14px; align-items: start; }
.tl-rail { display: flex; flex-direction: column; align-items: center; }
.tl-dot { width: 32px; height: 32px; border-radius: 999px; display: grid; place-items: center; flex-shrink: 0; z-index: 1; }
.tl-dot.accent  { background: var(--accent-tint);  color: var(--accent-fg); }
.tl-dot.info    { background: var(--info-tint);    color: var(--info-fg); }
.tl-dot.violet  { background: var(--violet-tint);  color: var(--violet-fg); }
.tl-dot.success { background: var(--success-tint); color: var(--success-fg); }
.tl-dot.warning { background: var(--warning-tint); color: var(--warning-fg); }
.tl-dot.neutral { background: var(--surface-muted); color: var(--fg2); }
.tl-line { width: 2px; flex: 1; background: var(--border); margin: 2px 0; min-height: 18px; }
.tl-main { padding-bottom: 20px; min-width: 0; }
.tl-title { font-size: 14px; font-weight: 600; color: var(--fg1); line-height: 1.3; }
.tl-detail { font-size: 13px; color: var(--fg2); margin-top: 4px; line-height: 1.4; }
.tl-time { font-size: 12px; padding-top: 8px; white-space: nowrap; }

/* ----- Workflow ----- */
.wf { display: flex; flex-direction: column; margin-top: 6px; }
.wf-stage { display: grid; grid-template-columns: 48px 1fr; gap: 16px; }
.wf-connector { display: flex; flex-direction: column; align-items: center; }
.wf-node { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; background: var(--surface-muted); color: var(--fg2); border: 1px solid var(--border); }
.wf-node.done    { background: var(--success-tint); color: var(--success-fg); border-color: transparent; }
.wf-node.locked  { background: var(--warning-tint); color: var(--warning-fg); border-color: transparent; }
.wf-arrow { flex: 1; display: flex; align-items: center; color: var(--fg3); padding: 6px 0; }
.wf-card { padding: 16px 18px; margin-bottom: 16px; }
.wf-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.wf-stage-name { font-size: 15px; font-weight: 700; color: var(--fg1); display: inline-flex; align-items: center; gap: 10px; letter-spacing: 0.01em; white-space: nowrap; }
.wf-stage-name .pill { text-transform: lowercase; }
.wf-stage-sub { font-size: 13px; color: var(--fg2); margin-top: 4px; }
.wf-count { font-size: 12.5px; font-weight: 600; color: var(--fg2); white-space: nowrap; }
.wf-note { font-size: 13.5px; color: var(--fg2); margin-top: 12px; line-height: 1.5; }
.wf-file { font-size: 12px; margin-top: 10px; }
.wf-stage.is-idle .wf-card, .wf-stage.is-pending .wf-card { opacity: 0.72; }

/* ============================================================
   LOGIN — full-screen branded auth
   ============================================================ */
.login-stage {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 22px; padding: 24px;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(59,130,246,0.18), transparent 60%),
    linear-gradient(160deg, #1e293b 0%, #0f172a 55%, #0a1120 100%);
}
.login-card {
  width: 100%; max-width: 420px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 18px;
  padding: 40px 36px 28px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
}
.login-brand { display: flex; justify-content: center; align-items: center; margin: 4px 0 2px; }
.login-brand img { width: 240px; max-width: 78%; height: auto; display: block; object-fit: contain; }
.login-tag { text-align: center; color: rgba(147,197,253,0.85); font-size: 13.5px; margin: 16px 0 28px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-form .form-label { color: rgba(226,232,240,0.85); }
.login-field {
  width: 100%; background: rgba(15,23,42,0.55);
  border-color: rgba(148,163,184,0.25); color: #f1f5f9;
  transition: border-color 140ms var(--ease-snap),
              box-shadow 140ms var(--ease-snap),
              background 140ms var(--ease-out);
}
.login-field:focus { border-color: var(--accent); box-shadow: var(--shadow-focus); background: rgba(15,23,42,0.7); }
.login-field::placeholder { color: rgba(148,163,184,0.6); }
.login-pass { position: relative; }
.login-eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border: 0; background: transparent; color: rgba(148,163,184,0.8); display: grid; place-items: center; border-radius: 6px; }
.login-eye:hover { color: #f1f5f9; }
.login-submit { width: 100%; justify-content: center; padding: 11px; font-size: 14px; margin-top: 4px; }
.login-foot { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 22px; font-size: 12px; color: rgba(148,163,184,0.7); }
.login-meta { display: flex; align-items: center; gap: 7px; font-size: 12px; color: rgba(148,163,184,0.6); }
.login-meta .xdi { color: var(--polaris-gold); font-weight: 700; letter-spacing: 0.02em; }
.login-meta-dot { opacity: 0.5; }

/* ============================================================
   CHANGE PASSWORD
   ============================================================ */
.cp-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
.cp-form { display: flex; flex-direction: column; gap: 18px; }
.cp-form .field { width: 100%; }
.cp-meter { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.cp-meter-track { display: flex; gap: 5px; flex: 1; }
.cp-seg { height: 5px; flex: 1; border-radius: 999px; transition: background var(--t-base) var(--ease-out); }
.cp-meter-label { font-size: 12px; font-weight: 700; white-space: nowrap; }
.cp-match { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; margin-top: 8px; }
.cp-match.ok { color: var(--success-fg); }
.cp-match.no { color: var(--danger-fg); }
.cp-actions { margin-top: 4px; }
.cp-actions .btn:disabled { opacity: 0.5; cursor: not-allowed; }
.cp-side { align-self: start; }
.cp-reqs { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.cp-reqs li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--fg2); }
.cp-reqs li svg { color: var(--fg3); flex-shrink: 0; }
.cp-reqs li.ok { color: var(--fg1); }
.cp-reqs li.ok svg { color: var(--success-fg); }
.cp-tip { display: flex; gap: 10px; font-size: 13px; color: var(--fg2); line-height: 1.5; background: var(--surface-muted); border-radius: 10px; padding: 14px 16px; }
.cp-tip svg { color: var(--accent-fg); flex-shrink: 0; margin-top: 1px; }

@media (max-width: 1100px) {
  .cp-grid { grid-template-columns: 1fr; }
  .qrow { grid-template-columns: 36px 1fr 90px; }
  .qrow-conf, .qrow-time { display: none; }
}

/* ============================================================
   PRESS FEEDBACK — `:active` scale on every pressable element.
   Buttons must feel responsive (Emil Kowalski's design eng rules).
   ============================================================ */
.chip, .tab, .tb-icon-btn, .lang-toggle, .ws-btn, .ws-item,
.seg-btn, .sb-item, .sb-foot-user, .sb-foot-logout,
.avu-drop, .tg-event, .xc-card, .dept-card, .agent-actions .btn,
.demo-exit, .login-eye {
  transition: transform 100ms var(--ease-snap),
              background var(--t-fast) var(--ease-out),
              border-color var(--t-fast) var(--ease-out),
              color var(--t-fast) var(--ease-out),
              box-shadow var(--t-fast) var(--ease-out);
}
.chip:active, .tab:active, .tb-icon-btn:active, .lang-toggle:active,
.ws-btn:not(.ws-btn-static):active, .ws-item:active,
.seg-btn:active, .sb-item:active, .sb-foot-user:active, .sb-foot-logout:active,
.avu-drop:active, .tg-event:active, .xc-card:active, .dept-card:active,
.demo-exit:active, .login-eye:active {
  transform: scale(0.97);
}

/* Toggle switches feel solid when pressed */
.toggle:not(:disabled):active { transform: scale(0.95); }

/* HOVER GATING — touch devices trigger :hover on tap, causing false-positive
   flashes. The block below re-applies every `:hover` rule in the file only
   under `@media (hover: hover) and (pointer: fine)`. The element definitions
   above ship their non-hover state by default; hover styling is layered. */
@media not all and (hover: hover), not all and (pointer: fine) {
  .tb-icon-btn:hover, .lang-toggle:hover span:not(.is-on),
  .btn-primary:hover, .btn-secondary:hover, .btn-ghost:hover,
  .ws-btn:hover, .ws-item:hover,
  .sb-item:hover, .sb-foot-user:hover, .sb-foot-logout:hover,
  .avu-drop:hover, .tg-event:hover, .xc-card:hover,
  .dept-card:hover, .tbl tbody tr:hover,
  .chip:hover, .tab:hover, .seg-btn:hover, .demo-exit:hover,
  .login-eye:hover, .ws-demo:hover {
    /* On touch devices, suppress the desktop hover treatment so taps
       don't leave a "stuck hover" visual. The default state wins. */
    background: revert; color: revert; border-color: revert; transform: revert;
  }
}

/* ============================================================
   VIEW TRANSITIONS — native cross-fade between page navigations.
   No JS, no SPA framework. Browser handles the fade when the
   user clicks any internal link or submits a form that navigates.
   Falls back gracefully (instant nav) on browsers without support.
   ============================================================ */
@view-transition { navigation: auto; }

/* Cross-fade timing — snappy 180ms so navigation feels fluid but
   not laggy. Custom name targets only the root (whole-page fade);
   pinned shell elements below get their own animation. */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 180ms;
  animation-timing-function: var(--ease-out);
}

/* Pin the SIDEBAR across navigation.
   We do NOT add view-transition-name on .tb or .content because they form
   stacking contexts that trap drawer/scrim z-indexes inside their layer.
   Drawer/scrim are DOM children of .content; if .content is a stacking
   context, the scrim (z-index 80) cannot escape it to cover the topbar
   (z-index 50 in root context). The whole-viewport cross-fade still works
   via the default root transition, and is barely noticeable in practice. */
.sb { view-transition-name: app-sidebar; }

::view-transition-old(app-sidebar),
::view-transition-new(app-sidebar) {
  /* No animation on the sidebar — it appears unchanged across nav. */
  animation: none;
}

/* Active sidebar item — shared view-transition-name across pages so the
   browser MORPHS the highlight from old position to new position when the
   user navigates. The result: a single highlight pill slides smoothly
   between menu items, like a tab indicator does. */
.sb-item.is-active { view-transition-name: sidebar-active; }

::view-transition-group(sidebar-active) {
  /* Container of the moving pill — controls position interpolation */
  animation-duration: 220ms;
  animation-timing-function: var(--ease-drawer);
}
::view-transition-old(sidebar-active),
::view-transition-new(sidebar-active) {
  /* Inside the pill, just cross-fade the label/icon */
  animation-duration: 140ms;
  animation-timing-function: var(--ease-out);
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation-duration: 0ms !important;
  }
}

/* ============================================================
   STAGGER ENTRIES — list items fade-in in cascade. Uses
   @starting-style so it fires on insertion (once per mount).
   Selector covers up to 12 children — pragmatic limit for
   dashboards. Beyond that, cascade gets too slow anyway.
   ============================================================ */
.row-3 > .card,
.row-4 > .card,
.dept-grid > .dept-card,
.stack-16 > .agent2 {
  transition: opacity 320ms var(--ease-out), transform 320ms var(--ease-out);
  opacity: 1; transform: translateY(0);
}
.row-3  > .card:nth-child(1),
.row-4  > .card:nth-child(1),
.dept-grid > .dept-card:nth-child(1),
.stack-16  > .agent2:nth-child(1)  { @starting-style { opacity: 0; transform: translateY(6px); transition-delay: 0ms; } }
.row-3  > .card:nth-child(2),
.row-4  > .card:nth-child(2),
.dept-grid > .dept-card:nth-child(2),
.stack-16  > .agent2:nth-child(2)  { @starting-style { opacity: 0; transform: translateY(6px); transition-delay: 50ms; } }
.row-3  > .card:nth-child(3),
.row-4  > .card:nth-child(3),
.dept-grid > .dept-card:nth-child(3),
.stack-16  > .agent2:nth-child(3)  { @starting-style { opacity: 0; transform: translateY(6px); transition-delay: 100ms; } }
.row-4  > .card:nth-child(4),
.dept-grid > .dept-card:nth-child(4),
.stack-16  > .agent2:nth-child(4)  { @starting-style { opacity: 0; transform: translateY(6px); transition-delay: 150ms; } }
.dept-grid > .dept-card:nth-child(n+5),
.stack-16  > .agent2:nth-child(n+5) { @starting-style { opacity: 0; transform: translateY(6px); transition-delay: 200ms; } }

/* ============================================================
   REDUCED MOTION — vestibular safety. Keep opacity/color so
   feedback still lands; drop transforms and big keyframe motion.
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 100ms !important;
  }
  /* Disable transforms entirely on press/scale interactions */
  .btn:active, .chip:active, .tab:active, .tb-icon-btn:active,
  .lang-toggle:active, .ws-btn:active, .ws-item:active, .seg-btn:active,
  .sb-item:active, .sb-foot-user:active, .avu-drop:active,
  .tg-event:active, .xc-card:active, .dept-card:active,
  .demo-exit:active, .login-eye:active, .toggle:active,
  .tile .val.is-bump {
    transform: none !important;
  }
  /* Drawer / scrim stay in place — replaced motion with simple fade */
  .drawer { transform: none !important; }
  .drawer-scrim, .drawer, .scrim { animation: none !important; }
  /* Pulse / blink animations on status badges off */
  .ws-badge.on .ws-dot, .ws-badge.off .ws-dot,
  .tb-live .ws-dot { animation: none !important; }
}

/* ============================================================
   ===== UNIFICARE 2026-06 — componente shared noi =====
   (design-spec.md secțiunea A — o singură sursă pentru toate paginile)
   ============================================================ */

/* ----- Focus visible — global, o singură regulă (A3) ----- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}
.field:focus-visible, .cmdk-input input:focus-visible { outline: none; } /* au deja shadow-focus */

/* ----- Card accent lateral (A5.1) ----- */
.card-accent-warning { border-left: 3px solid var(--warning); }
.card-accent-danger  { border-left: 3px solid var(--danger); }

/* ----- Acțiuni pe rând, vizibile la hover (A5.3) ----- */
.tbl .row-actions { opacity: 0; transition: opacity var(--t-fast) var(--ease-out); display: inline-flex; gap: 4px; }
.tbl tr:hover .row-actions, .tbl tr:focus-within .row-actions { opacity: 1; }

/* ----- Alert de formular (A5.7) — înlocuiește alert-urile inline ----- */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px;
  border-radius: var(--r-md); font-size: 13px; line-height: 1.45; }
.alert-error   { background: var(--danger-tint);  color: var(--danger-fg); }
.alert-success { background: var(--success-tint); color: var(--success-fg); }
.alert-warning { background: var(--warning-tint); color: var(--warning-fg); }
.alert code { font-family: var(--font-mono); font-size: 12px; }

/* ----- Search input standard (A5.8) ----- */
.search-input { position: relative; display: flex; align-items: center; }
.search-input svg { position: absolute; left: 10px; width: 14px; height: 14px; color: var(--fg2); pointer-events: none; }
.search-input .field { padding-left: 32px; width: 280px; }
.filter-bar .spacer { flex: 1; }

/* ----- Stat strip (A5.9) — statistici în capul tabelelor, fără stiluri inline ----- */
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); padding: 0; }
.stat-strip .item { padding: 14px 18px; border-left: 1px solid var(--border); }
.stat-strip .item:first-child { border-left: 0; }
.stat-strip .label { font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg2); font-weight: 600; }
.stat-strip .value { font-size: 20px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat-strip .value small { font-size: 13px; font-weight: 400; color: var(--fg2); }
.stat-strip .value.good { color: var(--success-fg); }
.stat-strip .value.bad  { color: var(--danger-fg); }
@media (max-width: 900px) { .stat-strip { grid-template-columns: 1fr 1fr; }
  .stat-strip .item { border-top: 1px solid var(--border); }
  .stat-strip .item:nth-child(-n+2) { border-top: 0; }
  .stat-strip .item:nth-child(odd) { border-left: 0; } }

/* ----- Confirm dialog (A5.11) — înlocuiește confirm()/alert() nativ ----- */
.confirm-scrim { position: fixed; inset: 0; background: var(--scrim); z-index: var(--z-modal);
  display: grid; place-items: center; opacity: 1;
  transition: opacity var(--t-fast) var(--ease-out); }
.confirm-scrim { @starting-style { opacity: 0; } }
.confirm-box { width: 420px; max-width: calc(100vw - 32px); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
  padding: 22px; transform: scale(1); transition: transform var(--t-fast) var(--ease-snap); }
.confirm-box { @starting-style { transform: scale(0.96); } }
.confirm-title { font-size: 16px; font-weight: 700; margin: 0 0 8px; color: var(--fg1); }
.confirm-msg { font-size: 13.5px; color: var(--fg2); line-height: 1.5; margin: 0 0 18px; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ----- Sidebar footer controls: theme + language (vizibile pe mobil în sidebar) ----- */
.sb-controls {
  display: none; /* ascuns pe desktop; arătat în drawer pe mobil via CSS */
  flex-direction: row; align-items: center; gap: 10px;
  padding: 2px 4px 12px; margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.sb-ctrl-cell { display: flex; align-items: center; gap: 9px; flex: 1; }
.sb-ctrl-cell .sb-seg { flex: 1; }
.sb-ctrl-ico { display: inline-flex; color: var(--fg3); flex-shrink: 0; }
/* sb-seg: segmented toggle (tema / limbă) */
.sb-seg {
  display: inline-flex; align-items: center; gap: 2px;
  height: 34px; padding: 2px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-muted); flex-shrink: 0;
}
.sb-seg span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; flex: 1;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em;
  color: var(--fg2); padding: 4px 8px; border-radius: 6px; line-height: 1;
  transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.sb-seg span.is-on { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }
/* sb-seg ca buton */
button.sb-seg { cursor: pointer; border: 1px solid var(--border); }
button.sb-seg:hover span:not(.is-on) { color: var(--fg1); }

/* ----- Mobile two-row header (mtb) — vizibil doar pe ≤900px ----- */
/* Rând 1: hamburger | titlu | bell | avatar */
/* Rând 2: search */
.mtb { display: none; } /* ascuns pe desktop */

/* ----- Sidebar responsive — overlay sub 900px (A7) ----- */
.tb-menu-btn { display: none; }
.sb-scrim { display: none; } /* nu participă la grid-ul .app pe desktop */
@media (max-width: 900px) {
  /* Scroll natural al documentului pe mobil — desktop ține 100vh+overflow:hidden
     cu scroll pe .content, dar pe mobil asta tăia conținutul (bug scroll). */
  .app { display: block; height: auto; overflow: visible; }
  .main { overflow: visible; }
  .content { overflow: visible; flex: none; }
  /* Sidebar-ul off-canvas (translateX(-105%)) stă în stânga ecranului → ar genera
     scroll orizontal. `overflow-x: clip` DECUPEAZĂ fără să creeze un container de
     scroll (spre deosebire de `hidden`, care făcea body+html scrollere concurente
     → scroll „sărit"/jumpy pe mobil). Scroll DOAR vertical, stabil. */
  html { overflow-x: clip; }
  body { overflow-x: clip; }
  .tb { position: sticky; top: 0; z-index: var(--z-topbar); background: var(--surface); }
  .sb {
    position: fixed; top: 0; left: 0; bottom: 0; width: 270px;
    z-index: calc(var(--z-drawer) + 1);
    transform: translateX(-105%);
    transition: transform var(--t-drawer-in) var(--ease-drawer);
    box-shadow: none;
  }
  .sb.is-open { transform: translateX(0); box-shadow: var(--shadow-xl); }
  .sb-scrim { display: block; position: fixed; inset: 0; background: var(--scrim); z-index: var(--z-drawer);
    opacity: 0; pointer-events: none; transition: opacity var(--t-fast) var(--ease-out); }
  .sb-scrim.is-on { opacity: 1; pointer-events: auto; }
  .tb-menu-btn { display: inline-flex; }
  .content { padding: 20px 16px 40px; }
  .tb { padding-left: 12px; }
  .tb-search { display: none; } /* căutarea rămâne pe ⌘K desktop; pe mobil nu are sens */
  .row-3, .row-4, .row-2 { grid-template-columns: 1fr; }

  /* ===== Mobile 2-row header (mtb) ===== */
  /* Pe mobil: ascunde .tb (desktop topbar) și arată .mtb (2-row mobile header) */
  .tb { display: none; }
  .mtb { display: flex; flex-direction: column; position: sticky; top: 0; z-index: var(--z-topbar); background: var(--surface); border-bottom: 1px solid var(--border); }
  .mtb-row1 { display: flex; align-items: center; gap: 4px; padding: 0 8px; height: 52px; }
  .mtb-title { flex: 1; font-size: 15px; font-weight: 600; color: var(--fg1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
  .mtb-bell { position: relative; }
  .mtb-row2 { display: flex; align-items: center; padding: 0 8px 8px; }
  .mtb-search { display: flex; align-items: center; gap: 8px; width: 100%; background: var(--surface-muted); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; cursor: pointer; color: var(--fg3); font-size: 13.5px; }
  .mtb-search i { flex-shrink: 0; }
  /* Ascunde controalele de temă + limbă din topbar pe mobil (sunt în sidebar footer) */
  #theme-toggle, .tb .lang-toggle { display: none; }
  /* sb-controls vizibil în sidebar drawer */
  .sb-controls { display: flex; }

  /* ===== Touch targets ≥44px (Apple/Google guideline) ===== */
  .btn { min-height: 44px; }
  .btn-sm { min-height: 40px; }
  .tb-icon-btn, .tb-menu-btn, #notif-bell, .lang-toggle, .theme-toggle { min-width: 44px; min-height: 44px; }
  .chip { min-height: 36px; }

  /* ===== Tabele → carduri pe ≤900px (fiecare rând = card cu etichete data-label) ===== */
  /* Elimină scroll orizontal — tabelele nu scroll, se transformă în stivă de carduri */
  .card:has(table.tbl) { overflow-x: visible; }
  .tbl { display: block; }
  .tbl thead { display: none; }
  .tbl tbody, .tbl tr { display: block; }
  .tbl tr {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 10px;
    padding: 2px 0 6px;
    box-shadow: var(--shadow-xs);
  }
  .tbl td {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 14px;
    font-size: 13.5px;
    white-space: normal;
    border-bottom: 1px solid var(--surface-muted);
    min-height: 36px;
  }
  .tbl tr td:last-child { border-bottom: 0; }
  .tbl td::before {
    content: attr(data-label);
    flex-shrink: 0;
    width: 108px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--fg3);
    padding-top: 3px;
    line-height: 1.4;
  }
  /* Celulele fără data-label (acțiuni etc.) rămân simple flex */
  .tbl td:not([data-label])::before { display: none; }
  .tbl td:not([data-label]) { justify-content: flex-end; padding-top: 6px; border-bottom: 0; }

  /* ===== Carduri departament: o coloană, fără înghesuire/suprapunere ===== */
  .dept-grid, .dept-grid.wide { grid-template-columns: 1fr; gap: 12px; }

  /* ===== Carduri agent: badge status în colț, fără risipă ===== */
  .agent-actions .btn { min-height: 44px; }

  /* ===== Login fluid: card cu padding mai mic, ochi + buton tap-abil ===== */
  .login-card { padding: 28px 20px 22px; }
  .login-eye { width: 40px; height: 40px; }
  .login-submit { min-height: 46px; padding: 12px; }

  /* ===== Drawer: butoane primare full-width tap-abile ===== */
  .drawer-foot .btn { min-height: 44px; }

  /* ===== Global settings: .gs-row colapsează pe o coloană ===== */
  .gs-row { grid-template-columns: 1fr; gap: 8px; }
  .gs-row .field, .gs-row select, .gs-row input, .gs-row textarea { max-width: 100%; width: 100%; }

  /* ===== .tb titlu lung → wrap natural pe mobil ===== */
  .tb { height: auto; min-height: 56px; }
  .tb-title { white-space: normal; font-size: 15px; }
}

/* ----- Notification panel (header bell) — fost inline în header.ejs ----- */
.notif-panel { position: absolute; right: 0; top: 40px; width: 340px; max-height: 440px;
  overflow: auto; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow-lg); z-index: var(--z-dropdown);
  transform-origin: top right; opacity: 1; transform: scale(1);
  transition: opacity var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out); }
.notif-panel { @starting-style { opacity: 0; transform: scale(0.97); } }
.notif-head { display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 1px solid var(--border); }
.notif-badge { position: absolute; top: 0; right: 0; min-width: 16px; height: 16px;
  background: var(--danger); color: #fff; border-radius: 8px; font-size: 10px;
  line-height: 16px; text-align: center; padding: 0 3px; }

/* ----- Agent control panel (B2) ----- */
.agent-ctl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.agent-ctl .spacer { flex: 1; }
.agent-log { max-height: 220px; overflow: auto; background: var(--surface-muted);
  padding: 10px 12px; border-radius: var(--r-sm); font-size: 11.5px; font-family: var(--font-mono);
  margin: 10px 0 0; }

/* ----- Card fără padding (tabele full-bleed) ----- */
.card-flush { padding: 0; overflow: hidden; }

/* ===== MOBILE APPROVAL VIEW (/m) — mutat din mobile.ejs (B16) ===== */
.mob-shell { max-width: 460px; margin: 0 auto; min-height: 100vh; background: var(--surface); display: flex; flex-direction: column; }
.mob-tb { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 5; }
.mob-tb h1 { font-size: 17px; margin: 0; font-weight: 700; flex: 1; }
.mob-ws { display: flex; align-items: center; gap: 6px; font-size: 11px; padding: 4px 9px; border-radius: 999px; background: var(--success-tint); color: var(--success-fg); font-weight: 700; }
.mob-ws-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); animation: pulse 1.8s infinite; }
.mob-body { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.mob-pending-stat { background: var(--accent-tint); border-radius: 12px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.mob-pending-stat .v { font-size: 32px; font-weight: 700; line-height: 1; color: var(--accent-pressed); }
.mob-pending-stat .l { font-size: 12px; color: var(--accent-pressed); font-weight: 600; }
.mob-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow-xs); }
.mob-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.mob-card-head .pill { font-size: 10.5px; padding: 1px 7px; }
.mob-card-title { font-size: 14px; font-weight: 600; flex: 1; }
.mob-card-detail { font-size: 12.5px; color: var(--fg2); margin-bottom: 8px; }
.mob-card-meta { font-size: 11.5px; color: var(--fg3); display: flex; align-items: center; gap: 6px; }
.mob-actions { display: flex; gap: 8px; margin-top: 12px; }
.mob-actions .btn { flex: 1; justify-content: center; min-height: 44px; }
/* 2FA bottom-sheet */
.mob-2fa-scrim {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.55);
  display: flex; align-items: flex-end;
  z-index: 200;
}
.mob-2fa-sheet {
  width: 100%; background: var(--surface);
  border-radius: 22px 22px 0 0;
  padding: 10px 20px calc(env(safe-area-inset-bottom, 16px) + 20px);
  animation: mob2faUp 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes mob2faUp {
  from { transform: translateY(60%); opacity: 0.5; }
  to   { transform: translateY(0);   opacity: 1; }
}
.mob-2fa-grab {
  width: 38px; height: 4px; border-radius: 999px;
  background: var(--border-strong); margin: 0 auto 18px;
}

/* ----- Variable chips (email-template-form) ----- */
.var-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.var-chips .chip { font-family: var(--font-mono); font-size: 11.5px; }

/* ============================================================
   ANALYTICS — an-* (KPI tiles, chart, distribution, dept perf, spark)
   ============================================================ */
.an-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.an-kpi { padding: 16px 18px; }
.an-kpi-top { display: flex; align-items: center; justify-content: space-between; }
.an-kpi-ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; }
.an-kpi-delta { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; }
.an-kpi-delta .arrow { font-size: 9px; }
.an-kpi-delta.up { color: var(--success-fg); }
.an-kpi-delta.down { color: var(--danger-fg); }
.an-kpi-delta.flat { color: var(--fg2); }
.an-kpi-val { font-size: 30px; font-weight: 700; color: var(--fg1); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin: 14px 0 0; line-height: 1; }
.an-kpi-val small { font-size: 15px; font-weight: 600; color: var(--fg2); }
.an-kpi-label { font-size: 13px; font-weight: 600; color: var(--fg1); margin-top: 9px; }
.an-kpi-note { font-size: 11.5px; color: var(--fg3); margin-top: 3px; }

.an-row { display: grid; grid-template-columns: 1.8fr 1fr; gap: 16px; align-items: start; }
.an-legend { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--fg2); }
.an-legend span { display: inline-flex; align-items: center; gap: 6px; }
.an-legend i { width: 10px; height: 10px; border-radius: 3px; }
.an-chart { position: relative; padding: 20px 18px 14px; }
.an-grid { position: absolute; left: 18px; right: 18px; top: 20px; height: 184px; display: flex; flex-direction: column; justify-content: space-between; }
.an-gridline { border-top: 1px dashed var(--surface-muted); height: 0; }
.an-bars { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; }
.an-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.an-stack { width: 100%; max-width: 30px; display: flex; flex-direction: column; justify-content: flex-end; border-radius: 5px 5px 0 0; overflow: hidden; }
.an-seg { width: 100%; }
.an-seg:first-child { border-radius: 5px 5px 0 0; }
.an-col-label { font-size: 10.5px; color: var(--fg3); font-weight: 600; }
.an-col-label.is-weekend { color: var(--fg3); opacity: 0.55; }

/* Distribution bar chart */
.an-dist { display: flex; flex-direction: column; gap: 14px; padding: 18px; }
.an-dist-row { display: grid; grid-template-columns: 150px 1fr 48px; gap: 12px; align-items: center; }
.an-dist-label { font-size: 12.5px; font-weight: 600; color: var(--fg1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-dist-bar { height: 9px; border-radius: 999px; background: var(--surface-muted); overflow: hidden; }
.an-dist-fill { height: 100%; border-radius: 999px; transition: width var(--t-slow) var(--ease-out); }
.an-dist-val { font-size: 13px; font-weight: 700; color: var(--fg1); text-align: right; font-variant-numeric: tabular-nums; }

/* Department performance cards */
.an-section-title { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; color: var(--fg1); margin: 4px 0 14px; }
.an-dept-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.an-dept { padding: 18px 20px; display: flex; flex-direction: column; gap: 16px; }
.an-dept-head { display: flex; align-items: center; gap: 12px; }
.an-dept-ico { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; }
.an-dept-id { flex: 1; min-width: 0; }
.an-dept-name { font-size: 16px; font-weight: 700; color: var(--fg1); letter-spacing: -0.01em; }
.an-dept-sub { font-size: 12.5px; color: var(--fg2); margin-top: 2px; }
.an-dept-mid { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.an-dept-bigval { font-size: 32px; font-weight: 700; color: var(--fg1); letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.an-dept-biglabel { font-size: 12px; color: var(--fg2); margin-top: 6px; }
.an-spark { display: flex; align-items: flex-end; gap: 3px; height: 46px; flex: 1; max-width: 200px; justify-content: flex-end; }
.an-spark > div { width: 7px; border-radius: 2px; flex-shrink: 0; }
.an-dept-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding-top: 16px; border-top: 1px solid var(--surface-muted); }
.an-dstat .k { font-size: 10.5px; letter-spacing: 0.03em; text-transform: uppercase; color: var(--fg2); font-weight: 600; }
.an-dstat .v { font-size: 17px; font-weight: 700; color: var(--fg1); margin-top: 5px; font-variant-numeric: tabular-nums; }
.an-dept-link { align-self: flex-start; }

/* Department throughput rows */
.tp-row { display: grid; grid-template-columns: 1fr 90px 80px 110px; gap: 16px; padding: 12px 16px; align-items: center; }
.tp-val { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.tp-share { font-size: 11px; color: var(--fg2); text-align: right; }
.tp-spark { display: flex; justify-content: flex-end; }

@media (max-width: 1100px) {
  .an-kpis { grid-template-columns: repeat(2, 1fr); }
  .an-row { grid-template-columns: 1fr; }
  .an-dept-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .tp-row { grid-template-columns: 1fr auto; row-gap: 2px; column-gap: 14px; align-items: start; }
  .tp-spark { display: none; }
}

/* ============================================================
   SYSTEM CONTROL PANEL — ctrl-*, res-*, hl-mini-*, super-*
   ============================================================ */
.super-tag { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; font-size: 11px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; color: var(--violet-fg); background: var(--violet-tint); padding: 4px 10px; border-radius: 999px; }
.super-note { display: flex; align-items: center; gap: 10px; padding: 11px 14px; margin: 16px 0; border-radius: 10px; background: var(--violet-tint); color: var(--violet-fg); font-size: 13px; font-weight: 500; line-height: 1.4; }
.super-note > svg { flex-shrink: 0; }

/* Resource meters (CPU/RAM/Disk/Queue) */
.res-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.res-card { border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.res-top { display: flex; align-items: center; gap: 9px; }
.res-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.res-label { font-size: 12.5px; font-weight: 600; color: var(--fg2); }
.res-val { font-size: 28px; font-weight: 700; color: var(--fg1); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin: 12px 0 10px; line-height: 1; }
.res-val small { font-size: 15px; font-weight: 600; color: var(--fg2); margin-left: 1px; }
.res-track { height: 6px; border-radius: 999px; background: var(--surface-muted); overflow: hidden; }
.res-fill { height: 100%; border-radius: 999px; transition: width var(--t-slow) var(--ease-out); }
.res-detail { font-size: 12px; color: var(--fg3); margin-top: 9px; font-variant-numeric: tabular-nums; }

/* Maintenance action cards */
.ctrl-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.ctrl-action { display: flex; align-items: center; gap: 13px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.ctrl-action.is-danger { border-color: var(--danger-tint); }
.ctrl-action.is-locked { opacity: 0.62; }
.ctrl-ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.ctrl-action.is-danger .ctrl-ico { background: var(--danger-tint); color: var(--danger-fg); }
.ctrl-text { flex: 1; min-width: 0; }
.ctrl-label { font-size: 14px; font-weight: 600; color: var(--fg1); }
.ctrl-desc { font-size: 12.5px; color: var(--fg2); margin-top: 3px; line-height: 1.4; }
.ctrl-run { flex-shrink: 0; min-width: 86px; justify-content: center; }
.ctrl-run.done { color: var(--success-fg); border-color: var(--success); }
.spin-ico { animation: spin 0.8s linear infinite; }

/* Machine mini-meters (CPU/RAM/Disk side-by-side in hl-machine) */
.hl-machine-meters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.hl-mini-meter { min-width: 0; }
.hl-mini-top { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--fg2); margin-bottom: 5px; }
.hl-mini-top b { color: var(--fg1); font-variant-numeric: tabular-nums; font-size: 11.5px; }
.hl-mini-track { height: 5px; border-radius: 999px; background: var(--surface-muted); overflow: hidden; }
.hl-mini-fill { height: 100%; border-radius: 999px; }

@media (max-width: 1100px) {
  .res-grid { grid-template-columns: repeat(2, 1fr); }
  .ctrl-grid { grid-template-columns: 1fr; }
  .hl-machine-meters { grid-column: 1 / -1; }
}

/* ============================================================
   DESKTOP TOP-BAR NOTIFICATIONS — tb-notif*, tb-ws-sep, gs-tab-toolbar
   ============================================================ */
.tb-ws-sep { width: 1px; height: 24px; background: var(--border); flex-shrink: 0; }
/* Workspace switcher right-anchored variant (xdi console topbar) */
.ws-right .ws-menu { left: auto; right: 0; }

/* Global settings Users tab toolbar */
.gs-tab-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }

/* Desktop notification bell + popup */
.tb-notif { position: relative; flex-shrink: 0; }
.tb-icon-btn.is-on { background: var(--surface-muted); color: var(--fg1); }
.tb-notif .notif-badge {
  position: absolute; top: 3px; right: 3px;
  min-width: 16px; height: 16px; padding: 0 4px;
  display: grid; place-items: center;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 800; line-height: 1;
  border-radius: 999px; border: 2px solid var(--surface);
  font-variant-numeric: tabular-nums;
}
.tb-notif-pop {
  position: absolute; top: 46px; right: 0; width: 360px; max-width: 88vw;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown); overflow: hidden;
}
.tb-notif-pop { @starting-style { opacity: 0; transform: translateY(-8px); } }
.tb-notif-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 14px; border-bottom: 1px solid var(--border); }
.tb-notif-head .notif-title { display: flex; align-items: center; gap: 9px; font-size: 14.5px; font-weight: 700; color: var(--fg1); }
.tb-notif-head .notif-count { font-size: 11px; font-weight: 700; color: var(--accent-fg); background: var(--accent-tint); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.tb-notif-head .notif-readall { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--accent-pressed); background: transparent; border: 0; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.tb-notif-head .notif-readall:hover { background: var(--accent-tint); }
.tb-notif-list { max-height: 380px; overflow-y: auto; padding: 6px; }
.tb-notif-list .notif-item {
  width: 100%; display: grid; grid-template-columns: 36px 1fr 10px; gap: 11px; align-items: start;
  text-align: left; padding: 11px 9px; border: 0; background: transparent; border-radius: 11px; cursor: pointer;
  transition: background var(--t-fast) var(--ease-out);
}
.tb-notif-list .notif-item:hover { background: var(--surface-muted); }
.tb-notif-list .notif-item.is-read { opacity: 0.6; }
.tb-notif-list .notif-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; }
.tb-notif-list .notif-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tb-notif-list .notif-item-title { font-size: 13.5px; font-weight: 600; color: var(--fg1); line-height: 1.3; }
.tb-notif-list .notif-item-text { font-size: 12.5px; color: var(--fg2); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-notif-list .notif-time { font-size: 11px; color: var(--fg3); margin-top: 3px; font-variant-numeric: tabular-nums; }
.tb-notif-list .notif-unread-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--accent); margin-top: 6px; align-self: start; }
.tb-notif-list .notif-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 20px; color: var(--fg3); text-align: center; }
.tb-notif-list .notif-empty p { margin: 0; font-size: 13.5px; font-weight: 500; }

/* ════════════════════════════════════════════════════════════════════════════
   ANI — assistant surface (from Polaris Design System: ani.html)
   ════════════════════════════════════════════════════════════════════════════ */
.ani-av { position: relative; flex-shrink: 0; display: inline-grid; place-items: center; border-radius: 999px; overflow: visible; background: var(--surface-muted); color: var(--accent); }
.ani-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; border-radius: 999px; display: block; }
.ani-av i { width: 52%; height: 52%; }
.ani-av:has(img) svg, .ani-fab:has(img) svg { display: none; }
.ani-av[data-online]::after { content: ""; position: absolute; right: 1%; bottom: 1%; width: 26%; height: 26%; min-width: 9px; min-height: 9px; border-radius: 999px; background: var(--success); box-shadow: 0 0 0 2.5px var(--surface); }

/* Ani full page fills the viewport cleanly (topbar 64 + content padding 24*2 = 112). */
.content:has(.ani-page) { overflow: hidden; padding: 24px 28px; }
.ani-page { flex: 1; min-height: 0; margin: 0; }
.ani-workspace { height: calc(100vh - 112px); min-height: 0; display: grid; grid-template-columns: 300px 1fr; gap: 20px; }
/* live loading status (replaces raw tool chips — shows what Ani is doing) */
/* processing / working indicator (rich) — spinner + live step label + shimmer track */
.ani-working { display: inline-flex; flex-direction: column; gap: 9px; min-width: 230px; padding: 13px 16px; }
.ani-working-top { display: flex; align-items: center; gap: 9px; }
.ani-spinner { width: 15px; height: 15px; flex-shrink: 0; border-radius: 999px; border: 2px solid color-mix(in srgb, var(--accent) 24%, transparent); border-top-color: var(--accent); animation: aniSpin 0.7s linear infinite; }
@keyframes aniSpin { to { transform: rotate(360deg); } }
.ani-working-step { font-size: 13px; font-weight: 600; color: var(--fg1); }
.ani-dots::after { content: ""; animation: aniDots 1.4s steps(4, end) infinite; }
@keyframes aniDots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.ani-track { height: 4px; border-radius: 999px; overflow: hidden; background: var(--surface); position: relative; }
.ani-track::before { content: ""; position: absolute; inset: 0; width: 40%; border-radius: 999px; background: var(--accent); animation: aniSlide 1.25s var(--ease-in-out) infinite; }
@keyframes aniSlide { 0% { left: -42%; } 100% { left: 102%; } }
.ani-tool.is-done i { color: var(--success); }
@media (prefers-reduced-motion: reduce) { .ani-spinner, .ani-track::before, .ani-dots::after { animation-duration: 0s; } }
.ani-rail { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px; display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.ani-newchat { width: 100%; justify-content: center; gap: 8px; font-size: 14px; font-weight: 600; padding: 11px 12px; }
.ani-rail-scroll { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; min-height: 0; margin: 0 -4px; padding: 0 4px; }
.ani-rail-label { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg3); padding: 4px 8px; }
.ani-thread { text-align: left; border: 1px solid transparent; border-radius: var(--r-md); padding: 10px 11px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; background: transparent; appearance: none; font-family: inherit; color: inherit; transition: background var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out); }
.ani-thread:hover { background: var(--surface-muted); }
.ani-thread.is-active { background: var(--accent-tint); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.ani-thread-title { font-size: 13.5px; font-weight: 600; color: var(--fg1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ani-thread.is-active .ani-thread-title { color: var(--accent-pressed); }
.ani-thread-meta { display: flex; align-items: center; gap: 8px; }
.ani-thread-dept { font-size: 11px; font-weight: 600; color: var(--fg2); background: var(--surface-muted); padding: 3px 8px; border-radius: var(--r-pill); }
.ani-thread.is-active .ani-thread-dept { background: var(--surface); }
.ani-thread-time { font-size: 11px; color: var(--fg3); margin-left: auto; }

.ani-chat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.ani-chat-head { display: flex; align-items: center; gap: 14px; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.ani-chat-head .ani-av { width: 42px; height: 42px; }
.ani-id { min-width: 0; }
.ani-id-name { display: flex; align-items: center; gap: 9px; }
.ani-id-name b { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; color: var(--fg1); }
.ani-status { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; color: var(--success-fg); }
.ani-status .dot { width: 7px; height: 7px; border-radius: 999px; background: var(--success); box-shadow: 0 0 0 3px var(--success-tint); }
.ani-id-sub { font-size: 12.5px; color: var(--fg2); margin-top: 2px; }
.ani-head-right { margin-left: auto; display: flex; align-items: flex-end; gap: 14px; }
.ani-dept { display: flex; flex-direction: column; gap: 5px; }
.ani-dept-label { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--fg3); }
.ani-dept select { width: 210px; }
.ani-head-btns { display: flex; gap: 6px; }
.ani-icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface); color: var(--fg2); cursor: pointer; transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out); }
.ani-icon-btn:hover { background: var(--surface-muted); color: var(--fg1); }

.ani-stream { flex: 1; overflow-y: auto; padding: 26px 22px; display: flex; flex-direction: column; gap: 22px; }
.ani-msg { display: flex; gap: 12px; max-width: 760px; }
.ani-msg .ani-av { width: 32px; height: 32px; margin-top: 2px; }
.ani-msg-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ani-bubble { background: var(--surface-muted); border: 1px solid var(--border); border-radius: 4px 14px 14px 14px; padding: 13px 16px; font-size: 14px; line-height: 1.55; color: var(--fg1); word-break: break-word; }
.ani-msg.is-user .ani-bubble { white-space: pre-wrap; }
.ani-bubble ul { margin: 8px 0 0; padding-left: 20px; }
.ani-bubble li { margin: 2px 0; }
.ani-bubble code { font-family: var(--font-mono); font-size: 12.5px; background: var(--surface); padding: 1px 5px; border-radius: 4px; }
.ani-bubble p { margin: 0; }
.ani-bubble p + p { margin-top: 10px; }
.ani-meta { font-size: 11.5px; color: var(--fg3); padding-left: 2px; }
.ani-msg.is-user { margin-left: auto; flex-direction: row-reverse; }
.ani-msg.is-user .ani-av { background: var(--accent-tint); }
.ani-msg.is-user .ani-av i { color: var(--accent-pressed); }
.ani-msg.is-user .ani-msg-body { align-items: flex-end; }
.ani-msg.is-user .ani-bubble { background: var(--accent); border-color: var(--accent); color: #fff; border-radius: 14px 4px 14px 14px; }
.ani-tool { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--fg2); background: var(--surface-muted); border: 1px solid var(--border); border-radius: var(--r-pill); padding: 5px 11px; }
.ani-approval { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--accent-fg); background: var(--accent-tint); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); border-radius: var(--r-md); padding: 8px 12px; }

.ani-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ani-chip { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; color: var(--fg1); background: var(--surface); border: 1px solid var(--border-strong); padding: 8px 13px; border-radius: var(--r-pill); cursor: pointer; transition: background var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out); }
.ani-chip:hover { background: var(--surface-muted); border-color: var(--accent); }
.ani-chip i { color: var(--accent); width: 15px; height: 15px; }

.ani-typing { display: inline-flex; gap: 4px; padding: 15px 16px; }
.ani-typing span { width: 7px; height: 7px; border-radius: 999px; background: var(--fg3); animation: aniBlink 1.2s infinite ease-in-out; }
.ani-typing span:nth-child(2) { animation-delay: 0.18s; }
.ani-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes aniBlink { 0%, 60%, 100% { opacity: 0.25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }

.ani-composer { padding: 14px 18px 16px; border-top: 1px solid var(--border); }
.ani-inputwrap { display: flex; align-items: flex-end; gap: 10px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-lg); padding: 8px 8px 8px 14px; transition: border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out); }
.ani-inputwrap:focus-within { border-color: var(--accent); box-shadow: var(--shadow-focus); }
.ani-input { flex: 1; border: none; background: transparent; resize: none; font-family: inherit; font-size: 14px; line-height: 1.5; color: var(--fg1); padding: 9px 0; max-height: 140px; outline: none; }
.ani-input::placeholder { color: var(--fg3); }
.ani-send { width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center; border: none; border-radius: var(--r-md); background: var(--accent); color: #fff; cursor: pointer; transition: background var(--t-fast) var(--ease-out); }
.ani-send:hover { background: var(--accent-hover); }
.ani-send:disabled { background: var(--surface-muted); color: var(--fg3); cursor: default; }
.ani-foot { display: flex; align-items: center; gap: 7px; margin-top: 9px; padding-left: 4px; font-size: 11.5px; color: var(--fg3); }
.ani-foot i { width: 13px; height: 13px; }

/* FLOAT VARIANT */
.ani-fab { position: fixed; right: 26px; bottom: 26px; z-index: 1200; width: 60px; height: 60px; border-radius: 999px; cursor: pointer; padding: 0; overflow: visible; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); display: grid; place-items: center; color: var(--accent); transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out); }
.ani-fab:hover { transform: translateY(-2px); box-shadow: var(--shadow-xl); }
.ani-fab img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; border-radius: 999px; }
.ani-fab i { width: 26px; height: 26px; }
.ani-fab::after { content: ""; position: absolute; right: 2px; bottom: 2px; z-index: 2; width: 14px; height: 14px; border-radius: 999px; background: var(--success); box-shadow: 0 0 0 2.5px var(--bg); }
.ani-fab::before { content: ""; position: absolute; inset: 0; border-radius: 999px; pointer-events: none; animation: aniPulse 2.6s var(--ease-out) infinite; }
.ani-fab.has-unread::before { animation: aniRing 1.6s var(--ease-out) infinite; }
@keyframes aniPulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 38%, transparent); } 70% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--accent) 0%, transparent); } 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent); } }
.ani-fab-badge { position: absolute; top: -4px; right: -4px; z-index: 3; min-width: 20px; height: 20px; padding: 0 5px; box-sizing: border-box; display: grid; place-items: center; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; border-radius: 999px; box-shadow: 0 0 0 2.5px var(--bg); animation: aniBadgePop var(--t-base) var(--ease-spring); }
.ani-fab-badge[hidden] { display: none; }
@keyframes aniBadgePop { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes aniRing { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); } 70% { box-shadow: 0 0 0 15px color-mix(in srgb, var(--accent) 0%, transparent); } 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent); } }

.ani-peek { position: fixed; right: 26px; bottom: 100px; z-index: 1205; width: 320px; max-width: calc(100vw - 40px); display: flex; align-items: flex-start; gap: 11px; padding: 14px 34px 14px 14px; cursor: pointer; background: var(--surface); border: 1px solid color-mix(in srgb, var(--accent) 48%, var(--border)); border-radius: var(--r-lg); box-shadow: var(--shadow-xl), 0 12px 40px -10px color-mix(in srgb, var(--accent) 52%, transparent); animation: aniPeekIn var(--t-slow) var(--ease-out); }
.ani-peek[hidden] { display: none; }
.ani-peek.is-out { animation: aniPeekOut var(--t-base) var(--ease-out) forwards; }
.ani-peek .ani-av { width: 36px; height: 36px; }
.ani-peek-body { min-width: 0; flex: 1; }
.ani-peek-name { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; color: var(--fg1); }
.ani-peek-name .tag { font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-fg); background: var(--accent-tint); padding: 2px 6px; border-radius: 999px; }
.ani-peek-text { font-size: 13px; line-height: 1.45; color: var(--fg2); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ani-peek-close { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; display: grid; place-items: center; border: none; background: transparent; color: var(--fg3); border-radius: var(--r-xs); cursor: pointer; }
.ani-peek-close:hover { background: var(--surface-muted); color: var(--fg1); }
@keyframes aniPeekIn { from { opacity: 0; transform: translateY(14px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes aniPeekOut { to { opacity: 0; transform: translateY(14px) scale(0.96); } }
.ani-msg.ani-in { animation: aniMsgIn 0.42s var(--ease-out) both; }
@keyframes aniMsgIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.ani-float { position: fixed; right: 26px; bottom: 100px; z-index: 1200; width: 384px; max-width: calc(100vw - 32px); height: 560px; max-height: calc(100vh - 130px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-xl); display: flex; flex-direction: column; overflow: hidden; transform-origin: bottom right; transition: opacity var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-out); }
.ani-float[hidden] { display: none; }
.ani-float.is-closing, .ani-float.is-opening { opacity: 0; transform: translateY(8px) scale(0.97); }
.ani-float-head { display: flex; align-items: center; gap: 11px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.ani-float-head .ani-av { width: 34px; height: 34px; }
.ani-float-id b { font-size: 15px; font-weight: 700; color: var(--fg1); display: block; line-height: 1.2; }
.ani-float-id span { font-size: 11.5px; font-weight: 600; color: var(--success-fg); display: inline-flex; align-items: center; gap: 5px; }
.ani-float-id span .dot { width: 6px; height: 6px; border-radius: 999px; background: var(--success); }
.ani-float-head .ani-float-btns { margin-left: auto; display: flex; gap: 2px; }
.ani-float-btns .ani-icon-btn { width: 30px; height: 30px; border: none; }
.ani-float .ani-stream { padding: 18px 16px; gap: 16px; }
.ani-float .ani-msg { max-width: 100%; }
.ani-float .ani-composer { padding: 12px; }
.ani-float .ani-foot { display: none; }

@media (prefers-reduced-motion: reduce) { .ani-typing span { animation: none; } .ani-float, .ani-fab { transition: none; } .ani-fab::before, .ani-fab.has-unread::before, .ani-fab-badge, .ani-peek, .ani-msg.ani-in { animation: none; } }
@media (max-width: 1120px) { .ani-workspace { grid-template-columns: 1fr; } .ani-rail { display: none; } }

/* ════════════════════════════════════════════════════════════════════════════
   Two-factor setup — standalone auth page (from Polaris Design System: 2fa.html)
   All scoped under body.tfa-page so it never collides with the settings 2FA UI.
   ════════════════════════════════════════════════════════════════════════════ */
body.tfa-page { margin: 0; min-height: 100dvh; width: 100%; display: flex; align-items: center; justify-content: center; padding: 24px; overflow: hidden; background: radial-gradient(1100px 620px at 50% -8%, rgba(59,130,246,0.16), transparent 60%), linear-gradient(160deg, #1e293b 0%, #0f172a 55%, #0a1120 100%); background-attachment: fixed; color: #f1f5f9; font-family: var(--font-sans, 'Inter', sans-serif); }
.tfa-page .tfa-card { width: 100%; max-width: 880px; max-height: calc(100dvh - 48px); display: grid; grid-template-columns: 1.02fr 0.98fr; background: rgba(255,255,255,0.045); border: 1px solid rgba(255,255,255,0.09); border-radius: 20px; box-shadow: 0 30px 70px -24px rgba(0,0,0,0.7); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); overflow: hidden; animation: tfaRise 0.5s cubic-bezier(0.16,1,0.3,1) both; }
@keyframes tfaRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.tfa-page .tfa-info { padding: 38px 36px; display: flex; flex-direction: column; border-right: 1px solid rgba(255,255,255,0.08); background: linear-gradient(180deg, rgba(59,130,246,0.06), transparent 40%); }
.tfa-page .tfa-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.tfa-page .tfa-logo { height: 46px; width: auto; display: block; }
.tfa-page .xdi-word { font-weight: 800; font-size: 46px; line-height: 1; letter-spacing: -0.04em; display: inline-flex; align-items: flex-start; color: #f8fafc; font-family: var(--font-display, var(--font-sans)); }
.tfa-page .xdi-word .x { background: linear-gradient(135deg, #60a5fa 0%, #2563eb 55%, #1d4ed8 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tfa-page .xdi-word .dot { width: 9px; height: 9px; border-radius: 999px; margin-top: 5px; margin-left: 1px; background: #38bdf8; box-shadow: 0 0 16px rgba(56,189,248,0.7); }
.tfa-page .tfa-org { font-size: 12.5px; font-weight: 500; color: rgba(147,197,253,0.85); letter-spacing: 0.04em; text-transform: uppercase; }
.tfa-page .tfa-title { font-size: 23px; font-weight: 700; letter-spacing: -0.015em; color: #f8fafc; margin: 30px 0 8px; font-family: var(--font-display, var(--font-sans)); line-height: 1.2; }
.tfa-page .tfa-sub { font-size: 13.5px; line-height: 1.55; color: rgba(148,163,184,0.92); margin: 0 0 26px; max-width: 320px; }
.tfa-page .tfa-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; counter-reset: step; }
.tfa-page .tfa-steps li { display: flex; gap: 13px; align-items: flex-start; counter-increment: step; }
.tfa-page .tfa-steps li::before { content: counter(step); flex-shrink: 0; width: 25px; height: 25px; border-radius: 999px; display: grid; place-items: center; background: rgba(59,130,246,0.16); border: 1px solid rgba(96,165,250,0.4); color: #93c5fd; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 1px; }
.tfa-page .tfa-steps li span { font-size: 13.5px; line-height: 1.5; color: rgba(226,232,240,0.92); }
.tfa-page .tfa-steps li b { color: #f8fafc; font-weight: 600; }
.tfa-page .tfa-info-foot { margin-top: auto; padding-top: 26px; display: flex; align-items: center; gap: 7px; font-size: 12px; color: rgba(148,163,184,0.6); }
.tfa-page .tfa-info-foot .xdi { color: var(--accent); font-weight: 700; }
.tfa-page .tfa-info-foot .dotsep { opacity: 0.5; }
.tfa-page .tfa-action { padding: 34px 36px; display: flex; flex-direction: column; min-height: 0; }
.tfa-page .tfa-qr-wrap { display: flex; justify-content: center; }
.tfa-page .tfa-qr { background: #fff; padding: 12px; border-radius: 14px; box-shadow: 0 8px 24px -6px rgba(0,0,0,0.55); line-height: 0; }
.tfa-page .tfa-qr canvas, .tfa-page .tfa-qr img { display: block; width: 156px; height: 156px; border-radius: 3px; }
.tfa-page .tfa-secret { display: flex; align-items: center; gap: 9px; margin: 16px 0 18px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; padding: 8px 8px 8px 13px; }
.tfa-page .tfa-secret-label { font-size: 10px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: rgba(148,163,184,0.75); }
.tfa-page .tfa-secret code { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.03em; color: #e2e8f0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tfa-page .tfa-copy { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12); color: #cbd5e1; font-size: 12px; font-weight: 600; font-family: inherit; padding: 7px 11px; border-radius: 8px; cursor: pointer; transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease; }
.tfa-page .tfa-copy:hover { background: rgba(255,255,255,0.12); color: #fff; }
.tfa-page .tfa-copy.is-done { color: #6ee7b7; border-color: rgba(16,185,129,0.45); background: rgba(16,185,129,0.14); }
.tfa-page .tfa-field-label { display: block; font-size: 12.5px; font-weight: 600; color: rgba(226,232,240,0.85); margin-bottom: 9px; }
.tfa-page .tfa-otp { display: flex; gap: 8px; justify-content: space-between; }
.tfa-page .tfa-otp input { flex: 1; width: 100%; min-width: 0; height: 52px; text-align: center; font-family: var(--font-mono); font-size: 21px; font-weight: 600; color: #f8fafc; caret-color: #60a5fa; background: rgba(255,255,255,0.05); border: 1.5px solid rgba(255,255,255,0.14); border-radius: 11px; outline: none; transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease; }
.tfa-page .tfa-otp input::placeholder { color: rgba(148,163,184,0.35); }
.tfa-page .tfa-otp input:focus { border-color: #3b82f6; background: rgba(59,130,246,0.1); box-shadow: 0 0 0 3px rgba(59,130,246,0.22); }
.tfa-page .tfa-otp input.is-filled { border-color: rgba(96,165,250,0.55); }
.tfa-page .tfa-error { display: none; align-items: center; gap: 6px; margin-top: 10px; font-size: 12.5px; color: #fca5a5; }
.tfa-page .tfa-error.show { display: flex; }
.tfa-page .tfa-verify { width: 100%; margin-top: 18px; justify-content: center; gap: 8px; display: inline-flex; align-items: center; padding: 12px; border-radius: 10px; border: 1px solid transparent; background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer; transition: background 0.15s ease, opacity 0.15s ease; }
.tfa-page .tfa-verify:hover { background: var(--accent-hover); }
.tfa-page .tfa-verify:disabled { opacity: 0.5; cursor: not-allowed; }
.tfa-page .tfa-cancel { display: block; width: 100%; margin-top: 12px; text-align: center; background: none; border: none; font-family: inherit; font-size: 13px; color: rgba(148,163,184,0.8); cursor: pointer; text-decoration: none; transition: color 0.15s ease; }
.tfa-page .tfa-cancel:hover { color: #e2e8f0; }
@keyframes tfaSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .tfa-page .tfa-card { animation: none; } }
@media (max-width: 720px) {
  body.tfa-page { padding: 16px; overflow: auto; align-items: flex-start; }
  .tfa-page .tfa-card { grid-template-columns: 1fr; max-height: none; max-width: 440px; margin: auto; }
  .tfa-page .tfa-info { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.08); padding: 28px 26px 22px; align-items: center; text-align: center; }
  .tfa-page .tfa-brand { align-items: center; }
  .tfa-page .tfa-sub { margin-bottom: 20px; }
  .tfa-page .tfa-steps li { text-align: left; }
  .tfa-page .tfa-info-foot { justify-content: center; padding-top: 20px; }
  .tfa-page .tfa-action { padding: 24px 26px 26px; }
  .tfa-page .tfa-verify { margin-top: 20px; }
}
@media (max-height: 640px) and (min-width: 721px) {
  .tfa-page .tfa-qr canvas, .tfa-page .tfa-qr img { width: 132px; height: 132px; }
  .tfa-page .tfa-action, .tfa-page .tfa-info { padding-top: 26px; padding-bottom: 26px; }
  .tfa-page .tfa-title { margin-top: 22px; }
}

/* ── Fleet Renewals · company page (design import: company.html) — scoped under .fr-company ── */
.fr-company .co-back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--fg2); text-decoration: none; margin-bottom: 14px; }
.fr-company .co-back:hover { color: var(--accent); }
.fr-company .co-head { display: flex; align-items: flex-start; gap: 16px; }
.fr-company .co-head .av { width: 52px; height: 52px; font-size: 18px; }
.fr-company .co-id { min-width: 0; flex: 1; }
.fr-company .co-name { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; color: var(--fg1); margin: 0; line-height: 1.15; }
.fr-company .co-summary { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 7px; font-size: 13px; color: var(--fg2); align-items: center; }
.fr-company .co-summary .sep { color: var(--fg4, var(--fg3)); }
.fr-company .co-summary .ok { color: var(--success-fg); font-weight: 600; }
.fr-company .co-summary .bad { color: var(--danger-fg); font-weight: 600; }
.fr-company .co-actions { display: flex; flex-wrap: wrap; gap: 8px; flex-shrink: 0; justify-content: flex-end; }
.fr-company .page-head.row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.fr-company .section-label { font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--fg2); margin: 0 0 11px; }
.fr-company .drive-bar { display: flex; align-items: center; gap: 10px; }
.fr-company .crumb { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--fg2); }
.fr-company .crumb b { color: var(--fg1); font-weight: 600; }
.fr-company .crumb .sep { color: var(--fg3); }
.fr-company .crumb button { background: none; border: none; font: inherit; color: var(--fg2); cursor: pointer; padding: 0; display: inline-flex; align-items: center; gap: 6px; }
.fr-company .crumb button:hover { color: var(--accent); }
.fr-company .drive-head { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.fr-company .drive-chev { color: var(--fg3); display: inline-flex; transition: transform var(--t-fast) var(--ease-out); flex-shrink: 0; }
.fr-company .drive-acc.open .drive-chev { transform: rotate(90deg); }
.fr-company .drive-body { display: none; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.fr-company .drive-acc.open .drive-body { display: block; }
.fr-company .fg-group + .fg-group { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.fr-company .folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.fr-company .folder { text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px; cursor: pointer; display: flex; align-items: center; gap: 11px; text-decoration: none; transition: border-color var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out); }
.fr-company .folder:hover { border-color: var(--accent); background: var(--surface-muted); transform: translateY(-1px); }
.fr-company .folder-ico { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.fr-company .folder-name { font-size: 13.5px; font-weight: 600; color: var(--fg1); display: block; line-height: 1.2; }
.fr-company .folder-meta { font-size: 11px; color: var(--fg3); margin-top: 2px; display: block; }
.fr-company .drv-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.fr-company .drv-toolbar .filter-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--fg2); }
.fr-company .seg { display: inline-flex; background: var(--surface-muted); border-radius: 8px; padding: 3px; gap: 2px; }
.fr-company .seg button { border: 0; background: transparent; font: inherit; font-size: 12.5px; color: var(--fg2); padding: 5px 11px; border-radius: 6px; cursor: pointer; }
.fr-company .seg button.on { background: var(--surface); color: var(--fg1); font-weight: 600; box-shadow: var(--shadow-xs); }
.fr-company .drv-toolbar .spacer { flex: 1; }
.fr-company .drv-toolbar .count { font-size: 12px; color: var(--fg2); font-variant-numeric: tabular-nums; }
.fr-company .date-range { display: inline-flex; align-items: center; gap: 6px; }
.fr-company .date-range input[type="date"] { padding: 5px 8px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--fg1); font-size: 12.5px; font-family: inherit; outline: none; color-scheme: dark; }
.fr-company .date-range input[type="date"]:focus { border-color: var(--accent); box-shadow: var(--shadow-focus); }
.fr-company .date-range input.set { border-color: var(--accent); }
.fr-company .date-range .arrow { color: var(--fg3); font-size: 13px; }
.fr-company .drv-toolbar .vr { width: 1px; height: 20px; background: var(--border); }
.fr-company .link-btn { background: none; border: 0; color: var(--accent); font: inherit; font-size: 12.5px; cursor: pointer; padding: 0; }
.fr-company .tbl td.mono { font-family: var(--font-mono); font-size: 12.5px; }
.fr-company .mvr-q { width: 20px; height: 20px; border-radius: 999px; background: var(--surface-muted); color: var(--fg3); display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; }
.fr-company .fresh-n { color: var(--success-fg); font-weight: 600; }
.fr-company .stale-n { color: var(--danger-fg); font-weight: 600; }
.fr-company .row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.fr-company .muted { color: var(--fg3); }
.fr-company .scrim { position: fixed; inset: 0; background: rgba(2,6,23,0.55); display: none; align-items: center; justify-content: center; z-index: 80; padding: 24px; }
.fr-company .scrim.show { display: flex; }
.fr-company .modal { width: 100%; max-width: 640px; max-height: 88vh; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-xl); overflow: hidden; }
.fr-company .modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.fr-company .modal-head h3 { margin: 0; font-size: 17px; font-weight: 700; color: var(--fg1); }
.fr-company .modal-x { width: 30px; height: 30px; border: 0; background: transparent; color: var(--fg2); border-radius: var(--r-sm); cursor: pointer; display: grid; place-items: center; }
.fr-company .modal-x:hover { background: var(--surface-muted); color: var(--fg1); }
.fr-company .modal-body { padding: 20px 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; overflow-y: auto; flex: 1 1 auto; align-content: start; }
.fr-company .modal-body .full { grid-column: 1 / -1; }
.fr-company .fld label { display: block; font-size: 12.5px; font-weight: 600; color: var(--fg2); margin-bottom: 7px; }
.fr-company .fld input, .fr-company .fld select, .fr-company .fld textarea { width: 100%; box-sizing: border-box; padding: 9px 11px; border-radius: 7px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--fg1); font-size: 13.5px; font-family: inherit; outline: none; }
.fr-company .fld input:focus, .fr-company .fld select:focus, .fr-company .fld textarea:focus { border-color: var(--accent); box-shadow: var(--shadow-focus); }
.fr-company .fld textarea { resize: vertical; min-height: 80px; }
.fr-company .ci-sec { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 4px; }
.fr-company .ci-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.fr-company .ci-head h4 { margin: 0; font-size: 13px; font-weight: 700; color: var(--fg1); }
.fr-company .ci-note { font-size: 11.5px; color: var(--fg3); }
.fr-company .ci-head a { margin-left: auto; }
.fr-company .ci-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fr-company .ci-grid .full { grid-column: 1 / -1; }
.fr-company .ci-grid .muted { grid-column: 1 / -1; color: var(--fg3); font-size: 13px; }
.fr-company .ci-loading { grid-column: 1 / -1; display: flex; align-items: center; gap: 9px; color: var(--fg2); font-size: 13px; padding: 8px 0; }
.fr-company .modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); flex-shrink: 0; }

/* ── Fleet Renewals · list page (design import: fleet-renewal.html) — scoped under .fr-list ── */
.fr-list .fr-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.fr-list .fr-sync { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.fr-list .sync-meta { font-size: 12px; color: var(--fg3); }
.fr-list .kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.fr-list .kpi { padding: 16px 18px; }
.fr-list .kpi .eyebrow { font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg2); font-weight: 600; }
.fr-list .kpi .val { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; margin-top: 9px; line-height: 1; font-variant-numeric: tabular-nums; }
.fr-list .kpi .val small { font-size: 13px; font-weight: 500; color: var(--fg2); margin-left: 6px; letter-spacing: 0; }
.fr-list .kpi .val.green { color: var(--success-fg); }
.fr-list .kpi .val.red { color: var(--danger-fg); }
.fr-list .toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.fr-list .search-box { position: relative; }
.fr-list .search-box i, .fr-list .search-box svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--fg3); pointer-events: none; }
.fr-list .search-box input { padding: 7px 12px 7px 32px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--fg1); font-size: 13px; width: 240px; outline: none; font-family: inherit; }
.fr-list .search-box input:focus { border-color: var(--accent); box-shadow: var(--shadow-focus); }
.fr-list .toolbar .spacer { flex: 1; }
.fr-list .toolbar .count { font-size: 12px; color: var(--fg2); font-variant-numeric: tabular-nums; }
.fr-list .seg { display: inline-flex; background: var(--surface-muted); border-radius: 8px; padding: 3px; gap: 2px; }
.fr-list .seg button { border: 0; background: transparent; font: inherit; font-size: 12.5px; color: var(--fg2); padding: 5px 12px; border-radius: 6px; cursor: pointer; }
.fr-list .seg button.on { background: var(--surface); color: var(--fg1); font-weight: 600; box-shadow: var(--shadow-xs); }
.fr-list .toolbar .filter-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--fg2); }
.fr-list .toolbar .link-btn { background: none; border: 0; color: var(--accent); font: inherit; font-size: 12.5px; cursor: pointer; }
.fr-list .toolbar .vr { width: 1px; height: 20px; background: var(--border); }
.fr-list .date-range { display: inline-flex; align-items: center; gap: 6px; }
.fr-list .date-range input[type="date"] { padding: 5px 8px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--fg1); font-size: 12.5px; font-family: inherit; outline: none; color-scheme: dark; }
.fr-list .date-range input[type="date"]:focus { border-color: var(--accent); box-shadow: var(--shadow-focus); }
.fr-list .date-range input.set { border-color: var(--accent); }
.fr-list .date-range .arrow { color: var(--fg3); font-size: 13px; }
.fr-list .tbl th.sortable { cursor: pointer; user-select: none; white-space: nowrap; transition: color var(--t-fast) var(--ease-out); }
.fr-list .tbl th.sortable .th-in { display: inline-flex; align-items: center; gap: 4px; }
.fr-list .tbl th.num.sortable .th-in { flex-direction: row-reverse; }
.fr-list .tbl th.sortable:hover { color: var(--fg1); }
.fr-list .tbl th .sort-ar { display: inline-flex; opacity: 0.3; transition: opacity var(--t-fast) var(--ease-out); }
.fr-list .tbl th.sortable:hover .sort-ar { opacity: 0.65; }
.fr-list .tbl th.sort-active { color: var(--fg1); }
.fr-list .tbl th.sort-active .sort-ar { opacity: 1; color: var(--accent); }
.fr-list .expires-cell { display: flex; flex-direction: column; gap: 3px; }
.fr-list .expires-cell .badge { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; align-self: flex-start; font-variant-numeric: tabular-nums; }
.fr-list .b-active { background: var(--success-tint); color: var(--success-fg); }
.fr-list .b-warning { background: var(--warning-tint); color: var(--warning-fg); }
.fr-list .b-danger { background: var(--danger-tint); color: var(--danger-fg); }
.fr-list .muted { color: var(--fg3); }
.fr-list .yearcell { max-width: 260px; font-size: 12.5px; color: var(--fg2); white-space: normal; }
.fr-list .fresh-n { color: var(--success-fg); font-weight: 600; }
.fr-list .stale-n { color: var(--danger-fg); font-weight: 600; }
.fr-list .zero { color: var(--fg3); }
.fr-list tr[data-company] { cursor: pointer; }
.fr-list .conf-desc { font-size: 13.5px; color: var(--fg2); margin: 0 0 16px; max-width: 720px; line-height: 1.5; }
.fr-list .conf-card { border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; }
.fr-list .conf-card + .conf-card { margin-top: 14px; }
.fr-list .conf-head { display: flex; align-items: center; gap: 10px; }
.fr-list .conf-head .nm { font-size: 16px; font-weight: 700; color: var(--fg1); }
.fr-list .conf-conf { font-size: 12px; font-weight: 700; color: var(--success-fg); background: var(--success-tint); padding: 2px 9px; border-radius: 999px; }
.fr-list .conf-mail { font-size: 13px; color: var(--fg2); margin-top: 8px; }
.fr-list .conf-mail .re { color: var(--fg1); }
.fr-list .conf-from { font-size: 12px; color: var(--fg3); margin-top: 3px; }
.fr-list .conf-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin: 18px 0; }
.fr-list .conf-f label { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--fg3); margin-bottom: 6px; }
.fr-list .conf-f input { width: 100%; box-sizing: border-box; padding: 9px 11px; border-radius: 7px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--fg1); font-size: 13px; font-family: inherit; outline: none; }
.fr-list .conf-f input:focus { border-color: var(--accent); box-shadow: var(--shadow-focus); }
.fr-list .conf-actions { display: flex; gap: 10px; }
@media (max-width: 1100px) { .fr-list .conf-grid { grid-template-columns: repeat(3, 1fr); } .fr-list .kpi-row { grid-template-columns: repeat(2, 1fr); } }

/* CAB safety accordion (company page) */
/* CAB safety accordion (matches design guide company.html) */
.fr-company .cab-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fr-company .cab-head { display: inline-flex; align-items: center; gap: 9px; min-width: 0; flex-wrap: wrap; }
.fr-company .cab-head > b { color: var(--fg1); font-size: 14px; font-weight: 600; }
.fr-company .cab-head > i { color: var(--fg2); }
.fr-company .cab-head[data-cab-toggle] { cursor: pointer; }
.fr-company .cab-chev { color: var(--fg3); display: inline-flex; transition: transform var(--t-fast) var(--ease-out); flex-shrink: 0; }
.fr-company .cab-acc.open .cab-chev { transform: rotate(90deg); }
.fr-company .usdot { font-family: var(--font-mono); font-size: 12px; background: var(--surface-muted); padding: 2px 8px; border-radius: 5px; color: var(--fg1); white-space: nowrap; }
.fr-company .cab-bar .pill { white-space: nowrap; }
.fr-company .cab-updated { font-size: 12px; color: var(--fg3); font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 6px; }
.fr-company .cab-body { display: none; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.fr-company .cab-acc.open .cab-body { display: block; }
.fr-company .cab-sub-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.fr-company .cab-sub-head .section-label { margin: 0; }
.fr-company .cab-legend { font-size: 11px; color: var(--fg3); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.fr-company .cab-legend .tick { width: 2px; height: 11px; background: var(--fg2); display: inline-block; border-radius: 1px; opacity: 0.55; }
.fr-company .cab-note { font-size: 11.5px; color: var(--fg3); margin: 14px 0 0; }
.fr-company .basic-row { display: grid; grid-template-columns: 210px 1fr 92px; align-items: center; gap: 16px; padding: 11px 0; }
.fr-company .basic-row + .basic-row { border-top: 1px solid var(--border); }
.fr-company .basic-name { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500; color: var(--fg1); }
.fr-company .basic-name .ico { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; background: var(--surface-muted); color: var(--fg2); flex-shrink: 0; }
.fr-company .basic-track { position: relative; height: 8px; border-radius: 999px; background: var(--surface-muted); }
.fr-company .basic-fill { position: absolute; left: 0; top: 0; height: 100%; border-radius: 999px; transition: width var(--t-med) var(--ease-out); }
.fr-company .basic-fill.lvl-ok { background: var(--success); }
.fr-company .basic-fill.lvl-warn { background: var(--warning); }
.fr-company .basic-fill.lvl-alert { background: var(--danger); }
.fr-company .basic-thresh { position: absolute; top: -3px; width: 2px; height: 14px; background: var(--fg2); border-radius: 1px; opacity: 0.55; }
.fr-company .basic-na-bar { font-size: 11.5px; color: var(--fg3); font-style: italic; }
.fr-company .basic-val { display: flex; align-items: center; gap: 9px; justify-content: flex-end; }
.fr-company .basic-pct { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--fg1); min-width: 38px; text-align: right; }
.fr-company .basic-pct .pp { font-size: 10.5px; color: var(--fg3); font-weight: 500; }
.fr-company .basic-dot { width: 8px; height: 8px; min-width: 8px; padding: 0; border-radius: 50%; flex-shrink: 0; flex-grow: 0; display: inline-block; }
.fr-company .basic-dot.lvl-ok { background: var(--success); }
.fr-company .basic-dot.lvl-warn { background: var(--warning); }
.fr-company .basic-dot.lvl-alert { background: var(--danger); }
.fr-company .basic-dot.lvl-na { background: var(--border-strong); }
@media (max-width: 760px) { .fr-company .basic-row { grid-template-columns: 150px 1fr 78px; gap: 10px; } }

/* ── Clients · list page (design import: clients.html) — scoped under .cl-list ── */
.cl-list .cl-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.cl-list .cl-head .page-sub { max-width: 540px; }
.cl-list .kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.cl-list .kpi { padding: 16px 18px; }
.cl-list .kpi .eyebrow { font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg2); font-weight: 600; }
.cl-list .kpi .val { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; margin-top: 9px; line-height: 1; font-variant-numeric: tabular-nums; }
.cl-list .kpi .val.green { color: var(--success-fg); }
.cl-list .toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.cl-list .search-box { position: relative; }
.cl-list .search-box i, .cl-list .search-box svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--fg3); pointer-events: none; }
.cl-list .search-box input { padding: 7px 12px 7px 32px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--fg1); font-size: 13px; width: 260px; outline: none; font-family: inherit; }
.cl-list .search-box input:focus { border-color: var(--accent); box-shadow: var(--shadow-focus); }
.cl-list .seg { display: inline-flex; background: var(--surface-muted); border-radius: 8px; padding: 3px; gap: 2px; }
.cl-list .seg button { border: 0; background: transparent; font: inherit; font-size: 12.5px; color: var(--fg2); padding: 5px 12px; border-radius: 6px; cursor: pointer; }
.cl-list .seg button.on { background: var(--surface); color: var(--fg1); font-weight: 600; box-shadow: var(--shadow-xs); }
.cl-list .toolbar .spacer { flex: 1; }
.cl-list .toolbar .count { font-size: 12px; color: var(--fg2); font-variant-numeric: tabular-nums; }
.cl-list .toolbar .filter-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--fg2); }
.cl-list .toolbar .link-btn { background: none; border: 0; color: var(--accent); font: inherit; font-size: 12.5px; cursor: pointer; }
.cl-list .cov-bar .cov-chips { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.cl-list .tbl th.sortable { cursor: pointer; user-select: none; white-space: nowrap; transition: color var(--t-fast) var(--ease-out); }
.cl-list .tbl th.sortable .th-in { display: inline-flex; align-items: center; gap: 4px; }
.cl-list .tbl th.num.sortable .th-in { flex-direction: row-reverse; }
.cl-list .tbl th.sortable:hover { color: var(--fg1); }
.cl-list .tbl th .sort-ar { display: inline-flex; opacity: 0.3; transition: opacity var(--t-fast) var(--ease-out); }
.cl-list .tbl th.sortable:hover .sort-ar { opacity: 0.65; }
.cl-list .tbl th.sort-active { color: var(--fg1); }
.cl-list .tbl th.sort-active .sort-ar { opacity: 1; color: var(--accent); }
.cl-list tr[data-client] { cursor: pointer; }
.cl-list .cl-client { display: flex; align-items: center; gap: 11px; }
.cl-list .cl-client .nm { font-weight: 600; color: var(--fg1); }
.cl-list .cl-client .sub { font-size: 11.5px; color: var(--fg3); margin-top: 1px; }
.cl-list .cov { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.cl-list .cov span { font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 4px; background: var(--surface-muted); color: var(--fg2); }
.cl-list .muted { color: var(--fg3); }
.cl-list .next-cell { display: inline-flex; align-items: center; gap: 7px; }
.cl-list .next-dot { width: 7px; height: 7px; border-radius: 999px; flex-shrink: 0; }
.cl-list .mvr-mini { display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.cl-list .fresh-n { color: var(--success-fg); font-weight: 600; }
.cl-list .stale-n { color: var(--danger-fg); font-weight: 600; }
@media (max-width: 1100px) { .cl-list .kpi-row { grid-template-columns: repeat(2, 1fr); } }
/* "Conclusion by Ani" suggestion tag in the COI review conclusion status */
.ani-tag { display:inline-flex; align-items:center; gap:4px; font-size:11.5px; font-weight:600; color:var(--accent); background:color-mix(in srgb, var(--accent) 12%, transparent); padding:2px 8px; border-radius:999px; }
