/* Admin dashboard styling — built on design/tokens.css's brand variables (colours, fonts). This
   file adds the layout/component CSS the dashboard screens need that tokens.css doesn't define
   (tokens.css is deliberately minimal: variables + two small utility classes). WCAG 2.2 AA target
   per CLAUDE.md §4: real focus rings, no colour-only signalling (classification chips carry text,
   not just colour), dark text on bright fills throughout. */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--tk-navy);
  color: var(--tk-text);
  font-family: var(--tk-font-body);
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--tk-aqua); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
  box-shadow: var(--tk-focus-ring);
}

.tk-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: var(--tk-blue);
  border-bottom: 1px solid var(--tk-border);
}
.tk-header .tk-logo { display: inline-flex; align-items: center; }
.tk-header .tk-logo img { display: block; width: auto; }
.tk-header .tk-programme { color: var(--tk-text-muted); font-size: 13px; }
.tk-header .tk-reviewer { color: var(--tk-text-muted); font-size: 13px; display: flex; align-items: center; gap: 10px; }
.tk-link-button {
  background: none; border: none; padding: 0; margin: 0;
  color: var(--tk-aqua); font-size: 13px; text-decoration: underline; cursor: pointer; font-family: inherit;
}

/* Login page */
.tk-login-wrap { max-width: 360px; margin: 64px auto; }
.tk-login-wrap .tk-field { margin-bottom: 16px; }
.tk-login-wrap label { display: block; font-size: 13px; color: var(--tk-text-muted); margin-bottom: 4px; }
.tk-login-wrap input[type="email"], .tk-login-wrap input[type="password"] {
  width: 100%; background: var(--tk-blue); color: var(--tk-text); border: 1px solid var(--tk-border);
  border-radius: 6px; padding: 10px 12px; font-size: 15px;
}

.tk-main { max-width: 1200px; margin: 0 auto; padding: 32px; }

.tk-flash { background: var(--tk-aqua); color: var(--tk-text-on-bright); padding: 12px 16px; border-radius: var(--tk-radius); margin-bottom: 20px; font-weight: 600; }
.tk-flash-error { background: var(--tk-orange); }

/* Filter bar */
.tk-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 24px; padding: 16px; background: var(--tk-blue); border-radius: var(--tk-radius); }
.tk-filters label { display: block; font-size: 12px; color: var(--tk-text-muted); margin-bottom: 4px; }
.tk-filters input[type="text"], .tk-filters select {
  background: var(--tk-navy); color: var(--tk-text); border: 1px solid var(--tk-border); border-radius: 6px;
  padding: 8px 10px; font-family: var(--tk-font-body); font-size: 14px;
}
.tk-filters button { align-self: flex-end; }

.tk-btn { font-family: var(--tk-font-sub); font-weight: 600; border: none; border-radius: 6px; padding: 9px 16px; font-size: 14px; cursor: pointer; }
.tk-btn-ghost { background: transparent; color: var(--tk-text); border: 1px solid var(--tk-border); }

/* Application cards (CLAUDE.md 5.4: one card per application) */
.tk-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.tk-card {
  background: var(--tk-blue); border-radius: var(--tk-radius); padding: 18px; border: 1px solid transparent;
  text-decoration: none; color: var(--tk-text); display: block;
}
.tk-card:hover, .tk-card:focus-visible { border-color: var(--tk-aqua); }
.tk-card h3 { margin: 0 0 4px; font-family: var(--tk-font-heading); font-size: 17px; }
.tk-card .tk-card-meta { color: var(--tk-text-muted); font-size: 13px; margin-bottom: 12px; }
.tk-card .tk-score-row { display: flex; gap: 16px; margin-bottom: 10px; flex-wrap: wrap; }
.tk-card .tk-score { font-size: 13px; }
.tk-card .tk-score strong { display: block; font-size: 18px; font-family: var(--tk-font-heading); }
.tk-score-pct { font-size: 13px; font-weight: 400; font-family: var(--tk-font-body); color: var(--tk-text-muted); }
.tk-card .tk-badges { display: flex; gap: 6px; flex-wrap: wrap; }

.tk-chip { display: inline-block; vertical-align: middle; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--tk-text-on-bright); }

/* Business-page stage stepper — "where are they in the workflow" at a glance, without piecing it
   together from the status chip, the Commitment Agreement section and the Growth Review tab. */
.tk-stage-stepper { display: flex; align-items: center; flex-wrap: wrap; gap: 0; margin: 2px 0 20px; }
.tk-stage-step { display: flex; align-items: center; gap: 6px; }
.tk-stage-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; border: 2px solid var(--tk-text-muted); background: transparent; flex-shrink: 0; }
.tk-stage-step-done .tk-stage-dot { background: var(--tk-status-strong); border-color: var(--tk-status-strong); }
.tk-stage-step-current .tk-stage-dot { background: var(--tk-orange); border-color: var(--tk-orange); }
.tk-stage-step-rejected .tk-stage-dot { background: var(--tk-pink); border-color: var(--tk-pink); }
.tk-stage-label { font-size: 12px; color: var(--tk-text-muted); white-space: nowrap; }
.tk-stage-step-current .tk-stage-label { color: var(--tk-text); font-weight: 700; }
.tk-stage-step-rejected .tk-stage-label { color: var(--tk-pink); font-weight: 700; }
.tk-stage-connector { width: 20px; height: 2px; background: var(--tk-border); margin: 0 6px; flex-shrink: 0; }
.tk-stage-connector-rejected { background: var(--tk-pink); }

/* The answer a "View answer" link (Reviewer flags) jumps to — briefly highlighted so it's obvious
   which one the link meant, not just a plain scroll to the top of the page. */
.tk-answer-row:target { background: rgba(255, 221, 46, 0.12); border-radius: 6px; box-shadow: 0 0 0 1px var(--tk-lemon); padding: 8px; margin: -8px -8px 6px; }
.tk-chip-strong { background: var(--tk-status-strong); }
.tk-chip-developing { background: var(--tk-status-developing); }
.tk-chip-focus { background: var(--tk-status-focus); }
.tk-chip-muted { background: var(--tk-text-muted); }
.tk-chip-status { background: var(--tk-violet); color: var(--tk-text-on-bright); }
.tk-chip-flag { background: var(--tk-pink); color: var(--tk-text-on-bright); }

.tk-pagination { margin-top: 20px; display: flex; gap: 8px; align-items: center; color: var(--tk-text-muted); font-size: 14px; }

/* Detail page */
.tk-back { display: inline-block; margin-bottom: 16px; color: var(--tk-text-muted); text-decoration: none; }
.tk-detail-header { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.tk-detail-header h1 { font-family: var(--tk-font-heading); margin: 0 0 6px; }
.tk-section { background: var(--tk-blue); border-radius: var(--tk-radius); padding: 20px; margin-bottom: 20px; }
.tk-section h2 { font-family: var(--tk-font-heading); font-size: 15px; text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 16px; color: var(--tk-text-muted); }

.tk-key-scores { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.tk-key-scores .tk-kv { text-align: center; }
.tk-key-scores .tk-kv .tk-value { font-family: var(--tk-font-heading); font-size: 32px; }
.tk-key-scores .tk-kv .tk-label { color: var(--tk-text-muted); font-size: 13px; }

.tk-cap-table { width: 100%; border-collapse: collapse; }
.tk-cap-table td, .tk-cap-table th { padding: 8px 4px; border-bottom: 1px solid var(--tk-border); text-align: left; font-size: 14px; }
.tk-cap-table th { color: var(--tk-text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }

.tk-flag-list { list-style: none; padding: 0; margin: 0; }
.tk-flag-list li { padding: 10px 0; border-bottom: 1px solid var(--tk-border); }
.tk-flag-list li:last-child { border-bottom: none; }
.tk-flag-list .tk-flag-meta { color: var(--tk-text-muted); font-size: 12px; }

.tk-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tk-actions form { display: inline; }

.tk-field { margin-bottom: 14px; }
.tk-field label { display: block; font-size: 13px; margin-bottom: 4px; color: var(--tk-text-muted); }
.tk-field input, .tk-field select, .tk-field textarea {
  width: 100%; background: var(--tk-navy); color: var(--tk-text); border: 1px solid var(--tk-border);
  border-radius: 6px; padding: 9px 10px; font-family: var(--tk-font-body); font-size: 14px;
}
.tk-field textarea { min-height: 70px; }

.tk-score-table { width: 100%; border-collapse: collapse; }
.tk-score-table td, .tk-score-table th { padding: 8px 4px; border-bottom: 1px solid var(--tk-border); text-align: left; font-size: 14px; }
.tk-score-table th { color: var(--tk-text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }
.tk-chip-warning { background: var(--tk-orange); }

/* Assessment-point switcher (business page) — Application / Baseline / Exit / 6 months. */
.tk-switcher { margin: 20px 0; }
.tk-switcher-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--tk-border); flex-wrap: wrap; }
.tk-switcher-tab {
  display: inline-block; padding: 10px 16px; color: var(--tk-text-muted); text-decoration: none;
  font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tk-switcher-tab:hover { color: var(--tk-text); }
.tk-switcher-tab-active { color: var(--tk-text); border-bottom-color: var(--tk-aqua); }
.tk-switcher-tab-disabled { color: var(--tk-text-muted); opacity: 0.45; cursor: default; }
.tk-switcher-banner {
  padding: 12px 0; color: var(--tk-text-muted); font-size: 13px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.tk-switcher-banner strong { color: var(--tk-text); font-size: 14px; }

/* Journey summary strip — Growth Readiness at Application -> Baseline -> Exit -> 6 months. */
.tk-journey { display: flex; gap: 0; align-items: center; margin-bottom: 20px; overflow-x: auto; }
.tk-journey-point { text-align: center; padding: 10px 18px; min-width: 110px; }
.tk-journey-point .tk-journey-value { font-family: var(--tk-font-heading); font-size: 20px; }
.tk-journey-point .tk-journey-label { color: var(--tk-text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; }
.tk-journey-point.tk-journey-blank { opacity: 0.4; }
.tk-journey-arrow { color: var(--tk-text-muted); font-size: 18px; }

/* Cohort overview page. */
.tk-cohort-grid { width: 100%; border-collapse: collapse; }
.tk-cohort-grid td, .tk-cohort-grid th { padding: 8px 10px; border-bottom: 1px solid var(--tk-border); text-align: left; font-size: 13px; white-space: nowrap; }
.tk-cohort-grid th { color: var(--tk-text-muted); font-weight: 600; font-size: 11px; text-transform: uppercase; }
.tk-cohort-grid td a { color: var(--tk-text); text-decoration: none; }
.tk-cohort-grid td a:hover { color: var(--tk-aqua); }
.tk-stat-row { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 8px; }
.tk-stat { background: var(--tk-navy); border-radius: var(--tk-radius); padding: 12px 16px; min-width: 130px; }
.tk-stat .tk-stat-value { font-family: var(--tk-font-heading); font-size: 22px; }
.tk-stat .tk-stat-label { color: var(--tk-text-muted); font-size: 12px; }

.tk-empty { color: var(--tk-text-muted); font-style: italic; }
