/* ==========================================================================
   Indikator — consultant and admin shell

   This is a working tool: a recruiter has several candidates open, is
   comparing them, and is about to walk into an interview. Density and
   scanability beat spaciousness here — the opposite of the candidate flow.
   ========================================================================== */

.app-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Top bar -------------------------------------------------------------- */

.topbar {
  background: var(--paper-raised);
  border-bottom: 1px solid var(--mist);
}

.topbar__inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-5);
  min-height: 58px;
}

.topbar__org {
  font-size: var(--t-sm);
  color: var(--ink-faint);
  padding-left: var(--space-4);
  border-left: 1px solid var(--mist);
}

.topbar__spacer { flex: 1; }

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav a {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--ink-muted);
  text-decoration: none;
  white-space: nowrap;
}
.nav a:hover { background: var(--paper-sunk); color: var(--ink); }
.nav a[aria-current='page'] { color: var(--ink); background: var(--paper-sunk); font-weight: 600; }

.topbar__user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--t-sm);
  color: var(--ink-muted);
}

/* --- Page frame ----------------------------------------------------------- */

.app-main {
  flex: 1;
  padding: var(--space-6) 0 var(--space-8);
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-5);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}
.page-head h1 { font-size: var(--t-xl); }
.page-head .lede { margin-top: var(--space-2); }

.breadcrumb {
  font-size: var(--t-sm);
  color: var(--ink-faint);
  margin-bottom: var(--space-2);
}
.breadcrumb a { color: var(--ink-muted); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* --- Metric strip --------------------------------------------------------- */

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: var(--mist);
  border: 1px solid var(--mist);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.metric {
  background: var(--paper-raised);
  padding: var(--space-4);
}
.metric__value {
  font-family: var(--mono);
  font-size: var(--t-xl);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  color: var(--ink);
}
.metric__label {
  font-size: var(--t-xs);
  color: var(--ink-faint);
  margin-top: var(--space-1);
}

/* --- Two-column detail layout --------------------------------------------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: var(--space-6);
  align-items: start;
}

/* --- Requirement-profile editor -------------------------------------------
   Twelve rows, each a 1–10 track with a draggable target range. The editor and
   the report use the same track geometry so a recruiter reads one picture.
   -------------------------------------------------------------------------- */

.kravprofil { display: grid; gap: 1px; background: var(--mist); }

.kp-row {
  display: grid;
  grid-template-columns: 190px 1fr 92px;
  gap: var(--space-4);
  align-items: center;
  background: var(--paper-raised);
  padding: var(--space-2) var(--space-4);
}

.kp-row__name { font-size: var(--t-sm); font-weight: 500; }
.kp-row__code {
  font-family: var(--mono);
  font-size: var(--t-xs);
  color: var(--ink-faint);
  margin-right: 0.5em;
}

.kp-track {
  position: relative;
  height: 30px;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  align-items: center;
}
.kp-track__cell {
  height: 22px;
  border-right: 1px solid var(--mist);
  background: var(--paper);
}
.kp-track__cell:last-child { border-right: 0; }
/* Sten 4–7 is the middle of the normal distribution: most people land here. */
.kp-track__cell[data-band='mid'] { background: var(--sand); }
.kp-track__cell[data-in='1'] { background: var(--petrol); }

.kp-weight { display: flex; justify-content: flex-end; }

.kp-scale {
  display: grid;
  grid-template-columns: 190px 1fr 92px;
  gap: var(--space-4);
  padding: 0 var(--space-4) var(--space-2);
}
.kp-scale__numbers {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  font-family: var(--mono);
  font-size: var(--t-xs);
  color: var(--ink-faint);
  text-align: center;
}

/* --- Candidate list rows -------------------------------------------------- */

.match {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--mono);
  font-size: var(--t-sm);
  font-variant-numeric: tabular-nums;
}
.match__bar {
  width: 54px;
  height: 6px;
  background: var(--mist);
  border-radius: 3px;
  overflow: hidden;
}
.match__fill { height: 100%; background: var(--petrol); }
.match__fill[data-low='1'] { background: var(--clay); }

/* --- Comparison ----------------------------------------------------------- */

.compare-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  font-size: var(--t-sm);
  margin-bottom: var(--space-4);
}
.compare-legend__item { display: flex; align-items: center; gap: var(--space-2); }
.compare-legend__swatch { width: 14px; height: 3px; border-radius: 2px; }

/* --- Login ---------------------------------------------------------------- */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
}
.auth-card {
  width: 100%;
  max-width: 400px;
}
.auth-card h1 {
  font-size: var(--t-xl);
  margin-bottom: var(--space-2);
}

/* --- Responsive ----------------------------------------------------------- */

@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .kp-row, .kp-scale { grid-template-columns: 140px 1fr 72px; gap: var(--space-3); }
}

@media (max-width: 700px) {
  .topbar__inner { flex-wrap: wrap; padding: var(--space-3) var(--space-4); min-height: 0; }
  .topbar__org { padding-left: 0; border-left: 0; width: 100%; }
  .nav { order: 3; width: 100%; overflow-x: auto; padding-bottom: var(--space-1); }
  .topbar__spacer { display: none; }
  .kp-row, .kp-scale { grid-template-columns: 1fr; gap: var(--space-2); }
  .kp-weight { justify-content: flex-start; }
}
