/* Пульт лицензий AI1C — палитра и шрифты сайта berkutov1c.ru:
   глубокий navy, минеральный изумруд, Manrope для заголовков, Golos для текста, JetBrains Mono для кодов. */

@font-face { font-family: "Manrope"; font-weight: 400 800; font-display: swap; src: url(assets/fonts/manrope-cyr.woff2) format("woff2"); unicode-range: U+301, U+400-45F, U+490-491, U+4B0-4B1, U+2116; }
@font-face { font-family: "Manrope"; font-weight: 400 800; font-display: swap; src: url(assets/fonts/manrope-lat.woff2) format("woff2"); unicode-range: U+0000-00FF, U+131, U+152-153, U+2BB-2BC, U+2C6, U+2DA, U+2DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Golos"; font-weight: 400 700; font-display: swap; src: url(assets/fonts/golos-cyr.woff2) format("woff2"); unicode-range: U+301, U+400-45F, U+490-491, U+4B0-4B1, U+2116; }
@font-face { font-family: "Golos"; font-weight: 400 700; font-display: swap; src: url(assets/fonts/golos-lat.woff2) format("woff2"); unicode-range: U+0000-00FF, U+131, U+152-153, U+2BB-2BC, U+2C6, U+2DA, U+2DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JBM"; font-weight: 400 600; font-display: swap; src: url(assets/fonts/jbm-cyr.woff2) format("woff2"); unicode-range: U+301, U+400-45F, U+490-491, U+4B0-4B1, U+2116; }
@font-face { font-family: "JBM"; font-weight: 400 600; font-display: swap; src: url(assets/fonts/jbm-lat.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+2212; }

:root {
  color-scheme: light;
  --navy: #071426;
  --navy-800: #0d213b;
  --navy-700: #173653;
  --ink: #102238;
  --muted: #627186;
  --faint: #8a97a8;
  --surface: #f4f6f8;
  --panel: #ffffff;
  --line: #e1e7ec;
  --line-strong: #cfd9e1;
  --brand: #13b889;
  --brand-dark: #0b8f6a;
  --brand-deep: #08704f;
  --brand-soft: #e7f7f1;
  --amber: #b26a00;
  --amber-soft: #fff4e0;
  --red: #c2414f;
  --red-soft: #fdecee;
  --blue: #2c63c9;
  --blue-soft: #e9f0fc;
  --slate: #56677c;
  --slate-soft: #eef2f6;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(7, 20, 38, .04), 0 12px 32px -24px rgba(7, 20, 38, .35);
  --shadow-lg: 0 30px 80px -30px rgba(7, 20, 38, .45);
  --font: "Golos", "Segoe UI", system-ui, sans-serif;
  --display: "Manrope", "Golos", "Segoe UI", sans-serif;
  --mono: "JBM", "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--surface);
  color: var(--ink);
  font: 15px/1.55 var(--font);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
::selection { background: rgba(19, 184, 137, .26); }
:focus-visible { outline: 3px solid rgba(19, 184, 137, .35); outline-offset: 2px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(16, 29, 51, .18); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
.boot { min-height: 100vh; background: var(--navy); }
.mono { font-family: var(--mono); letter-spacing: 0; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- Кнопки и поля ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink);
  font-weight: 600; font-size: 14px; white-space: nowrap;
  cursor: pointer; text-decoration: none;
  transition: background-color .16s, border-color .16s, color .16s, box-shadow .16s, transform .16s;
}
.btn:hover { border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn.primary { border-color: transparent; background: var(--brand-dark); color: #fff; box-shadow: 0 10px 22px -12px rgba(11, 143, 106, .8); }
.btn.primary:hover { background: var(--brand-deep); }
.btn.danger { color: var(--red); border-color: #efc4ca; }
.btn.danger:hover { background: var(--red-soft); border-color: var(--red); }
.btn.danger-solid { border-color: transparent; background: var(--red); color: #fff; }
.btn.danger-solid:hover { background: #a63340; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--slate-soft); }
.btn.sm { min-height: 32px; padding: 0 11px; font-size: 13px; }
.btn.icon { width: 40px; padding: 0; }
.btn.sm.icon { width: 32px; }

.field { display: grid; gap: 6px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field small { color: var(--faint); font-size: 12px; }
.input {
  width: 100%; min-height: 42px; padding: 9px 12px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: #fff;
  transition: border-color .16s, box-shadow .16s;
}
.input:hover { border-color: #b4c2ce; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(19, 184, 137, .14); }
textarea.input { min-height: 86px; resize: vertical; }
.input.mono { font-family: var(--mono); font-size: 13.5px; }

/* ---------- Вход ---------- */

.login {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr;
  background: var(--navy); color: #fff;
}
.login::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(700px circle at 18% 22%, rgba(19, 184, 137, .20), transparent 60%),
    radial-gradient(520px circle at 80% 90%, rgba(44, 99, 201, .16), transparent 62%);
}
.login::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%);
}
.login-brand { display: flex; flex-direction: column; justify-content: space-between; padding: 48px 56px; }
.login-brand img { width: 230px; height: auto; }
.login-pitch h1 {
  margin: 0 0 18px; max-width: 560px; color: #fff;
  font: 800 clamp(34px, 4.2vw, 56px)/1.02 var(--display); letter-spacing: -.04em;
}
.login-pitch h1 em { font-style: normal; color: var(--brand); }
.login-pitch p { margin: 0; max-width: 470px; color: #a7b6c8; font-size: 16px; }
.login-flow { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 30px; }
.login-flow span {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, .1); border-radius: 999px;
  background: rgba(255, 255, 255, .03); color: #cfd9e4; font-size: 13px;
}
.login-flow span b { color: var(--brand); font: 600 11px var(--mono); }
.login-foot { color: #66788f; font-size: 12.5px; }
.login-side { display: grid; place-items: center; padding: 40px 28px; }
.login-card {
  width: min(420px, 100%); padding: 34px 32px 30px;
  border: 1px solid rgba(255, 255, 255, .1); border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .03));
  box-shadow: 0 40px 100px -40px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .06);
  backdrop-filter: blur(18px);
}
.login-card .eyebrow { color: var(--brand); }
.login-card h2 { margin: 0 0 22px; font: 750 26px/1.15 var(--display); letter-spacing: -.03em; }
.login-card form { display: grid; gap: 16px; }
.login-card .field > span { color: #9fb0c3; }
.login-card .input { background: rgba(4, 12, 24, .55); border-color: rgba(255, 255, 255, .14); color: #fff; }
.login-card .input:focus { border-color: var(--brand); }
.login-card .btn.primary { min-height: 46px; margin-top: 6px; background: var(--brand); color: var(--navy); font-weight: 750; }
.login-card .btn.primary:hover { background: #2fd3a3; }
.login-error { min-height: 20px; color: #ff9aa6; font-size: 13.5px; }

/* ---------- Каркас ---------- */

.top {
  position: sticky; top: 0; z-index: 30;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background: rgba(7, 20, 38, .96); backdrop-filter: blur(16px);
  box-shadow: 0 8px 24px rgba(7, 20, 38, .1);
}
.wrap { width: min(1240px, calc(100% - 48px)); margin: 0 auto; }
.top-inner { display: flex; align-items: center; gap: 28px; min-height: 66px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.brand strong { display: block; font: 750 15px/1.15 var(--display); letter-spacing: -.01em; }
.brand small { display: block; color: #7f93a9; font-size: 11.5px; }
.nav { display: flex; gap: 2px; height: 66px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 8px; padding: 0 14px;
  color: #a9b8c9; font-size: 14px; font-weight: 500; text-decoration: none;
  transition: color .16s;
}
.nav a svg { width: 16px; height: 16px; opacity: .8; }
.nav a:hover { color: #fff; }
.nav a.active { color: #fff; }
.nav a.active::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--brand); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.who {
  display: flex; align-items: center; gap: 9px; padding: 4px 6px 4px 4px;
  border: 1px solid rgba(255, 255, 255, .1); border-radius: 999px; color: #d7e0e9; font-size: 13px;
}
.who i {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), #0a7d5c); color: var(--navy);
  font: 800 12px var(--display); font-style: normal; text-transform: uppercase;
}
.top .btn.ghost { color: #c9d4df; }
.top .btn.ghost:hover { background: rgba(255, 255, 255, .07); color: #fff; }

.page { padding: 34px 0 90px; animation: rise .35s cubic-bezier(.22, 1, .36, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.eyebrow {
  margin: 0 0 9px; color: var(--brand-dark);
  font: 700 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase;
}
.eyebrow a { text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; }
h1 { margin: 0; color: var(--navy); font: 800 clamp(30px, 3.6vw, 42px)/1.04 var(--display); letter-spacing: -.04em; }
.sub { margin: 10px 0 0; color: var(--muted); }
.heading-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 0; }
.card-head h2 { margin: 0; font: 750 16px/1.2 var(--display); letter-spacing: -.02em; color: var(--navy); }
.card-head .hint { color: var(--faint); font-size: 12.5px; }
.card-body { padding: 18px 22px 22px; }

/* ---------- Обзор ---------- */

.kpis {
  display: grid; grid-template-columns: repeat(6, 1fr);
  overflow: hidden; margin-bottom: 22px;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow);
}
.kpi {
  position: relative; display: block; padding: 18px 20px 20px;
  border: 0; border-right: 1px solid var(--line); background: #fff;
  text-align: left; text-decoration: none; cursor: pointer;
  transition: background-color .16s;
}
.kpi:last-child { border-right: 0; }
.kpi:hover { background: #fafcfd; }
.kpi::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--tone, var(--line)); opacity: 0; transition: opacity .16s; }
.kpi:hover::before { opacity: 1; }
.kpi .k-label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.kpi .k-label i { width: 7px; height: 7px; border-radius: 50%; background: var(--tone, var(--faint)); }
.kpi .k-value { display: block; margin-top: 8px; color: var(--navy); font: 800 34px/1 var(--display); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.kpi .k-note { display: block; margin-top: 6px; color: var(--faint); font-size: 12px; }

.grid-2 { display: grid; grid-template-columns: 1.25fr 1fr; gap: 22px; align-items: start; }
.stack { display: grid; gap: 22px; }

.attention { list-style: none; margin: 0; padding: 6px 0; }
.attention li a {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 16px;
  padding: 12px 22px; text-decoration: none; border-top: 1px solid var(--line);
  transition: background-color .14s;
}
.attention li:first-child a { border-top: 0; }
.attention li a:hover { background: #f8fbfa; }
.attention .a-name { min-width: 0; }
.attention .a-name strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.attention .a-name small { color: var(--muted); font-size: 12.5px; }
.attention .a-when { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

.empty {
  display: grid; place-items: center; gap: 6px; padding: 34px 22px; text-align: center; color: var(--muted);
}
.empty svg { width: 30px; height: 30px; color: var(--brand); }
.empty strong { color: var(--ink); font: 700 15px var(--display); }

.chart { display: grid; grid-template-columns: repeat(12, 1fr); align-items: end; gap: 6px; height: 132px; padding-top: 18px; }
.bar { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bar span {
  display: block; width: 100%; max-width: 22px; min-height: 3px; border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, #2fd3a3, var(--brand-dark));
  transition: filter .16s;
}
.bar.near span { background: linear-gradient(180deg, #f0b44c, #c97f0e); }
.bar.zero span { background: var(--line); }
.bar b { position: absolute; top: -18px; font: 700 11px var(--mono); color: var(--ink); opacity: 0; transition: opacity .14s; }
.bar:hover b, .bar.has b { opacity: 1; }
.bar:hover span { filter: brightness(1.08); }
.chart-axis { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; margin-top: 8px; color: var(--faint); font: 500 10.5px var(--mono); text-align: center; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; display: grid; grid-template-columns: 14px 1fr; gap: 12px; padding: 0 0 16px; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::before { display: none; }
.timeline .dot { width: 13px; height: 13px; margin-top: 4px; border-radius: 50%; border: 3px solid #fff; background: var(--tone, var(--faint)); box-shadow: 0 0 0 1px var(--line-strong); }
.timeline .t-text { min-width: 0; font-size: 14px; }
.timeline .t-text a { font-weight: 600; text-decoration: none; }
.timeline .t-text a:hover { text-decoration: underline; }
.timeline .t-meta { color: var(--faint); font-size: 12px; }

/* ---------- Статусы ---------- */

.pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px 3px 9px;
  border: 1px solid currentColor; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; line-height: 1.5; white-space: nowrap;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.s-active { --tone: var(--brand); color: var(--brand-dark); background: var(--brand-soft); border-color: rgba(11, 143, 106, .25); }
.s-expiring { --tone: #e39a1d; color: var(--amber); background: var(--amber-soft); border-color: rgba(178, 106, 0, .25); }
.s-offline { --tone: #7c8da3; color: var(--slate); background: var(--slate-soft); border-color: rgba(86, 103, 124, .25); }
.s-pending { --tone: var(--blue); color: var(--blue); background: var(--blue-soft); border-color: rgba(44, 99, 201, .22); }
.s-expired { --tone: var(--red); color: var(--red); background: var(--red-soft); border-color: rgba(194, 65, 79, .25); }
.s-disabled { --tone: #9aa6b4; color: #5f6b78; background: #f1f3f5; border-color: #d9dee4; }
.s-active.pill::before { box-shadow: 0 0 0 3px rgba(19, 184, 137, .18); animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 0 5px rgba(19, 184, 137, .05); } }
.k-active { --tone: var(--brand); }
.k-expiring { --tone: #e39a1d; }
.k-offline { --tone: #7c8da3; }
.k-pending { --tone: var(--blue); }
.k-expired { --tone: var(--red); }
.k-disabled { --tone: #9aa6b4; }
.t-info { --tone: var(--blue); }
.t-ok { --tone: var(--brand); }
.t-warn { --tone: #e39a1d; }
.t-bad { --tone: var(--red); }
.t-sys { --tone: #7c8da3; }

/* ---------- Клиенты ---------- */

.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.search { position: relative; flex: 1 1 280px; max-width: 420px; }
.search svg { position: absolute; left: 13px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search .input { padding-left: 40px; }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); padding: 1px 7px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--faint); font: 600 11px var(--mono); background: var(--surface); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff;
  color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer;
  transition: border-color .14s, color .14s, background-color .14s;
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip b { padding: 0 6px; border-radius: 999px; background: var(--slate-soft); color: var(--ink); font: 700 11px/18px var(--mono); }
.chip.on { border-color: var(--navy); background: var(--navy); color: #fff; }
.chip.on b { background: rgba(255, 255, 255, .14); color: #fff; }

.table-card { overflow: hidden; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  padding: 12px 18px; border-bottom: 1px solid var(--line); background: #fafbfc;
  color: var(--faint); font: 700 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; text-align: left; white-space: nowrap;
}
.table td { padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { cursor: pointer; transition: background-color .12s; }
.table tbody tr:hover { background: #f7fbf9; }
.table tbody tr:last-child td { border-bottom: 0; }
.c-name strong { display: block; font-weight: 650; color: var(--navy); }
.c-name small { color: var(--faint); font: 12px var(--mono); }
.c-paid { min-width: 150px; }
.c-paid .date { font-variant-numeric: tabular-nums; font-weight: 600; }
.c-paid small { display: block; color: var(--muted); font-size: 12px; }
.meter { height: 4px; margin-top: 7px; border-radius: 4px; background: var(--slate-soft); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 4px; background: var(--brand); }
.meter.warn span { background: #e39a1d; }
.meter.bad span { background: var(--red); }
.c-server .mono { font-size: 12.5px; }
.c-server small { display: block; color: var(--faint); font-size: 12px; }
.seen { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.seen i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.seen.on i { background: var(--brand); box-shadow: 0 0 0 3px rgba(19, 184, 137, .16); }
.seen.late i { background: #e39a1d; }
.chev { color: var(--faint); width: 18px; }

/* ---------- Карточка клиента ---------- */

.client-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 24px; }
.client-head h1 { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.client-head .meta { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 10px; color: var(--muted); font-size: 13.5px; }
.client-head .meta span { display: inline-flex; align-items: center; gap: 6px; }
.client-head .meta svg { width: 15px; height: 15px; }

.client-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: 22px; align-items: start; }

.keycard {
  position: relative; isolation: isolate; overflow: hidden;
  padding: 24px 24px 22px; border-radius: var(--radius);
  background: var(--navy); color: #fff; box-shadow: var(--shadow-lg);
}
.keycard::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(420px circle at 100% 0%, rgba(19, 184, 137, .28), transparent 60%),
    linear-gradient(to right, rgba(255, 255, 255, .04) 1px, transparent 1px) 0 0 / 30px 30px,
    linear-gradient(to bottom, rgba(255, 255, 255, .04) 1px, transparent 1px) 0 0 / 30px 30px;
}
.keycard .eyebrow { color: var(--brand); }
.keycard .key {
  display: block; margin: 6px 0 16px; padding: 14px 16px;
  border: 1px dashed rgba(255, 255, 255, .22); border-radius: 10px; background: rgba(0, 0, 0, .22);
  font: 600 clamp(15px, 1.9vw, 19px)/1.3 var(--mono); letter-spacing: .04em; word-break: break-all; user-select: all;
}
.keycard p { margin: 0; color: #9fb0c3; font-size: 13px; }
.keycard .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.keycard .btn { border-color: rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .06); color: #fff; }
.keycard .btn:hover { border-color: rgba(255, 255, 255, .4); background: rgba(255, 255, 255, .1); }
.keycard .btn.primary { border-color: transparent; background: var(--brand); color: var(--navy); }
.keycard .btn.primary:hover { background: #2fd3a3; }

.sub-card { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center; }
.ring { position: relative; width: 112px; height: 112px; }
.ring svg { width: 112px; height: 112px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring .track { stroke: var(--slate-soft); }
.ring .value { stroke: var(--tone, var(--brand)); stroke-linecap: round; transition: stroke-dashoffset .8s cubic-bezier(.22, 1, .36, 1); }
.ring .label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .label b { font: 800 28px/1 var(--display); letter-spacing: -.04em; color: var(--navy); }
.ring .label small { color: var(--muted); font-size: 11.5px; }

.facts { display: grid; gap: 0; margin: 0; }
.facts > div { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.facts > div:first-child { border-top: 0; }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 0; min-width: 0; font-size: 14px; overflow-wrap: anywhere; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 250px; padding: 6px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow-lg);
  animation: rise .16s ease-out;
}
.menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 11px;
  border: 0; border-radius: 8px; background: transparent; text-align: left; cursor: pointer; font-size: 14px;
}
.menu button:hover { background: var(--surface); }
.menu button svg { width: 16px; height: 16px; color: var(--muted); }
.menu button.danger { color: var(--red); }
.menu button.danger svg { color: var(--red); }
.menu hr { margin: 6px 4px; border: 0; border-top: 1px solid var(--line); }
.menu .menu-title { padding: 6px 11px 4px; color: var(--faint); font: 700 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; }

/* ---------- Отзывы ---------- */

.count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; margin-left: 8px; padding: 0 7px; border-radius: 999px; background: var(--brand-dark); color: #fff; font: 700 11.5px var(--mono); vertical-align: 2px; }
.fb-list { display: grid; }
.fb-item { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start; padding: 16px 22px; border-top: 1px solid var(--line); transition: background-color .14s; }
.fb-item:first-child { border-top: 0; }
.fb-item:hover { background: #fafcfd; }
.fb-item.done { opacity: .62; }
.fb-rate { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--slate-soft); color: var(--slate); }
.fb-rate svg { width: 18px; height: 18px; }
.fb-rate.up { background: var(--brand-soft); color: var(--brand-dark); }
.fb-rate.down { background: var(--red-soft); color: var(--red); }
.fb-body { min-width: 0; }
.fb-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fb-cat { padding: 2px 9px; border-radius: 6px; background: var(--slate-soft); color: var(--slate); font: 700 10.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.fb-cat.c-error, .fb-cat.c-wrong_data { background: var(--red-soft); color: var(--red); }
.fb-cat.c-slow, .fb-cat.c-not_found { background: var(--amber-soft); color: var(--amber); }
.fb-cat.c-idea { background: var(--blue-soft); color: var(--blue); }
.fb-cat.c-praise { background: var(--brand-soft); color: var(--brand-dark); }
.fb-client { font-weight: 650; color: var(--navy); text-decoration: none; }
.fb-client:hover { text-decoration: underline; }
.fb-text { margin: 7px 0 6px; font-size: 14.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.fb-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--faint); font-size: 12px; }
.fb-meta .mono { font-size: 11.5px; }
.fb-list.compact .fb-item { padding: 12px 22px; }
.fb-list.compact .fb-text { font-size: 14px; }
.chip svg { width: 15px; height: 15px; }
.fb-actions { display: flex; gap: 4px; align-items: center; }
@media (max-width: 640px) {
  .fb-item { grid-template-columns: auto 1fr; }
  .fb-item > .fb-actions { grid-column: 2; }
}

/* ---------- Журнал ---------- */

.log-table td:first-child { width: 170px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 13px; }
.log-table td .tag { display: inline-flex; align-items: center; gap: 7px; font: 600 11.5px var(--mono); color: var(--muted); white-space: nowrap; }
.log-table td .tag i { width: 7px; height: 7px; border-radius: 50%; background: var(--tone, var(--faint)); }
.log-table tbody tr { cursor: default; }
.log-table a { font-weight: 600; text-decoration: none; }
.log-table a:hover { text-decoration: underline; }

/* ---------- Настройки ---------- */

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.state-line { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-deep); }
.state-line.bad { background: var(--red-soft); color: var(--red); }
.state-line svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.state-line b { display: block; }
.state-line span { color: var(--ink); opacity: .8; font-size: 13.5px; }

/* ---------- Диалоги и уведомления ---------- */

dialog {
  width: min(520px, calc(100% - 32px)); padding: 0;
  border: 0; border-radius: 18px; background: #fff; color: var(--ink); box-shadow: var(--shadow-lg);
}
dialog::backdrop { background: rgba(7, 20, 38, .55); backdrop-filter: blur(3px); }
dialog[open] { animation: pop .2s cubic-bezier(.22, 1, .36, 1); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.dlg-head { padding: 22px 24px 0; }
.dlg-head h3 { margin: 0; font: 750 20px/1.2 var(--display); letter-spacing: -.03em; color: var(--navy); }
.dlg-head p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.dlg-body { padding: 18px 24px 4px; display: grid; gap: 14px; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 24px 22px; }
.dlg-error { color: var(--red); font-size: 13.5px; min-height: 0; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; }
.quick .chip.on { border-color: var(--brand-dark); background: var(--brand-dark); }
.license-out { width: 100%; min-height: 120px; font: 12px/1.5 var(--mono); word-break: break-all; }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 10px; max-width: 380px; padding: 12px 16px;
  border-radius: 12px; background: var(--navy); color: #fff; box-shadow: var(--shadow-lg); font-size: 14px;
  animation: pop .22s cubic-bezier(.22, 1, .36, 1);
}
.toast svg { width: 18px; height: 18px; color: var(--brand); flex: none; }
.toast.bad svg { color: #ff8b98; }

.foot { margin-top: 48px; color: var(--faint); font-size: 12.5px; text-align: center; }

/* ---------- Адаптив ---------- */

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .kpi:nth-child(3) { border-right: 0; }
  .kpi:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .grid-2, .client-grid, .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .login-brand { padding: 32px 24px 0; gap: 28px; }
  .login-foot { display: none; }
  .nav a span { display: none; }
  .brand small { display: none; }
  .table .hide-md { display: none; }
}
@media (max-width: 640px) {
  .wrap { width: calc(100% - 32px); }
  .top-inner { gap: 10px; }
  .brand strong { display: none; }
  .who span { display: none; }
  .nav a { padding: 0 10px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi { border-right: 1px solid var(--line) !important; border-bottom: 1px solid var(--line); }
  .kpi:nth-child(2n) { border-right: 0 !important; }
  .table .hide-sm { display: none; }
  .table td, .table th { padding: 12px; }
  .form-grid { grid-template-columns: 1fr; }
  .sub-card { grid-template-columns: 1fr; justify-items: start; }
  .facts > div { grid-template-columns: 1fr; gap: 2px; }
  .chart { gap: 3px; }
  .chart-axis { gap: 3px; font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
