/*
 * Vector Ridge founder CRM — private Atlas audit workspace.
 * Raw record content is rendered with textContent by vr-admin-atlas-logs.js.
 */
.atlas-admin {
  --atlas-line: rgba(255, 255, 255, 0.11);
  --atlas-line-soft: rgba(255, 255, 255, 0.065);
  --atlas-panel: #0d0d0f;
  --atlas-panel-raised: #111114;
  --atlas-muted: #8f8f98;
  --atlas-dim: #606068;
  min-width: 0;
  color: #f5f5f7;
  border: 1px solid var(--atlas-line);
  background:
    radial-gradient(circle at 86% -30%, rgba(255, 255, 255, 0.055), transparent 38%),
    #09090a;
  font-family: Inter, sans-serif;
  isolation: isolate;
}

.atlas-admin button,
.atlas-admin input,
.atlas-admin select {
  font: inherit;
}

.atlas-admin .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.atlas-admin button {
  cursor: pointer;
}

.atlas-admin-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.35rem 1.45rem 1.2rem;
  border-bottom: 1px solid var(--atlas-line);
}

.atlas-admin-title {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  min-width: 0;
}

.atlas-admin-mark {
  width: 39px;
  height: 39px;
  flex: 0 0 39px;
  display: grid;
  place-items: center;
  border: 1px solid var(--atlas-line);
  background: #0a0a0c;
}

.atlas-admin-mark img {
  width: 24px;
  height: 29px;
  object-fit: contain;
}

.atlas-admin-eyebrow,
.atlas-admin-section-label,
.atlas-admin-source-count,
.atlas-admin-kpi-label,
.atlas-admin-record-source,
.atlas-admin-detail-label {
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.atlas-admin-eyebrow {
  color: #b8b8c0;
  font-size: 0.61rem;
  margin-bottom: 0.25rem;
}

.atlas-admin-head h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.atlas-admin-head p {
  max-width: 720px;
  margin: 0.38rem 0 0;
  color: var(--atlas-muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

.atlas-admin-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.atlas-admin-status,
.atlas-admin-btn,
.atlas-admin-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  border: 1px solid var(--atlas-line);
  background: #0d0d0f;
  color: #d7d7dc;
  border-radius: 3px;
  white-space: nowrap;
}

.atlas-admin-status {
  padding: 0 0.75rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.61rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.atlas-admin-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #81818a;
}

.atlas-admin-status[data-tone="ready"]::before {
  background: #d7d7dc;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.07);
}

.atlas-admin-status[data-tone="warn"]::before {
  background: #fbbf24;
}

.atlas-admin-status[data-tone="error"]::before {
  background: #ef4444;
}

.atlas-admin-btn {
  padding: 0 0.82rem;
  font-size: 0.69rem;
  letter-spacing: 0.035em;
  text-decoration: none;
}

.atlas-admin-btn:hover,
.atlas-admin-btn:focus-visible {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.34);
  background: #151518;
}

.atlas-admin-btn[disabled] {
  cursor: not-allowed;
  opacity: 0.45;
}

.atlas-admin-btn-primary {
  background: #ececef;
  color: #09090a;
  border-color: #ececef;
  font-weight: 650;
}

.atlas-admin-btn-primary:hover,
.atlas-admin-btn-primary:focus-visible {
  background: #fff;
  color: #000;
}

.atlas-admin-coverage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 0.78rem 1.45rem;
  border-bottom: 1px solid var(--atlas-line-soft);
  background: rgba(255, 255, 255, 0.018);
}

.atlas-admin-coverage-copy {
  min-width: 0;
  color: #a7a7af;
  font-size: 0.7rem;
  line-height: 1.5;
}

.atlas-admin-coverage-copy strong {
  color: #efeff2;
  font-weight: 600;
}

.atlas-admin-coverage-scope {
  color: #73737c;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.59rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.atlas-admin-alert {
  display: none;
  margin: 0.9rem 1.45rem 0;
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.055);
  color: #dad2bc;
  font-size: 0.72rem;
  line-height: 1.5;
}

.atlas-admin-alert.is-visible {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.atlas-admin-alert[data-tone="error"] {
  border-color: rgba(239, 68, 68, 0.34);
  background: rgba(239, 68, 68, 0.055);
  color: #e5c1c1;
}

.atlas-admin-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-bottom: 1px solid var(--atlas-line);
}

.atlas-admin-kpi {
  min-width: 0;
  padding: 0.95rem 1rem;
  border-right: 1px solid var(--atlas-line-soft);
}

.atlas-admin-kpi:last-child {
  border-right: 0;
}

.atlas-admin-kpi-label {
  color: #777780;
  font-size: 0.55rem;
}

.atlas-admin-kpi-value {
  margin-top: 0.3rem;
  color: #f3f3f5;
  font-family: "JetBrains Mono", monospace;
  font-size: 1.08rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.atlas-admin-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(4, minmax(125px, 0.55fr));
  gap: 0.55rem;
  padding: 0.78rem;
  border-bottom: 1px solid var(--atlas-line);
  background: #0a0a0b;
}

.atlas-admin-control {
  position: relative;
  min-width: 0;
}

.atlas-admin-control input,
.atlas-admin-control select {
  width: 100%;
  height: 38px;
  border: 1px solid var(--atlas-line);
  border-radius: 3px;
  background: #0e0e10;
  color: #e8e8eb;
  padding: 0 0.75rem;
  font-size: 0.7rem;
}

.atlas-admin-control input::placeholder {
  color: #64646c;
}

.atlas-admin-control select {
  appearance: none;
  padding-right: 2rem;
  background-image:
    linear-gradient(45deg, transparent 50%, #85858d 50%),
    linear-gradient(135deg, #85858d 50%, transparent 50%);
  background-position:
    calc(100% - 15px) 16px,
    calc(100% - 11px) 16px;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}

.atlas-admin-workspace {
  display: grid;
  grid-template-columns: 205px minmax(340px, 1fr) minmax(300px, 370px);
  min-height: 570px;
}

.atlas-admin-sources,
.atlas-admin-timeline,
.atlas-admin-detail {
  min-width: 0;
}

.atlas-admin-sources {
  border-right: 1px solid var(--atlas-line);
  background: #0a0a0b;
  padding: 0.85rem 0.7rem;
}

.atlas-admin-section-label {
  padding: 0.2rem 0.55rem 0.65rem;
  color: #696972;
  font-size: 0.55rem;
}

.atlas-admin-section-label-spaced {
  margin-top: 0.8rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--atlas-line-soft);
}

.atlas-admin-source {
  width: 100%;
  min-height: 38px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.58rem 0.58rem;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: #96969e;
  text-align: left;
  font-size: 0.68rem;
}

.atlas-admin-source:hover {
  color: #ededf0;
  background: rgba(255, 255, 255, 0.025);
}

.atlas-admin-source.is-active {
  color: #fff;
  border-color: var(--atlas-line);
  background: #121214;
}

.atlas-admin-source-count {
  color: #6e6e77;
  font-size: 0.54rem;
}

.atlas-admin-source.is-active .atlas-admin-source-count {
  color: #d3d3d8;
}

.atlas-admin-timeline {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--atlas-line);
  background: #0b0b0c;
}

.atlas-admin-list-head,
.atlas-admin-detail-head {
  min-height: 53px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.72rem 0.9rem;
  border-bottom: 1px solid var(--atlas-line-soft);
}

.atlas-admin-list-head strong,
.atlas-admin-detail-head strong {
  font-size: 0.75rem;
  font-weight: 600;
}

.atlas-admin-list-head span,
.atlas-admin-detail-head span {
  color: #707078;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.58rem;
}

.atlas-admin-detail-head strong,
.atlas-admin-detail-head span,
.atlas-admin-record-summary,
.atlas-admin-record-meta {
  display: block;
}

.atlas-admin-detail-head span {
  margin-top: 0.18rem;
}

.atlas-admin-list {
  flex: 1;
  min-height: 0;
  max-height: 640px;
  overflow: auto;
  scrollbar-color: #34343a #0b0b0c;
}

.atlas-admin-record {
  width: 100%;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: start;
  padding: 0.83rem 0.9rem;
  border: 0;
  border-bottom: 1px solid var(--atlas-line-soft);
  background: transparent;
  color: inherit;
  text-align: left;
}

.atlas-admin-record:hover {
  background: rgba(255, 255, 255, 0.025);
}

.atlas-admin-record.is-active {
  background: #141416;
}

.atlas-admin-record-dot {
  width: 6px;
  height: 6px;
  margin-top: 0.34rem;
  border: 1px solid #86868e;
  border-radius: 50%;
}

.atlas-admin-record[data-state="failed"] .atlas-admin-record-dot {
  border-color: #ef4444;
  background: #ef4444;
}

.atlas-admin-record[data-state="pending"] .atlas-admin-record-dot {
  border-color: #fbbf24;
}

.atlas-admin-record[data-state="completed"] .atlas-admin-record-dot {
  background: #bdbdc4;
}

.atlas-admin-record-main {
  min-width: 0;
}

.atlas-admin-record-top {
  display: flex;
  align-items: baseline;
  gap: 0.52rem;
  min-width: 0;
}

.atlas-admin-record-source {
  color: #8e8e97;
  font-size: 0.52rem;
  flex: 0 0 auto;
}

.atlas-admin-record-user {
  min-width: 0;
  overflow: hidden;
  color: #d8d8dc;
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.atlas-admin-record-summary {
  margin-top: 0.28rem;
  color: #aaaab2;
  font-size: 0.7rem;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.atlas-admin-record-meta {
  margin-top: 0.36rem;
  color: #5f5f68;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.54rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.atlas-admin-record-time {
  color: #74747d;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.54rem;
  white-space: nowrap;
}

.atlas-admin-list-foot {
  min-height: 47px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-top: 1px solid var(--atlas-line-soft);
}

.atlas-admin-list-foot span {
  color: #64646d;
  font-size: 0.62rem;
}

.atlas-admin-detail {
  display: flex;
  flex-direction: column;
  background: #0d0d0e;
}

.atlas-admin-detail-body {
  min-height: 0;
  max-height: 640px;
  overflow: auto;
  padding: 0.9rem;
  scrollbar-color: #34343a #0d0d0e;
}

.atlas-admin-detail-empty,
.atlas-admin-empty {
  display: grid;
  place-items: center;
  min-height: 250px;
  padding: 2rem;
  color: #66666f;
  font-size: 0.72rem;
  line-height: 1.6;
  text-align: center;
}

.atlas-admin-detail-close {
  display: none;
  width: 30px;
  height: 30px;
  border: 1px solid var(--atlas-line);
  background: transparent;
  color: #aaaab2;
  border-radius: 3px;
}

.atlas-admin-detail-title {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.atlas-admin-detail-subtitle {
  margin-top: 0.35rem;
  color: #6e6e77;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.57rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.atlas-admin-detail-grid {
  margin-top: 0.9rem;
  border-top: 1px solid var(--atlas-line-soft);
}

.atlas-admin-detail-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--atlas-line-soft);
}

.atlas-admin-detail-label {
  color: #74747d;
  font-size: 0.52rem;
}

.atlas-admin-detail-value {
  min-width: 0;
  color: #d6d6db;
  font-size: 0.67rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.atlas-admin-related {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.85rem 0 0;
}

.atlas-admin-chip {
  min-height: 26px;
  max-width: 100%;
  padding: 0.2rem 0.5rem;
  color: #9f9fa7;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.52rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.atlas-admin-detail-actions {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.9rem;
  flex-wrap: wrap;
}

.atlas-admin-transcript {
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
}

.atlas-admin-turn {
  padding: 0.75rem 0.8rem;
  border: 1px solid var(--atlas-line-soft);
  background: #0a0a0b;
}

.atlas-admin-turn[data-role="assistant"] {
  border-left-color: rgba(255, 255, 255, 0.45);
  background: #111113;
}

.atlas-admin-turn-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.48rem;
}

.atlas-admin-turn-head strong {
  color: #ededf0;
  font-size: 0.64rem;
  font-weight: 600;
}

.atlas-admin-turn-head span {
  color: #65656e;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.52rem;
}

.atlas-admin-turn-content {
  color: #bcbcc4;
  font-size: 0.69rem;
  line-height: 1.58;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.atlas-admin-detail-note {
  margin-top: 0.8rem;
  padding: 0.65rem 0.72rem;
  border-left: 2px solid #6c6c75;
  background: rgba(255, 255, 255, 0.018);
  color: #84848d;
  font-size: 0.62rem;
  line-height: 1.5;
}

.atlas-admin-json {
  margin-top: 0.9rem;
  border: 1px solid var(--atlas-line-soft);
  background: #09090a;
}

.atlas-admin-json summary {
  padding: 0.65rem 0.72rem;
  color: #a1a1aa;
  cursor: pointer;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.atlas-admin-json pre {
  max-height: 360px;
  overflow: auto;
  margin: 0;
  padding: 0.75rem;
  border-top: 1px solid var(--atlas-line-soft);
  color: #b9b9c0;
  font: 0.59rem/1.55 "JetBrains Mono", monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.atlas-admin-loading {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1px solid #55555e;
  border-top-color: #eeeef1;
  border-radius: 50%;
  animation: atlas-admin-spin 0.75s linear infinite;
}

@keyframes atlas-admin-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 1180px) {
  .atlas-admin-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .atlas-admin-kpi:nth-child(3) {
    border-right: 0;
  }

  .atlas-admin-kpi:nth-child(-n + 3) {
    border-bottom: 1px solid var(--atlas-line-soft);
  }

  .atlas-admin-workspace {
    grid-template-columns: 175px minmax(300px, 1fr) minmax(280px, 330px);
  }
}

@media (max-width: 900px) {
  .atlas-admin-head,
  .atlas-admin-coverage {
    grid-template-columns: 1fr;
  }

  .atlas-admin-head {
    flex-direction: column;
  }

  .atlas-admin-actions {
    justify-content: flex-start;
  }

  .atlas-admin-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .atlas-admin-workspace {
    grid-template-columns: 1fr;
  }

  .atlas-admin-sources {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--atlas-line);
  }

  .atlas-admin-sources .atlas-admin-section-label {
    display: none;
  }

  .atlas-admin-source {
    width: auto;
    min-width: max-content;
    grid-template-columns: auto auto;
  }

  .atlas-admin-timeline {
    border-right: 0;
  }

  .atlas-admin-detail {
    position: fixed;
    inset: 52px 0 0;
    z-index: 10020;
    display: none;
    background: #0b0b0c;
  }

  .atlas-admin-detail.is-open {
    display: flex;
  }

  .atlas-admin-detail-close {
    display: inline-grid;
    place-items: center;
  }

  .atlas-admin-detail-body {
    max-height: none;
  }
}

@media (max-width: 768px) {
  .atlas-admin-detail {
    inset: 64px 0 0;
  }
}

@media (max-width: 620px) {
  .atlas-admin-head,
  .atlas-admin-coverage {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }

  .atlas-admin-mark {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .atlas-admin-head h2 {
    font-size: 1.12rem;
  }

  .atlas-admin-actions {
    width: 100%;
  }

  .atlas-admin-actions .atlas-admin-btn {
    flex: 1;
  }

  .atlas-admin-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .atlas-admin-kpi,
  .atlas-admin-kpi:nth-child(3) {
    border-right: 1px solid var(--atlas-line-soft);
    border-bottom: 1px solid var(--atlas-line-soft);
  }

  .atlas-admin-kpi:nth-child(even) {
    border-right: 0;
  }

  .atlas-admin-kpi:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .atlas-admin-toolbar {
    grid-template-columns: 1fr;
  }

  .atlas-admin-list {
    max-height: none;
  }

  .atlas-admin-record {
    grid-template-columns: 8px minmax(0, 1fr);
  }

  .atlas-admin-record-time {
    grid-column: 2;
  }

  .atlas-admin-detail-row {
    grid-template-columns: 1fr;
    gap: 0.28rem;
  }

  .atlas-admin-alert.is-visible {
    align-items: flex-start;
    flex-direction: column;
  }
}
