/* Buttons — base, accent (gradient), ghost, danger, small. */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  background: var(--panel-hi);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: border-color 0.16s, background 0.16s, transform 0.08s;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn:active[disabled] { transform: none; }

.btn.sm { padding: 4px 10px; font-size: 12px; }

.btn-accent {
  border: 0;
  background: linear-gradient(135deg, var(--gvia), var(--gfrom));
  color: var(--on-accent);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 34%, transparent);
}
.btn-accent:hover { filter: brightness(1.06); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--panel-hi); color: var(--text); border-color: transparent; }

.btn-danger { border-color: color-mix(in srgb, var(--err) 55%, transparent); color: var(--err); }
.btn-danger:hover { background: color-mix(in srgb, var(--err) 12%, transparent); border-color: var(--err); }

/* Toggle pill — the decision filters in the audit view. */
.tog {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 11px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.tog[aria-pressed="true"] { color: var(--text); border-color: var(--accent); }
/* Cards and stat tiles. */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.card-hd { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.card-title { font-weight: 650; }
.card-sub { color: var(--muted); font-size: 12px; }

/* Stat tile — the counters above the audit table. */
.stats { display: flex; gap: 10px; flex-wrap: wrap; }
.stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  min-width: 96px;
}
.stat-n { font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; }
.stat-k {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
/* Inputs, selects, checkboxes, field grouping. */

.input,
.select,
.textarea {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font: inherit;
  width: 100%;
}
.input:focus,
.select:focus,
.textarea:focus { outline: none; border-color: var(--accent); }
.input::placeholder { color: var(--muted); }
.input[disabled] { opacity: 0.55; cursor: not-allowed; }

.textarea { min-height: 92px; resize: vertical; font-family: var(--mono); font-size: 12px; }

.field { display: flex; flex-direction: column; gap: 5px; }
.label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; }
.hint { color: var(--muted); font-size: 12px; }
.error { color: var(--err); font-size: 12px; }

.filters { display: flex; gap: 10px; align-items: center; }
.filters .input { flex: 1; }

/* Search field with a leading affordance. */
.search { position: relative; flex: 1; }
.search .input { padding-left: 30px; }
.search::before {
  content: "";
  position: absolute;
  left: 10px; top: 50%;
  width: 10px; height: 10px;
  margin-top: -6px;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
  pointer-events: none;
}

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.switch input { accent-color: var(--accent); }
/* Small composable helpers. Deliberately few — a component belongs in
   components/, not in a pile of utility classes. */

.row { display: flex; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.spacer { flex: 1 1 auto; }
.wrap { flex-wrap: wrap; }

.mono { font-family: var(--mono); font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.break { word-break: break-word; }

.scroll-y { overflow-y: auto; }
.scroll-x { overflow-x: auto; }
.fill { flex: 1 1 auto; min-height: 0; } /* min-height:0 so a flex child may actually scroll */

.hidden { display: none !important; }

/* Screen-reader-only, still focusable. */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%);
  white-space: nowrap; border: 0;
}
