/* Ordinate visual-test base styles — minimal utility + component layer. */

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }

/* ─── Body ─── */
body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--color-gray-700);
  background: var(--color-gray-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern" 1;
}

/* ─── Typography ─── */
h1, h2, h3, h4, h5, h6 { color: var(--color-gray-900); line-height: 1.2; }
h1 { font-size: var(--text-3xl); font-weight: 700; }
h2 { font-size: var(--text-2xl); font-weight: 700; }
h3 { font-size: var(--text-xl);  font-weight: 700; }
h4 { font-size: var(--text-lg);  font-weight: 600; }
h5 { font-size: var(--text-md);  font-weight: 600; }
h6 { font-size: var(--text-sm);  font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-gray-500); }

p + p { margin-top: 1em; }

strong, b { font-weight: 700; color: var(--color-gray-900); }
em, i { font-style: italic; }

a.link {
  color: var(--color-primary);
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}
a.link:hover { border-bottom-color: var(--color-primary); }

.overline {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-gray-500);
}

.muted { color: var(--color-gray-500); }
.mono-nums { font-variant-numeric: tabular-nums; }

/* ─── Layout primitives ─── */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.main { flex: 1; padding: var(--space-6); }
.container { max-width: var(--width-web-max); margin: 0 auto; }
.stack > * + * { margin-top: var(--space-4); }
.stack-sm > * + * { margin-top: var(--space-2); }
.stack-lg > * + * { margin-top: var(--space-6); }
.row { display: flex; align-items: center; gap: var(--space-3); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }

.grid { display: grid; gap: var(--space-4); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

/* ─── Header (product) — sticky ─── */
.app-header {
  height: var(--app-header-h);
  background: var(--color-gray-800);
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  gap: var(--space-8);
  color: white;
  position: sticky;
  top: 0;
  z-index: 50;
}
.app-header .logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: var(--text-lg); font-weight: 700; color: white;
}
.app-header nav { display: flex; align-items: center; gap: 2px; height: 100%; }
.app-header nav a {
  height: 100%;
  display: inline-flex;
  align-items: center;
  padding: 0 var(--space-3);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-gray-400);
  border-bottom: 3px solid transparent;
  transition: color 0.15s;
}
.app-header nav a:hover { color: white; }
.app-header nav a.active { color: white; border-bottom-color: white; }
.app-header .right { margin-left: auto; display: flex; align-items: center; gap: var(--space-3); }
.app-header .icon-btn {
  width: 32px; height: 32px; border-radius: var(--radius);
  color: var(--color-gray-400);
  display: inline-flex; align-items: center; justify-content: center;
}
.app-header .icon-btn:hover { color: white; }
.app-header .user-chip {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-sm); color: var(--color-gray-200);
}

/* ─── Sub-nav (per-bid tabs) — sticky, sits below app-header ─── */
.subnav {
  background: white;
  border-bottom: 1px solid var(--color-gray-200);
  display: flex; align-items: center;
  padding: 0 var(--space-6);
  height: var(--app-subnav-h);
  gap: var(--space-6);
  position: sticky;
  top: var(--app-header-h);
  z-index: 40;
}
.subnav .title { font-size: var(--text-sm); font-weight: 700; color: var(--color-gray-900); }
.subnav-tabs { display: flex; gap: 2px; height: 100%; }
.subnav-tabs a {
  display: inline-flex; align-items: center;
  padding: 0 var(--space-3);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-gray-600);
  border-bottom: 2px solid transparent;
  transition: color 0.15s;
}
.subnav-tabs a:hover { color: var(--color-gray-900); }
.subnav-tabs a.active { color: var(--color-primary); border-bottom-color: var(--color-primary); font-weight: 600; }

/* ─── Page head ─── */
.page-head { margin-bottom: var(--space-6); display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4); }
.page-head h1 { margin-bottom: var(--space-1); }
.page-head .lede { color: var(--color-gray-500); font-size: var(--text-md); }
.breadcrumb { font-size: var(--text-sm); color: var(--color-gray-700); margin-bottom: var(--space-2); }
.breadcrumb a { color: var(--color-gray-700); font-weight: 500; }
.breadcrumb a:hover { color: var(--color-gray-900); text-decoration: underline; text-underline-offset: 2px; }
.breadcrumb .sep { margin: 0 8px; color: var(--color-gray-400); }

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  font-size: var(--text-sm);
  font-weight: 500;
  border: 2px solid transparent;
  border-radius: var(--radius);
  transition: background-color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
  font-family: inherit;
}
.btn:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 2px; }
.btn-sm { padding: 6px 12px; font-size: var(--text-xs); }
.btn-lg { padding: 12px 22px; font-size: var(--text-md); }

.btn-primary {
  background: var(--color-action);
  color: var(--color-action-text);
  border-color: var(--color-action);
}
.btn-primary:hover { background: var(--color-action-hover); border-color: var(--color-action-hover); }

.btn-secondary {
  background: white;
  color: var(--color-gray-900);
  border-color: var(--color-gray-300);
}
.btn-secondary:hover { background: var(--color-gray-50); }

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-outline:hover { background: var(--color-primary-light); }

.btn-ghost {
  background: transparent;
  color: var(--color-gray-600);
  border-color: transparent;
  padding: 6px 10px;
}
.btn-ghost:hover { background: var(--color-gray-100); color: var(--color-gray-900); }

.btn-destructive {
  background: var(--color-error);
  color: white;
  border-color: var(--color-error);
}

.icon { font-family: "Material Symbols Outlined"; font-weight: normal; font-style: normal; display: inline-block; line-height: 1; font-size: 18px; vertical-align: middle; font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 20; user-select: none; }

/* ─── Cards ─── */
.card {
  background: white;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.card-header {
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-gray-200);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
}
.card-header h3, .card-header h4 { margin: 0; }
.card-body { padding: var(--space-4); }
.card-footer {
  padding: var(--space-3) var(--space-4);
  background: var(--color-gray-50);
  border-top: 1px solid var(--color-gray-200);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-size: var(--text-sm);
  color: var(--color-gray-500);
}

/* ─── Stat pattern ─── */
.stat .stat-label { margin-bottom: var(--space-1); }
.stat .stat-value {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-gray-900);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.stat .stat-trend { font-size: var(--text-xs); color: var(--color-gray-600); margin-top: 2px; display: inline-flex; align-items: center; gap: 4px; }
.stat .stat-trend.up { color: var(--color-success); }
.stat .stat-trend.down { color: var(--color-error); }

/* ─── Badges ─── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.4;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

/* Stage badges — twelve canonical stages across four phases.
   White Glove uses a warm near-white fill and retains dark text + glove icon. Silver uses a cool light grey and retains dark text. */
.badge-stage { color: white; }
.badge-stage.yellow      { background: var(--color-stage-yellow); }
.badge-stage.purple      { background: var(--color-stage-purple); }
.badge-stage.blue        { background: var(--color-stage-blue); }
.badge-stage.black       { background: var(--color-stage-black); }
.badge-stage.pink        { background: var(--color-stage-pink); }
.badge-stage.red         { background: var(--color-stage-red); }
.badge-stage.green       { background: var(--color-stage-green); }
.badge-stage.gold        { background: var(--color-stage-gold); }
.badge-stage.white-glove { background: var(--color-stage-white-glove); color: var(--color-gray-900); }
.badge-stage.submission  { background: var(--color-stage-submission); }
.badge-stage.diamond     { background: var(--color-stage-diamond); }
.badge-stage.silver-stage { background: var(--color-stage-silver-stage); color: var(--color-gray-900); }

/* Lens badges — organisation-wide libraries that run alongside stages.
   Amber Lens (intelligence), Grey Lens (RIO), and Navy Lens (bid library) are
   not stages; they label continuous review activity that outlives any single bid. */
.badge-lens { color: white; }
.badge-lens.amber { background: var(--color-lens-amber); }
.badge-lens.grey  { background: var(--color-lens-grey); }
.badge-lens.navy  { background: var(--color-lens-navy); }

/* Status indicator — progress-bar style.
   Replaces the old tinted-pill pattern. Uppercase tracked label above a 3px progress
   bar. Fill percentage is explicit on the inner <span> style="width:X%". Sensible
   defaults per variant: success 100%, info 60%, warning 85%, error 100%, neutral 0%.

   Usage:
     <span class="status-progress success">
       <span class="label">Complete</span>
       <span class="bar"><span style="width:100%"></span></span>
     </span>
*/
.status-progress {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 96px;
  vertical-align: middle;
}
.status-progress .label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1;
  white-space: nowrap;
}
.status-progress .bar {
  display: block;
  width: 96px;
  height: 3px;
  background: var(--color-gray-200);
  border-radius: 2px;
  overflow: hidden;
}
.status-progress .bar > span {
  display: block;
  height: 100%;
  border-radius: 2px;
}
.status-progress.success .label      { color: var(--color-success); }
.status-progress.success .bar > span { background: var(--color-success); }
.status-progress.info    .label      { color: var(--color-primary); }
.status-progress.info    .bar > span { background: var(--color-primary); }
.status-progress.warning .label      { color: var(--color-warning); }
.status-progress.warning .bar > span { background: var(--color-warning); }
.status-progress.error   .label      { color: var(--color-error); }
.status-progress.error   .bar > span { background: var(--color-error); }
.status-progress.neutral .label      { color: var(--color-gray-500); }
.status-progress.neutral .bar > span { background: var(--color-gray-400); }

/* Tag */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 8px;
  background: var(--color-gray-100);
  color: var(--color-gray-700);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
}

/* Count */
.count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 18px; padding: 0 6px;
  background: var(--color-primary); color: white;
  font-size: 11px; font-weight: 700;
  border-radius: var(--radius-full);
}

/* ─── Tables ─── */
.tbl { width: 100%; border-collapse: collapse; background: white; }
.tbl thead th {
  text-align: left;
  padding: 10px 12px;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-gray-900);
  border-bottom: 2px solid var(--color-gray-900);
  background: white;
}
.tbl tbody td {
  padding: 12px;
  font-size: var(--text-sm);
  color: var(--color-gray-700);
  border-bottom: 1px solid var(--color-gray-200);
  vertical-align: middle;
}
.tbl tbody tr:hover td { background: var(--color-gray-50); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ─── Forms ─── */
.field { display: block; margin-bottom: var(--space-4); }
.field label { display: block; font-size: var(--text-sm); font-weight: 600; color: var(--color-gray-900); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 9px 12px;
  background: white;
  border: 2px solid var(--color-gray-300);
  border-radius: var(--radius);
  font-size: var(--text-base);
  color: var(--color-gray-900);
  font-family: inherit;
  transition: border-color 0.15s, outline-color 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 3px solid var(--color-primary);
  outline-offset: 0;
  border-color: var(--color-primary);
}
.field textarea { min-height: 96px; resize: vertical; }
.field .hint { font-size: var(--text-xs); color: var(--color-gray-500); margin-top: 4px; }
.field .err { font-size: var(--text-xs); color: var(--color-error); margin-top: 4px; }

/* ─── Alerts ─── */
.alert {
  display: flex; gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid;
  border-radius: var(--radius);
  font-size: var(--text-sm);
}
.alert .icon { margin-top: 1px; }
.alert-info    { background: var(--color-info-light);    border-left-color: var(--color-info);    color: var(--color-primary-dark); }
.alert-success { background: var(--color-success-light); border-left-color: var(--color-success); color: var(--color-success); }
.alert-warning { background: var(--color-warning-light); border-left-color: var(--color-warning); color: var(--color-warning); }
.alert-error   { background: var(--color-error-light);   border-left-color: var(--color-error);   color: var(--color-error); }

/* ─── Skipper AI surface ─── */
.skipper-panel {
  background: white;
  border: 1px solid var(--color-gray-200);
  border-left: 3px solid var(--color-brand-amber);
  border-radius: var(--radius);
  padding: var(--space-4);
}
.skipper-hdr {
  display: flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-sm); font-weight: 700;
  color: var(--color-gray-900);
  margin-bottom: var(--space-2);
}
.skipper-hdr .tag-skipper {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  background: var(--color-brand-amber); color: white;
  font-size: 12px; font-weight: 700;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
}
.skipper-panel .cite { font-size: var(--text-xs); color: var(--color-gray-500); }
.skipper-panel .cite a { color: var(--color-primary); }

/* ─── Pipeline / lifecycle visualisation ───
   Each stage is a card with a coloured marker + uppercase label + status line.
   Gold renders as a rectangle marker, matching the logo.
   Usage:
     <div class="pipeline">
       <div class="pipeline-stage yellow">
         <span class="stage-marker"></span>
         <span class="stage-name">Yellow</span>
         <span class="stage-status">Complete</span>
       </div>
       ... etc
       <div class="pipeline-stage gold">...</div>  // rectangle marker
     </div>
   Active stage: add .active — primary border + primary label text.
*/
.pipeline {
  display: flex; gap: var(--space-2);
  padding: var(--space-4);
  background: white;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-md);
}
.pipeline-stage {
  flex: 1;
  padding: var(--space-3) var(--space-2);
  background: var(--color-gray-50);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px;
  min-height: 96px;
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
}
.pipeline-stage .stage-marker {
  width: 18px; height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pipeline-stage.gold .stage-marker {
  width: 30px; height: 12px;
  border-radius: 2px;
}
.pipeline-stage .stage-name {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-gray-900);
  line-height: 1.2;
}
.pipeline-stage .stage-status {
  font-size: var(--text-xs);
  color: var(--color-gray-500);
  line-height: 1.2;
}
.pipeline-stage.yellow      .stage-marker { background: var(--color-stage-yellow); }
.pipeline-stage.purple      .stage-marker { background: var(--color-stage-purple); }
.pipeline-stage.blue        .stage-marker { background: var(--color-stage-blue); }
.pipeline-stage.black       .stage-marker { background: var(--color-stage-black); }
.pipeline-stage.pink        .stage-marker { background: var(--color-stage-pink); }
.pipeline-stage.red         .stage-marker { background: var(--color-stage-red); }
.pipeline-stage.green       .stage-marker { background: var(--color-stage-green); }
.pipeline-stage.gold        .stage-marker { background: var(--color-stage-gold); }
.pipeline-stage.white-glove .stage-marker { background: var(--color-stage-white-glove); border: 1px solid var(--color-gray-300); }
.pipeline-stage.submission  .stage-marker { background: var(--color-stage-submission); }
.pipeline-stage.diamond     .stage-marker { background: var(--color-stage-diamond); }
.pipeline-stage.silver-stage .stage-marker { background: var(--color-stage-silver-stage); border: 1px solid var(--color-gray-300); }
.pipeline-stage.upcoming { opacity: 0.75; }
.pipeline-stage.upcoming .stage-status { color: var(--color-gray-500); }
.pipeline-stage.active {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
}
.pipeline-stage.active .stage-name,
.pipeline-stage.active .stage-status { color: var(--color-primary); }

/* ─── Timeline ─── */
.timeline { display: flex; flex-direction: column; gap: var(--space-4); }
.timeline-item { display: grid; grid-template-columns: 16px 1fr auto; gap: var(--space-3); position: relative; }
.timeline-item::before {
  content: ""; position: absolute;
  top: 14px; left: 7px; width: 2px; bottom: -20px;
  background: var(--color-gray-200);
}
.timeline-item:last-child::before { display: none; }
.timeline-dot {
  width: 14px; height: 14px; border-radius: 50%;
  margin-top: 3px; background: var(--color-gray-400); z-index: 1;
  border: 2px solid white;
}
.timeline-dot.success { background: var(--color-success); }
.timeline-dot.primary { background: var(--color-primary); }
.timeline-item .time { font-size: var(--text-xs); color: var(--color-gray-500); white-space: nowrap; }
.timeline-item .content { font-size: var(--text-sm); color: var(--color-gray-700); }
.timeline-item .content strong { color: var(--color-gray-900); }

/* ─── Progress bar ─── */
.bar {
  height: 4px; background: var(--color-gray-200);
  border-radius: var(--radius-full); overflow: hidden;
}
.bar > span { display: block; height: 100%; background: var(--color-success); border-radius: var(--radius-full); }
.bar.warn > span { background: var(--color-warning); }
.bar.err  > span { background: var(--color-error); }

/* ─── Avatar ─── */
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--color-stage-purple); color: white;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: var(--text-xs); font-weight: 700;
}
.avatar.sm { width: 26px; height: 26px; }

/* ─── Score ring ─── */
.score-ring { width: 56px; height: 56px; position: relative; display: inline-block; }
.score-ring svg { transform: rotate(-90deg); }
.score-ring .lbl {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-md); font-weight: 700; color: var(--color-gray-900);
  font-variant-numeric: tabular-nums;
}

/* ─── Logo mark (compact) ───
   Six dots + gold bar, matching the standard lockup. Order is semantic: it is
   the lifecycle. Do not reorder. */
.mark-row { display: inline-flex; align-items: center; gap: 6px; }
.mark-row .dot { width: 10px; height: 10px; border-radius: 50%; }
.mark-row .bar { height: 10px; width: 15px; border-radius: 1px; background: var(--color-stage-gold); }
.mark-row .d1 { background: var(--color-stage-yellow); }
.mark-row .d2 { background: var(--color-stage-purple); }
.mark-row .d3 { background: var(--color-stage-blue); }
.mark-row .d4 { background: var(--color-stage-pink); }
.mark-row .d5 { background: var(--color-stage-green); }
.mark-row .d6 { background: var(--color-stage-red); }

/* ─── Utilities ─── */
.text-xs  { font-size: var(--text-xs); }
.text-sm  { font-size: var(--text-sm); }
.text-md  { font-size: var(--text-md); }
.text-lg  { font-size: var(--text-lg); }
.text-xl  { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.text-gray-500 { color: var(--color-gray-500); }
.text-gray-600 { color: var(--color-gray-600); }
.text-gray-900 { color: var(--color-gray-900); }
.text-primary { color: var(--color-primary); }
.mt-1 { margin-top: var(--space-1); } .mt-2 { margin-top: var(--space-2); } .mt-3 { margin-top: var(--space-3); } .mt-4 { margin-top: var(--space-4); } .mt-6 { margin-top: var(--space-6); } .mt-8 { margin-top: var(--space-8); }
.mb-1 { margin-bottom: var(--space-1); } .mb-2 { margin-bottom: var(--space-2); } .mb-3 { margin-bottom: var(--space-3); } .mb-4 { margin-bottom: var(--space-4); } .mb-6 { margin-bottom: var(--space-6); } .mb-8 { margin-bottom: var(--space-8); }
.p-4 { padding: var(--space-4); }
.gap-1 { gap: var(--space-1); } .gap-2 { gap: var(--space-2); } .gap-3 { gap: var(--space-3); } .gap-4 { gap: var(--space-4); } .gap-6 { gap: var(--space-6); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.tabular { font-variant-numeric: tabular-nums; }
.divider { height: 1px; background: var(--color-gray-200); margin: var(--space-6) 0; }
