/* openMIX licence pages: the site's system (sky ground, the app's charcoal, blue action, Unbounded + Onest) */
@font-face { font-family: "Unbounded"; font-weight: 800; font-display: swap; src: url(fonts/unbounded-800-cyrillic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Unbounded"; font-weight: 800; font-display: swap; src: url(fonts/unbounded-800-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Onest"; font-weight: 400 500; font-display: swap; src: url(fonts/onest-cyrillic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 400 500; font-display: swap; src: url(fonts/onest-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #d4e8fd; --surface: #c2dcf8; --ink: #1c2026; --muted: #3a4d61;
  --accent: #0087ff; --pvw: #ff8c00; --pgm: #18a33e; --pgm-ui: #1f7a2c; --bad: #b3261e;
  --dark: #1c2026; --dark-2: #262b33; --dark-3: #313842; --dark-ink: #eef1f4; --dark-muted: #a9b3bd;
  --small: 0.875rem; --body: 1.0625rem; --mid: clamp(1.25rem, 0.95rem + 0.9vw, 1.75rem); --head: clamp(1.75rem, 1.1rem + 2.6vw, 3.5rem);
  --m: clamp(16px, 3vw, 40px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--body)/1.5 "Onest", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--pvw); outline-offset: 2px; }
html:not([data-lang="en"]) .en, html[data-lang="en"] .ru { display: none !important; }
h1, h2 { font-family: "Unbounded", "Onest", sans-serif; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; margin: 0; }
h1 { font-size: var(--head); }
h2 { font-size: var(--mid); margin: 0 0 14px; }

/* bar */
header { display: flex; align-items: center; gap: 20px; padding: 20px var(--m); }
.mark { display: inline-flex; align-items: center; gap: 12px; font: 800 var(--mid)/1 "Unbounded", sans-serif; letter-spacing: -0.04em; text-decoration: none; }
.mark-grid { display: grid; grid-template-columns: repeat(3, 8px); gap: 3px; }
.mark-grid i { width: 8px; height: 8px; background: var(--accent); }
.mark-grid i.p { background: var(--pvw); } .mark-grid i.g { background: var(--pgm); }
header .place { font-weight: 500; color: var(--muted); }
header .grow { flex: 1; }
header .lang, header #logout { background: none; border: 0; padding: 8px 0; min-height: 0; color: inherit; font: 500 var(--body)/1 "Onest", sans-serif; cursor: pointer; }
header .lang:hover, header #logout:hover { text-decoration: underline; background: none; }
main { padding: 32px var(--m) 96px; }

/* controls */
label { display: grid; gap: 6px; font-size: var(--small); font-weight: 500; }
input, select, textarea { min-height: 48px; background: #fff; color: var(--ink); border: 2px solid transparent; border-radius: 0; padding: 0 12px; font: 400 var(--body)/1.2 "Onest", sans-serif; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { padding: 10px 12px; min-height: 120px; }
button { min-height: 48px; padding: 0 20px; border: 0; border-radius: 0; background: var(--dark); color: var(--dark-ink); font: 500 var(--body)/1 "Onest", sans-serif; cursor: pointer; transition: background-color 140ms, transform 120ms; }
button:hover { background: var(--dark-3); }
button:active { transform: scale(0.98); }
button.primary { background: var(--accent); color: var(--ink); }
button.primary:hover { background: #2a99ff; }
button.danger { background: var(--bad); color: #fff; }
button.danger:hover { background: #cc3a31; }
button.small { min-height: 34px; padding: 0 12px; font-size: var(--small); }
.row { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.muted { color: var(--muted); }
.link { font-weight: 500; text-decoration: underline; }
.err { color: var(--bad); font-weight: 500; min-height: 1.5em; }
.ok-msg { color: var(--pgm-ui); font-weight: 500; }

/* surfaces: one tone step, no outlines */
.card { background: var(--surface); padding: 24px; margin-bottom: 12px; }
.card.dark { background: var(--dark); color: var(--dark-ink); }
.card.dark .muted { color: var(--dark-muted); }

/* tables (real tables keep their rules) */
table { width: 100%; border-collapse: collapse; font-size: var(--small); }
th { text-align: left; font-weight: 500; color: var(--muted); padding: 8px 10px 8px 0; border-bottom: 2px solid rgba(28, 32, 38, 0.12); position: sticky; top: 0; background: var(--surface); }
td { padding: 10px 10px 10px 0; border-bottom: 1px solid rgba(28, 32, 38, 0.1); vertical-align: top; }
.card.dark th { color: var(--dark-muted); background: var(--dark); border-bottom-color: rgba(255, 255, 255, 0.14); }
.card.dark td { border-bottom-color: rgba(255, 255, 255, 0.08); }
tr:hover td { background: rgba(255, 255, 255, 0.25); }
.card.dark tr:hover td { background: rgba(255, 255, 255, 0.04); }

/* states: words in sentence case on a filled chip */
.tag { display: inline-block; padding: 2px 8px; font-size: var(--small); font-weight: 500; color: #fff; background: var(--dark-3); }
.tag.ok { background: var(--pgm-ui); } .tag.bad { background: var(--bad); } .tag.warn { background: var(--pvw); color: var(--ink); }
.tag.admin { background: #5a4630; } .tag.client { background: #1d4f91; }

/* sign-in */
.login { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; padding: 64px var(--m) 96px; align-items: start; }
.login .intro { grid-column: 1 / span 5; }
.login .intro p { margin-top: 18px; max-width: 38ch; }
.login .card { grid-column: 7 / span 5; display: grid; gap: 14px; padding: 28px; }
.login .card h2 { margin: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.login .tabs { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 6px; }
.tabs button { background: rgba(255, 255, 255, 0.5); color: var(--ink); }
.tabs button.sel, .tabs button.sel:hover { background: var(--dark); color: var(--dark-ink); }

/* customer: keys */
.keys-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px 32px; margin-bottom: 28px; }
.keys-head p { max-width: 52ch; }
.key { background: var(--dark); color: var(--dark-ink); padding: 24px; margin-bottom: 12px; }
.key .k { font: 500 var(--mid)/1.2 "Onest", sans-serif; letter-spacing: 0.03em; font-variant-numeric: tabular-nums; color: #fff; overflow-wrap: anywhere; }
.key .meta { margin: 8px 0 18px; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; color: var(--dark-muted); }
.key table { color: var(--dark-ink); }
.key th { color: var(--dark-muted); background: var(--dark); border-bottom-color: rgba(255, 255, 255, 0.14); }
.key td { border-bottom-color: rgba(255, 255, 255, 0.08); }
.key tr:hover td { background: rgba(255, 255, 255, 0.04); }
.key .none { color: var(--dark-muted); }
.more-key { margin-top: 40px; display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.more-key .card { grid-column: span 6; margin: 0; }
.more-key .card p { margin: 0 0 14px; }
.empty { background: var(--surface); padding: 28px; }
.empty p + p { margin-top: 10px; }

/* admin */
.stats { display: flex; flex-wrap: wrap; gap: 12px 40px; margin-bottom: 28px; }
.stats div { display: grid; }
.stats b { font: 800 var(--head)/1 "Unbounded", sans-serif; letter-spacing: -0.04em; }
.stats .card { margin: 0; padding: 18px 24px; }
td input, td select { min-height: 36px !important; height: auto !important; font-size: var(--small); }
.acts { margin: 4px 0 0; padding: 0; list-style: none; }
.acts li { margin: 4px 0; }
.scroll { max-height: 64vh; overflow: auto; }

@media (max-width: 860px) {
  header .place { display: none; }
  .login { display: block; padding-top: 32px; }
  .login .card { margin-top: 28px; }
  .more-key { display: block; }
  .more-key .card { margin-bottom: 12px; }
  .key { padding: 18px; }
  .key table, .key thead, .key tbody, .key tr, .key td { display: block; }
  .key thead { display: none; }
  .key tr { padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
  .key td { border: 0; padding: 2px 0; }
  .key td button { margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) { button { transition: none; } }
