/* Components in the Zeus look, for the macros in templates/_ui.html. Tokens: /static/ds/tokens.css.
   Cards are flat (hairline border, 10px radius, no shadow); controls are 8px; hover on rows and
   cards is a 1px inset ring, never a lift. */

/* ---- Icon (Lucide sprite /static/ds/icons.svg: geometry only; the stroke is set here) ---- */
.icon {
  display: inline-block;
  flex-shrink: 0;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---- Brand mark: typographic "A" tile + "Appraisal" ---- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: var(--weight-emphasis) var(--text-row)/1 var(--font-sans);
  color: var(--text-brand);
  text-decoration: none;
}
.brand-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-card);
  background: var(--brand-mark-bg);
  color: var(--ink-inverse);
  font: var(--weight-heading) var(--text-row)/1 var(--font-sans);
}

/* ---- Button: primary · secondary; md 36 · sm 32 · slim 30 ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: var(--control-h-band);
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: var(--radius-button);
  font: var(--weight-emphasis) var(--text-row)/1 var(--font-sans);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--duration-tint) var(--ease), border-color var(--duration-tint) var(--ease);
}
.btn-primary { background: var(--action-primary); border-color: var(--action-primary); color: var(--action-primary-ink); }
.btn-primary:hover { background: var(--action-primary-hover); border-color: var(--action-primary-hover); color: var(--action-primary-ink); }
.btn-secondary {
  background: var(--action-secondary-bg);
  border-color: var(--line-control);
  color: var(--action-secondary-ink);
  font-weight: var(--weight-control);
}
.btn-secondary:hover { background: var(--action-secondary-hover-bg); color: var(--action-secondary-ink); }
/* Quiet: transparent, brand ink (kit Button variant="quiet"), for a link-like action in a row. */
.btn-quiet { background: transparent; border-color: transparent; color: var(--ink-brand); }
.btn-quiet:hover { background: var(--accent-tint); color: var(--ink-brand); }
.btn-sm { height: var(--control-h-axis); }
.btn-slim { height: var(--control-h-slim); padding: 0 11px; font-size: var(--text-body); }
.btn-block { display: flex; width: 100%; }
.btn:disabled,
.btn:disabled:hover {
  background: var(--surface-track);
  border-color: var(--line-subtle);
  color: var(--ink-disabled);
  cursor: not-allowed;
}

/* ---- Badge: a dot plus a word, never colour alone ---- */
.badge {
  --tone-fill: var(--tone-info-fill);
  --tone-ink: var(--tone-info-ink);
  --tone-border: var(--tone-info-border);
  --tone-dot: var(--tone-info-dot);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border: 1px solid var(--tone-border);
  border-radius: var(--radius-pill);
  background: var(--tone-fill);
  color: var(--tone-ink);
  font: var(--weight-emphasis) var(--text-meta)/var(--leading-meta) var(--font-sans);
  white-space: nowrap;
  vertical-align: middle;
}
.badge::before {
  content: "";
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: var(--radius-pill);
  background: var(--tone-dot);
}
.badge-sm { gap: 5px; padding: 1px 7px; }
.badge-sm::before { width: 6px; height: 6px; }
.badge-neutral {
  --tone-fill: var(--tone-neutral-fill);
  --tone-ink: var(--tone-neutral-ink);
  --tone-border: var(--line-subtle);
  --tone-dot: var(--tone-neutral-dot);
}
.badge-danger,
.badge-critical {
  --tone-fill: var(--tone-critical-fill);
  --tone-ink: var(--tone-critical-ink);
  --tone-border: var(--tone-critical-border);
  --tone-dot: var(--tone-critical-dot);
}
.badge-success {
  --tone-fill: var(--tone-success-fill);
  --tone-ink: var(--tone-success-ink);
  --tone-border: var(--tone-success-border);
  --tone-dot: var(--tone-success-dot);
}
.badge-warning {
  --tone-fill: var(--tone-warning-fill);
  --tone-ink: var(--tone-warning-ink);
  --tone-border: var(--tone-warning-border);
  --tone-dot: var(--tone-warning-dot);
}
.badges { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---- Alert: the inline banner ---- */
.alert {
  padding: 8px 12px;
  border: 1px solid;
  border-radius: var(--radius-card);
  font: var(--weight-body) var(--text-row)/var(--leading-body-lg) var(--font-sans);
}
.alert-danger { background: var(--tone-critical-fill); border-color: var(--tone-critical-border); color: var(--tone-critical-ink); }
.alert-warning { background: var(--tone-warning-fill); border-color: var(--tone-warning-border); color: var(--tone-warning-ink); }

/* ---- Card: flat, never a shadow ---- */
.card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-card);
}
.card-flush { overflow: hidden; }
.card-header { padding: var(--card-header-padding); border-bottom: 1px solid var(--line-faint); }
.card-title { font: var(--weight-heading) var(--text-row)/var(--leading-body-lg) var(--font-sans); }
.card-desc { margin-top: 2px; color: var(--ink-muted); }
.card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 13px;
  font-size: var(--text-body-lg);
  line-height: var(--leading-body-lg);
}
.card-flush .card-body { display: block; padding: 0; }

/* ---- Layout helpers ---- */
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-lg { gap: 16px; }
.page-narrow { max-width: 640px; }
.page-medium { max-width: 960px; }
.page-wide { max-width: 1400px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.actions form { margin: 0; }

/* ---- Field and controls (30px, 8px radius, line-control border) ---- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-label {
  font: var(--type-eyebrow);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--ink-muted);
}
.field-help { font: var(--weight-body) var(--text-meta)/16px var(--font-sans); color: var(--ink-muted); }
.field-error { font: var(--weight-control) var(--text-meta)/16px var(--font-sans); color: var(--tone-critical-ink); }
.control {
  width: 100%;
  height: var(--control-h-slim);
  padding: 6px 11px;
  border: 1px solid var(--line-control);
  border-radius: var(--radius-button);
  background: var(--surface);
  color: var(--ink-primary);
  font: var(--weight-body) var(--text-body)/16px var(--font-sans);
  transition: border-color var(--duration-tint) var(--ease);
}
.control::placeholder { color: var(--ink-muted); opacity: 1; }
.control-mono { font-family: var(--font-mono); }
.control-inline { width: auto; }
.control[aria-invalid="true"] { border-color: var(--tone-critical-dot); }
.control-select {
  width: auto;
  min-width: 120px;
  padding-right: 28px;
  appearance: none;
  background-image: var(--control-select-arrow);
  background-repeat: no-repeat;
  background-position: right 8px center;
  cursor: pointer;
}
input[type="checkbox"] { width: 14px; height: 14px; margin: 0; accent-color: var(--action-primary); cursor: pointer; vertical-align: middle; }

/* ---- Table: uppercase eyebrow heads, numeric / mono columns, row hover ring ---- */
/* position: relative keeps absolutely positioned descendants (visually hidden header text) inside
   the scroller; without it they widen the whole page on narrow screens. */
.table-wrap { position: relative; max-width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; text-align: left; font-size: var(--text-body); line-height: 1.5; }
.table caption { padding: 8px 12px; caption-side: top; text-align: left; color: var(--ink-muted); }
.table th {
  padding: 10px 12px;
  font: var(--type-eyebrow);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--ink-muted);
  white-space: nowrap;
  vertical-align: bottom;
}
.table td { padding: 10px 12px; border-top: 1px solid var(--line-subtle); vertical-align: middle; }
.table tbody tr:hover { outline: 1px solid var(--line-hover); outline-offset: -1px; }
/* Banded rows (owner, 2026-11-05), as the React Table; a group row keeps its own fill. */
.table tbody tr:nth-child(even) { background: var(--surface-band); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .center { text-align: center; }
.table form { margin: 0; }
.table .actions { flex-wrap: nowrap; }
.table tr.group-row td { background: var(--surface-sunken); }
.table td.sub-cell { padding-left: 32px; }
.counts { display: flex; flex-wrap: wrap; gap: 2px 12px; margin: 0; padding: 0; list-style: none; font-variant-numeric: tabular-nums; }

/* ---- Empty state: glyph, what is empty, what to do next ---- */
.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 24px 16px; text-align: center; }
.empty-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  background: var(--surface-track);
  color: var(--ink-muted);
}
.empty-title { font-weight: var(--weight-emphasis); color: var(--ink-primary); }
.empty-body { max-width: 30rem; color: var(--ink-muted); }

/* ---- Stat tiles (Zeus StatTile): eyebrow label over a 17px tabular figure ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 12px; }
.stat { padding: 11px 13px; border: 1px solid var(--line-subtle); border-radius: var(--radius-card); }
.stat-value { margin-top: 4px; font: var(--type-figure); font-variant-numeric: tabular-nums; }
