:root {
  --bg: #0b0d10;
  --panel: #14181d;
  --panel-2: #1b2027;
  --line: #262d36;
  --fg: #e8edf3;
  --muted: #8d99a8;
  --accent: #4da3ff;
  --ok: #35c07a;
  --warn: #e0a33e;
  --err: #e05c5c;
  --radius: 12px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 15px; margin: 0 0 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.sub { color: var(--muted); margin: 0 0 28px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.tile {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color .15s, transform .15s;
}
.tile:hover { border-color: var(--accent); transform: translateY(-2px); }
.tile b { display: block; font-size: 17px; margin-bottom: 6px; }
.tile span { color: var(--muted); font-size: 14px; }

label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }

select, input[type="text"], input[type="password"] {
  width: 100%;
  padding: 9px 11px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--fg);
  font: inherit;
}
select:focus, input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 200px; }
.field { margin-bottom: 14px; }

button {
  font: inherit;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--fg);
  cursor: pointer;
}
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: var(--accent); border-color: var(--accent); color: #05121f; }
button.danger { border-color: #4a2a2a; color: #ffb4b4; }

.checkbox { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.checkbox input { width: auto; }

.status { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 4px rgba(53,192,122,.15); }
.dot.warn { background: var(--warn); }
.dot.err { background: var(--err); }

.meter { height: 8px; background: var(--panel-2); border-radius: 4px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--ok), var(--warn) 78%, var(--err)); transition: width .08s linear; }

.stats { display: flex; gap: 22px; flex-wrap: wrap; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.stats b { color: var(--fg); font-weight: 600; }

.preview .ru { color: var(--muted); font-size: 16px; min-height: 24px; }
.preview .en { font-size: 20px; font-weight: 500; min-height: 30px; margin-top: 6px; }
.preview .pending { opacity: .6; }

.hint { color: var(--muted); font-size: 13px; margin-top: 10px; }
code { background: var(--panel-2); padding: 2px 6px; border-radius: 5px; font-size: 13px; }

/* --- login / notice pages ------------------------------------------- */
body.centered {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login { width: 100%; max-width: 380px; }
.login h1 { font-size: 20px; }
.login .sub { margin-bottom: 22px; }
.error {
  margin: 0 0 14px;
  padding: 9px 12px;
  border-radius: 8px;
  background: #2a1618;
  border: 1px solid #4a2a2a;
  color: #ffb4b4;
  font-size: 14px;
}

/* --- operator page extras -------------------------------------------- */
.topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.who { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.who button { padding: 7px 13px; font-weight: 500; }

.qr-card { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.qr-card > div:first-child { flex: 1 1 260px; }
.qr-card input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.qr {
  margin: 0;
  padding: 10px;
  background: #fff;
  border-radius: 10px;
  flex: 0 0 auto;
  line-height: 0;
}
.qr svg {
  display: block;
  width: 148px;
  height: 148px;
}
