/* ============================================================
   ADR AI Gateway — UI v2 "paper & ink"
   Design language ported from tryclico.com:
     cream paper sheet on lavender field, graph-paper substrate,
     2px black outlines, zero-blur offset shadows,
     Instrument Serif display / Instrument Sans UI / JetBrains Mono data.

   IMPORTANT: every class name and every --token consumed inline by
   dashboard.html / admin.html is preserved. Only the visual layer changed.
   ============================================================ */

/* ─── Self-hosted fonts (latin subset, woff2) ────── */
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/InstrumentSans-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/InstrumentSerif-400-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/InstrumentSerif-400.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/JetBrainsMono-400.woff2') format('woff2');
}

/* ─── Design Tokens ─────────────────────────────── */
:root {
  /* clico palette */
  --bg-page: #c8bff5;          /* lavender field */
  --bg-card: #f6f3ec;          /* cream paper */
  --highlight: #c1f04c;        /* lime */
  --brand-blue: #5b5bd6;
  --brand-orange: #f26b3a;

  /* legacy token names, remapped to the paper theme
     (kept because HTML references them inline) */
  --bg: #f6f3ec;
  --bg-subtle: #efebe0;
  --surface: #ffffff;
  --surface-hover: #faf8f2;
  --surface2: #efebe0;
  --border: #0a0a0a;
  --border-focus: #0a0a0a;
  --border-light: rgba(10, 10, 10, 0.12);

  --text: #0a0a0a;
  --text-secondary: #45454a;
  --text-muted: #5c5c62;

  --accent: #5b5bd6;
  --accent-hover: #4646c4;
  --accent-subtle: rgba(91, 91, 214, 0.14);
  --danger: #d13d1f;
  --danger-hover: #b8331a;
  --danger-subtle: rgba(242, 107, 58, 0.16);
  --success: #4a7c0f;
  --success-subtle: rgba(193, 240, 76, 0.4);
  --warning: #a86a00;
  --warning-subtle: rgba(245, 197, 24, 0.28);

  --radius: 6px;
  --radius-lg: 10px;
  --radius-xl: 14px;

  /* hard, unblurred offset shadows — the signature device */
  --shadow-sm: 2px 2px 0 var(--border);
  --shadow-md: 3px 3px 0 var(--border);
  --shadow-lg: 5px 5px 0 var(--border);
  --shadow-hard: 2px 2px 0 var(--border);
  --shadow-btn: 3px 3px 0 var(--border);
  --shadow-btn-hover: 5px 5px 0 var(--border);

  --mono: 'JetBrains Mono', 'SF Mono', Monaco, 'Fira Code', monospace;
  --serif: 'Instrument Serif', Georgia, serif;
  --font: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: 250ms cubic-bezier(0.34, 1.56, 0.64, 1);
  --grid-line: rgba(120, 100, 80, 0.1);
}

/* ─── Reset ─────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}
body {
  background: var(--bg-page);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
::selection { background: var(--highlight); color: var(--text); }

/* ─── Navbar ────────────────────────────────────── */
.navbar {
  background: var(--bg-card);
  border-bottom: 2px solid var(--border);
  padding: 0 max(22px, calc((100% - 1400px) / 2 + 22px));
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  /* graph-paper substrate on the chrome too */
  background-image:
    linear-gradient(90deg, var(--grid-line) 1px, transparent 0),
    linear-gradient(var(--grid-line) 1px, transparent 0);
  background-size: 24px 24px;
}
.navbar .brand {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 23px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 2px;   /* serif cap-height optical centering */
}
.navbar .brand img { align-self: center; }
.navbar .brand img {
  height: 24px;
  padding: 4px;
  background: var(--highlight);
  border: 2px solid var(--border);
  border-radius: 5px;
  box-shadow: var(--shadow-hard);
  box-sizing: content-box;
}
.navbar .nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 3px;   /* room for the hard offset shadows */
}
.navbar .nav-sep {
  width: 2px;
  height: 20px;
  background: var(--border-light);
  flex-shrink: 0;
}
.navbar .user-info {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  min-width: 0;
}
.navbar .user-info .badge { flex-shrink: 0; }
.navbar .user-info #userEmail {
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 280px;
}
.navbar .btn-logout {
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--text);
  padding: 7px 15px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font);
  transition: var(--transition);
}
.navbar .btn-logout:hover {
  background: var(--brand-orange);
  color: #fff;
  box-shadow: 4px 4px 0 var(--border);
  transform: translate(-2px, -2px);
}

/* ─── Layout ────────────────────────────────────── */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 34px 26px 48px;
  width: 100%;
  box-sizing: border-box;
}
.container-wide { max-width: 1600px; }
/* admin pages run wider — keep the navbar gutters aligned to that container */
body:has(.container-wide) .navbar { padding: 0 max(22px, calc((100% - 1600px) / 2 + 22px)); }

/* ─── Login Page ────────────────────────────────── */
.center-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
}
.login-card {
  position: relative;
  background-position: center top;
  text-align: center;
  padding: 46px 38px 44px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 18px;
  box-shadow: 6px 6px 0 var(--border);
  max-width: 440px;
  width: 100%;
  overflow: hidden;
  background-image:
    linear-gradient(90deg, var(--grid-line) 1px, transparent 0),
    linear-gradient(var(--grid-line) 1px, transparent 0);
  background-size: 24px 24px;
}
.login-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 190px;
  pointer-events: none;
  background: radial-gradient(65% 100% at 50% 0%,
    rgba(91, 91, 214, 0.13) 0%, transparent 74%);
}
.login-card > * { position: relative; }

.logo {
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 400;
  margin-bottom: 0;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.logo > :not(img) { display: inline-block; }
.logo img {
  height: 34px;
  padding: 5px;
  background: var(--highlight);
  border: 2px solid var(--border);
  border-radius: 7px;
  box-shadow: var(--shadow-hard);
  box-sizing: content-box;
}
.subtitle {
  color: var(--text-secondary);
  margin: 12px 0 28px;
  font-size: 14px;
  line-height: 1.55;
}
.btn-google {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--highlight);
  color: var(--text);
  padding: 14px 30px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-btn);
  font-weight: 700;
  font-size: 14px;
  font-family: var(--font);
  transition: var(--transition);
}
.btn-google:hover {
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-btn-hover);
  transform: translate(-2px, -2px);
}
.btn-google:active { box-shadow: 1px 1px 0 var(--border); transform: translate(1px, 1px); }

/* ─── Cards ─────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 4px 4px 0 var(--border);
  padding: 24px;
  margin-bottom: 22px;
  transition: var(--transition);
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 0 3px 14px 0;   /* 3px right = room for the button's offset shadow */
  border-bottom: 1px solid var(--border-light);
}
.card > *:last-child { margin-bottom: 0; }
.card-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

/* ─── Buttons ───────────────────────────────────── */
.btn {
  background: var(--highlight);
  color: var(--text);
  border: 2px solid var(--border);
  padding: 9px 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-btn);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
}
.btn:hover {
  background: var(--highlight);
  box-shadow: var(--shadow-btn-hover);
  transform: translate(-2px, -2px);
}
.btn:active { box-shadow: 1px 1px 0 var(--border); transform: translate(1px, 1px); }
.btn:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 3px; }

.btn + .btn { margin-left: 8px; }
/* action clusters inside table cells: uniform metrics so rows stay aligned */
td .btn-sm { min-width: 62px; justify-content: center; }
.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  box-shadow: var(--shadow-hard);
  white-space: nowrap;
}
.btn-sm:hover { box-shadow: 4px 4px 0 var(--border); }

.btn-danger { background: var(--brand-orange); color: var(--text); }
.btn-danger:hover { background: #e05427; color: var(--text); }

.btn-ghost { background: var(--surface); color: var(--text); }
.btn-ghost:hover { background: var(--bg-subtle); color: var(--text); }

/* ─── Inputs ────────────────────────────────────── */
input[type="text"], input[type="password"], input[type="number"],
input[type="email"], select, textarea {
  background: var(--bg-card);
  border: 2px solid var(--border);
  color: var(--text);
  padding: 11px 13px;
  border-radius: var(--radius);
  font-size: 13px;
  font-family: var(--mono);
  width: 100%;
  outline: none;
  transition: var(--transition);
}
input:focus, select:focus, textarea:focus {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--shadow-btn);
  transform: translate(-1px, -1px);
}
input::placeholder { color: var(--text-muted); }
input[type="checkbox"] {
  width: auto;
  accent-color: var(--brand-blue);
  transform: scale(1.15);
}
select {
  font-family: var(--font);
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text) 50%),
                    linear-gradient(135deg, var(--text) 50%, transparent 50%);
  background-position: calc(100% - 17px) calc(50% + 1px), calc(100% - 12px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

/* ─── Tables ────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
}
th {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: transparent;
  border-top: 2px solid var(--border);
  border-bottom: 2px solid var(--border);
  padding: 10px 14px;
}
/* the .table-wrap owns the radius — a radius here creates a visible seam */
td {
  font-size: 13px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--highlight); }
tbody tr:nth-child(even) { background: rgba(10, 10, 10, 0.022); }
tbody tr:nth-child(even):hover { background: var(--highlight); }

/* ─── Badges (feat-tag device) ───────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  padding: 3px 11px;
  border: 1.5px solid var(--border);
  border-radius: 99px;
  line-height: 1.5;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--surface);
  color: var(--text);
}
/* status pills in table cells share a width so the column reads as a stack */
td > .badge:only-child { min-width: 78px; justify-content: center; }
.badge-admin    { background: var(--accent-subtle); }
.badge-user     { background: var(--bg-subtle); }
.badge-active   { background: var(--highlight); }
.badge-inactive {
  background: repeating-linear-gradient(-45deg,
    var(--danger-subtle) 0 5px, rgba(255,255,255,0.75) 5px 10px);
}
.badge-premium  { background: #f5c518; }
.badge-free     { background: var(--bg-subtle); color: var(--text-secondary); }

.badge-provider {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  padding: 2px 9px;
  border: 1.5px solid var(--border);
  border-radius: 99px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--bg-subtle);
  color: var(--text);
}
.badge-provider-google    { background: rgba(66, 133, 244, 0.22); }
.badge-provider-openai    { background: rgba(16, 163, 127, 0.22); }
.badge-provider-anthropic { background: rgba(204, 130, 72, 0.26); }
.badge-provider-meta      { background: rgba(59, 130, 246, 0.22); }
.badge-provider-mistral   { background: rgba(255, 119, 0, 0.24); }
.badge-provider-deepseek  { background: rgba(99, 102, 241, 0.22); }

/* ─── Key Display ───────────────────────────────── */
.key-display {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--highlight);
  border: 2px solid var(--border);
  box-shadow: var(--shadow-hard);
  padding: 14px 16px;
  border-radius: var(--radius);
  word-break: break-all;
  margin: 14px 0;
  color: var(--text);
  font-weight: 500;
}
.key-warning {
  color: var(--danger);
  font-size: 12px;
  margin-top: 6px;
  font-weight: 700;
}

/* ─── Modals ────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(200, 191, 245, 0.9);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal {
  position: relative;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: 6px 6px 0 var(--border);
  padding: 30px;
  max-width: 480px;
  width: 100%;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  animation: modalIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  background-image:
    linear-gradient(90deg, var(--grid-line) 1px, transparent 0),
    linear-gradient(var(--grid-line) 1px, transparent 0);
  background-size: 24px 24px;
}
@keyframes modalIn {
  from { opacity: 0; transform: translate(6px, 10px); }
  to   { opacity: 1; transform: none; }
}
.modal h3 {
  font-family: var(--serif);
  margin-bottom: 22px;
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.12;
}
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  margin-bottom: 7px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--text-secondary);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}

/* ─── Toast ─────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--highlight);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-btn);
  padding: 13px 20px;
  z-index: 300;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  animation: slideIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 400px;
}
.toast.error   { background: var(--brand-orange); color: var(--text); }
.toast.success { background: var(--highlight); color: var(--text); }
@keyframes slideIn {
  from { transform: translate(8px, 12px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

/* ─── Tabs ──────────────────────────────────────── */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 22px;
}
.tab {
  position: relative;
  padding: 0 20px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  color: var(--text-secondary);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  font-weight: 700;
  font-size: 12.5px;
  transition: var(--transition);
}
.tab.active {
  color: var(--text);
  background: var(--highlight);
  box-shadow: 4px 4px 0 var(--border);
  transform: translate(-2px, -2px);
}
.tab:hover { color: var(--text); box-shadow: 4px 4px 0 var(--border); transform: translate(-2px, -2px); }

/* ─── Endpoint Box ──────────────────────────────── */
.endpoint-box {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  padding: 15px 18px;
  margin-top: 8px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
}
.endpoint-box .method { color: var(--success); font-weight: 700; }
.endpoint-box .url { color: var(--text); font-weight: 500; word-break: break-all; }

/* ─── Stats Grid ────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.stat-item {
  padding: 16px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  min-width: 0;
}
.stat-label {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.11em;
  margin-bottom: 5px;
}
.stat-value {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--brand-blue);
  font-variant-numeric: tabular-nums;
}
.stat-value-sm {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 6px;
  letter-spacing: 0.02em;
}

/* ─── Progress Bar (barber-pole) ─────────────────── */
.progress-track {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 99px;
  height: 10px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  border-radius: 99px;
  box-shadow: inset 0 0 0 1px rgba(10, 10, 10, 0.25);
  transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ─── Empty State ───────────────────────────────── */
.empty {
  text-align: center;
  padding: 44px 24px;
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ─── Copy Button ───────────────────────────────── */
.copy-btn {
  background: var(--highlight);
  border: 1.5px solid var(--border);
  color: var(--text);
  padding: 4px 11px;
  border-radius: 4px;
  box-shadow: 1.5px 1.5px 0 var(--border);
  cursor: pointer;
  font-size: 10.5px;
  font-weight: 700;
  font-family: var(--font);
  flex-shrink: 0;
  transition: var(--transition);
}
.copy-btn:hover {
  box-shadow: 3px 3px 0 var(--border);
  transform: translate(-1.5px, -1.5px);
}

/* ─── Tables / responsive wrappers ──────────────── */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: transparent;
}
.table-wrap table { min-width: 520px; width: 100%; }
.table-wrap table.users-table { min-width: 1100px; table-layout: auto; }
.table-wrap table.users-table th:last-child,
.table-wrap table.users-table td:last-child {
  white-space: nowrap;
  min-width: 280px;
}

/* ─── API Key cards ─────────────────────────────── */
.key-cards { display: flex; flex-direction: column; gap: 14px; }
.key-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  padding: 16px;
  transition: var(--transition);
}
.key-card:hover {
  box-shadow: 4px 4px 0 var(--border);
  transform: translate(-2px, -2px);
}
.key-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--border-light);
}
.key-card-info { min-width: 0; flex: 1; }
.key-card-name {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--text);
  font-size: 19px;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.key-card-prefix {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 5px;
  word-break: break-all;
  line-height: 1.45;
}
.key-card-top .btn { flex-shrink: 0; }
.key-card-meta { display: flex; flex-direction: column; gap: 8px; }
.key-card-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  line-height: 1.4;
}
.key-card-row .meta-label {
  font-family: var(--mono);
  color: var(--text-secondary);
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  flex-shrink: 0;
}
.key-card-row .meta-value {
  font-family: var(--mono);
  color: var(--text);
  font-size: 11.5px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  min-width: 0;
  word-break: break-word;
}

/* ─── Model list ────────────────────────────────── */
.model-list { display: flex; flex-direction: column; gap: 8px; }
.model-item {
  font-family: var(--mono);
  color: var(--text);
  font-weight: 500;
  font-size: 12.5px;
  padding: 11px 14px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  word-break: break-all;
  transition: var(--transition);
}
.model-item:hover {
  background: var(--highlight);
  box-shadow: var(--shadow-hard);
  transform: translate(-1.5px, -1.5px);
}

.usage-note {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ─── Accessibility ─────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ─── Responsive ────────────────────────────────── */
@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
  .container { padding: 18px 12px 34px; }
  .card { padding: 18px 16px; margin-bottom: 16px; }
  .card-header { gap: 10px; margin-bottom: 14px; padding-bottom: 12px; flex-wrap: wrap; }
  .card-title { font-size: 19px; }

  .navbar,
  body:has(.container-wide) .navbar {
    padding: 0 12px;
    height: auto;
    min-height: 56px;
    gap: 8px;
  }
  .navbar .brand { font-size: 17px; flex-shrink: 0; }
  .navbar .brand img { height: 20px; }
  .navbar .nav-right { gap: 8px; min-width: 0; flex: 1; justify-content: flex-end; }
  .navbar .nav-sep { display: none; }
  .navbar .user-info { display: none; }
  .navbar .btn-logout,
  .navbar .btn-sm { padding: 6px 11px; font-size: 11px; }

  .login-card { padding: 32px 22px; margin: 0; }
  .logo { font-size: 27px; }
  .logo img { height: 27px; }

  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stats-grid .stat-item:first-child { grid-column: 1 / -1; }
  .stat-item { padding: 13px; }
  .stat-value { font-size: 26px; }

  .endpoint-box {
    flex-direction: column;
    align-items: stretch;
    padding: 13px;
    gap: 10px;
  }
  .endpoint-box .url { word-break: break-all; font-size: 12px; line-height: 1.5; }
  .endpoint-box .copy-btn { align-self: flex-end; }

  .key-card-row { flex-direction: column; align-items: flex-start; gap: 2px; }
  .key-card-row .meta-value { text-align: left; }
  .key-card-name { font-size: 17px; }

  th, td { padding: 10px; font-size: 12px; }
  .table-wrap table { min-width: 480px; }

  .modal { padding: 22px 18px; border-radius: var(--radius-lg); }
  .modal h3 { font-size: 22px; margin-bottom: 18px; }
  .modal-actions { flex-wrap: wrap; margin-top: 20px; padding-top: 16px; }

  .tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 18px; gap: 7px; padding: 2px 3px 5px 0; }
  .tab { padding: 0 15px; height: 36px; white-space: nowrap; font-size: 11.5px; flex-shrink: 0; }

  .toast { left: 12px; right: 12px; bottom: 12px; max-width: none; }
  .key-display { font-size: 11.5px; padding: 12px; }
}

@media (max-width: 380px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-value { font-size: 21px; }
  .navbar .brand span { display: none; }
}

/* ─── Scrollbar ─────────────────────────────────── */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--bg-page); }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border: 3px solid var(--bg-page);
  border-radius: 99px;
}
