/* Basic dashboard styling for the operator frontend */
:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --panel: #ffffff;
  --border: #d7dbe7;
  --text: #1d2433;
  --muted: #667085;
  --accent: #3858e9;
  --accent-soft: rgba(56, 88, 233, 0.12);
  --danger: #b42318;
  --success: #027a48;
  --shadow: 0 12px 30px rgba(19, 28, 45, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(56, 88, 233, 0.11), transparent 30%),
    radial-gradient(circle at top right, rgba(2, 122, 72, 0.08), transparent 28%),
    linear-gradient(180deg, #eef2ff 0%, var(--bg) 180px);
  color: var(--text);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
}

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

.brand h1 {
  margin: 0;
  font-size: 1.8rem;
}

.brand p {
  margin: 0;
  color: var(--muted);
}

.nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.nav a,
.nav span {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.nav a.active {
  background: var(--accent-soft);
  border-color: rgba(56, 88, 233, 0.25);
  font-weight: 600;
}

.grid {
  display: grid;
  gap: 18px;
}

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

@media (max-width: 900px) {
  .grid.two {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(56, 88, 233, 0.18);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(241, 245, 255, 0.94));
}

.hero::after {
  content: '';
  position: absolute;
  inset: auto -80px -90px auto;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 88, 233, 0.12), transparent 68%);
  pointer-events: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(56, 88, 233, 0.08);
  color: #3244a6;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.card h2,
.card h3,
.card h4 {
  margin-top: 0;
}

.muted {
  color: var(--muted);
}

.banner {
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 18px;
  background: var(--accent-soft);
  color: var(--text);
  border: 1px solid rgba(56, 88, 233, 0.24);
}

.banner.error {
  background: rgba(180, 35, 24, 0.08);
  border-color: rgba(180, 35, 24, 0.22);
}

.form-row {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 10px 12px;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

button.secondary,
.button.secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
}

button.danger,
.button.danger {
  background: var(--danger);
}

.list {
  display: grid;
  gap: 14px;
}

.list-item {
  padding: 14px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--border);
}

.kv {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.kv div {
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8faff;
  border: 1px solid #e7ebf7;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.detail-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .detail-grid,
  .detail-grid.compact {
    grid-template-columns: 1fr;
  }
}

.detail-grid > div {
  padding: 10px 12px;
  border-radius: 14px;
  background: #f8faff;
  border: 1px solid #e7ebf7;
}

.detail-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mono {
  font-family: "SFMono-Regular", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.result-card {
  position: relative;
}

.result-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 4px;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(90deg, var(--accent), rgba(56, 88, 233, 0.18));
}

.result-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.source-excerpt {
  border-radius: 16px;
  border: 1px solid #dbe4ff;
  background: #0b1220;
  color: #dbe7ff;
  padding: 12px;
  max-height: 620px;
  overflow: auto;
}

.source-line {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 1px 0;
}

.source-line-no {
  color: #7fa2ff;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.source-line-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.tiny {
  font-size: 0.88rem;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #34439e;
  font-size: 0.9rem;
}

.code {
  white-space: pre-wrap;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 14px;
  padding: 14px;
  overflow-x: auto;
}
