/* Консоль власника Mokosh. Кольори — з теми входу дизайнера (admin_panel/src/styles/login-theme.css):
   темно-синій бренд, зелений акцент, теплий сірий фон. Стан — мітка з текстом, не лише колір. */
@font-face { font-family: MokoshSans; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/mokosh-sans-400.woff) format("woff"); }
@font-face { font-family: MokoshSans; font-style: normal; font-weight: 700; font-display: swap;
  src: url(fonts/mokosh-sans-700.woff) format("woff"); }

:root {
  --canvas: #f0f2ef; --surface: #ffffff; --ink: #102030; --muted: #5c6b64; --line: #ccd6cf;
  --line-quiet: #e3e9e4; --brand: #081320; --brand-fg: #f7f9ff; --brand-muted: #9fb0c4;
  --accent: #176b50; --accent-fg: #ffffff; --accent-hover: #155a43; --focus: #267c5d;
  --ok: #1f7a4d; --ok-bg: #e4f3ea; --info: #3f5a70; --info-bg: #e8eef3;
  --warn: #8a5300; --warn-bg: #fdf0d8; --crit: #a32b25; --crit-bg: #fbe5e3;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #050c15; --surface: #0b1624; --ink: #e6edf5; --muted: #aab8c8; --line: #2b3b4e;
    --line-quiet: #1a2a3c; --brand: #02070d; --brand-fg: #f7f9ff; --brand-muted: #8395aa;
    --accent: #91dfbe; --accent-fg: #0b2a20; --accent-hover: #b4f1d6; --focus: #7ad9b5;
    --ok: #74d6a4; --ok-bg: #10291f; --info: #a9c1d6; --info-bg: #142333;
    --warn: #f3bf5f; --warn-bg: #2d2210; --crit: #ff9b93; --crit-bg: #33171a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --canvas: #050c15; --surface: #0b1624; --ink: #e6edf5; --muted: #aab8c8; --line: #2b3b4e;
  --line-quiet: #1a2a3c; --brand: #02070d; --brand-fg: #f7f9ff; --brand-muted: #8395aa;
  --accent: #91dfbe; --accent-fg: #0b2a20; --accent-hover: #b4f1d6; --focus: #7ad9b5;
  --ok: #74d6a4; --ok-bg: #10291f; --info: #a9c1d6; --info-bg: #142333;
  --warn: #f3bf5f; --warn-bg: #2d2210; --crit: #ff9b93; --crit-bg: #33171a;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--canvas); color: var(--ink);
  font: 15px/1.5 MokoshSans, "Noto Sans", system-ui, sans-serif; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.25; text-wrap: balance; margin: 0; }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
code, .mono { font-family: var(--mono); font-size: 13px; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* ── верхня смуга ── */
.top { background: var(--brand); color: var(--brand-fg); }
.top-in { max-width: 1180px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center;
  gap: 24px; min-height: 56px; flex-wrap: wrap; }
.brand { display: flex; align-items: baseline; gap: 8px; color: var(--brand-fg);
  text-decoration: none; font-weight: 700; letter-spacing: .02em; }
.brand small { color: var(--brand-muted); font-weight: 400; letter-spacing: .04em;
  text-transform: uppercase; font-size: 11px; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { white-space: nowrap; }
.nav a { color: var(--brand-muted); text-decoration: none; padding: 6px 10px; border-radius: 6px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--brand-fg); background: #ffffff14; }
.top form { margin: 0; }
.top .linkish { color: var(--brand-muted); }
.top .linkish:hover { color: var(--brand-fg); }

main { max-width: 1180px; margin: 0 auto; padding: 24px 16px 64px; display: grid; gap: 24px; }
.head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; }

/* ── мітки стану ── */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.l-ok { color: var(--ok); background: var(--ok-bg); }
.l-info { color: var(--info); background: var(--info-bg); }
.l-warn { color: var(--warn); background: var(--warn-bg); }
.l-crit { color: var(--crit); background: var(--crit-bg); }

/* ── картки й таблиці ── */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line-quiet); border-radius: 10px;
  padding: 16px; display: grid; gap: 12px; align-content: start; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.card-head a { color: inherit; text-decoration: none; }
.card-head a:hover h2 { text-decoration: underline; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.problems { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.problems li { display: grid; grid-template-columns: max-content 1fr; gap: 8px; align-items: start; }
.problems .why { overflow-wrap: anywhere; }
.banner { border-radius: 10px; padding: 12px 16px; display: grid; gap: 4px; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--surface);
  border: 1px solid var(--line-quiet); border-radius: 10px; overflow: hidden; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line-quiet);
  vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  font-weight: 700; background: var(--canvas); }
tr:last-child td { border-bottom: 0; }
td.when { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--muted); }
.section { display: grid; gap: 12px; }
.meters { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.meter { background: var(--surface); border: 1px solid var(--line-quiet); border-radius: 10px;
  padding: 12px 16px; display: grid; gap: 4px; }
.meter b { font-size: 22px; font-variant-numeric: tabular-nums; }
.card .meters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.card .meter { padding: 8px 12px; gap: 2px; }
.card .meter b { font-size: 18px; }
.bar { height: 6px; border-radius: 3px; background: var(--line-quiet); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); }
.bar i.hot { background: var(--crit); }
.w0 { width: 0 } .w10 { width: 10% } .w20 { width: 20% } .w30 { width: 30% } .w40 { width: 40% }
.w50 { width: 50% } .w60 { width: 60% } .w70 { width: 70% } .w80 { width: 80% } .w90 { width: 90% }
.w100 { width: 100% }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters a { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none;
  color: var(--ink); }
.filters a[aria-current="true"] { background: var(--ink); color: var(--canvas); border-color: var(--ink); }

/* ── форми й кнопки ── */
button, .button { font: inherit; font-weight: 700; border: 0; border-radius: 8px; padding: 10px 16px;
  background: var(--accent); color: var(--accent-fg); cursor: pointer; min-height: 44px; }
button:hover, .button:hover { background: var(--accent-hover); }
button:disabled { opacity: .6; cursor: progress; }
button.quiet { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button.quiet:hover { background: var(--line-quiet); }
button.danger { background: transparent; color: var(--crit); border: 1px solid var(--crit); }
.linkish { background: none; border: 0; padding: 0; min-height: 0; color: var(--accent); font-weight: 400;
  text-decoration: underline; }
.linkish:hover { background: none; color: var(--accent-hover); }
input[type="text"], input[type="password"], input:not([type]) { font: inherit; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink);
  min-height: 44px; width: 100%; }
label { display: grid; gap: 4px; font-weight: 700; }
label span { font-weight: 400; color: var(--muted); font-size: 13px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1 1 180px; }
.row > button { flex: 0 0 auto; }
form.inline { display: inline; margin: 0; }
.msg { min-height: 1.5em; }
.msg:empty { display: none; }
.msg.err { color: var(--crit); }

/* ── вхід ── */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-box { width: 100%; max-width: 420px; display: grid; gap: 24px; }
.auth-brand { display: flex; align-items: baseline; gap: 8px; font-weight: 700; font-size: 20px; }
.auth-brand small { color: var(--muted); font-weight: 400; font-size: 12px; letter-spacing: .05em;
  text-transform: uppercase; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.codes { columns: 2; font-family: var(--mono); font-size: 15px; padding-left: 20px; margin: 0; }
.qr svg { width: 220px; height: 220px; background: #fff; border-radius: 8px; padding: 8px; }
details summary { cursor: pointer; color: var(--accent); }

@media (max-width: 600px) {
  .top-in { gap: 0 12px; padding-top: 8px; }
  .brand { flex: 1; }
  .nav { order: 3; flex: 1 0 100%; margin: 4px -10px 0; padding-bottom: 4px; }
  .kv { grid-template-columns: 1fr; gap: 0; }
  .kv dd { margin-bottom: 6px; }
  .codes { columns: 1; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ── дії (К3) ── */
pre.log { background: var(--surface); border: 1px solid var(--line-quiet); border-radius: 10px;
  padding: 12px 16px; font: 12px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere;
  max-height: 70vh; overflow: auto; margin: 0; }
.offers { display: grid; gap: 8px; }
.offer { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 8px 0;
  border-top: 1px solid var(--line-quiet); }
.offer:first-child { border-top: 0; }
.offer .what { flex: 1 1 220px; display: grid; }
.offer input { width: 9em; flex: 0 0 auto; }
