/* Shared styles for /keys, /history, /profile.
   Built against the locked design tokens — same vibe as dashboard. */

/* ─── form fields (used by keys label input, password change, filters) ─ */
.field-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 200px;
}
.field label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: .3px;
  text-transform: uppercase;
}
.field input,
.field select {
  background: var(--bg-inset);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-button);
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  transition: border-color .15s ease;
}
.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--gold);
}
.field input::placeholder { color: var(--text-faint); }

/* ─── data tables ─────────────────────────────────────────────────── */
.tbl {
  width: 100%;
  border-collapse: collapse;
}
.tbl thead th {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: .8px;
  text-transform: uppercase;
  text-align: left;
  padding: 0 0 12px;
  border-bottom: 0.5px solid var(--bg-inset);
}
.tbl tbody td {
  padding: 12px 0;
  border-bottom: 0.5px solid var(--bg-inset);
  font-size: 13px;
  color: var(--text-primary);
  vertical-align: middle;
}
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .mono { font-family: var(--font-mono); color: var(--text-secondary); font-size: 12.5px; }
.tbl .dim  { color: var(--text-tertiary); font-size: 12px; }
.tbl .revoked { color: var(--text-faint); text-decoration: line-through; }
.tbl-empty {
  text-align: center;
  padding: 30px 0;
  color: var(--text-tertiary);
  font-size: 13px;
}

/* small icon button (revoke, copy etc.) */
.icon-btn {
  background: transparent;
  border: 0.5px solid var(--border);
  border-radius: 6px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  transition: color .12s ease, border-color .12s ease;
}
.icon-btn:hover {
  color: var(--verdict-ai);
  border-color: var(--verdict-ai);
}
.icon-btn.copy:hover {
  color: var(--gold);
  border-color: var(--gold);
}

/* status pills */
.pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .4px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--bg-inset);
  color: var(--text-secondary);
}
.pill.ok   { color: var(--verdict-real); }
.pill.warn { color: var(--gold); }
.pill.bad  { color: var(--verdict-ai); }

/* ─── modal ───────────────────────────────────────────────────────── */
.modal-shade {
  position: fixed;
  inset: 0;
  background: rgba(10, 6, 16, 0.62);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 24px;
}
.modal-shade.is-open { display: flex; }
.modal-card {
  width: 100%;
  max-width: 540px;
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-card);
  padding: 26px 28px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, .45);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: .3px;
}
.modal-close {
  background: transparent;
  border: 0;
  color: var(--text-secondary);
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.modal-close:hover { color: var(--text-primary); }

.key-display {
  background: var(--bg-code);
  border: 0.5px solid var(--gold);
  border-radius: 8px;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--gold);
  word-break: break-all;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.key-display .key-text { flex: 1; min-width: 0; }
.key-warn {
  background: rgba(204, 125, 98, 0.12);
  border: 0.5px solid rgba(204, 125, 98, 0.4);
  color: var(--verdict-ai);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.5;
  margin-bottom: 16px;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ─── profile stat blocks ─────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}
.stat {
  background: var(--bg-inset);
  border-radius: 8px;
  padding: 14px 16px;
}
.stat .label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.stat .value {
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.1;
}
.stat .sub {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

.account-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.account-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 0.5px solid var(--bg-inset);
}
.account-row:last-child { border-bottom: none; }
.account-row .key {
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: .3px;
  text-transform: uppercase;
  font-weight: 600;
}
.account-row .val {
  font-size: 14px;
  color: var(--text-primary);
}
.account-row .val.mono {
  font-family: var(--font-mono);
  font-size: 13px;
}

/* small secondary action (e.g. change password, manage billing) */
.btn-secondary {
  background: transparent;
  color: var(--gold);
  font-family: inherit;
  font-weight: 600;
  border: 1px solid var(--border-dashed);
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 13px;
  display: inline-block;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .15s ease;
}
.btn-secondary:hover { border-color: var(--gold); }

/* error / success banners */
.banner {
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.5;
  display: none;
  margin-bottom: 14px;
}
.banner.is-visible { display: block; }
.banner.err {
  background: rgba(204, 125, 98, 0.12);
  border: 0.5px solid rgba(204, 125, 98, 0.45);
  color: var(--verdict-ai);
}
.banner.ok {
  background: rgba(147, 171, 120, 0.12);
  border: 0.5px solid rgba(147, 171, 120, 0.45);
  color: var(--verdict-real);
}

/* "load more" footer */
.load-more {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}
