/* Стили служебных экранов (установка, вход, пользователи). Календарь несёт свой CSS-бандл. */
:root {
  --bg: #f4f5f7; --card: #fff; --text: #1f2933; --muted: #6b7280; --line: #e2e5ea;
  --primary: #2563eb; --primary-text: #fff; --danger: #dc2626; --ok: #15803d; --warn: #b45309;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111418; --card: #1b1f25; --text: #e5e7eb; --muted: #9ca3af; --line: #2d333b; --primary: #3b82f6; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--primary); }
h1 { font-size: 1.4rem; margin: 0 0 .75rem; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }

.topbar { display: flex; align-items: center; gap: 1.5rem; padding: .6rem 1.25rem; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 600; color: var(--text); text-decoration: none; }
.brand img { height: 28px; width: auto; }
.topbar nav { display: flex; gap: 1rem; flex: 1; }
.topbar nav a { text-decoration: none; }
.who { display: flex; align-items: center; gap: .75rem; color: var(--muted); }
.who form { margin: 0; }

.page { padding: 1.25rem; max-width: 1200px; margin: 0 auto; }
.page--center { min-height: 100vh; display: flex; align-items: center; justify-content: center; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.card--narrow { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: .9rem; }
.card--wide { width: 100%; max-width: 980px; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; }
.card__head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.card__head h1 { margin: 0; }
.card__brand { display: flex; flex-direction: column; align-items: center; gap: .5rem; text-align: center; }
.card__brand img { max-height: 64px; max-width: 200px; }
.langs { display: flex; gap: .75rem; }

fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin: 0; display: flex; flex-direction: column; gap: .75rem; }
legend { padding: 0 .4rem; font-weight: 600; }
label { display: flex; flex-direction: column; gap: .3rem; font-size: .9rem; color: var(--muted); flex: 1; min-width: 0; }
label.radio { flex-direction: row; align-items: center; gap: .4rem; color: var(--text); flex: 0 1 auto; }
label.narrow { max-width: 160px; }
.row { display: flex; gap: .75rem; flex-wrap: wrap; }
.row > label { min-width: 180px; }
input, select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: .5rem .6rem; width: 100%; }
input[type=radio] { width: auto; }
input:focus, select:focus { outline: 2px solid var(--primary); outline-offset: 0; }
.hint { font-size: .8rem; color: var(--muted); }

.btn { font: inherit; border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 8px; padding: .5rem 1rem; cursor: pointer; text-decoration: none; display: inline-block; }
.btn--primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.btn--danger { color: var(--danger); }
.btn--small { padding: .25rem .6rem; font-size: .85rem; }
.btn:disabled { opacity: .6; cursor: default; }
button.link { background: none; border: 0; color: var(--primary); cursor: pointer; font: inherit; padding: 0; }

.alert { border-radius: 8px; padding: .6rem .8rem; }
.alert--error { background: rgba(220, 38, 38, .1); color: var(--danger); }
.alert ul { margin: 0; padding-left: 1.1rem; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.checks li::before { display: inline-block; width: 1.3rem; font-weight: 700; }
.checks .ok::before { content: "✓"; color: var(--ok); }
.checks .fail::before { content: "✕"; color: var(--danger); }
.checks .warn::before { content: "!"; color: var(--warn); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th { font-size: .8rem; color: var(--muted); font-weight: 600; }
.table tr.muted td { color: var(--muted); }
.table .actions { display: flex; gap: .4rem; justify-content: flex-end; }
.badge { margin-left: .4rem; font-size: .75rem; padding: .05rem .4rem; border-radius: 999px; background: var(--line); color: var(--muted); }

.dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--text); padding: 1.25rem; width: min(640px, 96vw); }
.dialog::backdrop { background: rgba(0, 0, 0, .4); }
.dialog form { display: flex; flex-direction: column; gap: .75rem; }
.dialog__actions { display: flex; justify-content: flex-end; gap: .5rem; }
[hidden] { display: none !important; }
.stack { display: flex; flex-direction: column; gap: 1.25rem; }
.alert--ok { background: rgba(21, 128, 61, .1); color: var(--ok); display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.secret { font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: .3rem .5rem; color: var(--text); word-break: break-all; user-select: all; }
.badge--ok { background: rgba(21, 128, 61, .15); color: var(--ok); }
.badge--error { background: rgba(220, 38, 38, .12); color: var(--danger); }
.badge--warn { background: rgba(180, 83, 9, .14); color: var(--warn); }
.badge--muted { background: var(--line); color: var(--muted); }
.badge:first-child { margin-left: 0; }
.cell-url { max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.cell-events { white-space: normal !important; font-size: .82rem; color: var(--muted); max-width: 260px; }
.cell-result { white-space: normal !important; max-width: 360px; }
.payload { max-height: 260px; overflow: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: .5rem; font-size: 12px; white-space: pre-wrap; word-break: break-all; }
.checks-grid { display: grid; gap: .35rem; }
.dialog--wide { width: min(1000px, 96vw); }
details summary { cursor: pointer; color: var(--primary); font-size: .85rem; }

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; gap: .5rem 1rem; }
  .page { padding: .75rem; }
  .card { padding: 1rem; }
}
