/* Prayojan Studios — /compliance dashboard styles
   Scoped to .dash; extends the shared palette in styles.css */

.dash { max-width: 1080px; padding: 56px 0 96px; }
.dash h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin-bottom: 10px; }
.dash h2 { font-size: 1.3rem; margin: 44px 0 6px; }
.dash h3 { font-size: 1.02rem; }
.dash .lede { max-width: 46rem; margin-bottom: 28px; }
.dash .section-note { font-size: 0.88rem; color: var(--muted); margin-bottom: 18px; }

/* ---------- Status banner ---------- */

.banner {
  display: flex; align-items: flex-start; gap: 12px;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 20px; margin: 8px 0 30px;
  font-size: 0.95rem;
}
.banner .banner-dot {
  flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%;
  margin-top: 7px; background: var(--muted);
}
.banner strong { display: block; color: var(--ink); }
.banner p { font-size: 0.92rem; }
.banner-info { background: var(--bg-alt); }
.banner-info .banner-dot { background: var(--indigo); }
.banner-live { background: rgba(20, 184, 166, 0.08); border-color: rgba(20, 184, 166, 0.4); }
.banner-live .banner-dot { background: var(--teal); }
.banner-warn { background: #fffbeb; border-color: #f59e0b66; }
.banner-warn .banner-dot { background: #d97706; }
.banner-bad { background: #fef2f2; border-color: #ef444466; }
.banner-bad .banner-dot { background: #dc2626; }

/* ---------- Cards / grids ---------- */

.dash .panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px 26px; margin-bottom: 18px;
}
.dash .panel > h3 { margin-bottom: 14px; }

.kv {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 28px; margin: 0;
}
.kv-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kv-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kv > div { min-width: 0; }
.kv dt {
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted);
}
.kv dd { margin: 2px 0 0; font-size: 0.95rem; color: var(--ink); word-break: break-word; }
.kv dd.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.86rem; }

/* ---------- Badges ---------- */

.badge {
  display: inline-block; padding: 3px 12px; border-radius: 999px;
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; white-space: nowrap;
  background: var(--bg-alt); color: var(--slate); border: 1px solid var(--line);
}
.badge-ok { background: rgba(20, 184, 166, 0.12); color: #0f766e; border-color: rgba(20, 184, 166, 0.45); }
.badge-run { background: rgba(99, 102, 241, 0.1); color: var(--indigo-dark); border-color: rgba(99, 102, 241, 0.4); }
.badge-warn { background: #fffbeb; color: #b45309; border-color: #f59e0b55; }
.badge-bad { background: #fef2f2; color: #b91c1c; border-color: #ef444455; }
.badge-neutral { background: var(--bg-alt); color: var(--slate); }

/* ---------- Census ---------- */

.census { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.census-kind { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.census-kind h3 { margin-bottom: 14px; }
.census-kind .kv { grid-template-columns: 1fr 1fr; }
.census-flag { color: #b45309; font-weight: 600; }

/* ---------- Runs ---------- */

.run-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 24px; margin-bottom: 14px;
}
.run-card.selected { border-color: var(--indigo); box-shadow: 0 0 0 1px var(--indigo) inset; }
.run-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.run-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.run-title h3 { margin: 0; }
.run-title .run-id { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.8rem; color: var(--muted); word-break: break-all; }
.run-card .kv { margin-bottom: 12px; }
.run-card .kv:last-of-type { margin-bottom: 0; }
.run-missed { margin-top: 10px; font-size: 0.88rem; color: #b45309; }
.run-actions { margin-top: 14px; }

.btn-sm {
  display: inline-block; padding: 8px 18px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-alt);
  color: var(--ink); font-size: 0.86rem; font-weight: 600;
  font-family: inherit; cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.btn-sm:hover { border-color: var(--muted); background: #fff; }
.btn-sm:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; }
.btn-sm[disabled] { opacity: 0.55; cursor: default; }

/* ---------- Histograms ---------- */

.hists { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin: 18px 0; }
.hist h4 { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.hist-row { display: grid; grid-template-columns: 110px 1fr 56px; align-items: center; gap: 12px; margin-bottom: 8px; }
.hist-label {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem; color: var(--slate);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hist-bar { height: 10px; border-radius: 5px; background: var(--bg-alt); overflow: hidden; }
.hist-fill { height: 100%; background: linear-gradient(90deg, var(--indigo), var(--teal)); }
.hist-n { font-size: 0.82rem; color: var(--slate); text-align: right; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chip {
  padding: 4px 12px; border-radius: 999px; font-size: 0.8rem;
  background: var(--bg-alt); border: 1px solid var(--line); color: var(--slate);
}
.chip strong { color: var(--ink); }

/* ---------- Stored data / oldest videos ---------- */

.dash .panel.background p { font-size: 0.94rem; max-width: 46rem; }
.dash .panel.background p + p { margin-top: 10px; }

.subhead {
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); margin: 18px 0 8px;
}
.fields-list { font-size: 0.9rem; line-height: 1.7; color: var(--ink); }
.fields-list code, .section-note code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
}

.table-scroll { overflow-x: auto; margin-top: 8px; }
.data-table {
  width: 100%; border-collapse: collapse; font-size: 0.84rem;
}
.data-table th {
  text-align: left; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
  padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.data-table td {
  padding: 7px 10px; border-bottom: 1px solid var(--line);
  vertical-align: top; color: var(--ink);
}
.data-table td.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem; white-space: nowrap;
}
.data-table td.num { text-align: right; white-space: nowrap; }
.data-table a { color: var(--indigo); text-decoration: none; }
.data-table a:hover { text-decoration: underline; }

.outcome-table {
  width: 100%; border-collapse: collapse; margin: 4px 0 14px;
  font-size: 0.88rem;
}
.outcome-table th {
  text-align: left; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
  padding: 6px 10px 6px 0; border-bottom: 1px solid var(--line);
}
.outcome-table td {
  padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line);
  font-weight: 600; color: var(--ink);
}

pre.src-listing {
  margin: 14px 0 0; padding: 14px 16px; border-radius: 10px;
  background: var(--ink); color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.76rem; line-height: 1.55;
  max-height: 70vh; overflow: auto;
  white-space: pre-wrap; word-break: break-word;
}

/* ---------- Notes ---------- */

.dash .notes {
  margin-top: 44px; padding: 22px 26px;
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius);
}
.dash .notes h3 { margin-bottom: 10px; }
.dash .notes p { font-size: 0.9rem; margin-bottom: 10px; }
.dash .notes p:last-child { margin-bottom: 0; }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .kv-3, .kv-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .census, .hists { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .dash { padding: 40px 0 72px; }
  .kv, .kv-3, .kv-4 { grid-template-columns: 1fr; }
  .hist-row { grid-template-columns: 90px 1fr 46px; gap: 8px; }
}
