:root {
  --bg: #f5f6f8;
  --ink: #111827;
  --ink-subtle: #6b7280;
  --surface: rgba(255, 255, 255, 0.8);
  --surface-strong: #ffffff;
  --line: rgba(17, 24, 39, 0.08);
  --line-soft: rgba(17, 24, 39, 0.05);
  --shadow: 0 8px 26px rgba(15, 23, 42, 0.07);
  --accent: #007aff;
  --ok: #34c759;
  --warn: #ff3b30;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(900px 520px at 50% -12%, rgba(0, 122, 255, 0.12), transparent 65%),
    radial-gradient(700px 420px at 100% 100%, rgba(52, 199, 89, 0.08), transparent 70%),
    var(--bg);
}

.bg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0));
}

h1, h2, h3 {
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(1.2rem, 1.9vw, 1.52rem);
  font-weight: 700;
}

h2 {
  font-size: clamp(1.06rem, 1.55vw, 1.26rem);
  font-weight: 630;
}

h3 {
  font-size: 0.93rem;
  font-weight: 620;
}

p {
  color: var(--ink-subtle);
  line-height: 1.5;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: 18px 18px 0;
  padding: 14px 16px;
  border-radius: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.glass {
  background: var(--surface);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px) saturate(130%);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand p {
  margin: 0;
  font-size: 12px;
}

.chip {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: conic-gradient(from 30deg, #ffd667, #ff9f0a, #ff7a00, #ffd667);
  border: 2px solid rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 18px rgba(255, 159, 10, 0.3);
}

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

.btn {
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
  box-shadow: 0 8px 14px rgba(0, 122, 255, 0.2);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.secondary {
  background: #fff;
  color: #1f2937;
  border-color: var(--line);
  box-shadow: none;
}

.btn.ok {
  background: var(--ok);
  box-shadow: 0 8px 14px rgba(52, 199, 89, 0.22);
}

.btn.warn {
  background: var(--warn);
  box-shadow: 0 8px 14px rgba(255, 59, 48, 0.22);
}

.layout {
  margin: 12px 18px 18px;
  display: grid;
  grid-template-columns: 248px 1fr;
  gap: 16px;
}

.sidebar {
  padding: 14px;
  border-radius: 16px;
  position: sticky;
  top: 88px;
  align-self: start;
}

.tabs {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.tab-btn {
  width: 100%;
  text-align: left;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #4b5563;
  font-size: 13px;
  font-weight: 560;
  cursor: pointer;
}

.tab-btn:hover {
  background: rgba(0, 122, 255, 0.08);
  color: #1f2937;
}

.tab-btn.active {
  color: #004fbd;
  background: rgba(0, 122, 255, 0.12);
  border-color: rgba(0, 122, 255, 0.18);
}

.status-card {
  margin-top: 14px;
  border-top: 1px solid var(--line-soft);
  padding-top: 10px;
}

.status-card p,
.status-card li {
  font-size: 12.5px;
  color: var(--ink-subtle);
}

.qa-pass {
  margin-top: 6px;
  font-weight: 600;
  color: #0f766e;
}

.qa-fail {
  margin-top: 6px;
  font-weight: 600;
  color: #b42318;
}

.status-card ul {
  margin: 0;
  padding-left: 17px;
  max-height: 170px;
  overflow: auto;
}

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

.overview {
  display: grid;
  gap: 12px;
}

.overview-hero {
  border-radius: 16px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.overview-grid .card {
  min-height: 112px;
}

.section-head {
  margin-bottom: 12px;
}

.section-subtitle {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
}

.section-inline {
  margin-bottom: 12px;
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 6px;
  color: #6b7280;
}

.microcopy {
  margin: 6px 0 0;
  font-size: 12px;
  color: #6b7280;
}

.progress-shell {
  width: min(340px, 100%);
  height: 8px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.08);
  overflow: hidden;
  margin-top: 10px;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #007aff, #26a7ff);
  transition: width 260ms ease;
}

.panel {
  display: none;
  padding: 18px;
  border-radius: 16px;
  background: var(--surface-strong);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow);
}

.panel.active { display: block; }

.grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.card {
  padding: 14px;
  border-radius: 13px;
  border: 1px solid var(--line-soft);
  background: #fff;
}

label {
  display: block;
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--ink-subtle);
  font-weight: 560;
}

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

input:focus,
select:focus,
button:focus {
  outline: 2px solid rgba(0, 122, 255, 0.24);
  outline-offset: 1px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  margin: 0 6px 6px 0;
  border-radius: 999px;
  border: 1px solid rgba(0, 122, 255, 0.16);
  background: rgba(0, 122, 255, 0.08);
  color: #0d4da1;
  font-size: 12px;
  font-weight: 560;
}

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

.table-wrap { overflow: auto; }

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

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
}

th {
  color: #6b7280;
  font-size: 12px;
  font-weight: 600;
}

tbody tr:hover {
  background: rgba(0, 122, 255, 0.03);
}

.metric {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
}

.toast-rack {
  position: fixed;
  right: 14px;
  bottom: 14px;
  display: grid;
  gap: 8px;
  width: min(340px, calc(100vw - 28px));
  z-index: 30;
}

.toast {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  animation: slideIn 220ms ease-out;
}

.toast p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--ink-subtle);
}

.reveal { animation: reveal 360ms ease both; }

@keyframes reveal {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .overview-hero { flex-direction: column; align-items: flex-start; }
}
