/* ==========================================================================
   pages/visibility.css — visibility view: filters, ring, table, tabs
   ========================================================================== */

/* === Filter bar === */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--rl);
  padding: 14px 16px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-d);
}

.filter-sel {
  background: var(--surface2);
  border: 0.5px solid var(--border-m);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--text);
  font-family: var(--fb);
  font-size: 13px;
  outline: none;
  cursor: pointer;
  min-width: 130px;
}

.filter-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
  margin: 0 4px;
}

/* === Visibility ring (used in table rows) === */

.vis-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  flex-shrink: 0;
}

.vis-pct {
  font-family: var(--fh);
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.vis-lbl {
  font-size: 9px;
  color: var(--text-d);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* === Visibility table === */

.vis-table-wrap {
  overflow-x: auto;
  margin-top: 4px;
}

.vt {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.vt th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-d);
  padding: 9px 14px;
  text-align: left;
  white-space: nowrap;
  /* No border-bottom — header typography (uppercase + muted color) already
     creates enough separation; the line above the first data row read as
     a rogue divider. Per-row borders on .vt td stay for data separation. */
}

.vt td {
  padding: 9px 14px;
  border-bottom: 0.5px solid var(--border);
}

.vt tbody tr:hover {
  background: var(--surface2);
}

.vt tr:last-child td {
  border-bottom: none;
}

.vt-pct {
  font-family: var(--fm);
  font-size: 13px;
  font-weight: 500;
}

/* === Percentage colors (for inline %) === */

.pct-hi   { color: var(--green); }
.pct-md   { color: var(--amber); }
.pct-lo   { color: var(--red); }
.pct-zero { color: var(--text-d); }

.pct-bar {
  height: 4px;
  background: var(--surface3);
  border-radius: 2px;
  margin-top: 3px;
  width: 60px;
  overflow: hidden;
}

.pct-bar-fill {
  height: 100%;
  border-radius: 2px;
}

/* === Tabs (engine selector) === */

.tabs {
  display: flex;
  gap: 2px;
  background: var(--surface2);
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 16px;
  width: fit-content;
}

.tab {
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-m);
  transition: all 0.15s;
}

.tab.active {
  background: var(--surface3);
  color: var(--text);
  font-weight: 500;
}

/* === Content / empty-state toggle (no-client guard) ===================== */

.vis-content {
  display: block;
}
.vis-content.is-hidden {
  display: none;
}

.vis-card + .vis-card {
  margin-top: 16px;
}

/* === Empty state (no client selected) =================================== */

.vis-empty {
  display: none;
  text-align: center;
  padding: 80px 24px;
  color: var(--text-m);
}
.vis-empty.is-visible {
  display: block;
  animation: fadeIn 0.18s ease;
}

.vis-empty__icon {
  font-size: 44px;
  margin-bottom: 16px;
  opacity: 0.85;
}

.vis-empty__title {
  font-family: var(--fh);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.2px;
}

.vis-empty__text {
  font-size: 13px;
  color: var(--text-d);
  max-width: 420px;
  margin: 0 auto;
  line-height: 1.6;
}
