/* File: services/benchmark-dashboard/web/static/css/dashboard.css
 * Surface-specific styles for the benchmark dashboard.
 * tokens.css + fonts.css load first; this file only composes.
 */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--surface-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  line-height: var(--lh-sm);
}

/* App bar -------------------------------------------------------- */

.app-bar {
  height: 48px;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 0 var(--space-5);
  border-bottom: 1px solid var(--border-default);
  background: var(--surface-canvas);
}
.brand-mini {
  display: inline-flex;
  align-items: center;
  color: var(--text-primary);
  text-decoration: none;
}
.brand-mini img { display: block; height: 20px; width: auto; }

.page-title {
  margin: 0;
  font-size: var(--text-md);
  line-height: var(--lh-md);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
}
.spacer { flex: 1; }

/* Main ----------------------------------------------------------- */

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  padding: var(--space-6) var(--space-5);
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

.section-title {
  margin: 0 0 var(--space-3);
  font-size: var(--text-lg);
  line-height: var(--lh-lg);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}
.section-title .count {
  font-size: var(--text-2xs);
  line-height: var(--lh-2xs);
  font-weight: var(--font-weight-regular);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Card surface -------------------------------------------------- */

.card {
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* Table --------------------------------------------------------- */

.table-scroll {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-xs);
  line-height: var(--lh-xs);
}
th, td {
  padding: var(--space-2) var(--space-4);
  text-align: right;
  border-bottom: 1px solid var(--border-default);
  color: var(--text-primary);
}
th {
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
  background: var(--surface-sunken);
  position: sticky;
  top: 0;
}
.th-l { text-align: left; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-sunken); }
tbody td { font-variant-numeric: tabular-nums; }

.empty {
  text-align: center !important;
  padding: var(--space-6) !important;
  color: var(--text-muted);
}

.mono-sm {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  line-height: var(--lh-2xs);
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Badge --------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-2);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  line-height: var(--lh-2xs);
  font-weight: var(--font-weight-medium);
  background: var(--surface-sunken);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}
.badge--accent {
  background: var(--accent-500);
  color: var(--accent-on);
  border-color: var(--accent-500);
}

/* Links --------------------------------------------------------- */

.link-sm {
  color: var(--text-link);
  text-decoration: none;
  font-size: var(--text-xs);
  line-height: var(--lh-xs);
  border-bottom: 1px solid transparent;
  transition: border-color var(--motion-snap) var(--motion-ease);
}
.link-sm:hover { border-bottom-color: currentColor; }

/* Footer -------------------------------------------------------- */

.oss-credits {
  color: var(--text-muted);
  font-size: var(--text-2xs);
  line-height: var(--lh-2xs);
  padding: var(--space-4) var(--space-5);
  text-align: center;
  border-top: 1px solid var(--border-default);
  margin-top: var(--space-6);
}
.oss-credits a {
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.oss-credits a:hover {
  color: var(--text-primary);
  border-bottom-color: var(--border-default);
}

/* Settings page ------------------------------------------------ */

.muted-note {
  margin: 0 0 var(--space-4);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  line-height: var(--lh-xs);
  max-width: 64ch;
}

.setting-card {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: 720px;
}

.setting-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.setting-row.presets {
  flex-wrap: wrap;
  gap: var(--space-2);
}
.setting-row.actions {
  justify-content: flex-end;
}

.slider {
  flex: 1;
  appearance: none;
  height: 4px;
  background: var(--border-default);
  border-radius: var(--radius-sm);
}
.slider::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-500);
  cursor: pointer;
  border: 2px solid var(--surface-canvas);
}
.slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-500);
  cursor: pointer;
  border: 2px solid var(--surface-canvas);
}
.slider:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.slider-value {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  line-height: var(--lh-md);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  min-width: 42px;
  text-align: right;
}

.btn-sm {
  appearance: none;
  background: var(--surface-canvas);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  line-height: var(--lh-xs);
  cursor: pointer;
  transition: border-color var(--motion-snap) var(--motion-ease),
              color var(--motion-snap) var(--motion-ease);
}
.btn-sm:hover { border-color: var(--accent-500); color: var(--text-primary); }
.btn-sm:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-4);
  font: var(--font-weight-medium) var(--text-sm)/20px var(--font-sans);
  cursor: pointer;
  transition: background var(--motion-snap) var(--motion-ease);
}
.btn--primary {
  background: var(--accent-500);
  color: var(--accent-on);
  min-height: 36px;
}
.btn--primary:hover  { background: var(--accent-600); }
.btn--primary:active { background: var(--accent-700); }
.btn:focus-visible   { outline: none; box-shadow: var(--focus-ring); }

.status-msg {
  font-size: var(--text-xs);
  line-height: var(--lh-xs);
  color: var(--text-muted);
  margin-right: auto;
}
.status-msg--ok  { color: var(--success-500); }
.status-msg--err { color: var(--danger-500); }

/* Narrow viewports --------------------------------------------- */

@media (max-width: 640px) {
  .app-bar { padding: 0 var(--space-3); gap: var(--space-3); }
  main     { padding: var(--space-4) var(--space-3); }
}
