/* ==========================================================================
   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; }

/* Product switcher — only rendered when the person can open more than one tool
   in this organisation (or has more than one organisation). */
.product-switcher {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
  margin-left: var(--space-2);
}

.product-switcher__pills {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border-radius: 999px;
  background: var(--paper-sunk);
  border: 1px solid var(--mist);
  gap: 0;
}

.product-switcher__item {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  border-radius: 999px;
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--ink-muted);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}

a.product-switcher__item:hover {
  color: var(--ink);
  background: var(--paper-raised);
}

.product-switcher__item[aria-current='true'] {
  color: var(--ink);
  background: var(--paper-raised);
  font-weight: 600;
  box-shadow: 0 0 0 1px var(--mist);
}

.product-switcher__item--blocked {
  color: var(--ink-faint);
  cursor: not-allowed;
}

.product-switcher__more {
  font-size: var(--t-sm);
  color: var(--ink-faint);
  text-decoration: none;
  white-space: nowrap;
}
.product-switcher__more:hover {
  color: var(--ink-muted);
  text-decoration: underline;
}

.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,
.split-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); }
.split-head { margin-bottom: 0; align-items: center; }

.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;
}
/* --- Off-screen but readable ----------------------------------------------
   For a label a screen reader needs and a sighted reader does not, because the
   surrounding row already says what the field is. The clip-path pair is what
   keeps it out of the layout without hiding it from assistive technology —
   display:none would remove it from both. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* The three parts are spans, so without this they set on one line and the
   margin-top below is silently ignored — which is how the overview ended up
   reading "2 organisationer 0 lukkede" as running text. */
.metric {
  display: flex;
  flex-direction: column;
  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);
  text-decoration: none;
}
a.metric__value:hover { text-decoration: underline; }
.metric__label {
  font-size: var(--t-xs);
  color: var(--ink-faint);
  margin-top: var(--space-1);
}
/* The window the number covers. Quieter than the label, because it qualifies it
   rather than naming it — but present on every metric, since one marked figure
   among unmarked ones is still ambiguous. */
.metric__hint {
  font-size: var(--t-xs);
  color: var(--ink-faint);
  opacity: 0.7;
}

/* --- 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(--brand); }

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

/* Compact sten selects. Inline padding used to wipe padding-right, so the
   custom chevron sat on top of the digit. */
.select--sten {
  width: auto;
  min-width: 3.5rem;
  min-height: 32px;
  padding: 0.15rem 1.55rem 0.15rem 0.5rem;
  background-position: right 0.4rem center;
  background-size: 10px 6px;
}

.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(--brand); }
.match__fill[data-low='1'] { background: var(--alert); }

/* --- 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%; }
  .product-switcher { order: 2; }
  .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; }
}

/* --------------------------------------------------------------------------
   Acting as a customer

   Loud on purpose. A platform administrator looking at a customer's account
   should never be able to forget it, and a screenshot taken during support
   should show plainly whose account it was. Alert red, because that is the only
   colour in this system that means "look here".
   -------------------------------------------------------------------------- */

.acting {
  background: var(--alert);
  color: var(--paper);
  font-size: var(--t-sm);
}
.acting__inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: var(--space-3) var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.acting__label {
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid rgba(247, 246, 242, 0.45);
  padding: 0.15em 0.55em;
  flex: none;
}
.acting__exit {
  margin-left: auto;
  color: var(--paper);
  font-weight: 600;
  text-decoration-thickness: 2px;
}
.acting__exit:hover { color: var(--paper); }

/* A twelve-month sparkline. CSS bars rather than a chart: one number per month
   needs no axis, and an axis would imply a precision a monthly count does not
   have. */
.spark { display: flex; align-items: flex-end; gap: 4px; height: 90px; }
.spark__col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end;
              align-items: center; height: 100%; gap: 4px; }
.spark__bar { width: 100%; background: var(--brand); border-radius: 1px 1px 0 0; min-height: 3px; }
.spark__label { font-family: var(--mono); font-size: 9px; color: var(--ink-faint); }

/* --- Tabs -----------------------------------------------------------------
   For the four screens that make up one customer. They used not to link to each
   other at all, and two of them carried the same <h1> — so the heading says
   whose account this is and the strip says which part of it. */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  border-bottom: 1px solid var(--mist);
  margin-bottom: var(--space-6);
}
.tabs__tab {
  padding: var(--space-2) 0;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--ink-faint);
  text-decoration: none;
  font-size: var(--t-sm);
}
.tabs__tab:hover { color: var(--ink); }
.tabs__tab[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--brand);
  font-weight: 500;
}

/* ==========================================================================
   Platform admin shell

   Same tokens as the rest of the product, but denser and ops-first. Scoped
   under .admin-body so the consultant UI is untouched. The home is an inbox
   of work, not a wall of equal-weight metric tiles.
   ========================================================================== */

.admin-body .topbar {
  border-bottom-color: var(--mist-strong);
}

.admin-body .topbar__inner {
  max-width: 1400px;
  flex-wrap: wrap;
  row-gap: var(--space-2);
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
}

.admin-body .topbar__org {
  display: none; /* wordmark already says Admin */
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
  flex: 1;
}

.admin-nav__primary,
.admin-nav__secondary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
}

.admin-nav__primary a,
.admin-nav__secondary a {
  padding: var(--space-1) 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;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.admin-nav__primary a:hover,
.admin-nav__secondary a:hover {
  background: var(--paper-sunk);
  color: var(--ink);
}

.admin-nav__primary a[aria-current='page'] {
  color: var(--ink);
  background: var(--paper-sunk);
  font-weight: 600;
}

.admin-nav__secondary a {
  font-weight: 400;
  font-size: var(--t-xs);
  color: var(--ink-faint);
}

.admin-nav__secondary a[aria-current='page'] {
  color: var(--ink-muted);
  font-weight: 600;
}

.admin-nav__sep {
  width: 1px;
  height: 14px;
  background: var(--mist);
  margin: 0 var(--space-2);
  flex: none;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25em;
  height: 1.25em;
  padding: 0 0.35em;
  border-radius: 999px;
  background: var(--alert-wash);
  color: var(--alert);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* --- Ops inbox ------------------------------------------------------------ */

.attention {
  border: 1px solid var(--mist);
  border-radius: var(--radius-lg);
  background: var(--paper-raised);
  overflow: hidden;
}

.attention__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--mist);
}

.attention__head h2 {
  font-size: var(--t-lg);
  margin: 0;
}

.attention__count {
  font-size: var(--t-sm);
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.attention__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.attention__item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-3) var(--space-4);
  align-items: start;
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--mist);
  text-decoration: none;
  color: inherit;
}

a.attention__item:hover {
  background: var(--paper-sunk);
}

.attention__item:first-child {
  border-top: 0;
}

.attention__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 0.45em;
  background: var(--ink-faint);
  flex: none;
}

.attention__item--block .attention__dot,
.attention__item--warn .attention__dot {
  background: var(--alert);
}

.attention__kind {
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 var(--space-1);
}

.attention__item--block .attention__kind,
.attention__item--warn .attention__kind {
  color: var(--alert);
}

.attention__title {
  margin: 0;
  font-size: var(--t-base);
  font-weight: 500;
  color: var(--ink);
}

.attention__detail {
  margin: var(--space-1) 0 0;
  font-size: var(--t-sm);
  color: var(--ink-muted);
}

.attention__meta {
  font-family: var(--mono);
  font-size: var(--t-xs);
  color: var(--ink-faint);
  white-space: nowrap;
  padding-top: 0.2em;
}

.attention__empty {
  padding: var(--space-6) var(--space-5);
  text-align: center;
}

.attention__empty p {
  margin: 0;
  color: var(--ink-muted);
}

.attention__empty .attention__calm {
  font-family: var(--display);
  font-size: var(--t-lg);
  color: var(--ink);
  margin-bottom: var(--space-2);
}

/* Quiet platform numbers under the inbox — not the hero of the page. */
.admin-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  font-size: var(--t-sm);
  color: var(--ink-muted);
}

.admin-stats a {
  color: var(--ink-muted);
  text-decoration: none;
}

.admin-stats a:hover {
  color: var(--brand);
  text-decoration: underline;
}

.admin-stats__value {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--ink);
  margin-right: 0.25em;
}

.admin-stats__zero .admin-stats__value {
  color: var(--ink-faint);
  font-weight: 400;
}

/* Customers with setup problems on the home */
.admin-problem-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--mist);
  border-radius: var(--radius-lg);
  background: var(--paper-raised);
  overflow: hidden;
}

.admin-problem-list li {
  border-top: 1px solid var(--mist);
}

.admin-problem-list li:first-child {
  border-top: 0;
}

.admin-problem-list a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-5);
  text-decoration: none;
  color: inherit;
}

.admin-problem-list a:hover {
  background: var(--paper-sunk);
}

.admin-problem-list__name {
  font-weight: 500;
  color: var(--ink);
}

.admin-problem-list__what {
  font-size: var(--t-sm);
  color: var(--ink-muted);
  text-align: right;
}

/* Dense action column on list tables */
.table .row-actions {
  white-space: nowrap;
  text-align: right;
}

.table .row-actions a + a::before {
  content: '·';
  margin: 0 0.35em;
  color: var(--ink-faint);
}

/* User detail action stacks stay tidy */
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

@media (max-width: 700px) {
  .attention__item {
    grid-template-columns: auto 1fr;
  }
  .attention__meta {
    grid-column: 2;
    padding-top: 0;
  }
  .admin-problem-list a {
    flex-direction: column;
    align-items: flex-start;
  }
  .admin-problem-list__what {
    text-align: left;
  }
}
