﻿/* kc-v2 v1.5.7 -- badges & status */
/* Full class contract and conventions: see README.md and kc-v2-base.css. */

/* ---------------------------------------------------------------------------
 * Badges & Status
 * ------------------------------------------------------------------------- */

.kc-v2-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 13px;
  border-radius: var(--kc-v2-radius-pill);
  font-family: var(--kc-v2-font-family);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 15px;
  /* A tag is a single label and must never break: in a narrow table cell "Gross" was rendering as
     "Gros" over "s". A pill split across two lines stops reading as a pill at all. If the column is
     too tight the table scrolls -- that is what the wrapper is for. */
  white-space: nowrap;
}

/* Category tags are an open-ended, page-assigned palette (a page picks
   whichever color fits its own category names) -- named by color, not by the
   department names Figma happens to show. */
.kc-v2-tag--blue    { background-color: var(--kc-v2-blue-tint); color: var(--kc-v2-blue); }
.kc-v2-tag--green   { background-color: #E7F6EE; color: var(--kc-v2-success-icon); }
.kc-v2-tag--teal    { background-color: #EAF3F4; color: var(--kc-v2-teal); }
.kc-v2-tag--indigo  { background-color: #ECEDF7; color: var(--kc-v2-indigo); }
.kc-v2-tag--olive   { background-color: #F0F4E8; color: #5C7A12; }
/* Muted: a tag whose value is "none"/"not applicable". Reads as absent rather than as another
   category, which the coloured variants above would imply. */
.kc-v2-tag--muted   { background-color: var(--kc-v2-ink-100); color: var(--kc-v2-ink-500); }

/* Small: a tag beside a value in a dense table row, where the full-size pill is taller than the
   compact inputs around it (KENT-115). */
.kc-v2-tag--sm {
  padding: 3px 8px;
  font-size: 11px;
  line-height: 13px;
}

/* Interactive tag (KENT-44 1.2.0).
 *
 * A tag that is also the control that opens something -- the annual return's Fee Type cell, where
 * "Gross" and "Net" open the matching schedule dialog while "None" is inert.
 *
 * `button.kc-v2-tag` rather than a --clickable modifier: the affordance has to be a real <button>
 * for keyboard and screen-reader users, and element-qualifying means the reset below cannot
 * accidentally apply to the <span> form. The host ships bare `button` styling (bootstrap) and
 * site.css sizes buttons, so appearance/border/margin are all restated -- a tag must look identical
 * whether it is a span or a button.
 *
 * Inherits its colour from whichever --variant is also applied, so it needs no per-variant
 * interactive rules. */
 * SETS NO COLOURS. This rule is (0,1,1) and every --variant is (0,1,0), so anything declared here
 * outranks all of them: an earlier version set background-color/color and every tag rendered
 * ink-100 regardless of variant, measured identical across Gross/Net/None. An element-qualified
 * base must restrict itself to properties no modifier owns -- resets -- or it silently defeats its
 * own modifiers. (Same trap as .kc-v2-table__cell--total, hit twice in KENT-44; see the contract
 * note in kc-v2-base.css.) */
button.kc-v2-tag {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  font: inherit;
  font-family: var(--kc-v2-font-family);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 15px;
}
button.kc-v2-tag:hover {
  /* Darkens whatever the variant set, rather than naming a hover colour per variant. */
  filter: brightness(95%);
  border-color: currentColor;
}
button.kc-v2-tag:focus-visible {
  outline: var(--kc-v2-focus-ring-width) solid var(--kc-v2-focus-ring-color);
  outline-offset: 2px;
}
/* Not every tag value is actionable: "None" has no schedule to open. Disabled rather than swapped
   for a span, so the column keeps one consistent element and Knockout needs no conditional markup. */
button.kc-v2-tag:disabled {
  cursor: default;
  filter: none;
  border-color: transparent;
}
/* Chevron on an actionable tag (KENT-44 1.3.0).
 *
 * "Gross" and "Net" open the matching schedule dialog, but a coloured pill on its own did not read
 * as something to click -- it looked like the status pills used elsewhere in the same table. The
 * chevron is the affordance that separates the two.
 *
 * Sized below the 12.5px label rather than matching it: the icon is a hint, not a second glyph
 * competing with the word. The tag is already inline-flex with align-items: center, so no
 * alignment work is needed here. Only the actionable values render one -- see the visible binding
 * in _AnnualEarnings.cshtml. */
button.kc-v2-tag > svg {
  width: 11px;
  height: 11px;
  margin-left: 5px;
  /* The pill must not squeeze the icon when the column is tight; white-space: nowrap on .kc-v2-tag
     keeps the label whole, and this keeps the chevron whole with it. */
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
}

button.kc-v2-tag:disabled:hover {
  filter: none;
  border-color: transparent;
}

.kc-v2-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: var(--kc-v2-radius-pill);
  font-family: var(--kc-v2-font-family);
  font-size: 13px;
  font-weight: 600;
  line-height: 18px; /* declared, not inherited -- see .kc-v2-counter note below */
}
.kc-v2-status-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: currentColor;
}

/* Status is a fixed, known vocabulary (unlike category tags above), so these
   are named for what they mean, not just their color. */
.kc-v2-status-pill--open     { background-color: var(--kc-v2-success-bg); color: var(--kc-v2-success-icon); }
.kc-v2-status-pill--pending  { background-color: var(--kc-v2-warning-bg); color: var(--kc-v2-warning-icon); }
.kc-v2-status-pill--closed   { background-color: #FDF0EE; color: var(--kc-v2-error-text); }
.kc-v2-status-pill--archived { background-color: var(--kc-v2-ink-100); color: var(--kc-v2-ink-500); }

@media (forced-colors: active) {
  /* The dot is drawn with background-color, which forced-colors mode can
     strip like any other background-color (the same issue the checkbox/radio
     fill has). A border-based fallback survives regardless of whether the
     background is honored. */
  .kc-v2-status-pill::before {
    background-color: transparent;
    border: 2px solid currentColor;
    box-sizing: border-box;
  }
}

/* line-height is declared rather than left at `normal`: these are inline-flex pills whose height
   is padding + line box, so an inherited body line-height (17.1px under site.css, 20px under
   Bootstrap) silently changed their size per host. KENT-44 audit. */
.kc-v2-counter {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: var(--kc-v2-radius-pill);
  font-family: var(--kc-v2-font-family);
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
  color: var(--kc-v2-white);
}
.kc-v2-counter--blue  { background-color: var(--kc-v2-blue); }
.kc-v2-counter--green { background-color: var(--kc-v2-green); }
.kc-v2-counter--error {
  background-color: var(--kc-v2-error);
  padding: 0 7px; /* tighter horizontal padding for a single numeric digit, per Figma */
}
.kc-v2-counter--gov {
  background-color: var(--kc-v2-ink-900);
  border-radius: 6px; /* off-scale, matching Figma exactly rather than the
                          nearest token (radius-sm is 8px) */
  font-size: 11px;
}

@media (forced-colors: active) {
  .kc-v2-tag {
    border: 1px solid CanvasText;
  }
}

@media print {
  .kc-v2-tag,
  .kc-v2-status-pill,
  .kc-v2-counter {
    border: 1px solid currentColor;
  }
}
