/* ============================================================================
   domains.css — Domains page (list triage + detail) for the ONYX Mail Ops UI.
   Owned by domains.js. Uses ONLY existing design tokens from app.css
   (var(--…)); NO color literals are introduced here. New component classes
   only — existing shared classes (.toolbar/.card/.filterbar/.pill/.kv/…) keep
   their app.css styling.
   ========================================================================== */

/* ---- Triage strip ------------------------------------------------------- */
.triage-card {
  margin-bottom: 16px;
  padding: 14px 16px;
}
.triage {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
/* Clickable problem-count tiles. Neutralise the base <button> gradient. */
.triage-item {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  background-image: none;
  border: 1px solid var(--line);
  box-shadow: none;
  color: var(--ink-soft);
}
.triage-item:hover { background: var(--line-soft); filter: none; box-shadow: var(--sh-xs); }
.triage-item .t-num { font-size: 18px; font-weight: 800; letter-spacing: -.4px; }
.triage-item .t-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--muted);
}
/* Severity accents — token colours only. */
.triage-item.t-bad   { border-color: var(--danger-line); background: var(--danger-bg); }
.triage-item.t-bad   .t-num { color: var(--danger); }
.triage-item.t-warn  { border-color: var(--warn-line); background: var(--warn-bg); }
.triage-item.t-warn  .t-num { color: var(--warn); }
.triage-item.t-muted .t-num { color: var(--muted); }

.triage-clear { font-size: 13px; font-weight: 600; color: var(--ok); }
.triage-note { margin-left: 4px; }
.triage-actions { margin-left: auto; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }

/* ---- Facet chips -------------------------------------------------------- */
.facets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--surface);
  background-image: none;
  border: 1px solid var(--line);
  box-shadow: var(--sh-xs);
}
.chip:hover { background: var(--surface-2); border-color: var(--faint); filter: none; }
.chip.active {
  color: var(--info);
  background: var(--info-bg);
  border-color: var(--info-line);
}
.chip .chip-n {
  font-size: 11px;
  font-weight: 800;
  min-width: 18px;
  text-align: center;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
}
.chip.active .chip-n {
  background: var(--surface);
  border-color: var(--info-line);
  color: var(--info);
}

/* ---- Searchable combobox (tenant filter) -------------------------------- */
/* Typeahead replacement for a native <select> that would otherwise render every
   tenant at once. Input mirrors the shared select styling; menu is an absolute
   popover scoped to the wrapper. */
.combo { position: relative; width: 100%; }
.combo-input {
  width: 100%;
  /* leave room on the right for the chevron, like a native select */
  padding-right: 30px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.combo-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 264px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: var(--sh-md, var(--sh-sm));
  padding: 4px;
}
.combo-opt {
  padding: 7px 10px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.combo-opt:hover,
.combo-opt.active { background: var(--surface-2); }
.combo-opt.selected { color: var(--info); font-weight: 600; }
.combo-empty {
  padding: 8px 10px;
  font-size: 13px;
  color: var(--muted);
}

/* Tenant chip — adopted domains show the owning tenant as a neutral tag rather
   than an "adopted" pill + loose muted text. */
.tenant-chip {
  display: inline-block;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

/* ---- List table --------------------------------------------------------- */
/* overflow:visible so the sticky <thead> sticks to the viewport rather than
   being clipped by the card's overflow:hidden. */
.dtable-card { overflow: visible; }
.dtable thead th {
  position: sticky;
  top: var(--topbar-h);
  z-index: 5;
}
.dtable .col-health { width: 1%; padding-left: 16px; padding-right: 0; text-align: center; }
.dtable td.actions button { margin-left: 6px; }
.dtable .row-click { cursor: pointer; }

.domlink { font-weight: 600; color: var(--sky-700); text-decoration: none; }
.domlink:hover { text-decoration: underline; }

/* Health dot — solid status-token fills. */
.health-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  vertical-align: middle;
}
.health-dot.h-ok   { background: var(--ok); }
.health-dot.h-warn { background: var(--warn); }
.health-dot.h-bad  { background: var(--danger); }
.health-dot.h-off  { background: var(--muted); }

/* SES counts cell. */
.ses-cell { font-size: 12.5px; white-space: nowrap; }
.ses-bad  { color: var(--danger); font-weight: 700; }
.ses-warn { color: var(--warn); font-weight: 700; }

/* ---- Detail view -------------------------------------------------------- */
.crumb { margin: 0 0 10px; }
.crumb a { font-size: 13px; font-weight: 600; text-decoration: none; color: var(--muted); }
.crumb a:hover { color: var(--sky-700); text-decoration: underline; }

.detail-pills { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.detail-card { padding: 4px 18px 16px; }
.detail-card-head { margin: 0 0 4px; padding-top: 12px; }
.detail-card-title { font-size: 15px !important; font-weight: 700; letter-spacing: -.1px; }
.detail-card-body { font-size: 13.5px; }
.detail-card-body .kv { align-items: flex-start; }
.detail-card-body .kv .muted { min-width: 110px; flex: 0 0 auto; }
.detail-card-body .kv-val { flex: 1 1 auto; word-break: break-word; color: var(--ink-soft); }

/* Compact tables inside detail / panel. */
.suppress-table, .mbx-table { font-size: 13px; }
.suppress-table th, .mbx-table th { padding: 8px 12px; }
.suppress-table td, .mbx-table td { padding: 8px 12px; }
.suppress-panel { font-size: 13px; }

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 920px) {
  .detail-grid { grid-template-columns: 1fr; }
  .dtable thead th { top: 0; }   /* sidebar reflows to a strip; no fixed topbar offset */
}
@media (max-width: 720px) {
  .triage-actions { margin-left: 0; width: 100%; }
  .dtable .actions { white-space: normal; }
}
