@import url("https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800&family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap");

:root {
  --color-navy-900: #0b1d3a;
  --color-navy-700: #1a3560;
  --color-teal-500: #00c4b4;
  --color-teal-600: #009e90;
  --color-rse-500: #22c55e;
  --color-perf-500: #f59e0b;
  --color-sec-500: #6366f1;
  --color-qual-500: #8b5cf6;
  --color-slate-900: #0f172a;
  --color-slate-700: #334155;
  --color-slate-600: #475569;
  --color-slate-400: #94a3b8;
  --color-slate-300: #cbd5e1;
  --color-slate-200: #e2e8f0;
  --color-slate-100: #f1f5f9;
  --color-slate-50: #f8fafc;
  --color-white: #ffffff;
  --bg-app: #f4f7fb;
  --bg-card: #ffffff;
  --font-display: "Sora", sans-serif;
  --font-body: "DM Sans", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 24px rgba(11, 29, 58, 0.14);
  --radius-md: 8px;
  --radius-lg: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-slate-900);
  background: var(--bg-app);
}

.page {
  min-height: 100vh;
  padding: 24px;
}

.app-shell {
  min-height: 100vh;
  background: var(--bg-app);
}

.app-sidebar {
  width: 240px;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  background: var(--color-navy-900);
  color: var(--color-white);
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.app-logo {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.app-logo img {
  height: 28px;
  width: auto;
}

.app-logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--color-teal-500);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
}

.app-logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.2px;
  font-size: 18px;
}

.app-nav {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.app-nav a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}

.app-nav a .icon {
  margin-right: 8px;
  opacity: 0.9;
}

.app-nav a.active,
.app-nav a:hover {
  background: rgba(0, 196, 180, 0.16);
  color: var(--color-teal-500);
}

.app-sidebar-footer {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
}

.app-main {
  margin-left: 240px;
  min-height: 100vh;
}

.app-header {
  height: 60px;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-slate-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.header-url {
  display: flex;
  align-items: center;
  max-width: 560px;
  width: 100%;
  background: var(--color-slate-50);
  border: 1px solid var(--color-slate-200);
  border-radius: 8px;
  overflow: hidden;
}

.header-url input {
  border: none;
  background: transparent;
  padding: 10px 12px;
  font-size: 14px;
  width: 100%;
  outline: none;
}

.header-url button {
  border: none;
  background: var(--color-navy-900);
  color: var(--color-white);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.app-content {
  padding: 24px;
}

.shell {
  max-width: 1280px;
  margin: 0 auto;
}

.hero {
  background: linear-gradient(135deg, var(--color-navy-900), var(--color-navy-700));
  color: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  margin-bottom: 16px;
}

.hero h1 {
  font-family: var(--font-display);
  margin: 0 0 8px 0;
  font-size: 28px;
}

.hero p {
  margin: 0;
  opacity: 0.92;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--color-slate-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 20px;
  margin-bottom: 16px;
}

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

.muted { color: var(--color-slate-600); }
.mono { font-family: var(--font-mono); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: 150ms ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-navy-900), #254880);
  color: var(--color-white);
}

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

.btn-secondary {
  background: var(--color-white);
  border-color: var(--color-slate-300);
  color: var(--color-navy-900);
}

.btn-danger {
  background: #ef4444;
  color: var(--color-white);
}

.input, .select {
  width: 100%;
  border: 1px solid var(--color-slate-300);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 15px;
  font-family: var(--font-body);
}

.input:focus, .select:focus {
  outline: none;
  border-color: var(--color-teal-500);
  box-shadow: 0 0 0 3px rgba(0, 196, 180, 0.2);
}

.label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-slate-700);
}

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

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

.kpi {
  background: var(--color-white);
  border: 1px solid var(--color-slate-200);
  border-radius: var(--radius-md);
  padding: 12px;
}

.kpi .label { margin: 0; font-size: 12px; color: var(--color-slate-600); text-transform: uppercase; }
.kpi .value { margin-top: 8px; font-family: var(--font-display); font-size: 24px; }

.score-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
}

.score-dial {
  position: relative;
  width: 120px;
  height: 120px;
}

.score-dial svg { transform: rotate(-90deg); }

.score-dial .num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 30px;
  color: var(--color-navy-900);
}

.table-wrap { overflow: auto; border: 1px solid var(--color-slate-200); border-radius: var(--radius-md); }

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 840px;
}

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-slate-100);
  font-size: 14px;
}

th {
  background: var(--color-slate-50);
  color: var(--color-slate-700);
  font-weight: 700;
}

.badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge-ok { background: #dcfce7; color: #166534; }
.badge-warn { background: #fef3c7; color: #92400e; }
.badge-err { background: #fee2e2; color: #991b1b; }
.badge-run { background: #e0e7ff; color: #3730a3; }

.alert {
  margin-bottom: 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 14px;
}

.alert-success { background: #dcfce7; border-color: #86efac; color: #166534; }
.alert-error { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }

.links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 980px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
}
