/*
 * ДИЗАЙН-ТОКЕНЫ скопированы из web-chat/design/tokens.css (репозиторий web-chat).
 * Источник: https://github.com/.../web-chat/blob/main/design/tokens.css — единственный источник
 * правды по цветам, радиусам, теням и шрифтам контура. Шрифты системные (внешних загрузок нет).
 */

:root {
  /* ─────────────── ШКАЛЫ ─────────────── */
  --yellow-50: #fffcf0;
  --yellow-100: #fff5d1;
  --yellow-200: #ffe9a3;
  --yellow-300: #ffdb6e;
  --yellow-400: #ffcd3c;
  --yellow-500: #f7b916;
  --yellow-600: #d99a06;
  --yellow-700: #a86f00;
  --yellow-800: #7d5305;
  --yellow-900: #573a08;
  --yellow-950: #33230a;
  --neutral-0: #ffffff;
  --neutral-50: #faf9f6;
  --neutral-100: #f3f1ec;
  --neutral-200: #e7e4dd;
  --neutral-300: #d5d1c8;
  --neutral-400: #a8a398;
  --neutral-500: #8a8479;
  --neutral-600: #5f5b53;
  --neutral-700: #46433d;
  --neutral-800: #2f2d29;
  --neutral-850: #252420;
  --neutral-900: #1c1b18;
  --neutral-950: #131210;
  --green-100: #e3f4e9;
  --green-400: #5cc98a;
  --green-600: #1e7a4a;
  --green-900: #163324;
  --red-100: #fce8e6;
  --red-400: #f28b80;
  --red-600: #b3261e;
  --red-900: #3d1a17;
  --blue-100: #e5eefb;
  --blue-400: #82b4f0;
  --blue-600: #1f5ea8;
  --blue-900: #172a42;

  /* ─────────────── СЕМАНТИКА ─────────────── */
  --background: var(--neutral-0);
  --surface: var(--neutral-0);
  --surface-muted: var(--neutral-50);
  --surface-hover: var(--neutral-100);
  --border: var(--neutral-200);
  --border-strong: var(--neutral-500);
  --text: var(--neutral-900);
  --text-muted: var(--neutral-600);
  --accent: var(--yellow-400);
  --accent-hover: var(--yellow-500);
  --accent-foreground: var(--neutral-900);
  --accent-soft: var(--yellow-100);
  --accent-soft-foreground: var(--yellow-900);
  --accent-border: var(--yellow-300);
  --success: var(--green-600);
  --success-soft: var(--green-100);
  --warning: var(--yellow-800);
  --warning-soft: var(--yellow-100);
  --danger: var(--red-600);
  --danger-soft: var(--red-100);
  --danger-foreground: var(--neutral-0);
  --info: var(--blue-600);
  --info-soft: var(--blue-100);
  --focus-ring: var(--yellow-700);
  --radius: 0.75rem;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgb(40 30 10 / 0.06);
  --shadow-md: 0 2px 8px rgb(40 30 10 / 0.06), 0 1px 2px rgb(40 30 10 / 0.04);
  --font-text: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-code: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
}
.topbar .brand { font-weight: 700; }
.topbar nav a { margin-right: 1rem; }

main { padding: 1.5rem; max-width: 64rem; margin: 0 auto; }

h1 { font-size: 1.4rem; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; margin: 0 0 0.75rem; }

table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); }
th { background: var(--surface-muted); font-weight: 600; }
tr:hover td { background: var(--surface-hover); }

button, .btn {
  display: inline-block;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  cursor: pointer;
  font-family: var(--font-text);
}
button:hover, .btn:hover { background: var(--surface-hover); }
.btn-primary { background: var(--accent); border-color: var(--accent-border); color: var(--accent-foreground); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: var(--danger-foreground); }
.btn-danger:hover { opacity: 0.9; }

label { display: block; margin-top: 0.75rem; font-weight: 600; font-size: 0.85rem; }
input[type="text"], input[type="password"], input[type="date"], select {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: var(--font-text);
  background: var(--surface);
  color: var(--text);
}
input[type="checkbox"] { margin-right: 0.4rem; }
input:focus { outline: 2px solid var(--focus-ring); outline-offset: 1px; }

.form-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.form-row > div { flex: 1 1 14rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.error { color: var(--danger); background: var(--danger-soft); padding: 0.5rem 0.75rem; border-radius: var(--radius); margin-bottom: 1rem; }
.success { color: var(--success); background: var(--success-soft); padding: 0.5rem 0.75rem; border-radius: var(--radius); margin-bottom: 1rem; }
.muted { color: var(--text-muted); font-size: 0.85rem; }

.tabs { display: flex; gap: 0.25rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border); }
.tabs a { padding: 0.5rem 1rem; border-radius: var(--radius) var(--radius) 0 0; color: var(--text-muted); }
.tabs a.active { color: var(--text); border: 1px solid var(--border); border-bottom-color: var(--background); font-weight: 600; }

.health-badges { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.badge { padding: 0.35rem 0.7rem; border-radius: var(--radius-pill); font-size: 0.8rem; font-weight: 600; }
.badge.ok { background: var(--success-soft); color: var(--success); }
.badge.error { background: var(--danger-soft); color: var(--danger); }
.badge.timeout { background: var(--warning-soft); color: var(--warning); }

code { font-family: var(--font-code); }
