/* ============================================================================
   JN Music Royalty Calculator — design system

   Loaded after bootstrap.min.css (v5.1), so plain class selectors here win
   over Bootstrap's compiled defaults without !important. Bootstrap 5.1 does
   not expose component-level CSS variables, so the components we actually use
   are restyled explicitly below.

   The palette is monochrome ink to match the black JN Music Group wordmark,
   with a single blue accent reserved for interactive affordances (links,
   focus, active navigation) and the status colours.
   ========================================================================= */

:root {
  color-scheme: light;

  /* Neutral ink ramp -------------------------------------------------- */
  --ink-950: #0b0f19;
  --ink-900: #101828;
  --ink-800: #1d2939;
  --ink-700: #344054;
  --ink-600: #475467;
  --ink-500: #667085;
  --ink-400: #98a2b3;
  --ink-300: #d0d5dd;
  --ink-200: #e4e7ec;
  --ink-100: #f2f4f7;
  --ink-50:  #f9fafb;

  /* Surfaces and lines ------------------------------------------------ */
  --canvas: #f6f7f9;
  --surface: #ffffff;
  --border: rgba(16, 24, 40, 0.10);
  --border-strong: rgba(16, 24, 40, 0.16);

  /* Accent ------------------------------------------------------------ */
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff4ff;
  --accent-ring: rgba(37, 99, 235, 0.24);

  /* Status ------------------------------------------------------------ */
  --success: #067647;
  --success-soft: #ecfdf3;
  --success-line: #abefc6;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --danger-line: #fecdca;
  --warning: #b54708;
  --warning-soft: #fffaeb;
  --warning-line: #fedf89;
  --info: #175cd3;
  --info-soft: #eff8ff;
  --info-line: #b2ddff;

  /* Radii ------------------------------------------------------------- */
  --radius-sm: 0.375rem;
  --radius: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 0.875rem;

  /* Elevation --------------------------------------------------------- */
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.10);

  /* Layout ------------------------------------------------------------ */
  --header-height: 4rem;
  --content-max: 78rem;

  --font-sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system,
               "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas,
               "Liberation Mono", monospace;
}

/* ============================================================================
   Base
   ========================================================================= */

html {
  font-size: 16px;
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--ink-700);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--ink-900);
  font-weight: 600;
  letter-spacing: -0.011em;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.12s ease;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 0.125em;
}

code, .mono {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ink-700);
  background: var(--ink-100);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.0625rem 0.3125rem;
}

.text-muted {
  color: var(--ink-500) !important;
}

/* Consistent focus treatment across every interactive element. */
:where(a, button, input, select, textarea, .btn, .nav-link):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: none;
}

.btn:focus,
.btn:active:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 3px var(--accent-ring);
}

/* ============================================================================
   Icons — an inline SVG sprite (Pages/Shared/_Icons.cshtml) referenced with
   <svg class="icon"><use href="#i-name" /></svg>. No icon font, no CDN.
   ========================================================================= */

.icon {
  width: 1em;
  height: 1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.145em;
}

.icon-lg { width: 1.25em; height: 1.25em; }
.icon-xl { width: 1.5rem; height: 1.5rem; stroke-width: 1.5; }

/* ============================================================================
   App shell
   ========================================================================= */

.app-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.app-header-inner {
  height: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Brand: the square JN mark next to the product name. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  flex: none;
  text-decoration: none;
  color: var(--ink-900);
}

.brand:hover {
  text-decoration: none;
  color: var(--ink-900);
}

.brand-logo {
  height: 2rem;
  width: auto;
}

.brand-name {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.011em;
  white-space: nowrap;
}

/* Primary navigation ------------------------------------------------- */

.app-nav {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  height: 100%;
  flex: 1 1 auto;
  list-style: none;
  margin: 0;
  padding: 0;
}

.app-nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4375rem;
  height: 100%;
  padding: 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-600);
  border-radius: var(--radius-sm);
  transition: color 0.12s ease, background-color 0.12s ease;
}

.app-nav-link:hover {
  color: var(--ink-900);
  text-decoration: none;
}

.app-nav-link[aria-current="page"] {
  color: var(--ink-900);
  font-weight: 600;
}

/* Active marker sits on the header's bottom border. */
.app-nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: -1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--ink-900);
}

.app-nav-link .icon { color: var(--ink-400); }

.app-nav-link:hover .icon,
.app-nav-link[aria-current="page"] .icon { color: inherit; }

/* Signed-in user ------------------------------------------------------ */

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex: none;
}

.avatar {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  flex: none;
  border-radius: 50%;
  background: var(--ink-900);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  user-select: none;
}

.user-name {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-700);
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Icon-only button, used for sign-out. */
.btn-icon {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-500);
  transition: all 0.12s ease;
}

.btn-icon:hover {
  color: var(--ink-900);
  border-color: var(--border-strong);
  background: var(--ink-50);
}

/* Main ---------------------------------------------------------------- */

.app-main {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 2rem 1.5rem 3.5rem;
}

/* Site footer: copyright line, then the 5 Stars credit under it. ------- */

.site-footer {
  flex: none;
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-500);
  font-size: 0.8125rem;
}

.site-footer-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Flex row, so "created by" sits on the logo's centre line, not its baseline. */
.site-footer-credit {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.site-footer-credit a {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--ink-600);
  font-weight: 500;
  text-decoration: none;
}

.site-footer-credit a:hover,
.site-footer-credit a:focus {
  color: var(--ink-900);
  text-decoration: underline;
}

/* Deliberately smaller than the JN mark in the header. */
.site-footer-logo {
  height: 1.75rem;
  width: auto;
  mix-blend-mode: multiply;
}

/* Mobile -------------------------------------------------------------- */

@media (max-width: 47.9375em) {
  .app-header { height: auto; position: static; }
  .app-header-inner {
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
  }
  .app-nav {
    order: 3;
    width: 100%;
    height: auto;
    overflow-x: auto;
    gap: 0.25rem;
    padding-bottom: 0.125rem;
  }
  .app-nav-link {
    height: 2.25rem;
    background: var(--ink-100);
    white-space: nowrap;
  }
  .app-nav-link[aria-current="page"] {
    background: var(--ink-900);
    color: #fff;
  }
  .app-nav-link[aria-current="page"]::after { display: none; }
  .app-nav-link[aria-current="page"] .icon { color: #fff; }
  .user-name { display: none; }
  .brand-name { display: none; }
  .app-main { padding: 1.5rem 1rem 2.5rem; }
  .site-footer-inner { justify-content: center; text-align: center; }
}

/* ============================================================================
   Page header — title, optional subtitle, right-aligned actions
   ========================================================================= */

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0;
}

/* A run id and its status pill sit on the title line; neither should inherit
   the 1.5rem title size. */
.page-title code {
  font-size: 1.125rem;
  padding: 0.0625rem 0.4375rem;
  vertical-align: 0.045em;
}

.page-title .pill {
  vertical-align: 0.22em;
  margin-left: 0.375rem;
}

.page-subtitle {
  margin: 0.3125rem 0 0;
  color: var(--ink-500);
  font-size: 0.875rem;
  max-width: 60ch;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.section-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink-900);
  margin: 0 0 0.75rem;
}

/* ============================================================================
   Cards and panels
   ========================================================================= */

.card-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.card-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.card-panel-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink-900);
  margin: 0;
}

.card-panel-body {
  padding: 1.25rem;
}

/* ============================================================================
   Stat tiles
   ========================================================================= */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  padding: 1.125rem 1.25rem;
}

.stat-label {
  display: flex;
  align-items: center;
  gap: 0.4375rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-500);
  margin: 0 0 0.5rem;
}

.stat-label .icon { color: var(--ink-400); }

.stat-value {
  font-size: 1.625rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
}

.stat-meta {
  margin: 0.3125rem 0 0;
  font-size: 0.8125rem;
  color: var(--ink-500);
}

/* ============================================================================
   Tables
   ========================================================================= */

.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.table-scroll { overflow-x: auto; }

.data-table {
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
}

.data-table thead th {
  padding: 0.625rem 1.25rem;
  background: var(--ink-50);
  border-bottom: 1px solid var(--border);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  color: var(--ink-500);
  white-space: nowrap;
  text-align: left;
}

.data-table tbody td {
  padding: 0.8125rem 1.25rem;
  border-bottom: 1px solid var(--ink-100);
  vertical-align: middle;
  color: var(--ink-700);
}

.data-table tbody tr:last-child td { border-bottom: 0; }

.data-table tbody tr { transition: background-color 0.1s ease; }
.data-table tbody tr:hover { background: var(--ink-50); }

.data-table tfoot td {
  padding: 0.8125rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--ink-50);
  font-weight: 600;
  color: var(--ink-900);
}

/* Numeric columns: right-aligned, with figures that line up vertically. */
.data-table .num,
.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.data-table th.num { text-align: right; }

.data-table .cell-actions {
  text-align: right;
  white-space: nowrap;
}

.cell-actions .btn + .btn,
.cell-actions form { margin-left: 0.375rem; }

/* Primary identifying cell in a row. */
.cell-strong {
  font-weight: 500;
  color: var(--ink-900);
}

.file-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.5625rem;
  min-width: 0;
}

.file-cell .icon {
  color: var(--ink-400);
  font-size: 1.0625rem;
}

.file-cell.is-folder .icon { color: var(--accent); }

/* ============================================================================
   Status pills
   ========================================================================= */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.125rem 0.5rem 0.125rem 0.4375rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25rem;
  white-space: nowrap;
}

.pill::before {
  content: "";
  width: 0.4375rem;
  height: 0.4375rem;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.pill-queued {
  color: var(--ink-600);
  background: var(--ink-100);
  border-color: var(--border);
}

.pill-running {
  color: var(--info);
  background: var(--info-soft);
  border-color: var(--info-line);
}

.pill-running::before { animation: pill-pulse 1.6s ease-in-out infinite; }

.pill-succeeded {
  color: var(--success);
  background: var(--success-soft);
  border-color: var(--success-line);
}

.pill-failed {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: var(--danger-line);
}

@keyframes pill-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.35; transform: scale(0.8); }
}

@media (prefers-reduced-motion: reduce) {
  .pill-running::before { animation: none; }
}

/* ============================================================================
   Buttons — restyled over Bootstrap 5.1's compiled defaults
   ========================================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4375rem;
  padding: 0.5rem 0.875rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: background-color 0.12s ease, border-color 0.12s ease,
              color 0.12s ease, box-shadow 0.12s ease;
}

.btn-sm {
  padding: 0.3125rem 0.625rem;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.625rem 1.125rem;
  font-size: 0.9375rem;
}

/* Primary = ink, matching the black wordmark. */
.btn-primary {
  background-color: var(--ink-900);
  border-color: var(--ink-900);
  color: #fff;
  box-shadow: var(--shadow-xs);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--ink-800);
  border-color: var(--ink-800);
  color: #fff;
}

.btn-primary:active,
.btn-primary:not(:disabled):not(.disabled):active {
  background-color: var(--ink-950);
  border-color: var(--ink-950);
  color: #fff;
}

.btn-primary:disabled,
.btn-primary.disabled {
  background-color: var(--ink-400);
  border-color: var(--ink-400);
  opacity: 1;
}

/* Secondary = neutral outline. Bootstrap's outline-primary is remapped here
   because every page already uses it as the secondary action. */
.btn-outline-primary,
.btn-outline-secondary {
  background-color: var(--surface);
  border-color: var(--border-strong);
  color: var(--ink-700);
  box-shadow: var(--shadow-xs);
}

.btn-outline-primary:hover,
.btn-outline-secondary:hover,
.btn-outline-primary:focus,
.btn-outline-secondary:focus {
  background-color: var(--ink-50);
  border-color: var(--ink-300);
  color: var(--ink-900);
}

.btn-outline-primary:active,
.btn-outline-secondary:active,
.btn-outline-primary:not(:disabled):not(.disabled):active,
.btn-outline-secondary:not(:disabled):not(.disabled):active {
  background-color: var(--ink-100);
  border-color: var(--ink-300);
  color: var(--ink-900);
}

.btn-outline-danger {
  background-color: var(--surface);
  border-color: var(--danger-line);
  color: var(--danger);
  box-shadow: var(--shadow-xs);
}

.btn-outline-danger:hover,
.btn-outline-danger:focus,
.btn-outline-danger:not(:disabled):not(.disabled):active {
  background-color: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger);
}

.btn-light {
  background-color: var(--surface);
  border-color: var(--border-strong);
  color: var(--ink-800);
}

.btn-light:hover,
.btn-light:focus {
  background-color: var(--ink-50);
  border-color: var(--ink-300);
  color: var(--ink-900);
}

/* ============================================================================
   Forms
   ========================================================================= */

.form-control,
.form-select {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--ink-900);
  background-color: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.form-control::placeholder { color: var(--ink-400); }

.form-control:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.form-control[type="file"] { padding: 0.375rem 0.75rem; }

.form-control[type="file"]::file-selector-button {
  padding: 0.3125rem 0.75rem;
  margin: 0 0.75rem 0 -0.25rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--ink-50);
  color: var(--ink-700);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: background-color 0.12s ease;
}

.form-control[type="file"]::file-selector-button:hover { background: var(--ink-100); }

.form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-700);
  margin-bottom: 0.375rem;
}

.form-check-input { border-color: var(--border-strong); }

.form-check-input:checked {
  background-color: var(--ink-900);
  border-color: var(--ink-900);
}

/* Scrollable selection lists (New run). */
.select-list {
  max-height: 22rem;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.select-list-sm { max-height: 16rem; }

.select-option {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 1rem;
  margin: 0;
  border-bottom: 1px solid var(--ink-100);
  cursor: pointer;
  transition: background-color 0.1s ease;
}

.select-option:last-child { border-bottom: 0; }
.select-option:hover { background: var(--ink-50); }

.select-option input {
  margin: 0;
  flex: none;
}

.select-option-body {
  min-width: 0;
  flex: 1 1 auto;
}

.select-option-name {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-900);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-option-meta {
  display: block;
  font-size: 0.75rem;
  color: var(--ink-500);
  font-variant-numeric: tabular-nums;
}

/* Numbered step heading for the New run wizard. */
.step-heading {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink-900);
  margin: 0 0 0.75rem;
}

.step-number {
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
  border-radius: 50%;
  background: var(--ink-900);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ============================================================================
   Tabs and breadcrumbs
   ========================================================================= */

.nav-tabs {
  border-bottom: 1px solid var(--border);
  gap: 0.25rem;
}

.nav-tabs .nav-link {
  margin-bottom: -1px;
  padding: 0.625rem 0.875rem;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-500);
  background: transparent;
  transition: color 0.12s ease, border-color 0.12s ease;
}

.nav-tabs .nav-link:hover {
  color: var(--ink-900);
  border-color: transparent;
  text-decoration: none;
}

.nav-tabs .nav-link.active {
  color: var(--ink-900);
  font-weight: 600;
  background: transparent;
  border-color: var(--ink-900);
}

.breadcrumb {
  margin: 0;
  padding: 0;
  background: transparent;
  font-size: 0.8125rem;
  align-items: center;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  color: var(--ink-500);
}

.breadcrumb-item + .breadcrumb-item { padding-left: 0; }

.breadcrumb-item + .breadcrumb-item::before {
  content: "/";
  padding: 0 0.5rem;
  color: var(--ink-300);
}

.breadcrumb-item a { color: var(--ink-500); font-weight: 500; }
.breadcrumb-item a:hover { color: var(--ink-900); text-decoration: none; }
.breadcrumb-item:last-child a { color: var(--ink-900); }

/* ============================================================================
   Alerts
   ========================================================================= */

.alert {
  padding: 0.875rem 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  font-size: 0.875rem;
}

.alert-info {
  background: var(--info-soft);
  border-color: var(--info-line);
  color: var(--info);
}

.alert-danger {
  background: var(--danger-soft);
  border-color: var(--danger-line);
  color: var(--danger);
}

.alert-warning {
  background: var(--warning-soft);
  border-color: var(--warning-line);
  color: var(--warning);
}

.alert strong { color: inherit; }

/* Validation summary rendered by asp-validation-summary. */
.validation-summary {
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--danger-line);
  border-radius: var(--radius-lg);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.875rem;
}

.validation-summary ul {
  margin: 0;
  padding-left: 1.125rem;
}

.validation-summary:empty,
.validation-summary.validation-summary-valid { display: none; }

/* ============================================================================
   Empty states
   ========================================================================= */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 3.25rem 1.5rem;
}

.empty-state-icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 1rem;
  border-radius: 50%;
  background: var(--ink-100);
  color: var(--ink-500);
}

.empty-state-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink-900);
  margin: 0 0 0.25rem;
}

.empty-state-text {
  font-size: 0.875rem;
  color: var(--ink-500);
  margin: 0;
  max-width: 42ch;
}

.empty-state-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 1.25rem;
}

/* ============================================================================
   Run detail
   ========================================================================= */

.meta-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.1875rem;
}

.meta-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  color: var(--ink-500);
}

.meta-value {
  font-size: 0.875rem;
  color: var(--ink-900);
  font-weight: 500;
}

.input-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.input-list li {
  display: flex;
  align-items: center;
  gap: 0.5625rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--ink-100);
  font-size: 0.875rem;
}

.input-list li:last-child { border-bottom: 0; }
.input-list .icon { color: var(--ink-400); font-size: 1.0625rem; }

.input-role {
  margin-left: auto;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  color: var(--ink-500);
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 0.625rem;
}

.download-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  color: var(--ink-900);
  font-size: 0.875rem;
  font-weight: 500;
  transition: border-color 0.12s ease, box-shadow 0.12s ease,
              transform 0.12s ease;
}

.download-item:hover {
  border-color: var(--ink-300);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--ink-900);
  transform: translateY(-1px);
}

.download-item .icon {
  color: var(--success);
  font-size: 1.125rem;
}

.download-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Live progress banner while a run is queued or running. */
.progress-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.125rem;
  border: 1px solid var(--info-line);
  border-radius: var(--radius-lg);
  background: var(--info-soft);
  color: var(--info);
}

.progress-banner .spinner-border {
  color: var(--info);
  border-width: 0.15em;
}

.progress-banner-text {
  font-size: 0.875rem;
  font-weight: 500;
}

.progress {
  height: 0.5rem;
  border-radius: 999px;
  background: var(--ink-100);
}

.progress-bar { background-color: var(--ink-900); }

/* ============================================================================
   Sign-in and access-denied pages (Pages/Shared/_AuthLayout.cshtml).
   The brand sits centered on screen; everything else stays quiet.
   ========================================================================= */

.auth-body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  background:
    radial-gradient(60rem 40rem at 50% -12rem, rgba(37, 99, 235, 0.06), transparent 70%),
    linear-gradient(180deg, #f8f9fb 0%, #eceff4 100%);
}

.auth-main {
  margin: auto;
  width: 100%;
  max-width: 25rem;
  padding: 2.5rem 1rem;
}

.auth-card {
  padding: 2.5rem 2rem;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  width: 100%;
  max-width: 15rem;
  height: auto;
  margin-bottom: 1.25rem;
}

.auth-title {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 0.375rem;
}

.auth-subtitle {
  margin-bottom: 1.75rem;
  color: var(--ink-500);
  font-size: 0.9375rem;
}

/* One full-width button per provider, icon and label centered together. */
.auth-provider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: 100%;
  margin-bottom: 0.625rem;
  padding: 0.625rem 1rem;
  font-weight: 500;
  border-color: var(--border-strong);
}

.auth-provider:last-child { margin-bottom: 0; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0 1rem;
  color: var(--ink-400);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--border);
}

.auth-footer {
  margin-top: 1.75rem;
  text-align: center;
  color: var(--ink-500);
  font-size: 0.8125rem;
}

.auth-credit,
.auth-copyright { margin: 0; }

/* Flex row, so "created by" sits on the logo's centre line, not its baseline. */
.auth-credit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
}

.auth-credit a {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--ink-600);
  font-weight: 500;
  text-decoration: none;
}

.auth-credit a:hover,
.auth-credit a:focus {
  color: var(--ink-900);
  text-decoration: underline;
}

.auth-copyright {
  margin-top: 0.375rem;
  font-size: 0.75rem;
  color: var(--ink-400);
}

/* Kept well below the JN logo on the card; the artwork has a white
   background, so multiply drops it into the page. */
.auth-footer-logo {
  width: auto;
  height: 2rem;
  mix-blend-mode: multiply;
}

/* ============================================================================
   Utilities
   ========================================================================= */

.stack-sm > * + * { margin-top: 0.5rem; }
.stack > * + *    { margin-top: 1rem; }
.stack-lg > * + * { margin-top: 1.75rem; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
