:root {
  /* AI Test Lab design tokens — the canonical palette. Legacy variable
     names below (--navy, --ice, --bg, etc.) are kept because every
     existing page/table/pill references them, but now point at these same
     token values so the whole app shares one palette instead of two. */
  --color-primary: #6343e7;
  --color-primary-dark: #140d48;
  --color-primary-deep: #231e57;
  --color-primary-light: #eee9ff;
  --color-primary-light-2: #f5f2ff;
  --color-accent: #7c5cff;
  --color-accent-2: #6d4aff;

  --color-background: #f6f7fd;
  --color-surface: #fefefe;
  --color-surface-alt: #e6e9fc;
  --color-border: #e6e9fc;
  --color-border-soft: #eef0f8;

  --color-text-primary: #140d48;
  --color-text-secondary: #7b7aa4;
  --color-text-muted: #9da0c2;

  --color-success: #3baf6c;
  --color-success-bg: #def1e8;
  --color-error: #f86778;
  --color-error-bg: #fde8ec;
  --color-warning: #f9963a;
  --color-warning-bg: #fff0e2;
  --color-info: #287bfa;
  --color-info-bg: #eaf2ff;
  --color-neutral: #9da0c2;

  /* Legacy aliases — remapped to the tokens above so older markup picks up
     the same palette automatically. */
  --navy: var(--color-primary);
  --ice: var(--color-primary-light);
  --white: var(--color-surface);
  --bg: var(--color-background);
  --text: var(--color-text-primary);
  --muted: var(--color-text-secondary);
  --green: var(--color-success);
  --amber: var(--color-warning);
  --red: var(--color-error);
  --card-border: var(--color-border);

  --sidebar-dark: var(--color-primary-dark);
  --sidebar-dark-2: var(--color-primary-deep);
  --hero-start: var(--color-primary);
  --hero-end: var(--color-accent-2);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* --- App shell: sidebar + main area --- */

.app-shell {
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
}

.sidebar {
  width: 230px;
  flex-shrink: 0;
  background:
    radial-gradient(120% 55% at 25% 112%, #f3f0fd 0%, rgba(243, 240, 253, 0) 62%),
    linear-gradient(180deg, var(--sidebar-dark) 0%, var(--sidebar-dark-2) 52%, #7a6dd4 80%, #d9d3f8 93%, #f2effc 100%);
  color: white;
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 20px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-logo img {
  height: 34px;
  width: auto;
}

.sidebar-logo span {
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: white;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: white;
}

.nav-item.active {
  background: linear-gradient(90deg, #7d57df, #332e70);
  color: white;
  font-weight: 700;
}

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 12px;
  margin-top: 12px;
}

.sidebar-footer > a.nav-item {
  color: var(--navy);
  margin-top: 100px;
}

.sidebar-footer > a.nav-item:hover {
  background: rgba(91, 63, 217, 0.08);
  color: var(--navy);
}

.main-area {
  flex: 1;
  min-width: 0;
  padding: 28px 32px 64px;
}

/* --- Hero --- */

.hero {
  background: linear-gradient(120deg, var(--hero-start) 0%, var(--hero-end) 100%);
  border-radius: 20px;
  padding: 36px 40px 56px;
  color: white;
  margin-bottom: -40px;
  position: relative;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 600px;
}

.eyebrow {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #e4d9ff;
  margin-bottom: 10px;
}

.hero h1 {
  font-size: 40px;
  margin: 0 0 10px;
  line-height: 1.1;
}

.hero h1 .accent {
  color: #d8b4fe;
}

.hero-sub {
  font-size: 16px;
  color: #e9e3ff;
  margin: 0 0 30px;
}

.steps-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

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

.step-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.step-text {
  display: flex;
  flex-direction: column;
  font-size: 12.5px;
}

.step-text strong {
  font-size: 13.5px;
  margin-bottom: 2px;
}

.step-text span {
  color: #d9cdfa;
  max-width: 130px;
}

.step-arrow {
  color: rgba(255, 255, 255, 0.5);
  font-size: 16px;
}

@media (max-width: 900px) {
  .steps-row { display: none; }
  .hero-side { display: none; }
  .hero-content { max-width: 100%; }
}

/* --- Input card --- */

.input-card {
  position: relative;
  z-index: 2;
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(91, 63, 217, 0.15);
  padding: 28px 32px;
  margin-bottom: 24px;
}

.input-card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.input-card-heading {
  flex: 1;
}

.input-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--ice);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.input-card-icon.small {
  width: 36px;
  height: 36px;
  font-size: 15px;
}

.input-card-heading h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.input-card-heading p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.input-card textarea {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  padding: 14px;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  resize: vertical;
}

.char-counter {
  text-align: right;
  font-size: 11.5px;
  color: var(--muted);
  margin: 4px 2px 16px;
}

.action-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  grid-auto-flow: column;
  align-items: stretch;
  gap: 12px;
}

@media (max-width: 760px) {
  .action-chips {
    grid-template-columns: 1fr;
    grid-auto-flow: row;
  }
}

.chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  flex: 1;
  min-width: 170px;
}

.chip:hover {
  border-color: var(--navy);
  background: var(--ice);
}

.chip-icon {
  font-size: 17px;
}

.chip-text {
  display: flex;
  flex-direction: column;
  font-size: 12.5px;
}

.chip-text strong {
  font-size: 13px;
  color: var(--text);
}

.chip-text small {
  color: var(--muted);
  font-size: 11px;
}

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

.cta-btn {
  background: #d3f8df;
  color: #15803d;
  border: none;
  padding: 13px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.cta-btn:hover:not(:disabled) { background: #bdf3cf; }

.cta-btn:disabled { opacity: 0.6; cursor: default; }

.chip-panel {
  margin-top: 16px;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
}

.chip-panel label {
  font-size: 12.5px;
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
}

.chip-panel input[type="text"],
.chip-panel textarea {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  padding: 9px 10px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  resize: vertical;
}

/* --- Recent runs --- */

.recent-runs {
  background: var(--white);
  border-radius: 16px;
  padding: 24px 28px;
  margin-bottom: 24px;
  border: 1px solid var(--card-border);
}

.recent-runs-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.recent-runs-header .view-all-link {
  margin-left: auto;
  align-self: center;
  color: var(--navy);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}

.recent-runs-header .view-all-link:hover {
  text-decoration: underline;
}

.row-actions {
  position: relative;
  display: inline-block;
}

.row-actions-trigger {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 6px;
}

.row-actions-trigger:hover {
  background: var(--bg);
  color: var(--text);
}

.row-actions-menu {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 5;
  background: white;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(30, 17, 71, 0.14);
  padding: 6px;
  display: flex;
  flex-direction: column;
  min-width: 150px;
}

.row-actions-menu button,
.row-actions-menu a {
  border: none;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
}

.row-actions-menu button:hover,
.row-actions-menu a:hover {
  background: var(--ice);
}

.recent-runs-header h2 {
  margin: 0 0 4px;
  font-size: 17px;
}

.recent-runs-header p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.quality-ring {
  font-weight: 700;
}

/* --- Hero right-side panel: real photo not available, so this uses an
   abstract gradient panel with the same tagline text instead --- */

.hero-side {
  position: absolute;
  right: 40px;
  top: 90px;
  text-align: right;
  max-width: 340px;
}

.hero-script {
  font-family: "Caveat", cursive;
  font-size: 28px;
  color: white;
  line-height: 1.15;
  margin-bottom: 10px;
  white-space: nowrap;
}

.hero-tagline {
  font-size: 14px;
  color: #e9e3ff;
  line-height: 1.5;
  white-space: nowrap;
}

.see-example-btn {
  background: var(--white);
  color: var(--navy);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

/* --- Chip icon circles (color-coded per action, matches reference) --- */

.chip-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.chip[data-toggle="jira-panel"] .chip-icon { background: #eef4fe; }
.chip[for="file-upload"] .chip-icon { background: #f3eefe; }
.chip[data-toggle="url-panel"] .chip-icon { background: #f1ecfe; }

/* --- Sidebar upgrade card --- */

.upgrade-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  color: white;
}

.upgrade-card .upgrade-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 4px;
}

.upgrade-card .upgrade-sub {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.4;
}

/* --- Quality ring (conic-gradient donut, matches reference) --- */

.quality-ring-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ring {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  background: conic-gradient(var(--ring-color, var(--green)) calc(var(--ring-pct, 0) * 1%), #e9e5f7 0);
  position: relative;
}

.ring::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--white);
}

/* --- Recent Runs table: light header (overrides the dark .data-table th
   default used elsewhere, to match the reference exactly for this table) --- */

.recent-runs-table thead tr {
  background: var(--bg);
}

.recent-runs-table th {
  background: var(--bg) !important;
  color: var(--muted) !important;
  font-size: 11px !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

/* --- Secondary pages (Home, My Pipelines, Test Cases, etc.) --- */

.page-header-card {
  background: linear-gradient(120deg, var(--hero-start) 0%, var(--hero-end) 100%);
  border-radius: 20px;
  padding: 28px 32px;
  color: white;
  margin-bottom: 24px;
}

.page-header-card h1 {
  margin: 0 0 6px;
  font-size: 26px;
}

.page-header-card p {
  margin: 0;
  color: #e9e3ff;
  font-size: 14px;
}

.content-card {
  background: var(--white);
  border-radius: 16px;
  padding: 24px 28px;
  margin-bottom: 24px;
  border: 1px solid var(--card-border);
  box-shadow: 0 4px 20px rgba(20, 13, 72, 0.04);
}

.content-card h2 {
  margin: 0 0 4px;
  font-size: 17px;
}

.content-card .content-sub {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--muted);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}

.stat-box {
  background: var(--bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 16px;
}

.stat-box .num {
  font-size: 26px;
  font-weight: 800;
  color: var(--navy);
}

.stat-box .label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
}

.status-pill.ok { background: #e3f5ec; color: var(--green); }
.status-pill.warn { background: #fdf3d9; color: var(--amber); }

.integration-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--card-border);
}
.integration-row:last-child { border-bottom: none; }

.integration-row .name {
  font-weight: 700;
  font-size: 14px;
}
.integration-row .desc {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}

.empty-hint {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 13.5px;
}

.empty-hint a {
  color: var(--navy);
  font-weight: 600;
}

header {
  background: var(--white);
  color: var(--navy);
  padding: 24px 32px;
  border-bottom: 1px solid var(--card-border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-logo {
  height: 48px;
  width: auto;
  flex-shrink: 0;
}

header h1 {
  margin: 0 0 4px;
  font-size: 22px;
}

header p {
  margin: 0;
  color: var(--navy);
  opacity: 0.75;
  font-size: 14px;
}

main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 32px 64px;
}

.controls {
  background: var(--white);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 20px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.controls label {
  font-size: 13px;
  color: var(--muted);
}

.controls input[type="text"] {
  padding: 8px 10px;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  font-size: 14px;
  min-width: 180px;
}

.controls button {
  background: var(--navy);
  color: var(--white);
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}

.controls button:disabled {
  opacity: 0.6;
  cursor: default;
}

.controls .mock-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

#status-banner {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}

#error-banner {
  background: #fdecea;
  color: var(--red);
  border: 1px solid #f5c2c0;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 20px;
  display: none;
}

.summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.summary-header h2 {
  margin: 0;
  font-size: 18px;
}

.risk-badge {
  font-weight: 700;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 999px;
  letter-spacing: 0.03em;
}

.risk-LOW { background: #e3f5ec; color: var(--green); }
.risk-MEDIUM { background: #fdf3d9; color: var(--amber); }
.risk-HIGH { background: #fdecea; color: var(--red); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 18px;
  text-align: left;
}

.stat-card .num {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
}

.stat-card .label {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--muted);
}

.stat-card.tested .num { color: var(--green); }
.stat-card.weak .num { color: var(--amber); }
.stat-card.missing .num { color: var(--muted); }
.stat-card.conflict .num { color: var(--red); }

.page-section-title {
  font-size: 19px;
  margin: 0 0 6px;
}

.section-divider {
  border: none;
  border-top: 1px solid var(--card-border);
  margin: 40px 0;
}

.pipeline-section .section-sub {
  margin-bottom: 18px;
}

.pipeline-inputs {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 14px;
  align-items: stretch;
  margin-bottom: 16px;
}

@media (max-width: 860px) {
  .pipeline-inputs {
    grid-template-columns: 1fr;
  }
  .pipeline-or {
    padding-top: 0;
  }
}

.pipeline-field input[type="text"] {
  font-family: inherit;
  font-size: 14px;
  padding: 10px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
}

.field-note {
  font-size: 11.5px;
  color: var(--muted);
  margin: 0;
}

.field-hint {
  font-size: 11.5px;
  color: var(--red);
}

.pipeline-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pipeline-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.pipeline-field textarea {
  font-family: inherit;
  font-size: 14px;
  padding: 10px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  resize: vertical;
}

.pipeline-or {
  align-self: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  padding-top: 20px;
}

/* #pipeline-run-btn intentionally has no styling here — it's the same
   element as .cta-btn (kept one ID for JS), and this old ID rule used to
   override the new green button with the previous navy style since ID
   beats class specificity. Styling lives on .cta-btn now. */

#pipeline-status { font-size: 13px; color: var(--muted); margin-top: 10px; }

#pipeline-error {
  background: #fdecea;
  color: var(--red);
  border: 1px solid #f5c2c0;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  margin-top: 14px;
  display: none;
}

#pipeline-results { margin-top: 24px; }

.report-card {
  background: var(--white);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

.report-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.report-header h3 { margin: 0; font-size: 16px; }

.readiness-badge {
  font-weight: 700;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  letter-spacing: 0.03em;
}

.readiness-badge-READY { background: #e3f5ec; color: var(--green); }
.readiness-badge-AT_RISK { background: #fdf3d9; color: var(--amber); }
.readiness-badge-NOT_READY { background: #fdecea; color: var(--red); }

.report-card ul { margin: 10px 0 0; padding-left: 20px; font-size: 13.5px; }
.report-card li { margin-bottom: 4px; }

.analysis-card {
  background: var(--white);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  font-size: 13.5px;
}

.analysis-card h3 { margin: 0 0 10px; font-size: 15px; }
.analysis-card p { margin: 0 0 8px; }
.analysis-list { margin-top: 10px; }
.analysis-list ul { margin: 4px 0 0; padding-left: 20px; }

.assumptions-card {
  background: #f3f7ff;
  border: 1px solid #c5d6f5;
}
.assumptions-list { margin: 0; padding-left: 20px; }
.assumptions-list li { margin-bottom: 6px; font-weight: 600; color: var(--navy); }
.gap-type {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--amber);
  text-transform: uppercase;
}

.section-title { font-size: 16px; margin: 24px 0 12px; }

.req-list, .test-list { display: grid; gap: 12px; margin-bottom: 8px; }

.req-card, .test-card {
  background: var(--white);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 16px 18px;
}

.req-header, .test-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.req-id { font-size: 11.5px; font-weight: 700; color: var(--muted); }

.source-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
}

.source-generated { background: #eef0f5; color: var(--navy); }
.source-input { background: #e3f5ec; color: var(--green); }
.source-missing { background: #fdf3d9; color: var(--amber); }

.req-title, .test-title { font-weight: 700; font-size: 14.5px; margin-bottom: 4px; }
.req-desc { font-size: 13px; color: var(--text); margin-bottom: 8px; }
.req-rationale { font-size: 12px; color: var(--amber); margin-bottom: 8px; }
.ac-list { margin: 0; padding-left: 20px; font-size: 12.5px; color: var(--muted); }
.ac-list li { margin-bottom: 3px; }

.test-for { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.steps-list { margin: 0 0 8px; padding-left: 20px; font-size: 13px; }
.steps-list li { margin-bottom: 3px; }
.expected-result { font-size: 12.5px; color: var(--text); }

.priority-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: capitalize;
}
.priority-high { background: #fdecea; color: var(--red); }
.priority-medium { background: #fdf3d9; color: var(--amber); }
.priority-low { background: #eef0f5; color: var(--muted); }

.sim-banner {
  background: #eef0f5;
  color: var(--muted);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12.5px;
  margin-bottom: 12px;
}

.sim-banner.real-banner {
  background: #e3f5ec;
  color: #146c43;
}

.exec-summary { font-size: 13px; font-weight: 600; margin-bottom: 12px; }

.exec-list {
  background: var(--white);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  overflow: hidden;
}

.exec-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--card-border);
  align-items: start;
}

.exec-row:last-child { border-bottom: none; }

.verdict-pill {
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  text-align: center;
  height: fit-content;
}
.verdict-pass { background: #e3f5ec; color: var(--green); }
.verdict-fail { background: #fdecea; color: var(--red); }
.verdict-blocked { background: #eef0f5; color: var(--muted); }
.verdict-not_run { background: #f3f0fe; color: var(--muted); }

.exec-title { font-size: 14px; margin-bottom: 4px; }
.exec-reason { font-size: 12.5px; color: var(--muted); }

.analyzed-list {
  background: var(--white);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 13px;
}

.analyzed-list summary {
  cursor: pointer;
  color: var(--navy);
  font-weight: 600;
}

.analyzed-list ul {
  margin: 12px 0 0;
  padding-left: 0;
  list-style: none;
}

.analyzed-list li {
  padding: 6px 0;
  border-bottom: 1px solid var(--card-border);
  color: var(--text);
}

.analyzed-list li:last-child { border-bottom: none; }

.section-title {
  font-size: 16px;
  margin: 32px 0 4px;
}

.section-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0 0 14px;
}

.missing-list {
  display: grid;
  gap: 12px;
}

.missing-card {
  background: var(--white);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 16px 18px;
}

.missing-title {
  font-weight: 700;
  font-size: 14.5px;
  margin-bottom: 6px;
}

.missing-desc {
  font-size: 13.5px;
  margin-bottom: 8px;
  line-height: 1.45;
}

.missing-rationale {
  font-size: 12.5px;
  color: var(--amber);
  margin-bottom: 4px;
}

.missing-related {
  font-size: 12px;
  color: var(--muted);
}

.issue-list {
  background: var(--white);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  overflow: hidden;
}

.issue-row {
  display: grid;
  grid-template-columns: 100px 1fr 140px;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--card-border);
  align-items: start;
}

.issue-row:last-child { border-bottom: none; }

.issue-key {
  font-weight: 600;
  font-size: 13px;
  color: var(--navy);
}

.issue-body .summary {
  font-size: 14px;
  margin-bottom: 4px;
}

.issue-body .reason {
  font-size: 12.5px;
  color: var(--muted);
}

.category-pill {
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  text-align: center;
  white-space: nowrap;
}

.category-implemented_tested { background: #e3f5ec; color: var(--green); }
.category-weak_coverage { background: #fdf3d9; color: var(--amber); }
.category-not_implemented { background: #eef0f5; color: var(--muted); }
.category-conflict { background: #fdecea; color: var(--red); }

#empty-state {
  color: var(--muted);
  font-size: 14px;
  padding: 40px 0;
  text-align: center;
}

footer {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 24px;
}

/* --- Secondary inputs: file upload + target URL --- */

.secondary-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}

@media (max-width: 700px) {
  .secondary-inputs { grid-template-columns: 1fr; }
}

.upload-field, .target-field {
  background: var(--white);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.upload-field label, .target-field label {
  font-size: 12.5px;
  font-weight: 600;
}

.upload-field input[type="file"] {
  font-size: 12.5px;
}

.target-row {
  display: flex;
  gap: 8px;
}

.target-row input[type="text"] {
  flex: 1;
  font-family: inherit;
  font-size: 13px;
  padding: 8px 10px;
  border: 1px solid var(--card-border);
  border-radius: 6px;
}

.target-row button {
  background: var(--white);
  color: var(--navy);
  border: 1px solid var(--navy);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
}

.target-row button:disabled { opacity: 0.6; cursor: default; }

/* --- Run row + timer --- */

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

.pipeline-timer {
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.last-result-banner {
  background: var(--ice);
  color: var(--navy);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 16px;
}

.grounding-note {
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 16px;
}

.grounding-good { background: #e3f5ec; color: var(--green); }
.grounding-warn { background: #fdf3d9; color: var(--amber); }

/* --- Data tables --- */

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  background: var(--white);
  margin-bottom: 12px;
}

.data-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12.5px;
}

.data-table th {
  background: var(--navy);
  color: var(--white);
  text-align: left;
  padding: 10px 12px;
  white-space: nowrap;
  position: sticky;
  top: 0;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--card-border);
  vertical-align: top;
  max-width: 260px;
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:nth-child(even) { background: #fafbfd; }

.data-table .mono { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; white-space: nowrap; }
.muted-small { color: var(--muted); font-size: 10.5px; }

.cell-title { font-weight: 700; margin-bottom: 3px; }
.cell-sub { color: var(--muted); margin-bottom: 4px; }
.cell-note { color: var(--amber); font-size: 11.5px; margin-bottom: 3px; }
.cell-source { font-size: 10.5px; color: var(--navy); text-transform: uppercase; letter-spacing: 0.02em; margin-top: 4px; }

.data-table .ac-list { margin: 0; padding-left: 16px; }
.data-table .ac-list li { margin-bottom: 3px; }

.table-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.pri-P0 { background: #fdecea; color: var(--red); }
.pri-P1 { background: #fdf3d9; color: var(--amber); }
.pri-P2 { background: #eef0f5; color: var(--navy); }
.pri-P3 { background: #eef0f5; color: var(--muted); }

.risk-High { background: #fdecea; color: var(--red); }
.risk-Medium { background: #fdf3d9; color: var(--amber); }
.risk-Low { background: #e3f5ec; color: var(--green); }

.sev-Critical { background: #fdecea; color: var(--red); }
.sev-High { background: #fdf1ea; color: #c2410c; }
.sev-Medium { background: #fdf3d9; color: var(--amber); }
.sev-Low { background: #eef0f5; color: var(--muted); }

/* --- Quality dashboard + result --- */

.dashboard-table .metric-value { font-weight: 700; text-align: right; }
.dashboard-table .metric-status { text-align: center; width: 40px; }

.result-card {
  border-radius: 10px;
  padding: 18px 20px;
  margin-top: 12px;
  border: 1px solid var(--card-border);
}

.result-READY { background: #e3f5ec; }
.result-AT_RISK { background: #fdf3d9; }
.result-NOT_READY { background: #fdecea; }

.result-label { font-size: 15px; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.03em; }
.result-summary { font-size: 13.5px; color: var(--text); }

/* --- Export bar --- */

.export-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.export-bar button {
  background: var(--white);
  color: var(--navy);
  border: 1px solid var(--navy);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

.export-bar button:disabled { opacity: 0.6; cursor: default; }

/* --- Real website automation --- */

.subsection-title {
  font-size: 14px;
  margin: 18px 0 10px;
}

.automation-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.automation-bar button {
  background: var(--navy);
  color: var(--white);
  border: none;
  padding: 9px 16px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

.automation-bar button:disabled { opacity: 0.6; cursor: default; }

.script-list, .real-exec-list {
  display: grid;
  gap: 10px;
  margin-bottom: 8px;
}

.script-card, .real-exec-card {
  background: var(--white);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 12px 16px;
}

.script-card summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
}

.code-block {
  background: #0d1117;
  color: #c9d1d9;
  padding: 12px;
  border-radius: 8px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11.5px;
  overflow-x: auto;
  white-space: pre;
  margin-top: 10px;
}

.real-exec-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.real-exec-reason {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 8px;
}

.real-exec-screenshot {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  margin-top: 8px;
}

/* --- Sign up / log in --- */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, var(--hero-start) 0%, var(--hero-end) 100%);
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(31, 27, 46, 0.35);
  padding: 32px 30px;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 22px;
}
.auth-logo::before {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--hero-start) 0%, var(--hero-end) 100%);
  flex-shrink: 0;
}
.auth-logo span {
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--navy);
}

.auth-card h1 {
  font-size: 20px;
  margin: 0 0 4px;
}
.auth-card p.auth-sub {
  margin: 0 0 22px;
  font-size: 13px;
  color: var(--muted);
}

.auth-field { margin-bottom: 14px; }
.auth-field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.auth-field input {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  padding: 11px 13px;
  border: 1px solid var(--card-border);
  border-radius: 9px;
  background: var(--bg);
}
.auth-field input:focus {
  outline: none;
  border-color: var(--navy);
}

.auth-submit {
  width: 100%;
  margin-top: 6px;
  background: var(--navy);
  color: #fff;
  border: none;
  padding: 13px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.auth-submit:hover:not(:disabled) { background: #4c33c4; }
.auth-submit:disabled { opacity: 0.6; cursor: default; }

.auth-message {
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.5;
}
.auth-message.error { color: var(--red); }
.auth-message.success { color: var(--green); }

.auth-switch {
  margin-top: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.auth-switch a { color: var(--navy); font-weight: 600; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }

/* --- Topbar search + notifications + user menu --- */

.topbar-main {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.topbar-search {
  flex: 1;
  max-width: 480px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--color-surface-alt);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 16px;
  color: var(--color-text-secondary);
}

.topbar-search:focus-within {
  border-color: var(--color-primary);
  background: var(--color-surface);
}

.topbar-search svg { flex-shrink: 0; color: var(--color-text-muted); }

.topbar-search input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--color-text-primary);
}

.topbar-search input::placeholder { color: var(--color-text-muted); }

.topbar-search kbd {
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 2px 6px;
}

.topbar-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-width: 480px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(20, 13, 72, 0.1);
  z-index: 20;
  max-height: 320px;
  overflow-y: auto;
}

.topbar-search-wrap { position: relative; flex: 1; max-width: 480px; }

.topbar-search-results a {
  display: block;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--color-text-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--color-border-soft);
}
.topbar-search-results a:last-child { border-bottom: none; }
.topbar-search-results a:hover { background: var(--color-primary-light-2); }
.topbar-search-results .result-type {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
  margin-right: 8px;
}
.topbar-search-empty {
  padding: 14px 16px;
  font-size: 12.5px;
  color: var(--color-text-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.topbar-notif-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-secondary);
}
.topbar-notif-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.topbar-notif-btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

.topbar-notif-dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-error);
  border: 1.5px solid var(--color-surface);
}

.topbar-user-menu { position: relative; }

.topbar-user-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 12px;
  font-family: inherit;
}
.topbar-user-trigger:hover { background: var(--color-primary-light-2); }
.topbar-user-trigger:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

.topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.topbar-user-info { text-align: left; line-height: 1.3; }
.topbar-user-name { font-size: 13.5px; font-weight: 700; color: var(--color-text-primary); }
.topbar-user-email { font-size: 11.5px; color: var(--color-text-muted); }
.topbar-user-chevron { color: var(--color-text-muted); margin-left: 2px; }

.topbar-user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 200px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(20, 13, 72, 0.12);
  padding: 8px;
  z-index: 20;
}

.topbar-user-dropdown a,
.topbar-user-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border-radius: 8px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--color-text-primary);
  text-decoration: none;
  cursor: pointer;
}
.topbar-user-dropdown a:hover,
.topbar-user-dropdown button:hover { background: var(--color-primary-light); color: var(--color-primary); }
.topbar-user-dropdown .divider { height: 1px; background: var(--color-border-soft); margin: 6px 4px; }

.mobile-menu-btn {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-primary);
  flex-shrink: 0;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 13, 72, 0.45);
  z-index: 39;
}

/* --- Home hero --- */

.home-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(124, 92, 255, 0.1) 0%, rgba(124, 92, 255, 0) 55%),
    linear-gradient(120deg, var(--color-primary-light-2) 0%, var(--color-surface) 45%, var(--color-info-bg) 100%);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 36px 40px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.home-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.home-hero-content { max-width: 460px; }

.home-hero h1 {
  margin: 0 0 10px;
  font-size: 32px;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.2;
}

.home-hero-sub {
  margin: 0 0 22px;
  font-size: 14.5px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.home-hero-ctas {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(120deg, var(--color-primary) 0%, var(--color-accent-2) 100%);
  color: white;
  border: none;
  padding: 12px 22px;
  border-radius: 11px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 6px 16px rgba(99, 67, 231, 0.28);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(99, 67, 231, 0.34); }
.btn-primary:focus-visible { outline: 2px solid var(--color-primary-dark); outline-offset: 2px; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-surface);
  color: var(--color-primary-deep);
  border: 1px solid var(--color-border);
  padding: 12px 22px;
  border-radius: 11px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.btn-secondary:hover { background: var(--color-primary-light-2); border-color: var(--color-primary); }
.btn-secondary:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

.home-hero-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 6px 10px;
}

.hero-visual-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

/* Soft flowing wave shapes behind the robot/headline group, echoing the
   reference's curved background — layered underneath everything else in
   the hero via z-index, purely decorative. */
.hero-visual-row::before {
  content: "";
  position: absolute;
  inset: -20px -10px;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 140% at 8% 50%, rgba(124, 92, 255, 0.14) 0%, rgba(124, 92, 255, 0) 70%),
    radial-gradient(50% 120% at 92% 30%, rgba(40, 123, 250, 0.08) 0%, rgba(40, 123, 250, 0) 70%);
}

.hero-sparkle {
  position: absolute;
  z-index: 1;
  color: var(--color-accent);
  font-size: 13px;
  opacity: 0.8;
  pointer-events: none;
}
.hero-sparkle.sp1 { top: -8px; left: 218px; font-size: 15px; }
.hero-sparkle.sp2 { top: 6px; left: 330px; font-size: 10px; opacity: 0.55; }
.hero-sparkle.sp3 { bottom: 2px; left: 260px; font-size: 11px; opacity: 0.6; }

.hero-bot-column {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 240px;
  flex-shrink: 0;
}

.hero-bot-stage {
  position: relative;
  width: 240px;
  height: 116px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.hero-bot-glow {
  position: absolute;
  z-index: 0;
  top: 50%;
  left: 56px;
  transform: translate(-50%, -50%);
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 92, 255, 0.35) 0%, rgba(124, 92, 255, 0.12) 55%, rgba(124, 92, 255, 0) 78%);
}

.hero-bot-svg {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 10px 14px rgba(20, 13, 72, 0.16));
}

.hero-bot-bubble {
  position: absolute;
  z-index: 2;
  top: -6px;
  left: 96px;
  width: 138px;
  background: var(--color-surface);
  border-radius: 12px;
  padding: 8px 11px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--color-primary-deep);
  line-height: 1.35;
  box-shadow: 0 6px 18px rgba(20, 13, 72, 0.12);
}

.hero-tagline-block {
  position: relative;
  z-index: 1;
  text-align: left;
}

.hero-tagline-block .headline {
  font-size: 25px;
  font-weight: 700;
  font-style: italic;
  color: var(--color-text-primary);
  line-height: 1.22;
  margin-bottom: 5px;
}
.hero-tagline-block .headline .accent {
  background: linear-gradient(100deg, var(--color-primary) 0%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-tagline-block .sub {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.hero-sources {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.hero-sources::-webkit-scrollbar { display: none; }

.hero-source-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

.hero-source-sep {
  color: var(--color-text-muted);
  font-size: 12px;
  flex-shrink: 0;
}

.hero-source-icon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: white;
}

.hero-source-icon.tone-doc { background: var(--color-primary-dark); }
.hero-source-icon.tone-link { background: var(--color-surface-alt); color: var(--color-text-secondary); }
.hero-source-icon.tone-jira { background: var(--color-info); }
.hero-source-icon.tone-excel { background: var(--color-success); }
.hero-source-icon.tone-web { background: var(--color-primary); }

@media (max-width: 980px) {
  .home-hero-top { flex-direction: column; align-items: flex-start; }
  .hero-visual-row { justify-content: flex-start; }
}

@media (max-width: 560px) {
  .hero-visual-row { flex-direction: column; align-items: flex-start; }
  .hero-bot-column { margin-bottom: 8px; }
}

/* --- KPI cards --- */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 18px 18px 16px;
  box-shadow: 0 4px 20px rgba(20, 13, 72, 0.04);
}

.kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.kpi-icon.tone-info { background: var(--color-info-bg); color: var(--color-info); }
.kpi-icon.tone-primary { background: var(--color-primary-light); color: var(--color-primary); }
.kpi-icon.tone-success { background: var(--color-success-bg); color: var(--color-success); }
.kpi-icon.tone-error { background: var(--color-error-bg); color: var(--color-error); }
.kpi-icon.tone-accent { background: var(--color-primary-light); color: var(--color-accent-2); }

.kpi-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--color-text-primary);
  line-height: 1.1;
}

.kpi-label {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-top: 4px;
  font-weight: 500;
}

.kpi-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 700;
  margin-top: 10px;
}

.kpi-trend.up { color: var(--color-success); }
.kpi-trend.down { color: var(--color-error); }
.kpi-trend.flat { color: var(--color-text-muted); }

@media (max-width: 1240px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
  .kpi-grid { grid-template-columns: 1fr; }
}

/* --- Dashboard grid: Recent Pipelines / Execution Trend / Quality at a Glance --- */

.dashboard-row {
  display: grid;
  grid-template-columns: 1.3fr 1.15fr 0.85fr;
  gap: 16px;
  align-items: stretch;
  margin-bottom: 24px;
}

@media (max-width: 1180px) {
  .dashboard-row { grid-template-columns: 1fr; }
}

.dash-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 4px 20px rgba(20, 13, 72, 0.04);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.dash-card-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.dash-card-header .view-all-link {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
  white-space: nowrap;
}
.dash-card-header .view-all-link:hover { text-decoration: underline; }

.range-select {
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-text-primary);
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}
.range-select:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 1px; }

/* Recent Pipelines table */

.pipelines-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.pipelines-table th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  padding: 0 8px 10px 0;
}
.pipelines-table td {
  padding: 11px 8px 11px 0;
  border-top: 1px solid var(--color-border-soft);
  vertical-align: middle;
}
.pipelines-table tbody tr:hover { background: var(--color-primary-light-2); }
.pipelines-table .pl-name {
  font-weight: 700;
  color: var(--color-text-primary);
  text-decoration: none;
}
.pipelines-table .pl-name:hover { color: var(--color-primary); }
.pipelines-table .pl-type { color: var(--color-text-secondary); }
.pipelines-table .pl-date { color: var(--color-text-muted); white-space: nowrap; }

.pl-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 11px 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.pl-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.pl-status.status-completed { background: var(--color-success-bg); color: var(--color-success); }
.pl-status.status-in-progress { background: var(--color-info-bg); color: var(--color-info); }
.pl-status.status-failed { background: var(--color-error-bg); color: var(--color-error); }
.pl-status.status-at-risk { background: var(--color-warning-bg); color: var(--color-warning); }
.pl-status.status-draft { background: var(--color-surface-alt); color: var(--color-text-muted); }
.pl-status.status-blocked { background: var(--color-warning-bg); color: var(--color-warning); }

.pl-actions-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: 15px;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
}
.pl-actions-btn:hover { background: var(--color-primary-light-2); color: var(--color-primary); }

/* Execution trend chart */

.trend-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 10px;
}
.trend-legend .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.trend-chart-wrap { flex: 1; min-height: 180px; }
.trend-chart-wrap svg { width: 100%; height: 100%; display: block; overflow: visible; }
.trend-axis-label { font-size: 10px; fill: var(--color-text-muted); }

/* Quality at a glance donut */

.donut-wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 1;
}

.donut-ring {
  position: relative;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  flex-shrink: 0;
  background: conic-gradient(var(--donut-gradient, var(--color-border) 0 100%));
}
.donut-ring::after {
  content: "";
  position: absolute;
  inset: 16px;
  border-radius: 50%;
  background: var(--color-surface);
  display: flex;
}
.donut-center {
  position: absolute;
  inset: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 1;
}
.donut-center .num { font-size: 22px; font-weight: 800; color: var(--color-text-primary); line-height: 1.1; }
.donut-center .lbl { font-size: 10.5px; color: var(--color-text-muted); margin-top: 2px; }

.donut-legend { display: flex; flex-direction: column; gap: 9px; font-size: 12px; }
.donut-legend-row { display: flex; align-items: center; gap: 8px; color: var(--color-text-secondary); }
.donut-legend-row .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.donut-legend-row .val { margin-left: auto; font-weight: 700; color: var(--color-text-primary); }

/* --- Skeleton loaders --- */

@keyframes skeleton-shimmer {
  0% { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--color-border-soft) 0px, var(--color-surface-alt) 40px, var(--color-border-soft) 80px);
  background-size: 200px 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: 8px;
}

.skeleton-hero { height: 220px; border-radius: 20px; margin-bottom: 24px; }
.skeleton-kpi { height: 118px; border-radius: 16px; }
.skeleton-dash { height: 320px; border-radius: 16px; }
.skeleton-row { height: 16px; margin-bottom: 8px; }

/* --- Dashboard empty / error states --- */

.dash-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px 16px;
  color: var(--color-text-muted);
  font-size: 12.5px;
  gap: 10px;
}
.dash-empty strong { color: var(--color-text-primary); font-size: 13.5px; }

.dash-error {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px 16px;
  color: var(--color-error);
  font-size: 12.5px;
  gap: 10px;
}
.dash-error button {
  background: var(--color-surface);
  border: 1px solid var(--color-error);
  color: var(--color-error);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.dash-error button:hover { background: var(--color-error-bg); }

/* --- Responsive: mobile nav drawer --- */

@media (max-width: 900px) {
  .mobile-menu-btn { display: flex; }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 0 0 40px rgba(20, 13, 72, 0.3);
  }
  .sidebar.open { transform: translateX(0); }

  .sidebar-overlay.open { display: block; }

  .main-area { padding: 20px 16px 48px; }

  .topbar-search-wrap { max-width: none; }
  .topbar-user-info { display: none; }
}

@media (max-width: 560px) {
  .topbar-main { flex-wrap: wrap; }
  .topbar-search-wrap { order: 3; max-width: 100%; flex-basis: 100%; }
}

/* --- Print / PDF export --- */

@media print {
  .no-print, .pipeline-inputs, .secondary-inputs, .run-row, #pipeline-status, #pipeline-error {
    display: none !important;
  }
  body { background: white; }
  header { background: white !important; color: black !important; }
  header p { color: #333 !important; }
  .table-scroll { overflow: visible; border: 1px solid #ccc; }
  .data-table { font-size: 10px; }
  .data-table th { background: #eee !important; color: black !important; }
}
